/* ============================================================
   Wicked Health — Brand Book tokens
   Boston-gothic palette × premium-clinical telehealth.
   Foundation type from Porchlight (Jost / Space Grotesk / JetBrains Mono).
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=Jost:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400;1,600&family=Space+Grotesk:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&family=DM+Serif+Display:ital@0;1&display=swap");

:root {
  /* — Type — */
  --wh-mono:    "JetBrains Mono", ui-monospace, "SF Mono", monospace;
  --wh-display: "Jost", system-ui, -apple-system, sans-serif;
  --wh-body:    "Space Grotesk", "Jost", system-ui, sans-serif;
  --wh-serif:   "DM Serif Display", Georgia, serif;

  /* — Boston Gothic palette (default: Beacon Hill) — */
  --ink:        #140811;   /* deep aubergine — primary surface */
  --ink-elev:   #1f0e1a;   /* slight lift */
  --ink-sunk:   #0c0509;
  --brick:      #b8344b;   /* primary accent — Boston brick / Sox red */
  --brick-deep: #7a1027;
  --brick-soft: rgba(184, 52, 75, 0.18);
  --brass:      #d4a256;   /* warm gas-lamp gold — secondary accent */
  --brass-deep: #9c7434;
  --plum:       #5a1a4a;   /* deep gothic plum */
  --parchment:  #f0e4d0;   /* warm cream — foreground on ink */
  --fog:        rgba(240, 228, 208, 0.55);
  --hairline:   rgba(240, 228, 208, 0.12);
  --hairline-2: rgba(240, 228, 208, 0.22);

  /* Semantic — light mode flips these */
  --bg:         var(--ink);
  --bg-elev:    var(--ink-elev);
  --bg-sunk:    var(--ink-sunk);
  --fg-1:       var(--parchment);
  --fg-2:       rgba(240, 228, 208, 0.7);
  --fg-3:       rgba(240, 228, 208, 0.45);
  --border:     var(--hairline);
  --border-strong: var(--hairline-2);
  --accent:     var(--brick);
  --accent-2:   var(--brass);

  /* — Spacing (4pt) — */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px;
  --s6: 24px; --s8: 32px; --s10: 40px; --s12: 48px; --s16: 64px;
  --s20: 80px; --s24: 96px; --s32: 128px; --s40: 160px;

  /* — Radii — */
  --r-xs: 4px; --r-sm: 8px; --r-md: 12px; --r-lg: 20px; --r-xl: 32px; --r-pill: 999px;

  /* — Motion — */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 150ms; --dur: 280ms; --dur-slow: 600ms;
}

/* — Light mode (parchment surface) — */
[data-mode="light"] {
  --bg:         var(--parchment);
  --bg-elev:    #f6ecd9;
  --bg-sunk:    #e6d8be;
  --fg-1:       var(--ink);
  --fg-2:       rgba(20, 8, 17, 0.72);
  --fg-3:       rgba(20, 8, 17, 0.45);
  --border:     rgba(20, 8, 17, 0.12);
  --border-strong: rgba(20, 8, 17, 0.22);
}

/* — Palette variants — */
[data-palette="crimson"] {
  --ink: #0a0507; --ink-elev: #16080a; --ink-sunk: #050203;
  --brick: #d92642; --brick-deep: #8a0e22; --brick-soft: rgba(217, 38, 66, 0.2);
  --brass: #e8c889; --plum: #2a0f15; --parchment: #f5ece0;
}
[data-palette="apothecary"] {
  --ink: #0e1a13; --ink-elev: #142318; --ink-sunk: #06100a;
  --brick: #a8324a; --brick-deep: #6d1428; --brick-soft: rgba(168, 50, 74, 0.18);
  --brass: #c89958; --plum: #1a2f23; --parchment: #ede2c8;
}
[data-palette="plum"] {
  --ink: #170a1a; --ink-elev: #211024; --ink-sunk: #0d050f;
  --brick: #c43a6b; --brick-deep: #851548; --brick-soft: rgba(196, 58, 107, 0.2);
  --brass: #dba26f; --plum: #3a1239; --parchment: #f0dee8;
}

/* ============================================================
   Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--fg-1);
  font-family: var(--wh-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

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

/* ============================================================
   Layout
   ============================================================ */
.wh-page {
  min-height: 100vh;
  padding: var(--s24) var(--s24);
  position: relative;
  border-bottom: 1px solid var(--border);
}
.wh-page > .wh-inner {
  max-width: 1240px;
  margin: 0;
}

