/* The Hidden Wave — design system
   Warm editorial: sand canvas, espresso ink, clay + teal accents.
   Fraunces (display) / Hanken Grotesk (body) / Atkinson Hyperlegible (a11y toggle). */

:root {
  --ink: #211c18;
  --ink-soft: #4a4038;
  --muted: #6e6257;
  --canvas: #f6efe4;
  --canvas-2: #efe4d3;
  --panel: #fffaf1;
  --line: #ddccb4;
  --clay: #c25b3f;
  --clay-deep: #a6472e;
  --teal: #2c6e68;
  --teal-deep: #1f524d;
  --white: #fffdf8;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Hanken Grotesk", system-ui, sans-serif;
  --font-legible: "Atkinson Hyperlegible", var(--font-body);

  --step: 1;               /* text-size multiplier, set by a11y control */
  --measure: 66ch;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(33,28,24,.06), 0 12px 34px -18px rgba(33,28,24,.34);
  --shadow-lift: 0 2px 4px rgba(33,28,24,.08), 0 22px 50px -22px rgba(33,28,24,.42);
  --ease: cubic-bezier(.2,.7,.2,1);
}

/* legibility toggle */
body.legible { --font-body: var(--font-legible); --font-display: var(--font-legible); }
body.legible p, body.legible li { letter-spacing: .01em; }

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: calc(1.06rem * var(--step));
  line-height: 1.65;
  font-weight: 420;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
/* paper grain */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: .5; mix-blend-mode: multiply;
  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='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.28'/%3E%3C/svg%3E");
}
main, header, footer { position: relative; z-index: 1; }

img { max-width: 100%; display: block; }
a { color: var(--clay-deep); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
a:hover { color: var(--clay); }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 560; line-height: 1.06; letter-spacing: -.015em; color: var(--ink); margin: 0 0 .5em; font-optical-sizing: auto; }
h1 { font-size: calc(clamp(2.5rem, 6vw, 4.6rem) * var(--step)); font-weight: 600; }
h2 { font-size: calc(clamp(1.8rem, 3.6vw, 2.9rem) * var(--step)); }
h3 { font-size: calc(1.42rem * var(--step)); }
p { margin: 0 0 1.1em; max-width: var(--measure); }

.wrap { width: min(1140px, 92vw); margin-inline: auto; }
.narrow { width: min(720px, 92vw); margin-inline: auto; }
.eyebrow { font-family: var(--font-body); font-weight: 700; text-transform: uppercase; letter-spacing: .18em; font-size: .72rem; color: var(--clay-deep); display: inline-block; }
.serif-italic { font-family: var(--font-display); font-style: italic; font-weight: 460; }

/* skip link */
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--white); padding: .6rem 1rem; border-radius: 0 0 8px 0; z-index: 200; }
.skip:focus { left: 0; }

/* ---------- header ---------- */
.site-head { position: sticky; top: 0; z-index: 100; background: color-mix(in srgb, var(--canvas) 86%, transparent); backdrop-filter: blur(10px) saturate(1.2); border-bottom: 1px solid var(--line); }
.site-head__row { display: flex; align-items: center; gap: 1.5rem; padding: .85rem 0; }
.brand { display: inline-flex; align-items: baseline; gap: .5ch; font-family: var(--font-display); font-weight: 600; font-size: 1.32rem; letter-spacing: -.02em; color: var(--ink); text-decoration: none; }
.brand .the { font-style: italic; font-weight: 460; font-size: .82em; color: var(--muted); }
.brand__wave { color: var(--teal); }
.nav { margin-left: auto; display: flex; align-items: center; gap: 1.4rem; }
.nav a { font-family: var(--font-body); font-weight: 560; font-size: .96rem; color: var(--ink-soft); text-decoration: none; padding: .2rem 0; position: relative; }
.nav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: -2px; height: 2px; background: var(--clay); transition: right .28s var(--ease); }
.nav a:hover::after, .nav a[aria-current="page"]::after { right: 0; }
.nav a[aria-current="page"] { color: var(--ink); }

