/* ============================================================
   Vitiligo research site — shared token system.
   Same palette/convention as this project's other interactive pages, so
   the whole property (3D model, console, and this site) reads as
   one family. Swap --page/--ink/etc. here to re-skin everything.
   ============================================================ */
/* One palette, no toggle. The site now shares the "Mono" editorial system of the lieflat-charts
   figures on it — paper ground, charcoal ink, Inter, hairline rules — so the charts read as
   native page furniture rather than embedded plates. Lightness carries meaning; the single
   restrained accent (slate) is reserved for links and current-state. Swap --page/--ink/etc.
   here to re-skin everything. */
:root {
  color-scheme: light;
  --page:        #F0EFEB;   /* paper — same ground as the chart plates */
  --surface:     #F6F5F1;   /* cards: a hair above paper */
  --surface-2:   #E8E7E0;
  --ink:         #1C1C1A;   /* charcoal */
  --ink-2:       #4A4944;
  --ink-muted:   #8F8E88;
  --grid:        #DEDDD6;
  --border:      rgba(28,28,26,0.14);
  --accent:      #365F86;   /* one restrained slate — links + current state only */
  --accent-ink:  #F0EFEB;

  --status-good:     #4A7C59;   /* muted, tuned to sit on paper */
  --status-warning:  #B9862E;
  --status-critical: #A5473F;

  --radius: 12px;
  --shadow: 0 10px 30px rgba(28,28,26,0.08);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; background: var(--page); color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 2px; }

/* ---------------- top nav (injected by nav.js) ---------------- */
#site-nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: flex-start; flex-wrap: wrap;
  gap: 10px 18px; padding: 13px 24px;
  background: color-mix(in srgb, var(--page) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}
#site-nav .brand {
  display: flex; align-items: center; gap: 9px; margin-right: 6px;
  text-decoration: none; color: var(--ink);
  font-weight: 700; font-size: 14px; letter-spacing: -0.01em;
}
#site-nav .brand .brand-mark { border-radius: 50%; flex: none; }
#site-nav .brand small { font-weight: 450; color: var(--ink-muted); font-size: 11.5px; }
#site-nav .links { display: flex; gap: 2px; flex-wrap: wrap; }
#site-nav .x-link {
  display: flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  margin-left: auto; border-radius: 999px; border: none;
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  color: var(--ink-2); text-decoration: none; font-size: 14px; line-height: 1; flex: none;
  transition: background 0.15s ease, color 0.15s ease;
}
#site-nav .x-link:hover { color: var(--page); background: var(--ink); }

/* Below this width, brand + links no longer fit one row — push .links to its own full-width
   row so they flow left-to-right instead of being squeezed into a narrow column. */
@media (max-width: 640px) {
  #site-nav .links { flex: 1 1 100%; order: 3; }
  #site-nav .brand small { display: none; }
}
#site-nav .links a {
  text-decoration: none; color: var(--ink-2); font-size: 13px; font-weight: 500;
  letter-spacing: -0.005em; padding: 6px 12px; border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}
#site-nav .links a:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink); }
#site-nav .links a.current {
  background: var(--ink); color: var(--page); font-weight: 600;
}
#site-nav .links a.current:hover { background: var(--ink); color: var(--page); }

/* ---------------- shared layout ---------------- */
.wrap { max-width: 980px; margin: 0 auto; padding: 32px 20px 64px; }
.wrap.wide { max-width: 1180px; }

.kicker {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--ink-muted); font-weight: 700; margin: 0 0 6px;
}
h1.page-title { font-size: 30px; margin: 0 0 8px; letter-spacing: -0.02em; }
.lede { font-size: 15px; color: var(--ink-2); max-width: 68ch; margin: 0 0 28px; }

.disclaimer {
  font-size: 12.5px; color: var(--ink-muted); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; margin: 0 0 28px;
}
.disclaimer strong { color: var(--ink-2); }

/* stat row */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 0 0 32px; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px;
}
.stat .n { font-size: 24px; font-weight: 750; letter-spacing: -0.02em; }
.stat .n.good { color: var(--status-good); }
.stat .label { font-size: 11.5px; color: var(--ink-muted); margin-top: 2px; }

/* nav cards on index */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 0 0 32px; }
.nav-card {
  display: block; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.nav-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.nav-card .icon { font-size: 26px; margin-bottom: 10px; display: block; }
.nav-card h3 { margin: 0 0 6px; font-size: 16px; }
.nav-card p { margin: 0; font-size: 13px; color: var(--ink-2); }

/* generic section card */
.section { margin: 0 0 40px; }
.section > h2 { font-size: 20px; margin: 0 0 4px; }
.section > .sub { font-size: 13px; color: var(--ink-muted); margin: 0 0 16px; }

/* hypothesis / persona cards */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; margin-bottom: 12px;
}
.card h3 { margin: 0 0 6px; font-size: 15.5px; }
.card .meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.pill {
  display: inline-block; font-size: 10.5px; font-weight: 700; padding: 3px 9px;
  border-radius: 999px; white-space: nowrap;
}
.pill.tested { background: color-mix(in srgb, var(--status-good) 18%, transparent); color: var(--status-good); }
.pill.untested { background: color-mix(in srgb, var(--ink-muted) 18%, transparent); color: var(--ink-2); }
.pill.fail { background: color-mix(in srgb, var(--status-critical) 18%, transparent); color: var(--status-critical); }
.pill.id { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.card .field { font-size: 13px; color: var(--ink-2); margin: 6px 0; }
.card .field b { color: var(--ink); font-weight: 650; }
.card details summary { cursor: pointer; font-size: 12.5px; color: var(--accent); margin-top: 8px; }
.card .test-list { list-style: none; margin: 8px 0 0; padding: 0; font-size: 12.5px; }
.card .test-list li { padding: 3px 0; color: var(--ink-2); }
.card .test-list .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 7px; }
.card .test-list .dot.ok { background: var(--status-good); }
.card .test-list .dot.bad { background: var(--status-critical); }