@media (max-width: 900px) {
  .wh-page { padding: var(--s16) var(--s8); }
}

/* Page eyebrow numbering */
.wh-folio {
  display: flex;
  align-items: baseline;
  gap: var(--s4);
  font-family: var(--wh-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: var(--s10);
}
.wh-folio .num {
  color: var(--accent);
  font-weight: 600;
}
.wh-folio .rule {
  flex: 1;
  height: 1px;
  background: var(--border);
  max-width: 240px;
}

/* ============================================================
   Type system
   ============================================================ */
.wh-display {
  font-family: var(--wh-mono);
  font-weight: 700;
  font-size: clamp(48px, 10vw, 140px);
  line-height: 0.92;
  letter-spacing: -0.04em;
  margin: 0;
  text-wrap: balance;
}
.wh-h1 {
  font-family: var(--wh-mono);
  font-weight: 700;
  font-size: clamp(36px, 5.5vw, 72px);
  line-height: 1.0;
  letter-spacing: -0.03em;
  margin: 0;
  text-wrap: balance;
}
.wh-h2 {
  font-family: var(--wh-mono);
  font-weight: 600;
  font-size: clamp(28px, 3.6vw, 44px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0;
}
.wh-h3 {
  font-family: var(--wh-mono);
  font-weight: 600;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0;
}
.wh-eyebrow {
  font-family: var(--wh-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
}
.wh-lede {
  font-family: var(--wh-body);
  font-weight: 400;
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.45;
  color: var(--fg-2);
  text-wrap: pretty;
  max-width: 720px;
}
.wh-body {
  font-family: var(--wh-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--fg-1);
  text-wrap: pretty;
  max-width: 640px;
}
.wh-meta {
  font-family: var(--wh-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.wh-serif {
  font-family: var(--wh-serif);
  font-style: italic;
}

em.accent { color: var(--accent); font-style: normal; }
em.brass  { color: var(--brass); font-style: normal; }

/* ============================================================
   Components — buttons, chips, swatches, cards
   ============================================================ */
.wh-btn {
  display: inline-flex; align-items: center; gap: var(--s2);
  font-family: var(--wh-mono);
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.15em; text-transform: uppercase;
  padding: var(--s3) var(--s5);
  border-radius: var(--r-pill);
  background: var(--accent); color: var(--parchment);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur) var(--ease);
}
.wh-btn.ghost {
  background: transparent;
  color: var(--fg-1);
  border-color: var(--border-strong);
}
.wh-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(184,52,75,0.28); }
.wh-btn.ghost:hover { border-color: var(--accent); color: var(--accent); box-shadow: none; }

.wh-chip {
  display: inline-flex; align-items: center; gap: var(--s2);
  font-family: var(--wh-mono);
  font-size: 10px; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-strong);
  color: var(--fg-2);
}
.wh-chip .dot {
  width: 6px; height: 6px; border-radius: var(--r-pill); background: var(--accent);
}

.wh-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s8);
}

/* ============================================================
   Logo system
   ============================================================ */
.logo {
  font-family: var(--wh-mono);
  font-weight: 700;
  color: var(--fg-1);
  letter-spacing: -0.02em;
  line-height: 0.95;
  display: inline-flex; align-items: baseline; gap: 0.4em;
  font-feature-settings: "ss01";
}
.logo .dot {
  display: inline-block;
  width: 0.32em; height: 0.32em;
  border-radius: var(--r-pill);
  background: var(--accent);
  transform: translateY(-0.05em);
  box-shadow: 0 0 0.4em var(--brick-soft);
}
.logo.stacked {
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  line-height: 0.88;
}
.logo.stacked .row { display: flex; align-items: baseline; gap: 0.3em; }
.logo.stacked .health { color: var(--accent); }

.logo-lockup {
  display: inline-flex; flex-direction: column; gap: 6px; align-items: flex-start;
}
.logo-lockup .tagline {
  font-family: var(--wh-serif);
  font-style: italic;
  font-size: 0.32em;
  letter-spacing: 0;
  line-height: 1.1;
  color: var(--brass);
}