.btn { --bg: var(--clay); --fg: var(--white); display: inline-flex; align-items: center; gap: .5ch; font-family: var(--font-body); font-weight: 640; font-size: 1rem; line-height: 1; padding: .82em 1.35em; border-radius: 100px; background: var(--bg); color: var(--fg); border: 1.5px solid var(--bg); text-decoration: none; cursor: pointer; transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s; box-shadow: var(--shadow); }
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); color: var(--fg); background: var(--clay-deep); border-color: var(--clay-deep); }
.btn--ghost { --bg: transparent; --fg: var(--ink); border-color: var(--ink); box-shadow: none; }
.btn--ghost:hover { background: var(--ink); --fg: var(--white); border-color: var(--ink); }
.btn--teal { --bg: var(--teal); border-color: var(--teal); }
.btn--teal:hover { background: var(--teal-deep); border-color: var(--teal-deep); }
.btn--sm { font-size: .9rem; padding: .6em 1.1em; }

/* a11y control cluster */
.a11y { display: flex; align-items: center; gap: .35rem; }
.a11y button { font-family: var(--font-body); font-weight: 640; font-size: .82rem; border: 1.5px solid var(--line); background: var(--panel); color: var(--ink-soft); border-radius: 8px; padding: .34rem .5rem; cursor: pointer; line-height: 1; transition: .18s; }
.a11y button:hover { border-color: var(--ink); color: var(--ink); }
.a11y button[aria-pressed="true"] { background: var(--teal); color: var(--white); border-color: var(--teal); }
.a11y__aa small { font-size: .7em; }

.nav-toggle { display: none; margin-left: auto; background: none; border: 1.5px solid var(--ink); border-radius: 8px; padding: .45rem .6rem; cursor: pointer; }
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after { display: block; width: 20px; height: 2px; background: var(--ink); position: relative; transition: .2s; }
.nav-toggle span::before, .nav-toggle span::after { content: ""; position: absolute; left: 0; }
.nav-toggle span::before { top: -6px; } .nav-toggle span::after { top: 6px; }

/* focus mode dims chrome */
body.focus .site-head, body.focus .site-foot { opacity: .35; transition: opacity .3s; }
body.focus .site-head:hover, body.focus .site-foot:hover { opacity: 1; }
body.focus .aside, body.focus .site-foot__cols { display: none; }

:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; border-radius: 4px; }

