/* ==========================================================================
   PLI — base.css  ·  LIQUID GLASS variant
   Design tokens, reset, typography, glass buttons, shared utilities.
   Glassmorphism as a system: a fixed navy+gold "liquid" mesh background,
   frosted translucent panels, specular sheen, theme-aware (light + dark).
   System fonts only. No external fonts, no CDNs, no network dependencies.

   Architecture note: raw BRAND tokens (--navy/--gold/…) stay constant across
   themes; SEMANTIC tokens (surfaces, text, glass) flip under
   prefers-color-scheme. Components read the semantic tokens, so one media
   query reskins the whole site to dark. Sections marked .on-dark are a dark
   glass slab in BOTH themes (always light text).
   ========================================================================== */

:root {
  /* ---- Brand tokens (constant) ---- */
  --navy:        #15243d;
  --navy-deep:   #0e1a30;
  --navy-abyss:  #0a1526;
  --navy-mid:    #1b2f52;
  --navy-soft:   #2a3d5e;
  --navy-line:   #33466b;

  --gold:        #d4af5a;
  --gold-bright: #e6c877;
  --gold-deep:   #a8843a;
  --gold-ink:    #7d6126;

  --cream:       #f4eeda;
  --ink:         #17233a;

  /* ---- Liquid mesh background (light) ---- */
  --bg-base:     #eaeef5;
  --bg-mesh:
      radial-gradient(58rem 48rem at 86% -12%, rgba(212, 175, 90, 0.20), transparent 60%),
      radial-gradient(52rem 46rem at -12% 6%, rgba(27, 60, 128, 0.20), transparent 58%),
      radial-gradient(46rem 42rem at 52% 118%, rgba(212, 175, 90, 0.12), transparent 60%),
      linear-gradient(158deg, #eef2f8 0%, #e3e9f2 58%, #e8edf5 100%);

  /* ---- Semantic text (light) ---- */
  --text-heading: var(--navy);
  --text-body:    #1c2740;
  --text-muted:   #45546d;
  --text-faint:   #647089;

  /* ---- Glass surfaces (light) ---- */
  --glass-fill:        rgba(255, 255, 255, 0.58);
  --glass-fill-strong: rgba(255, 255, 255, 0.74);   /* behind body text — keeps AA */
  --glass-fill-soft:   rgba(255, 255, 255, 0.40);
  --glass-blur:        18px;
  --glass-sat:         168%;
  --glass-border:      rgba(255, 255, 255, 0.70);
  --glass-border-ink:  rgba(21, 36, 61, 0.10);
  --glass-hi:          rgba(255, 255, 255, 0.85);    /* inner top highlight */
  --glass-sheen:       rgba(255, 255, 255, 0.55);
  --glass-shadow:      0 10px 30px rgba(12, 22, 42, 0.14), 0 2px 8px rgba(12, 22, 42, 0.07);
  --glass-shadow-lg:   0 22px 50px rgba(12, 22, 42, 0.20), 0 6px 16px rgba(12, 22, 42, 0.10);
  --hairline:          rgba(21, 36, 61, 0.14);
  --hairline-soft:     rgba(21, 36, 61, 0.09);

  /* ---- Dark glass slab (for .on-dark — constant across themes) ---- */
  --dark-glass:        rgba(14, 26, 48, 0.62);
  --dark-glass-strong: rgba(10, 20, 40, 0.72);
  --dark-glass-border: rgba(212, 175, 90, 0.22);
  --dark-hairline:     rgba(212, 175, 90, 0.16);
  --on-navy:           #e7ecf6;
  --on-navy-muted:     #aeb9cf;

  /* ---- Type ---- */
  --serif: Georgia, "Times New Roman", "Liberation Serif", "Nimbus Roman", serif;
  --sans:  "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono:  "SFMono-Regular", "Cascadia Code", "Consolas", "Liberation Mono", Menlo, monospace;

  /* ---- Rhythm ---- */
  --measure: 66ch;
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.75rem;
  --space-4: 3rem;
  --space-5: 5rem;
  --space-6: 7rem;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-sm: 8px;

  --ease: cubic-bezier(0.2, 0.6, 0.2, 1);
  --t-fast: 130ms;
  --t-med: 240ms;
  --t-slow: 520ms;
}

/* ---------- Dark theme: flip semantic tokens only ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-base: #070f1e;
    --bg-mesh:
        radial-gradient(58rem 50rem at 84% -12%, rgba(212, 175, 90, 0.14), transparent 60%),
        radial-gradient(54rem 48rem at -10% 6%, rgba(43, 82, 156, 0.30), transparent 58%),
        radial-gradient(46rem 44rem at 58% 120%, rgba(150, 112, 48, 0.16), transparent 60%),
        linear-gradient(158deg, #0b1626 0%, #070f1e 58%, #0a1526 100%);

    --text-heading: var(--cream);
    --text-body:    #d8e0f1;
    --text-muted:   #a2b2ce;
    --text-faint:   #8492ac;

    --glass-fill:        rgba(26, 42, 70, 0.48);
    --glass-fill-strong: rgba(20, 34, 60, 0.66);
    --glass-fill-soft:   rgba(30, 48, 78, 0.34);
    --glass-border:      rgba(255, 255, 255, 0.14);
    --glass-border-ink:  rgba(0, 0, 0, 0.30);
    --glass-hi:          rgba(255, 255, 255, 0.16);
    --glass-sheen:       rgba(255, 255, 255, 0.16);
    --glass-shadow:      0 14px 38px rgba(0, 0, 0, 0.48), 0 2px 8px rgba(0, 0, 0, 0.30);
    --glass-shadow-lg:   0 26px 60px rgba(0, 0, 0, 0.60), 0 8px 20px rgba(0, 0, 0, 0.40);
    --hairline:          rgba(255, 255, 255, 0.13);
    --hairline-soft:     rgba(255, 255, 255, 0.08);

    /* .on-dark slabs go a touch deeper so they still read as distinct bands */
    --dark-glass:        rgba(9, 18, 36, 0.58);
    --dark-glass-strong: rgba(6, 13, 28, 0.68);
  }
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
  color-scheme: light dark;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg-base);
  background-image: var(--bg-mesh);
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: var(--text-body);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Fine frosted grain over the mesh — self-contained SVG turbulence, no files. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}

