/* =========================================================================
   GeniusToker — design system
   Concept: certification lab meets a warm, hazy lounge. Precision + haze.
   Accent: honey-gold (the seal) · secondary: glass-teal (the data)
   ========================================================================= */

/* ---- Tokens: light is the :root default, dark overrides below ---------- */
:root {
  /* warm-cool "frosted glass" neutrals — deliberately not cream */
  --ground:    #e8e9e5;
  --surface:   #f2f2ee;
  --surface-2: #fafaf7;
  --border:    #d5d4cb;
  --border-2:  #c4c2b7;
  --text:      #211d17;
  --muted:     #5b554b;
  --faint:     #8a8477;

  /* accents */
  --gold:      #a9761a;   /* seal / primary accent, sits on light */
  --gold-2:    #c68d24;
  --gold-glow: #d69a2e;   /* decorative seal fill */
  --teal:      #2c7a74;   /* precision / data */
  --teal-2:    #35908a;

  /* semantic (verdicts) — distinct from accent */
  --pass:  #3f7d4e;
  --hold:  #a9741f;
  --fail:  #ad4636;

  --haze-a: rgba(214,154,46,0.10);
  --haze-b: rgba(44,122,116,0.09);
  --shadow: 0 1px 2px rgba(20,15,8,.06), 0 8px 30px -12px rgba(20,15,8,.18);

  --font-display: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-body:    ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono:    ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;

  --maxw: 1080px;
  --gutter: clamp(1.1rem, 4vw, 2.5rem);
  --radius: 14px;
  --radius-sm: 9px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground:    #15120d;
    --surface:   #1d1913;
    --surface-2: #251f18;
    --border:    #342d23;
    --border-2:  #453c2f;
    --text:      #efe9df;
    --muted:     #b4aa9b;
    --faint:     #7c7365;

    --gold:      #e8b24c;
    --gold-2:    #d29a34;
    --gold-glow: #e8b24c;
    --teal:      #58beb2;
    --teal-2:    #46a89d;

    --pass:  #6fbb7d;
    --hold:  #e0b04a;
    --fail:  #dd8069;

    --haze-a: rgba(232,178,76,0.10);
    --haze-b: rgba(88,190,178,0.08);
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 20px 50px -20px rgba(0,0,0,.6);
  }
}

/* explicit toggle wins over OS preference, both directions */
:root[data-theme="light"] {
  --ground:#e8e9e5; --surface:#f2f2ee; --surface-2:#fafaf7; --border:#d5d4cb; --border-2:#c4c2b7;
  --text:#211d17; --muted:#5b554b; --faint:#8a8477;
  --gold:#a9761a; --gold-2:#c68d24; --gold-glow:#d69a2e; --teal:#2c7a74; --teal-2:#35908a;
  --pass:#3f7d4e; --hold:#a9741f; --fail:#ad4636;
  --haze-a:rgba(214,154,46,0.10); --haze-b:rgba(44,122,116,0.09);
  --shadow:0 1px 2px rgba(20,15,8,.06), 0 8px 30px -12px rgba(20,15,8,.18);
}
:root[data-theme="dark"] {
  --ground:#15120d; --surface:#1d1913; --surface-2:#251f18; --border:#342d23; --border-2:#453c2f;
  --text:#efe9df; --muted:#b4aa9b; --faint:#7c7365;
  --gold:#e8b24c; --gold-2:#d29a34; --gold-glow:#e8b24c; --teal:#58beb2; --teal-2:#46a89d;
  --pass:#6fbb7d; --hold:#e0b04a; --fail:#dd8069;
  --haze-a:rgba(232,178,76,0.10); --haze-b:rgba(88,190,178,0.08);
  --shadow:0 1px 2px rgba(0,0,0,.4), 0 20px 50px -20px rgba(0,0,0,.6);
}

/* ---- Base ------------------------------------------------------------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.02rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* drifting haze — the "lounge" atmosphere */
body::before {
  content: "";
  position: fixed;
  inset: -30vmax;
  z-index: -1;
  background:
    radial-gradient(38vmax 38vmax at 18% 12%, var(--haze-a), transparent 60%),
    radial-gradient(42vmax 42vmax at 85% 30%, var(--haze-b), transparent 62%),
    radial-gradient(36vmax 36vmax at 60% 95%, var(--haze-a), transparent 60%);
  filter: blur(8px);
  animation: drift 34s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes drift {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to   { transform: translate3d(3%, 2%, 0) scale(1.08); }
}
@media (prefers-reduced-motion: reduce) { body::before { animation: none; } }

a { color: var(--gold); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--gold-2); }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }

/* ---- Typography ------------------------------------------------------- */
h1, h2, h3, .display { font-family: var(--font-display); font-weight: 600; line-height: 1.08; text-wrap: balance; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); margin: 0 0 .4em; }
h3 { font-size: 1.28rem; margin: 0 0 .35em; letter-spacing: 0; }
p { margin: 0 0 1rem; max-width: 66ch; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--teal);
  margin: 0 0 1rem;
  display: inline-flex; align-items: center; gap: .55rem;
}
.eyebrow::before { content: ""; width: 26px; height: 1px; background: var(--teal); opacity: .7; }

