/* ============================================================
   MIREN DESIGN SYSTEM — v3.0
   Single source of truth for all design tokens, typography,
   and base component classes.
   ============================================================ */

/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@300;400;500&family=Inter:wght@400;500;600;700&display=swap');

/* ── Design Tokens ────────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg-primary:    #000000;
  --bg-secondary:  #0A0A0A;

  /* Surfaces */
  --surface-base:   #111111;
  --surface-raised: #161616;
  --surface-soft:   #1A1A1A;
  --surface-hover:  #202020;
  --surface-active: #F5F1E8;

  /* Text */
  --text-primary:   #F7F3EA;
  --text-secondary: #C8C2B8;
  --text-muted:     #8C877F;
  --text-disabled:  #4F4B46;
  --text-inverse:   #000000;

  /* Borders */
  --border-subtle: #242424;
  --border-strong: #3A3A3A;
  --border-soft:   rgba(245, 241, 232, 0.12);

  /* Overlays */
  --overlay-dark: rgba(0, 0, 0, 0.72);
  --overlay-soft: rgba(0, 0, 0, 0.48);

  /* Accents */
  --cream-glow: rgba(245, 241, 232, 0.18);

  /* Typography */
  --font-serif: "Cormorant Garamond", Georgia, serif;
  --font-sans:  "Inter", "Helvetica Neue", Arial, sans-serif;

  /* Radius */
  --radius-xs:    6px;
  --radius-sm:    10px;
  --radius-md:    16px;
  --radius-lg:    24px;
  --radius-xl:    32px;
  --radius-pill:  999px;
  --radius-modal: 28px;

  /* Spacing */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  24px;
  --space-6:  32px;
  --space-7:  40px;
  --space-8:  48px;
  --space-9:  64px;
  --space-10: 80px;
  --space-11: 96px;
  --space-12: 128px;

  /* Motion */
  --ease-standard:   cubic-bezier(0.22, 1, 0.36, 1);
  --duration-fast:   120ms;
  --duration-standard: 180ms;
  --duration-slow:   360ms;
}

/* ── Global Reset ─────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, video {
  max-width: 100%;
  display: block;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ── Typography — Display (Cormorant Garamond 300) ────────── */
.display-xl {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: 52px;
  line-height: 0.9;
  letter-spacing: 0.18em;
}

.display-l {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: 40px;
  line-height: 0.95;
  letter-spacing: 0.08em;
}

.display-m {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: 34px;
  line-height: 1.0;
  letter-spacing: 0.02em;
}