img, svg { max-width: 100%; height: auto; display: block; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--serif);
  color: var(--text-heading);
  line-height: 1.16;
  margin: 0 0 var(--space-2);
  letter-spacing: 0.005em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.25rem, 5.4vw, 3.6rem); font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.65rem, 3.6vw, 2.35rem); font-weight: 700; }
h3 { font-size: clamp(1.2rem, 2.4vw, 1.48rem); font-weight: 700; }
h4 { font-size: 1.05rem; font-weight: 700; }

p { margin: 0 0 var(--space-2); max-width: var(--measure); }
ul, ol { margin: 0 0 var(--space-2); padding-left: 1.4rem; max-width: var(--measure); }
li { margin-bottom: 0.5rem; }

a {
  color: var(--navy-mid);
  text-decoration-color: var(--gold-deep);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  transition: color var(--t-fast) var(--ease);
}
a:hover { color: var(--gold-ink); }
@media (prefers-color-scheme: dark) {
  a { color: #cdd8ef; text-decoration-color: var(--gold); }
  a:hover { color: var(--gold-bright); }
}

strong { color: var(--text-heading); font-weight: 700; }
em { color: inherit; }

/* Letter-spaced small-caps eyebrow above headings */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--sans);
  font-size: 0.775rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-ink);
  margin-bottom: 0.85rem;
}
.kicker::before {
  content: "";
  width: 1.6rem;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), var(--gold-deep));
  display: inline-block;
  border-radius: 2px;
}
@media (prefers-color-scheme: dark) { .kicker { color: var(--gold-bright); } }

.on-dark .kicker { color: var(--gold-bright); }
.on-dark .kicker::before { background: var(--gold); }
.on-dark h1, .on-dark h2, .on-dark h3, .on-dark h4 { color: var(--cream); }
.on-dark p, .on-dark li { color: var(--on-navy); }
.on-dark a { color: var(--cream); text-decoration-color: var(--gold); }
.on-dark a:hover { color: var(--gold-bright); }
.on-dark strong { color: var(--cream); }

.lede {
  font-size: clamp(1.15rem, 1.9vw, 1.3rem);
  line-height: 1.58;
  color: var(--text-muted);
  max-width: 60ch;
}
.on-dark .lede { color: var(--on-navy); }

.section-head { max-width: 54ch; margin-bottom: var(--space-4); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head.center .kicker { justify-content: center; }
.section-head.center .rule-gold { margin-inline: auto; }
.section-head p { color: var(--text-muted); }
.on-dark .section-head p { color: var(--on-navy); }

/* ---------- Focus visibility ---------- */
:focus-visible {
  outline: 3px solid var(--gold-deep);
  outline-offset: 2px;
  border-radius: 3px;
}
.on-dark :focus-visible, .site-header :focus-visible { outline-color: var(--gold-bright); }
@media (prefers-color-scheme: dark) { :focus-visible { outline-color: var(--gold-bright); } }

/* ==========================================================================
   Glass primitives — utility base for frosted panels
   ========================================================================== */
.glass, .card, .service, .answer, .notice, .disclaimer,
.hub-nav a, .founder-photo img, .table-scroll {
  background: var(--glass-fill-strong);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  border: 1px solid var(--glass-border-ink);
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-hi);
}