/* ---------- hero ---------- */
.hero { padding: clamp(3rem, 8vw, 6.5rem) 0 clamp(2.5rem,5vw,4rem); }
.hero__grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(2rem,5vw,4rem); align-items: center; }
.hero h1 .u-wave { position: relative; white-space: nowrap; color: var(--teal-deep); }
.hero h1 .u-wave::after { content: ""; position: absolute; left: 0; right: 0; bottom: -.12em; height: .32em; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='18' viewBox='0 0 120 18'%3E%3Cpath d='M0 12 Q 15 2 30 9 T 60 9 T 90 9 T 120 9' fill='none' stroke='%23c25b3f' stroke-width='3.4' stroke-linecap='round'/%3E%3C/svg%3E") repeat-x left center / auto 100%; animation: draw 1.1s var(--ease) both .35s; }
@keyframes draw { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.hero__lead { font-size: calc(1.24rem * var(--step)); color: var(--ink-soft); max-width: 34ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.6rem; align-items: center; }
.hero__note { font-size: .9rem; color: var(--muted); margin: 1.1rem 0 0; }

/* floaty reveal */
.reveal { opacity: 0; transform: translateY(14px); animation: rise .8s var(--ease) forwards; }
.reveal.d1 { animation-delay: .05s; } .reveal.d2 { animation-delay: .18s; } .reveal.d3 { animation-delay: .32s; } .reveal.d4 { animation-delay: .46s; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* hero art: concentric wave portrait */
.hero__art { aspect-ratio: 4/5; border-radius: 200px 200px 18px 18px; background:
    radial-gradient(120% 90% at 50% 8%, #f4d9b0 0%, #e9b98a 34%, #cf8a63 62%, #9c5a45 100%);
  position: relative; overflow: hidden; box-shadow: var(--shadow-lift); border: 1px solid rgba(33,28,24,.1); }
.hero__art svg { position: absolute; inset: 0; width: 100%; height: 100%; }

/* section rhythm */
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section--panel { background: var(--canvas-2); border-block: 1px solid var(--line); }
.section__head { max-width: 40ch; margin-bottom: 2.4rem; }
.wave-div { display: block; width: 100%; height: 34px; color: var(--canvas-2); }

/* cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap: 1.2rem; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem 1.4rem; box-shadow: var(--shadow); transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
a.card { text-decoration: none; color: inherit; display: block; }
a.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.card__num { font-family: var(--font-display); font-style: italic; color: var(--clay); font-size: 1.5rem; }
.card h3 { margin-top: .4rem; }
.card p { font-size: .98rem; color: var(--ink-soft); margin-bottom: 0; }
.card__more { display: inline-block; margin-top: .9rem; font-weight: 640; color: var(--teal-deep); font-size: .94rem; }

/* steps */
.steps { counter-reset: s; display: grid; gap: 1.1rem; }
.step { display: grid; grid-template-columns: auto 1fr; gap: 1.1rem; padding: 1.2rem 1.3rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.step::before { counter-increment: s; content: counter(s); font-family: var(--font-display); font-weight: 600; font-size: 1.5rem; color: var(--white); background: var(--teal); width: 2.4rem; height: 2.4rem; display: grid; place-items: center; border-radius: 50%; }
.step h3 { margin: .1rem 0 .3rem; font-size: 1.16rem; }
.step p { margin: 0; font-size: .98rem; color: var(--ink-soft); }

/* badges: Myth vs Evidence */
.badge { display: inline-flex; align-items: center; gap: .45ch; font-family: var(--font-body); font-weight: 700; font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; padding: .28em .6em; border-radius: 100px; vertical-align: middle; }
.badge--myth { background: #f6ded4; color: var(--clay-deep); border: 1px solid #eab69f; }
.badge--evidence { background: #d6e8e5; color: var(--teal-deep); border: 1px solid #a7cec8; }
.badge--contested { background: #f4ead1; color: #8a6d24; border: 1px solid #ddc487; }

/* claim block (myth vs evidence) */
.claim { background: var(--panel); border: 1px solid var(--line); border-left: 5px solid var(--clay); border-radius: 12px; padding: 1.2rem 1.3rem; margin: 1.4rem 0; }
.claim--contested { border-left-color: #c99a2e; }
.claim__q { font-family: var(--font-display); font-size: 1.2rem; font-weight: 560; margin: .4rem 0 .6rem; }
.claim p:last-child { margin-bottom: 0; }
.claim cite { color: var(--muted); font-style: normal; font-size: .86rem; }

/* callouts */
.note { background: color-mix(in srgb, var(--teal) 8%, var(--panel)); border: 1px solid #bcd8d3; border-radius: 12px; padding: 1rem 1.2rem; font-size: .96rem; }
.note strong { color: var(--teal-deep); }
.disclaimer { font-size: .86rem; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 1rem; margin-top: 2rem; }

/* article */
.article { padding: clamp(2rem,5vw,3.5rem) 0 4rem; }
.article__meta { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; color: var(--muted); font-size: .9rem; margin-bottom: 1.4rem; }
.readtime { display: inline-flex; align-items: center; gap: .4ch; }
.prose h2 { margin-top: 2.2rem; }
.prose h3 { margin-top: 1.6rem; }
.prose ul, .prose ol { max-width: var(--measure); padding-left: 1.2rem; }
.prose li { margin-bottom: .5rem; }
.prose blockquote { margin: 1.4rem 0; padding: .4rem 0 .4rem 1.3rem; border-left: 4px solid var(--teal); font-family: var(--font-display); font-style: italic; font-size: 1.25rem; color: var(--ink-soft); }

/* details / progressive disclosure */
details.dd { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); margin: .8rem 0; overflow: hidden; }
details.dd > summary { cursor: pointer; padding: 1rem 1.2rem; font-family: var(--font-display); font-weight: 560; font-size: 1.1rem; list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.dd > summary::-webkit-details-marker { display: none; }
details.dd > summary::after { content: "+"; font-size: 1.4rem; color: var(--clay); transition: transform .2s; }
details.dd[open] > summary::after { transform: rotate(45deg); }
details.dd > div { padding: 0 1.2rem 1.1rem; }
details.dd > div > *:first-child { margin-top: 0; }

/* ---------- quiz ---------- */
.quiz { min-height: 72vh; display: grid; place-items: center; padding: 2.5rem 0 4rem; }
.quiz__card { width: min(640px, 92vw); background: var(--panel); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-lift); padding: clamp(1.6rem, 4vw, 2.6rem); }
.quiz__prog { display: flex; align-items: center; gap: .8rem; margin-bottom: 1.6rem; }
.quiz__bar { flex: 1; height: 8px; background: var(--canvas-2); border-radius: 100px; overflow: hidden; }
.quiz__bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--teal), var(--clay)); border-radius: 100px; transition: width .5s var(--ease); }
.quiz__count { font-weight: 640; font-size: .82rem; color: var(--teal-deep); white-space: nowrap; }
.quiz__q { font-family: var(--font-display); font-size: calc(1.7rem * var(--step)); font-weight: 560; margin: .2rem 0 1.3rem; }
.quiz__opts { display: grid; gap: .7rem; }
.opt { text-align: left; font-family: var(--font-body); font-size: 1.02rem; font-weight: 480; color: var(--ink); background: var(--white); border: 1.5px solid var(--line); border-radius: 13px; padding: 1rem 1.1rem; cursor: pointer; transition: .18s var(--ease); display: flex; gap: .8rem; align-items: center; }
.opt:hover { border-color: var(--teal); transform: translateX(3px); box-shadow: var(--shadow); }
.opt__k { font-family: var(--font-display); font-weight: 600; color: var(--clay); }
.quiz__nav { display: flex; justify-content: space-between; margin-top: 1.4rem; }
.link-btn { background: none; border: none; color: var(--muted); font-family: var(--font-body); font-weight: 560; cursor: pointer; font-size: .95rem; }
.link-btn:hover { color: var(--ink); }
.quiz__anim { animation: swap .4s var(--ease); }
@keyframes swap { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }

/* result */
.result__type { font-family: var(--font-display); font-size: calc(2.6rem * var(--step)); color: var(--teal-deep); font-weight: 600; margin: .2rem 0; }
.result__profile { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 1.4rem; }
.chip { background: var(--canvas-2); border: 1px solid var(--line); border-radius: 100px; padding: .35em .8em; font-size: .84rem; font-weight: 560; }
.chip strong { color: var(--teal-deep); }

/* email capture */
.capture { background: var(--ink); color: var(--canvas); border-radius: 18px; padding: 1.6rem; margin-top: 1.6rem; }
.capture h3 { color: var(--white); }
.capture p { color: #d9cdbd; font-size: .96rem; }
.field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .9rem; }
.field label { font-weight: 640; font-size: .9rem; }
.field input[type=email] { font-family: var(--font-body); font-size: 1rem; padding: .8rem .9rem; border-radius: 10px; border: 1.5px solid #4a4038; background: #2c2620; color: var(--white); }
.field input[type=email]::placeholder { color: #9b8f81; }
.consent { display: flex; gap: .6rem; align-items: flex-start; font-size: .86rem; color: #cabcac; }
.consent a { color: #eab89f; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-msg { font-size: .92rem; margin-top: .6rem; min-height: 1.2em; }
.form-msg.ok { color: #8fd3b6; } .form-msg.err { color: #f0a48c; }

/* ---------- footer ---------- */
.site-foot { background: var(--ink); color: #cdbfae; margin-top: 4rem; padding: 3rem 0 2rem; }
.site-foot a { color: #e7d8c4; text-decoration: none; }
.site-foot a:hover { color: var(--white); text-decoration: underline; }
.site-foot__cols { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 2rem; }
.site-foot .brand { color: var(--white); }
.site-foot h4 { font-family: var(--font-body); font-weight: 700; text-transform: uppercase; letter-spacing: .12em; font-size: .74rem; color: #9c8f80; margin: 0 0 .8rem; }
.site-foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; font-size: .94rem; }
.site-foot__base { margin-top: 2.4rem; padding-top: 1.4rem; border-top: 1px solid #3a332c; font-size: .82rem; color: #8a7d6e; display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; }

/* affiliate disclosure inline component */
.aff-disclose { font-size: .8rem; color: var(--muted); background: var(--canvas-2); border: 1px dashed var(--line); border-radius: 8px; padding: .5rem .7rem; margin: .8rem 0; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__art { max-width: 320px; margin: 0 auto; }
  .site-foot__cols { grid-template-columns: 1fr 1fr; }
  .nav, .a11y { display: none; }
  .nav-toggle { display: block; }
  .site-head__row.open .nav { display: flex; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: flex-start; gap: 1rem; background: var(--canvas); padding: 1.2rem 4vw 1.6rem; border-bottom: 1px solid var(--line); }
  .site-head__row.open .a11y { display: flex; position: absolute; top: 100%; right: 4vw; margin-top: 12.5rem; }
}
@media (max-width: 520px) {
  .site-foot__cols { grid-template-columns: 1fr; }
  .hero__cta { flex-direction: column; align-items: stretch; }
  .hero__cta .btn { justify-content: center; }
}