.lead { font-size: clamp(1.05rem, 1.6vw, 1.22rem); color: var(--muted); max-width: 60ch; }

/* ---- Buttons ---------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font: 600 .95rem/1 var(--font-body);
  padding: .8rem 1.25rem; border-radius: 999px;
  border: 1px solid transparent; cursor: pointer;
  text-decoration: none; transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--gold); color: #1a1206; border-color: var(--gold); }
.btn-primary:hover { background: var(--gold-2); color: #1a1206; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-2); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn .arrow { transition: transform .15s ease; }
.btn:hover .arrow { transform: translateX(3px); }

/* ---- Header ----------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(140%) blur(10px);
  background: color-mix(in srgb, var(--ground) 82%, transparent);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; gap: 1rem; min-height: 64px; }
.brand { display: flex; align-items: center; gap: .6rem; font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; color: var(--text); text-decoration: none; letter-spacing: -.01em; }
.brand .mark { width: 26px; height: 26px; flex: none; }
.nav-links { display: flex; gap: 1.4rem; margin-left: auto; align-items: center; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: .95rem; font-weight: 500; }
.nav-links a:hover { color: var(--text); }
.theme-btn {
  background: transparent; border: 1px solid var(--border-2); color: var(--muted);
  width: 38px; height: 38px; border-radius: 999px; cursor: pointer; font-size: 1rem;
  display: grid; place-items: center;
}
.theme-btn:hover { color: var(--gold); border-color: var(--gold); }
.nav-toggle { display: none; }

@media (max-width: 720px) {
  .nav-links {
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; gap: 0; align-items: stretch;
    background: var(--surface); border-bottom: 1px solid var(--border);
    max-height: 0; overflow: hidden; transition: max-height .28s ease;
  }
  .nav-links.open { max-height: 340px; }
  .nav-links a { padding: .9rem var(--gutter); border-top: 1px solid var(--border); }
  .nav-toggle { display: grid; place-items: center; margin-left: auto; width: 40px; height: 40px; background: transparent; border: 1px solid var(--border-2); border-radius: 9px; color: var(--text); cursor: pointer; }
  .theme-btn { margin-left: .4rem; }
}
@media (prefers-reduced-motion: reduce) { .nav-links { transition: none; } }

/* ---- Sections --------------------------------------------------------- */
section { padding-block: clamp(3rem, 7vw, 5.5rem); }
.section-head { max-width: 60ch; margin-bottom: 2.2rem; }

/* ---- Hero ------------------------------------------------------------- */
.hero { padding-top: clamp(3rem, 8vw, 6rem); padding-bottom: clamp(2.5rem, 6vw, 4rem); }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero h1 { font-size: clamp(2.5rem, 5.6vw, 4.4rem); margin: 0 0 1.1rem; }
.hero h1 em { font-style: normal; color: var(--gold); }
.hero .lead { margin-bottom: 1.8rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-bottom: 1.6rem; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 1.4rem; font-family: var(--font-mono); font-size: .78rem; color: var(--faint); letter-spacing: .04em; }
.hero-meta b { color: var(--text); font-weight: 600; }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; text-align: left; }
  .seal-stage { order: -1; }
}

/* ---- The Seal --------------------------------------------------------- */
.seal-stage { display: grid; place-items: center; }
.seal {
  width: min(340px, 78vw); aspect-ratio: 1; position: relative;
  filter: drop-shadow(0 18px 40px rgba(0,0,0,.25));
  animation: sealin 1s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes sealin { from { opacity: 0; transform: scale(.8) rotate(-8deg); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .seal { animation: none; } }
.seal .ring-text { animation: spin 60s linear infinite; transform-origin: 50% 50%; }
@media (prefers-reduced-motion: reduce) { .seal .ring-text { animation: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
.seal:hover .ring-text { animation-duration: 14s; }

/* ---- Cards / grids ---------------------------------------------------- */
.grid { display: grid; gap: 1.1rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 860px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow);
  transition: transform .18s ease, border-color .18s ease;
}
.card.link:hover { transform: translateY(-3px); border-color: var(--gold); }
.card h3 { margin-bottom: .3rem; }
.card p { color: var(--muted); font-size: .95rem; margin-bottom: 0; }
a.card { text-decoration: none; color: inherit; display: block; }

/* ---- Verdict / review cards ------------------------------------------ */
.verdict {
  display: flex; flex-direction: column; gap: .9rem;
}
.verdict-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.score {
  font-family: var(--font-mono); font-weight: 700; font-variant-numeric: tabular-nums;
  font-size: 1.5rem; line-height: 1; color: var(--gold);
  display: flex; align-items: baseline; gap: .12em;
}
.score small { font-size: .72rem; color: var(--faint); font-weight: 500; }
.cat-tag { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--teal); }
.stamp {
  font-family: var(--font-mono); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .6rem; border-radius: 999px;
  border: 1px solid currentColor;
}
.stamp.pass { color: var(--pass); }
.stamp.hold { color: var(--hold); }
.stamp.fail { color: var(--fail); }
.stamp::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* rubric bars */
.rubric { display: grid; gap: .7rem; margin: 1.4rem 0; }
.rubric-row { display: grid; grid-template-columns: minmax(120px, 1fr) 2.4fr auto; gap: .8rem; align-items: center; }
.rubric-row .lbl { font-size: .9rem; color: var(--muted); }
.rubric-row .bar { height: 8px; border-radius: 999px; background: var(--border); overflow: hidden; }
.rubric-row .bar > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--teal), var(--gold)); }
.rubric-row .num { font-family: var(--font-mono); font-size: .82rem; color: var(--text); font-variant-numeric: tabular-nums; }
@media (max-width: 520px) { .rubric-row { grid-template-columns: 1fr auto; } .rubric-row .bar { grid-column: 1 / -1; order: 3; } }