/* Specular top-sheen shared by glass cards (decorative, non-interactive) */
.card::before, .service::before, .answer::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, var(--glass-sheen) 0%, transparent 22%);
  opacity: 0.5;
  mix-blend-mode: screen;
}

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--sans);
  font-weight: 650;
  font-size: 0.98rem;
  letter-spacing: 0.01em;
  padding: 0.8rem 1.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: background-color var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease),
              box-shadow var(--t-med) var(--ease),
              transform var(--t-fast) var(--ease);
}
/* glass specular cap on every button */
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,0.42) 0%, rgba(255,255,255,0.06) 46%, transparent 60%);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn .arrow { transition: transform var(--t-med) var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

.btn-primary {
  background: linear-gradient(160deg, var(--navy-mid), var(--navy-deep));
  color: var(--cream);
  border-color: rgba(255,255,255,0.14);
  box-shadow: var(--glass-shadow), inset 0 1px 0 rgba(255,255,255,0.18);
}
.btn-primary:hover { color: #fff; box-shadow: var(--glass-shadow-lg), inset 0 1px 0 rgba(255,255,255,0.24); }

.btn-gold {
  background: linear-gradient(160deg, var(--gold-bright), var(--gold) 55%, var(--gold-deep));
  color: var(--navy-abyss);
  border-color: rgba(125, 97, 38, 0.5);
  box-shadow: 0 8px 24px rgba(168, 132, 58, 0.32), inset 0 1px 0 rgba(255,255,255,0.55);
}
.btn-gold:hover { box-shadow: 0 12px 32px rgba(168, 132, 58, 0.44), inset 0 1px 0 rgba(255,255,255,0.7); color: var(--navy-abyss); }

.btn-outline {
  background: var(--glass-fill-soft);
  -webkit-backdrop-filter: blur(10px) saturate(150%);
  backdrop-filter: blur(10px) saturate(150%);
  color: var(--text-heading);
  border-color: var(--glass-border-ink);
}
.btn-outline::before { background: linear-gradient(180deg, var(--glass-sheen) 0%, transparent 55%); opacity: 0.5; }
.btn-outline:hover { border-color: var(--gold-deep); color: var(--gold-ink); background: rgba(212,175,90,0.10); }
@media (prefers-color-scheme: dark) {
  .btn-outline { color: var(--cream); }
  .btn-outline:hover { color: var(--gold-bright); border-color: var(--gold); }
}
.on-dark .btn-outline { color: var(--cream); border-color: rgba(212,175,90,0.3); background: rgba(212,175,90,0.06); }
.on-dark .btn-outline:hover { border-color: var(--gold); color: var(--gold-bright); background: rgba(212,175,90,0.12); }

.btn-sm { padding: 0.55rem 1.05rem; font-size: 0.9rem; }

/* Plain text link with arrow */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 650;
  font-family: var(--sans);
  font-size: 0.98rem;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.link-arrow .arrow { transition: transform var(--t-med) var(--ease); }
.link-arrow:hover .arrow { transform: translateX(3px); }

/* ---------- Layout primitives ---------- */
.container { width: min(100% - 2.5rem, 72rem); margin-inline: auto; }
.container-narrow { width: min(100% - 2.5rem, 52rem); margin-inline: auto; }
.container-wide { width: min(100% - 2.5rem, 78rem); margin-inline: auto; }

.section { padding-block: var(--space-5); }
.section-tight { padding-block: var(--space-4); }

.rule-gold {
  border: 0;
  height: 3px;
  width: 60px;
  background: linear-gradient(90deg, var(--gold-bright), var(--gold-deep));
  border-radius: 2px;
  margin: 0 0 var(--space-3);
  box-shadow: 0 0 14px rgba(212, 175, 90, 0.5);
}

/* Utility */
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.stack > * + * { margin-top: var(--space-2); }
.eyebrow-muted { color: var(--text-faint); font-size: 0.9rem; }

/* Skip link */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 200;
  background: var(--gold);
  color: var(--navy-deep);
  padding: 0.6rem 1rem;
  font-weight: 700;
  border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; top: 0; }

/* ==========================================================================
   Graceful fallback: no backdrop-filter → solid, readable panels
   ========================================================================== */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root {
    --glass-fill:        #eef2f8;
    --glass-fill-strong: #f5f7fb;
    --glass-fill-soft:   #e8edf5;
  }
  @media (prefers-color-scheme: dark) {
    :root {
      --glass-fill:        #16233c;
      --glass-fill-strong: #101d33;
      --glass-fill-soft:   #1a2942;
    }
  }
  .btn-outline { background: var(--glass-fill-soft); }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
  .btn:hover, [data-reveal] { transform: none !important; }
}