/* ── Typography — Headings (Cormorant Garamond 300) ───────── */
.h1, h1 {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: 36px;
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.h2, h2 {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: 30px;
  line-height: 1.08;
  letter-spacing: -0.01em;
}

.h3, h3 {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: 24px;
  line-height: 1.12;
  letter-spacing: 0;
}

.h4, h4 {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0;
}

/* ── Typography — Interface Text (Inter) ─────────────────── */
.body-l {
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: 0;
}

.body-m {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0;
}

.body-s {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0.01em;
}

.caption {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0.02em;
}

.label-sm {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.label-micro {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.btn-label {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-label {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.data-large {
  font-family: var(--font-sans);
  font-size: 38px;
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.02em;
}

.data-medium {
  font-family: var(--font-sans);
  font-size: 26px;
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.01em;
}

/* ── Tablet breakpoint — typography ──────────────────────── */
@media (min-width: 768px) {
  .display-xl { font-size: 72px; }
  .display-l  { font-size: 56px; }
  .display-m  { font-size: 44px; }
  .h1, h1     { font-size: 48px; }
  .h2, h2     { font-size: 40px; }
  .h3, h3     { font-size: 32px; }
  .h4, h4     { font-size: 24px; }
}

/* ── Desktop breakpoint — typography ─────────────────────── */
@media (min-width: 1280px) {
  .display-xl { font-size: 96px; }
  .display-l  { font-size: 72px; }
  .display-m  { font-size: 56px; }
  .h1, h1     { font-size: 64px; }
  .h2, h2     { font-size: 52px; }
  .h3, h3     { font-size: 40px; }
  .h4, h4     { font-size: 28px; }
}

/* ── Primary Button ───────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #F5F1E8;
  color: #000000;
  border: 1px solid #F5F1E8;
  border-radius: var(--radius-pill);
  height: 56px;
  padding: 0 28px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--duration-standard) var(--ease-standard),
              border-color var(--duration-standard) var(--ease-standard),
              transform var(--duration-standard) var(--ease-standard);
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary:hover {
  background: #FFFFFF;
  border-color: #FFFFFF;
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary:disabled,
.btn-primary[disabled] {
  background: #242424;
  color: #4F4B46;
  border-color: #242424;
  cursor: default;
  transform: none;
}

@media (min-width: 1280px) {
  .btn-primary { height: 52px; }
}

/* ── Secondary Button ─────────────────────────────────────── */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #F7F3EA;
  border: 1px solid rgba(245, 241, 232, 0.28);
  border-radius: var(--radius-pill);
  height: 52px;
  padding: 0 28px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--duration-standard) var(--ease-standard),
              border-color var(--duration-standard) var(--ease-standard);
  white-space: nowrap;
  text-decoration: none;
}

.btn-secondary:hover {
  background: #161616;
  border-color: #F5F1E8;
}

.btn-secondary:active {
  background: #202020;
}

.btn-secondary:disabled,
.btn-secondary[disabled] {
  color: #4F4B46;
  border-color: #242424;
  cursor: default;
}

/* ── Filter Pill ──────────────────────────────────────────── */
.filter-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #C8C2B8;
  border: 1px solid #3A3A3A;
  border-radius: var(--radius-pill);
  height: 36px;
  padding: 0 16px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--duration-standard) var(--ease-standard),
              color var(--duration-standard) var(--ease-standard),
              border-color var(--duration-standard) var(--ease-standard);
}

.filter-pill.active,
.filter-pill[aria-pressed="true"] {
  background: #F5F1E8;
  color: #000000;
  border-color: #F5F1E8;
}

/* ── Badge ────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  height: 26px;
  padding: 0 10px;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Badge variants — Status Badge Colour Specification */
.badge-keep {
  background: #181818;
  color: #F7F3EA;
  border: 1px solid #D8D2C4;
}

.badge-consider {
  background: #151515;
  color: #C8C2B8;
  border: 1px solid #8C877F;
}

.badge-reconsider {
  background: #111111;
  color: #8C877F;
  border: 1px solid #4F4B46;
}

.badge-regular {
  background: #151515;
  color: #C8C2B8;
  border: 1px solid #3A3A3A;
}

.badge-investment {
  background: #F5F1E8;
  color: #000000;
  border: 1px solid #F5F1E8;
}

/* ── Card Surfaces ────────────────────────────────────────── */
.card-surface {
  background: var(--surface-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

.card-surface-raised {
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

/* ── Input Field ──────────────────────────────────────────── */
.input-field {
  display: block;
  width: 100%;
  background: #111111;
  color: #F7F3EA;
  border: 1px solid #242424;
  border-radius: var(--radius-pill);
  height: 52px;
  padding: 0 18px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 400;
  outline: none;
  transition: border-color var(--duration-standard) var(--ease-standard);
  -webkit-appearance: none;
}

.input-field::placeholder {
  color: #5F5A54;
}

.input-field:focus {
  border-color: #F5F1E8;
}

.input-field:disabled {
  background: #0A0A0A;
  color: #4F4B46;
  cursor: default;
}

.input-field--textarea {
  border-radius: 18px;
  height: auto;
  padding: 14px 18px;
  resize: vertical;
}

.input-label {
  display: block;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8C877F;
  margin-bottom: 8px;
}

/* ── Modal Overlay & Content ──────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-dark);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 1000;
  animation: overlayFadeIn var(--duration-standard) var(--ease-standard) both;
}

@media (min-width: 768px) {
  .modal-overlay {
    align-items: center;
  }
}

.modal-content {
  background: #161616;
  border: 1px solid #242424;
  border-radius: var(--radius-modal) var(--radius-modal) 0 0;
  padding: 24px;
  width: 100%;
  max-width: calc(100vw - 32px);
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: modalSlideUp var(--duration-slow) var(--ease-standard) both;
}

@media (min-width: 768px) {
  .modal-content {
    border-radius: var(--radius-modal);
    padding: 32px;
    max-width: 720px;
  }
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8C877F;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-size: 24px;
  line-height: 1;
}

/* ── Loading Spinner ──────────────────────────────────────── */
.loading-spinner {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #242424;
  border-top-color: #F5F1E8;
  animation: spinnerRotate 900ms linear infinite;
  flex-shrink: 0;
}

/* ── Empty State ──────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: var(--space-4);
  max-width: 360px;
  margin: 0 auto;
  padding: var(--space-9) var(--space-5);
}

.empty-state__icon {
  font-size: 40px;
  color: #8C877F;
  line-height: 1;
}

.empty-state__heading {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: 20px;
  line-height: 1.2;
  color: #F7F3EA;
}

.empty-state__text {
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.45;
  color: #8C877F;
}

/* ── Animations ───────────────────────────────────────────── */
@keyframes overlayFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes spinnerRotate {
  to { transform: rotate(360deg); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Focus ring (accessibility) ───────────────────────────── */
:focus-visible {
  outline: 1px solid #F5F1E8;
  outline-offset: 3px;
}

/* ── Reduced motion ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Utility — hidden scrollbar for horizontal pill rows ─── */
.scroll-row {
  display: flex;
  flex-wrap: nowrap;
  gap: var(--space-2);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 2px;
}

.scroll-row::-webkit-scrollbar {
  display: none;
}

/* ============================================
   GLOBAL PAGE LAYOUT
   ============================================ */

.page-container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}
@media (min-width: 768px)  { .page-container { padding: 0 48px; } }
@media (min-width: 1280px) { .page-container { padding: 0 64px; } }

body {
  min-height: 100vh;
  overflow-x: hidden;
}

main {
  padding-top: 76px;
}

/* ============================================================
   GLOBAL NAV
   ============================================================ */
.topnav {
  position: sticky;
  top: 0;
  z-index: 200;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 0 64px;
  background: rgba(0,0,0,0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid #141414;
}

.nav-wordmark {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: 18px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--text-primary);
  text-decoration: none;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-link {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
  white-space: nowrap;
}

.nav-link:hover { color: var(--text-primary); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-shrink: 0;
}

.nav-logout {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s;
  padding: 0;
  white-space: nowrap;
}

.nav-logout:hover { color: var(--text-primary); }

/* Burger menu */
.nav-burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-burger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text-primary);
  transition: all 0.2s;
}

.nav-mobile {
  display: none;
  position: fixed;
  top: 76px;
  left: 0;
  right: 0;
  background: #0A0A0A;
  border-bottom: 1px solid #141414;
  padding: 24px 32px;
  flex-direction: column;
  gap: 20px;
  z-index: 199;
}

.nav-mobile.open { display: flex; }

.nav-mobile .nav-link,
.nav-mobile .nav-logout {
  font-size: 15px;
}

/* Always use burger — hide inline nav links on all screen sizes */
.nav-links { display: none; }
.nav-actions .nav-logout { display: none; }
.nav-burger { display: flex; }

@media (max-width: 767px) {
  .topnav { padding: 0 24px; }
}

@media (min-width: 768px) {
  .nav-mobile {
    left: auto;
    right: 0;
    width: 280px;
    border-left: 1px solid #1A1A1A;
    border-bottom: 1px solid #1A1A1A;
    border-bottom-left-radius: 8px;
  }
}
