/* ============================================================
   DEKODING BRILLIANCE — Design System
   One source of truth: tokens, type, spacing, shared components,
   nav + footer. Page-specific section styles live with each page.
   ============================================================ */

/* ---------- TOKENS ---------- */
:root {
  /* Ink / navy scale (single hue, real scale — no one-off rgba) */
  --ink:        #181A20;   /* deep navy — primary text, dark sections */
  --ink-80:     #3a4760;
  --ink-60:     #6b7589;
  --ink-45:     #939bab;
  --ink-30:     #bcc1cb;

  /* Surfaces — paper scale */
  --cream:      #FFFFFF;   /* page background */
  --paper:      #FFFFFF;   /* raised cards */
  --sand:       #F2F2F2;   /* alt section / wells */
  --sand-deep:  #E8E8E8;

  /* Accent — gold */
  --gold:       #FFE600;   /* accent: rules, fills, on-dark text */
  --gold-soft:  #FFF04D;   /* gold on dark, lighter */
  --gold-ink:   #16233B;   /* CONTRAST-SAFE gold for text on light (~5:1) */

  /* Secondary */
  --rust:       #E6CF00;
  --rust-deep:  #16233B;

  /* Aliases used by page-specific section styles (kept for compatibility) */
  --offwhite:   #FFFFFF;
  --warm:       #E8E8E8;
  --sage:       #24262D;   /* dark alt section */
  --border:     rgba(24,26,32,.09);

  /* On-dark text */
  --on-dark:        #FFFFFF;
  --on-dark-70:     rgba(255,255,255,.72);
  --on-dark-45:     rgba(255,255,255,.5);

  /* Lines */
  --line:       rgba(24,26,32,.12);
  --line-soft:  rgba(24,26,32,.07);
  --line-gold:  rgba(255,230,0,.45);
  --line-on-dark: rgba(255,255,255,.16);

  /* Radius scale */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-pill: 999px;

  /* Spacing scale (4px base) */
  --s-1: .25rem;  --s-2: .5rem;   --s-3: .75rem;  --s-4: 1rem;
  --s-5: 1.5rem;  --s-6: 2rem;    --s-7: 3rem;    --s-8: 4rem;
  --s-9: 6rem;    --s-10: 8rem;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(24,26,32,.06), 0 2px 8px rgba(24,26,32,.05);
  --shadow-md: 0 4px 14px rgba(24,26,32,.08), 0 14px 40px rgba(24,26,32,.08);
  --shadow-lg: 0 18px 50px rgba(24,26,32,.16), 0 6px 18px rgba(24,26,32,.10);

  /* Type families */
  --serif: "Space Grotesk", system-ui, sans-serif;
  --sans:  "DM Sans", system-ui, -apple-system, sans-serif;

  /* Layout */
  --maxw: 1180px;
  --maxw-narrow: 760px;
}

/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--cream);
  color: var(--ink);
  font-size: 18px;
  line-height: 1.62;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ---------- TYPE SCALE ---------- */
.display {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.7rem, 6.2vw, 5rem);
  line-height: 1.02;
  letter-spacing: -0.018em;
  font-optical-sizing: auto;
}
h1, .h1 { font-family: var(--serif); font-weight: 420; font-size: clamp(2.2rem, 4.6vw, 3.6rem); line-height: 1.06; letter-spacing: -0.015em; margin: 0; }
h2, .h2 { font-family: var(--serif); font-weight: 420; font-size: clamp(1.9rem, 3.4vw, 2.9rem); line-height: 1.1; letter-spacing: -0.012em; margin: 0; }
h3, .h3 { font-family: var(--serif); font-weight: 460; font-size: clamp(1.3rem, 2vw, 1.7rem); line-height: 1.18; letter-spacing: -0.008em; margin: 0; }
.lede {
  font-size: clamp(1.15rem, 1.7vw, 1.4rem);
  line-height: 1.55;
  color: var(--ink-80);
  font-weight: 400;
}
p { margin: 0 0 1em; text-wrap: pretty; }
strong { font-weight: 600; color: var(--ink); }

/* Eyebrow / small-caps label */
.eyebrow {
  font-family: var(--sans);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold-ink);
  display: inline-flex;
  align-items: center;
  gap: .6rem;
}
/* (decorative rule before labels removed — clean labels site-wide) */
.eyebrow.on-dark { color: var(--gold-soft); }
.eyebrow.center { justify-content: center; }
.eyebrow.no-rule::before { display: none; }

/* ---------- LAYOUT ---------- */
.section { padding: var(--s-9) var(--s-6); }
.wrap { max-width: var(--maxw); margin: 0 auto; }
.wrap-narrow { max-width: var(--maxw-narrow); margin: 0 auto; }
.bg-cream { background: var(--cream); }
.bg-paper { background: var(--paper); }
.bg-sand  { background: var(--sand); }
.bg-ink   { background: var(--ink); color: var(--on-dark); }
.bg-ink .lede { color: var(--on-dark-70); }