/* ---- How-we-test criteria -------------------------------------------- */
.criteria { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
@media (max-width: 620px) { .criteria { grid-template-columns: 1fr; } }
.criterion { background: var(--surface); padding: 1.3rem; }
.criterion .n { font-family: var(--font-mono); font-size: .72rem; color: var(--teal); letter-spacing: .1em; }
.criterion h3 { margin: .5rem 0 .3rem; font-size: 1.1rem; }
.criterion p { font-size: .92rem; color: var(--muted); margin: 0; }
.criterion .wt { font-family: var(--font-mono); font-size: .72rem; color: var(--gold); margin-top: .6rem; display: block; }

/* ---- Toke of Wisdom toy ---------------------------------------------- */
.toke {
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border-2); border-radius: var(--radius);
  padding: clamp(1.6rem, 4vw, 2.6rem); box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.toke::after { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 90% at 100% 0, var(--haze-a), transparent 60%); pointer-events: none; }
.toke-label { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin-bottom: 1rem; }
.toke-label .subj { color: var(--teal); }
.toke-fact { font-family: var(--font-display); font-size: clamp(1.35rem, 3vw, 1.9rem); line-height: 1.25; min-height: 3.4em; text-wrap: balance; margin: 0 0 1.4rem; transition: opacity .3s ease, transform .3s ease; }
.toke-fact.swap { opacity: 0; transform: translateY(8px); }
@media (prefers-reduced-motion: reduce) { .toke-fact { transition: none; } }
.toke-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }

/* ---- Article / prose -------------------------------------------------- */
.prose { max-width: 68ch; margin-inline: auto; }
.prose p, .prose li { color: var(--text); }
.prose h2 { margin-top: 2.2rem; }
.prose blockquote { margin: 1.6rem 0; padding-left: 1.2rem; border-left: 3px solid var(--gold); color: var(--muted); font-style: italic; }
.prose ul { padding-left: 1.2rem; }
.article-head { max-width: 68ch; margin: 0 auto 2rem; }
.article-meta { font-family: var(--font-mono); font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); display: flex; gap: 1rem; flex-wrap: wrap; }

/* ---- Callout ---------------------------------------------------------- */
.callout { display: grid; gap: 1.2rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(1.6rem, 4vw, 2.6rem); text-align: center; place-items: center; }
.callout p { margin-inline: auto; }

/* ---- Footer ----------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--border); margin-top: 2rem; padding-block: 2.5rem; color: var(--muted); }
.footer-grid { display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: space-between; align-items: flex-start; }
.footer-grid .brand { color: var(--text); margin-bottom: .5rem; }
.foot-cols { display: flex; gap: 3rem; flex-wrap: wrap; }
.foot-cols h4 { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin: 0 0 .7rem; }
.foot-cols a { display: block; color: var(--muted); text-decoration: none; font-size: .92rem; padding: .18rem 0; }
.foot-cols a:hover { color: var(--gold); }
.foot-legal { margin-top: 2rem; font-size: .82rem; color: var(--faint); border-top: 1px solid var(--border); padding-top: 1.4rem; }

/* pill list */
.pills { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; margin: 1rem 0 0; }
.pills li { font-family: var(--font-mono); font-size: .74rem; color: var(--muted); border: 1px solid var(--border-2); border-radius: 999px; padding: .32rem .7rem; }

/* ---- Notice / sample banner ------------------------------------------ */
.notice {
  display: flex; gap: .7rem; align-items: flex-start;
  background: color-mix(in srgb, var(--teal) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--teal) 34%, var(--border));
  border-radius: var(--radius-sm);
  padding: .85rem 1.05rem; font-size: .9rem; color: var(--muted);
  margin-bottom: 1.6rem;
}
.notice b { color: var(--text); }
.notice .ico { color: var(--teal); flex: none; font-weight: 700; }

/* utility */
.center { text-align: center; }
.muted { color: var(--muted); }
.stack { display: grid; gap: 1rem; }
.mt-2 { margin-top: 2rem; }
.divider { height: 1px; background: var(--border); border: 0; margin: 0; }