/* Monogram seal */
.seal {
  width: 200px; height: 200px;
  border-radius: 999px;
  border: 1.5px solid var(--brass);
  position: relative;
  display: grid; place-items: center;
  color: var(--fg-1);
  background: radial-gradient(circle at 50% 38%, rgba(212,162,86,0.06), transparent 60%);
}
.seal::before {
  content: ""; position: absolute; inset: 8px;
  border-radius: 999px;
  border: 0.5px solid var(--hairline-2);
}
.seal .wh {
  font-family: var(--wh-mono);
  font-weight: 700;
  font-size: 56px;
  letter-spacing: -0.04em;
}
.seal .ring-text {
  position: absolute; inset: 0;
  font-family: var(--wh-mono);
  font-size: 9px; letter-spacing: 0.32em;
  color: var(--brass);
  text-transform: uppercase;
}

/* ============================================================
   Color swatch
   ============================================================ */
.swatch {
  border-radius: var(--r-md);
  padding: var(--s4);
  display: flex; flex-direction: column; justify-content: space-between;
  font-family: var(--wh-mono);
  font-size: 11px;
  min-height: 200px;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.swatch .name {
  font-family: var(--wh-mono);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
  text-transform: none;
}
.swatch .role { font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; opacity: 0.65; }
.swatch .hex { font-size: 11px; letter-spacing: 0.05em; }

/* ============================================================
   App screen mock
   ============================================================ */
.phone {
  width: 280px;
  aspect-ratio: 9 / 19.5;
  border-radius: 36px;
  background: var(--bg-sunk);
  border: 8px solid #0a0507;
  padding: 0;
  position: relative;
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(0,0,0,0.45), 0 1px 0 var(--hairline) inset;
}
.phone .notch {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  width: 90px; height: 22px; background: #050203; border-radius: 12px;
  z-index: 2;
}
.phone-inner {
  height: 100%;
  padding: 44px 16px 20px;
  display: flex; flex-direction: column; gap: 14px;
  font-family: var(--wh-body);
  color: var(--parchment);
  background:
    radial-gradient(80% 50% at 20% 0%, rgba(184,52,75,0.22), transparent 60%),
    radial-gradient(60% 40% at 100% 100%, rgba(212,162,86,0.12), transparent 60%),
    var(--ink);
}

/* ============================================================
   Brass plaque
   ============================================================ */
.plaque {
  background: linear-gradient(180deg, #e0bb78 0%, #b88a3e 50%, #9c7434 100%);
  color: #1a0c08;
  padding: var(--s8) var(--s10);
  border-radius: 4px;
  position: relative;
  font-family: var(--wh-mono);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.55),
    inset 0 -1px 0 rgba(0,0,0,0.25),
    0 8px 24px rgba(0,0,0,0.35);
}
.plaque::before, .plaque::after {
  content: ""; position: absolute; width: 8px; height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff5d5, #6a4a18);
  box-shadow: inset 0 -1px 1px rgba(0,0,0,0.4);
}
.plaque::before { top: 10px; left: 10px; }
.plaque::after  { top: 10px; right: 10px; }
.plaque .bot-left, .plaque .bot-right {
  position: absolute; bottom: 10px; width: 8px; height: 8px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff5d5, #6a4a18);
  box-shadow: inset 0 -1px 1px rgba(0,0,0,0.4);
}
.plaque .bot-left { left: 10px; } .plaque .bot-right { right: 10px; }

/* ============================================================
   Voice — do/don't pairs
   ============================================================ */
.voice-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s6);
  border-top: 1px solid var(--border);
  padding: var(--s6) 0;
}
.voice-row:last-child { border-bottom: 1px solid var(--border); }
.voice-cell .verdict {
  font-family: var(--wh-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: var(--s3);
  display: inline-flex; align-items: center; gap: var(--s2);
}
.voice-cell .verdict.ok { color: var(--brass); }
.voice-cell .verdict.no { color: var(--accent); }
.voice-cell .verdict .glyph {
  display: inline-grid; place-items: center;
  width: 16px; height: 16px; border-radius: 50%;
  border: 1px solid currentColor;
  font-size: 9px; line-height: 1;
}
.voice-cell .quote {
  font-family: var(--wh-mono);
  font-size: 18px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--fg-1);
}
.voice-cell .quote.bad { color: var(--fg-3); text-decoration: line-through; text-decoration-color: var(--accent); text-decoration-thickness: 1px; }
.voice-cell .why {
  margin-top: var(--s3);
  font-family: var(--wh-body);
  font-size: 13px;
  color: var(--fg-3);
}

/* ============================================================
   Misc
   ============================================================ */
.divider-rule {
  height: 1px;
  background: var(--border);
  margin: var(--s10) 0;
}

.kicker {
  font-family: var(--wh-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass);
}

a.wh-link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
}

::selection { background: var(--brick); color: var(--parchment); }