.center { text-align: center; }
.section-head { max-width: 720px; margin-bottom: var(--s-7); }
.section-head.center { margin-left: auto; margin-right: auto; }
.section-head .eyebrow { margin-bottom: var(--s-4); }
.section-head h2 { margin-bottom: var(--s-4); }

/* ---------- BUTTONS (one canonical definition) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: .002em;
  padding: 1rem 1.7rem;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  transition: transform .18s ease, background .2s ease, color .2s ease, box-shadow .2s ease, border-color .2s ease;
  line-height: 1;
}
.btn:active { transform: translateY(1px); }
/* primary = filled gold, navy text. ALWAYS this, everywhere. */
.btn-primary { background: var(--gold); color: var(--ink); box-shadow: 0 6px 18px rgba(255,230,0,.35); }
.btn-primary:hover { background: var(--gold-soft); box-shadow: 0 8px 22px rgba(255,230,0,.45); transform: translateY(-2px); }
/* secondary on light = outlined ink */
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); background: rgba(24,26,32,.03); }
/* secondary on dark */
.btn-ghost-dark { background: transparent; color: var(--on-dark); border-color: var(--line-on-dark); }
.btn-ghost-dark:hover { border-color: var(--gold-soft); color: var(--gold-soft); }
.btn-lg { padding: 1.15rem 2.1rem; font-size: 1.08rem; }
.btn .arrow { transition: transform .2s ease; }
.btn:hover .arrow { transform: translateX(3px); }

/* ---------- PILL / BADGE ---------- */
.pill {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .82rem; font-weight: 500;
  padding: .42rem .85rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-80);
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.pill.on-dark { background: rgba(255,255,255,.06); border-color: var(--line-on-dark); color: var(--on-dark-70); }

/* ---------- CARD ---------- */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s-6);
}

/* ---------- NAV (shared — rendered by site.js) ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.85);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto;
  padding: .9rem var(--s-6);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}

/* Brand / logo — SINGLE SWAP-POINT lives in site.js.
   Wordmark by default; .brand img (a real logo) drops in cleanly. */
.brand { display: flex; align-items: center; gap: .6rem; }
.brand img.logo-img { height: 34px; width: auto; display: block; }
.footer .brand img.logo-img { height: 30px; }

.nav-links { display: flex; align-items: center; gap: 1.7rem; }
.nav-links a { font-size: .95rem; color: var(--ink-80); font-weight: 500; transition: color .15s; white-space: nowrap; }
.nav-links a:hover { color: var(--ink); }
.nav-links a.is-active { color: var(--ink); font-weight: 600; }
.nav-links .btn { padding: .68rem 1.3rem; font-size: .92rem; }

/* hamburger */
.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 42px; height: 42px; padding: 0; background: none; border: none; cursor: pointer;
}
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .25s, opacity .2s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: var(--s-4);
    background: rgba(255,255,255,.97); backdrop-filter: blur(12px);
    padding: var(--s-5) var(--s-6); border-bottom: 1px solid var(--line);
    transform: translateY(-8px); opacity: 0; pointer-events: none; transition: transform .22s ease, opacity .22s ease;
  }
  .nav-links.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav-links .btn { width: 100%; }
}

/* ---------- FOOTER (shared — rendered by site.js) ---------- */
.footer { background: var(--ink); color: var(--on-dark-70); padding: var(--s-8) var(--s-6) var(--s-6); border-top: 1px solid var(--line-on-dark); }
.footer-inner { max-width: var(--maxw); margin: 0 auto; display:flex; justify-content: space-between; gap: var(--s-6); flex-wrap: wrap; align-items: flex-start; }
.footer .brand { margin-bottom: var(--s-4); }
.footer .logo-word { color: var(--on-dark); }
.footer .logo-accent { color: var(--gold-soft); }
.footer .footer-brand p { margin: 0; max-width: 34ch; font-size: .92rem; }
.footer a:hover { color: var(--gold-soft); }
.footer .cols { display:flex; gap: var(--s-8); flex-wrap: wrap; }
.footer .col h5 { font-family: var(--sans); font-size: .76rem; letter-spacing:.13em; text-transform:uppercase; color: var(--gold-soft); margin:0 0 var(--s-4); font-weight:600; }
.footer .col a, .footer .col span { display:block; font-size:.92rem; margin-bottom: var(--s-3); }
.footer-base { max-width: var(--maxw); margin: var(--s-7) auto 0; padding-top: var(--s-5); border-top: 1px solid var(--line-on-dark); font-size:.82rem; color: var(--on-dark-45); display:flex; justify-content: space-between; gap:1rem; flex-wrap: wrap; }

/* ---------- SCROLL REVEAL ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce){ .reveal { opacity:1; transform:none; transition:none; } html{ scroll-behavior:auto; } }

/* ---------- ICONS (generic) ---------- */
.ic svg, svg.ic { display:block; }
.btn .arrow svg { width: 1.05em; height: 1.05em; vertical-align: -0.14em; stroke-width: 2.5; }