/* persona cards */
.persona-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.persona-card h3 { font-size: 14.5px; }
.persona-card .role { font-size: 12px; color: var(--ink-muted); margin: -4px 0 8px; }
.persona-card .asks { font-size: 13px; font-style: italic; color: var(--ink-2); margin: 6px 0; }
.persona-card .lens, .persona-card .blind { font-size: 12px; color: var(--ink-muted); margin: 4px 0; }

/* markdown-rendered content */
.md-body { font-size: 14px; color: var(--ink-2); }
.md-body :is(h1,h2,h3,h4) { color: var(--ink); }
.md-body h1 { font-size: 22px; }
.md-body h2 { font-size: 18px; margin-top: 28px; }
.md-body h3 { font-size: 15px; margin-top: 20px; }
.md-body code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: 0.9em; }
.md-body pre { background: var(--surface-2); padding: 12px; border-radius: 8px; overflow-x: auto; }
.md-body table { border-collapse: collapse; width: 100%; margin: 12px 0; font-size: 13px; display: block; overflow-x: auto; }
.md-body th, .md-body td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; }
.md-body th { background: var(--surface-2); }
.md-body blockquote { border-left: 3px solid var(--accent); margin: 0; padding: 2px 14px; color: var(--ink-muted); }

/* round accordion */
.round-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 10px; overflow: hidden;
}
.round-item > summary {
  cursor: pointer; padding: 14px 18px; font-weight: 650; font-size: 14px;
  list-style: none; display: flex; justify-content: space-between; align-items: center;
}
.round-item > summary::-webkit-details-marker { display: none; }
.round-item > summary .chev { color: var(--ink-muted); transition: transform 0.15s ease; }
.round-item[open] > summary .chev { transform: rotate(90deg); }
.round-item .round-body { padding: 0 18px 18px; }

.transcript-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.transcript-links button {
  font: inherit; font-size: 12px; cursor: pointer; padding: 5px 10px; border-radius: 7px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--ink-2);
}
.transcript-links button:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.tab-row { display: flex; gap: 6px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.tab-row button {
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; padding: 10px 14px;
  border: none; background: none; color: var(--ink-muted); border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab-row button.active { color: var(--ink); border-bottom-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.loading-row { color: var(--ink-muted); font-size: 13px; padding: 20px 0; }

footer.site-footer {
  max-width: 980px; margin: 48px auto 0; padding: 22px 2px; color: var(--ink-muted);
  font-size: 12px; border-top: 1px solid var(--border);
}
footer.site-footer a { color: var(--ink-2); }

/* ---------------- Lieflat-charts figures (findings.html + home page) ---------------- */
/* ── Lieflat-charts "Mono" figures ─────────────────────────────────────────────
     Adapted from the lieflat-charts skill (github.com/larashero3-dotcom/lieflat-charts,
     PolyForm Noncommercial 1.0.0) — Lupi Editorial + Lupi Basics templates, Mono
     greyscale only: lightness encodes magnitude, there is no decorative colour. Each
     figure is a self-contained paper "plate" and keeps its own tokens so it does not
     inherit the site's dark theme — the one exception the skill allows is the single
     dark plate (the dot cascade). All classes are lf-* so nothing collides with
     site.css's own .card rules. */
  .lf-note { font-size: 13px; color: var(--ink-2); max-width: 74ch; margin: 0 0 6px; }
  .lf-note.sys { color: var(--ink-muted); font-size: 12px; margin: 0 0 26px; }

  .lf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 22px; }
  .lf-card {
    background: #F0EFEB; color: #1C1C1A; border-radius: 24px; padding: 26px 26px 18px;
    border: 1px solid var(--border);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  }
  .lf-card.dark { background: #1C1C1A; color: #F0EFEB; border-color: #33322E; }
  .lf-card.wide { grid-column: 1 / -1; }
  .lf-card h2 {
    font-weight: 700; font-size: 16.5px; letter-spacing: -0.02em; margin: 0 0 3px; color: inherit;
  }
  .lf-card .lf-sub { font-size: 11.5px; color: #8F8E88; margin: 0 0 14px; line-height: 1.45; }
  .lf-card.dark .lf-sub { color: #8F8E88; }
  .lf-card .lf-src {
    font-size: 9.5px; color: #C6C5BF; margin-top: 10px; letter-spacing: 0.08em; font-weight: 500;
  }
  .lf-card.dark .lf-src { color: #55554F; }
  .lf-card svg { display: block; width: 100%; height: auto; cursor: pointer; }
  .lf-card svg text { font-family: 'Inter', sans-serif; }

  .lf-card .pop { transform-box: fill-box; transform-origin: center; animation: lf-pop .5s cubic-bezier(.2,.7,.3,1.3) both; }
  @keyframes lf-pop { from { transform: scale(0); } to { transform: none; } }
  .lf-card .fade { animation: lf-fade .9s ease both; }
  @keyframes lf-fade { from { opacity: 0; } }
  .lf-card .draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: lf-draw 1s cubic-bezier(.4,0,.2,1) both; }
  @keyframes lf-draw { to { stroke-dashoffset: 0; } }
  @media (prefers-reduced-motion: reduce) {
    .lf-card .pop, .lf-card .fade { animation: none; }
    .lf-card .draw { animation: none; stroke-dasharray: none; stroke-dashoffset: 0; }
  }
  .lf-loading { color: var(--ink-muted); font-size: 13px; padding: 24px 0; }
