/* Inwy Research — flat, warm, emoji-tinted. One stylesheet, light + dark. */
:root {
  color-scheme: light;
  --page: #faf9f5;
  --surface: #ffffff;
  --ink: #141413;
  --ink-2: #4d4c47;
  --muted: #84827a;
  --rule: #e8e6dc;
  --rule-strong: #d3d0c3;
  --tint-mix: 24%;
  --moon: #f6c744;
  /* one hue per idea, taken from its emoji */
  --h-sky: #4a9fe0; --h-peach: #f29559; --h-rose: #e8636a; --h-lilac: #9b84dc;
  --h-butter: #eec540; --h-coral: #f06f55; --h-indigo: #6679d6; --h-gold: #e0a928;
  --h-sage: #79b061; --h-mint: #3fb98f; --h-wool: #a29d8c; --h-green: #4cb84c; --h-stone: #7e92a6;
  /* chart palette (dataviz reference, validated) */
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100;
  --pos: #2a78d6; --neg: #e34948;
  --grid: #e8e6dc; --base: #c3c2b7;
  --good-ink: #1b6b1b; --good-bg: #dff1dc;
  --bad-ink: #a32424; --bad-bg: #f9e0dd;
  --warn-ink: #7a5300; --warn-bg: #faeec8;
  --display: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Consolas, monospace;
  --wide: 76rem;
  --text: 42rem;
  --r: 22px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #141413; --surface: #1d1d1b; --ink: #f4f3ee; --ink-2: #c6c4ba; --muted: #8f8d84;
    --rule: #2b2b28; --rule-strong: #3a3a36; --tint-mix: 20%;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
    --pos: #3987e5; --neg: #e66767; --grid: #2b2b28; --base: #3a3a36;
    --good-ink: #7fdc7f; --good-bg: #17301a; --bad-ink: #f29a9a; --bad-bg: #3a1d1d;
    --warn-ink: #f5c55a; --warn-bg: #352a10;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #141413; --surface: #1d1d1b; --ink: #f4f3ee; --ink-2: #c6c4ba; --muted: #8f8d84;
  --rule: #2b2b28; --rule-strong: #3a3a36; --tint-mix: 20%;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
  --pos: #3987e5; --neg: #e66767; --grid: #2b2b28; --base: #3a3a36;
  --good-ink: #7fdc7f; --good-bg: #17301a; --bad-ink: #f29a9a; --bad-bg: #3a1d1d;
  --warn-ink: #f5c55a; --warn-bg: #352a10;
}

* { box-sizing: border-box; }
html { font-size: clamp(16px, 0.35vw + 14px, 18px); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--page); color: var(--ink); font-family: var(--sans); line-height: 1.6; text-rendering: optimizeLegibility; }
a { color: inherit; text-decoration-color: var(--rule-strong); text-underline-offset: 3px; }
img { display: block; }
.emoji { width: 1em; height: 1em; display: inline-block; vertical-align: -0.12em; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }

/* tint helper: --h set per element, --tint derived */
[class*="c-"] { --tint: color-mix(in srgb, var(--h) var(--tint-mix), var(--page)); --deep: color-mix(in srgb, var(--h) 70%, var(--ink)); }
.c-sky { --h: var(--h-sky); } .c-peach { --h: var(--h-peach); } .c-rose { --h: var(--h-rose); } .c-lilac { --h: var(--h-lilac); }
.c-butter { --h: var(--h-butter); } .c-coral { --h: var(--h-coral); } .c-indigo { --h: var(--h-indigo); } .c-gold { --h: var(--h-gold); }
.c-sage { --h: var(--h-sage); } .c-mint { --h: var(--h-mint); } .c-wool { --h: var(--h-wool); } .c-green { --h: var(--h-green); } .c-stone { --h: var(--h-stone); }

/* ---------- top bar ---------- */
.topbar { max-width: var(--wide); margin: 0 auto; padding: 1.1rem 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; font-weight: 600; letter-spacing: -.01em; }
.brand .emoji { width: 1.9rem; height: 1.9rem; }
.brand em { font-family: var(--display); font-style: italic; font-weight: 400; font-size: 1.6rem; line-height: 1; color: var(--ink-2); margin-left: -.15rem; letter-spacing: -.01em; }
.topbar nav { display: flex; align-items: center; gap: .25rem; }
.topbar nav a { text-decoration: none; padding: .45rem .8rem; border-radius: 999px; color: var(--ink-2); font-size: .92rem; }
.topbar nav a:hover { background: var(--rule); color: var(--ink); }
.topbar nav a.icon-btn { padding: 0; }
.topbar nav a.pill { background: var(--ink); color: var(--page); }
.topbar nav a.pill:hover { opacity: .85; background: var(--ink); }

/* ---------- hero ---------- */
.hero { max-width: var(--wide); margin: 0 auto; padding: 3rem 1.25rem 2.5rem; }
.eyebrow { margin: 0 0 1rem; font-family: var(--mono); font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.eyebrow a { text-decoration: none; }
.hero h1 { font-family: var(--display); font-weight: 400; font-size: clamp(2.8rem, 6.5vw, 5.6rem); line-height: 1; letter-spacing: -.02em; margin: 0; max-width: none; }
.hero h1 .l { display: block; }
.hero h1 em { font-style: italic; }
.lede { font-size: clamp(1.1rem, 1.2vw + .8rem, 1.45rem); line-height: 1.45; color: var(--ink-2); max-width: 38rem; margin: 1.4rem 0 0; }
.hero-home { display: grid; grid-template-columns: 1fr; gap: 2rem; }

/* scoreboard: the whole research on one strip */
.board { max-width: var(--wide); margin: 0 auto; padding: 0 1.25rem; }
.board-grid { display: grid; grid-template-columns: repeat(13, 1fr); gap: .5rem; }
.tile { position: relative; aspect-ratio: 1; border-radius: 16px; background: var(--tint); display: grid; place-items: center; text-decoration: none; transition: transform .15s; }
.tile:hover { transform: translateY(-3px); }
.tile .emoji { width: 52%; height: 52%; }
.tile.no .emoji { opacity: .45; filter: grayscale(.6); }
.tile.ok { box-shadow: inset 0 0 0 2px var(--good-ink); }
.tile .mark { position: absolute; right: -.3rem; top: -.3rem; width: 1.15rem; height: 1.15rem; border-radius: 50%; display: grid; place-items: center; background: var(--page); }
.tile .mark svg { width: 100%; height: 100%; }
.tile .name { position: absolute; left: 50%; bottom: calc(100% + .4rem); transform: translateX(-50%); background: var(--ink); color: var(--page); font-size: .75rem; padding: .25rem .55rem; border-radius: 8px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 5; }
.tile:hover .name, .tile:focus-visible .name { opacity: 1; }
.board-key { display: flex; gap: 1.4rem; flex-wrap: wrap; margin: 1rem 0 0; font-size: .85rem; color: var(--muted); }
.board-key span { display: inline-flex; align-items: center; gap: .4rem; }
.board-key i { width: .9rem; height: .9rem; border-radius: 4px; background: var(--rule-strong); display: inline-block; }
.board-key i.ok { box-shadow: inset 0 0 0 2px var(--good-ink); background: var(--good-bg); }

/* ---------- sections ---------- */
.sec { max-width: var(--wide); margin: 0 auto; padding: 4.5rem 1.25rem 0; }
.sec-head { max-width: 44rem; margin-bottom: 2rem; }
.sec h2, .band h2 { font-family: var(--display); font-weight: 400; font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.05; letter-spacing: -.015em; margin: 0 0 .7rem; }
.sec-head p { margin: 0; color: var(--ink-2); font-size: 1.08rem; }
.band { margin-top: 4.5rem; padding: 4rem 0; background: var(--surface); border-block: 1px solid var(--rule); }
.band > .inner { max-width: var(--wide); margin: 0 auto; padding: 0 1.25rem; }

/* answers (survivors) */
.answers { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.answer { display: flex; flex-direction: column; gap: .9rem; padding: 2rem; border-radius: var(--r); background: var(--tint); text-decoration: none; position: relative; overflow: hidden; min-height: 26rem; transition: transform .15s; }
.answer:hover { transform: translateY(-3px); }
.answer .big { width: 7.5rem; height: 7.5rem; margin: 0 0 .5rem -.3rem; }
.answer h3 { font-family: var(--display); font-weight: 400; font-size: 2.4rem; line-height: 1; margin: 0; }
.answer p { margin: 0; color: var(--ink-2); max-width: 30rem; }
.answer .figs { display: flex; gap: 2.2rem; margin-top: auto; padding-top: 1rem; flex-wrap: wrap; }
.answer .figs b { display: block; font-family: var(--display); font-weight: 400; font-size: 3.2rem; line-height: 1; letter-spacing: -.02em; }
.answer .figs small { display: block; color: var(--ink-2); font-size: .85rem; margin-top: .2rem; max-width: 11rem; line-height: 1.3; }
.answer .more { font-weight: 600; font-size: .92rem; }

/* funnel */
.funnel { display: grid; gap: .6rem; }
.fn-row { display: grid; grid-template-columns: 1fr 24rem; gap: 1.5rem; align-items: center; }
.fn-bar { height: 4.4rem; border-radius: 14px; background: var(--tint); display: flex; align-items: center; padding: 0 1.3rem; gap: .9rem; width: var(--w); min-width: 11rem; }
.fn-bar b { font-family: var(--display); font-weight: 400; font-size: 2.6rem; line-height: 1; }
.fn-bar span { font-size: .9rem; color: var(--ink-2); line-height: 1.25; }
.fn-row p { margin: 0; color: var(--ink-2); font-size: .95rem; max-width: 26rem; }

/* flow (method / rules): emoji steps, full width */
.prose .flow, .flow { list-style: none; margin: 2rem 0; padding: 0; display: grid; grid-template-columns: repeat(var(--n, 5), 1fr); gap: .8rem; counter-reset: s; }
.flow li { position: relative; padding: 1.4rem 1.2rem 1.4rem; border-radius: 18px; background: var(--tint); display: flex; flex-direction: column; gap: .5rem; }
.flow li:not(:last-child)::after { content: ""; position: absolute; right: -.62rem; top: 50%; width: .8rem; height: .8rem; border-top: 2px solid var(--ink-2); border-right: 2px solid var(--ink-2); transform: translateY(-50%) rotate(45deg); z-index: 2; opacity: .5; }
.flow .emoji { width: 2.6rem; height: 2.6rem; margin-bottom: .3rem; }
.flow strong { font-size: 1.05rem; line-height: 1.25; }
.flow span.t { color: var(--ink-2); font-size: .92rem; line-height: 1.45; }
.flow.branch { grid-template-columns: 1fr 1fr 1fr; }

/* study cards */
.study-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.study { display: flex; flex-direction: column; gap: .5rem; padding: 1.5rem; border-radius: 20px; background: var(--tint); text-decoration: none; min-height: 15rem; transition: transform .15s; }
.study:hover { transform: translateY(-3px); }
.study .top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: .6rem; }
.study .emoji { width: 3.4rem; height: 3.4rem; }
.study .num { font-family: var(--mono); font-size: .78rem; color: var(--ink-2); opacity: .8; }
.study strong { font-size: 1.15rem; line-height: 1.25; letter-spacing: -.01em; }
.study .q { color: var(--ink-2); font-size: .95rem; line-height: 1.45; margin-bottom: auto; }
.study .v { align-self: flex-start; margin-top: .8rem; }

/* verdict chip */
.v { display: inline-flex; align-items: center; gap: .4rem; padding: .22rem .7rem .22rem .5rem; border-radius: 999px; font-size: .8rem; font-weight: 600; line-height: 1.4; }
.v svg { width: .9rem; height: .9rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.v.ok { background: var(--good-bg); color: var(--good-ink); }
.v.no { background: var(--bad-bg); color: var(--bad-ink); }
.v.mixed { background: var(--warn-bg); color: var(--warn-ink); }
.v.big { font-size: .95rem; padding: .35rem .95rem .35rem .7rem; margin-top: 1.4rem; }

/* lessons */
.lessons { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; list-style: none; margin: 0; padding: 0; }
.lessons li { padding: 1.4rem 0 0; border-top: 2px solid var(--ink); }
.lessons .emoji { width: 2.2rem; height: 2.2rem; margin-bottom: .8rem; }
.lessons strong { display: block; font-size: 1.05rem; line-height: 1.3; margin-bottom: .5rem; }
.lessons span.t { color: var(--ink-2); font-size: .92rem; line-height: 1.5; display: block; }

/* ---------- study hero ---------- */
.study-band { background: var(--tint); }
.study-band .hero { padding-bottom: 3rem; display: grid; grid-template-columns: 1fr auto; gap: 2rem; align-items: center; }
.study-band h1 { font-size: clamp(2.6rem, 5.5vw, 4.6rem); max-width: 18ch; }
.study-band .art { width: clamp(9rem, 20vw, 17rem); height: clamp(9rem, 20vw, 17rem); }
.qa { max-width: var(--wide); margin: 0 auto; padding: 2rem 1.25rem 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.qa > div { padding: 1.6rem 1.8rem; border-radius: var(--r); border: 1px solid var(--rule); background: var(--surface); }
.qa > div.ans { background: var(--tint); border-color: transparent; }
.qa small { display: block; font-family: var(--mono); font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: .5rem; }
.qa .ans small { color: var(--ink-2); }
.qa p { margin: 0; font-family: var(--display); font-size: clamp(1.5rem, 2.4vw, 2rem); line-height: 1.15; }
.how { max-width: var(--wide); margin: 1rem auto 0; padding: 0 1.25rem; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.how div { padding: 0 .3rem; font-size: .92rem; color: var(--ink-2); }
.how b { display: inline-block; font-family: var(--mono); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-right: .5rem; font-weight: 500; }
.details-head { max-width: var(--wide); margin: 4rem auto 0; padding: 0 1.25rem; display: flex; align-items: center; gap: 1rem; font-family: var(--mono); font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.details-head::after { content: ""; flex: 1; height: 1px; background: var(--rule); }

/* ---------- prose ---------- */
.prose { max-width: var(--wide); margin: 0 auto; padding: 2rem 1.25rem 0; }
.prose > * { max-width: var(--text); margin-inline: 0; }
.prose > .stats, .prose > figure, .prose > .flow, .prose > .table-wrap { max-width: none; }
.prose h2 { font-family: var(--display); font-weight: 400; font-size: clamp(1.8rem, 3vw, 2.5rem); line-height: 1.1; letter-spacing: -.01em; margin-top: 3.2rem; margin-bottom: .8rem; }
.prose h3 { font-size: 1.1rem; margin: 2rem 0 .4rem; }
.prose p, .prose li { font-size: 1.06rem; color: var(--ink-2); }
.prose strong { color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin: .45rem 0; }
.prose li::marker { color: var(--muted); }
.table-wrap { overflow-x: auto; margin-block: 1.6rem; border: 1px solid var(--rule); border-radius: 18px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .95rem; font-variant-numeric: tabular-nums; }
th, td { padding: .8rem 1.1rem; text-align: left; border-bottom: 1px solid var(--rule); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { font-family: var(--mono); font-weight: 500; font-size: .74rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); background: color-mix(in srgb, var(--rule) 40%, transparent); }
th[align="right"], td[align="right"] { text-align: right; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; margin-block: 2rem; }
.stat { padding: 1.6rem 1.7rem; border-radius: 20px; background: var(--tint, var(--surface)); border: 1px solid var(--rule); }
.stat strong { display: block; font-family: var(--display); font-weight: 400; font-size: clamp(2.6rem, 4.5vw, 3.8rem); line-height: 1; letter-spacing: -.02em; color: var(--ink); }
.stat span { display: block; margin-top: .5rem; color: var(--ink-2); font-size: .95rem; line-height: 1.4; }
.has-tint .stat { border-color: transparent; }

/* ---------- charts (full width) ---------- */
.chart { margin: 2.4rem 0; padding: 1.8rem 2rem 1.6rem; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); }
.chart figcaption { display: flex; flex-direction: column; gap: .2rem; margin-bottom: 1rem; }
.chart figcaption strong { font-family: var(--display); font-weight: 400; font-size: 1.7rem; line-height: 1.1; }
.chart figcaption span { color: var(--muted); font-size: .92rem; }
.legend { display: flex; flex-wrap: wrap; gap: 1.2rem; margin-bottom: 1.1rem; font-size: .88rem; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: .45rem; }
.sw { width: .8rem; height: .8rem; border-radius: 3px; display: inline-block; background: var(--s1); }
.sw.s2 { background: var(--s2); } .sw.s3 { background: var(--s3); } .sw.s4 { background: var(--s4); }
.bars .rows { display: grid; gap: .55rem; }
.bars .row { display: grid; grid-template-columns: minmax(8rem, 22%) 1fr 4.6rem; gap: 1rem; align-items: center; font-size: .95rem; }
.bars .lab { color: var(--ink-2); line-height: 1.25; }
.bars .val { text-align: right; font-family: var(--mono); font-size: .88rem; font-variant-numeric: tabular-nums; color: var(--ink); }
.bars .track { position: relative; height: 1.5rem; display: block; }
.bars .track.thin { height: .9rem; margin: .12rem 0; }
.bars .zero { position: absolute; top: -3px; bottom: -3px; width: 1px; background: var(--base); }
.bars .bar { position: absolute; top: 0; bottom: 0; background: var(--pos); border-radius: 5px; }
.bars .bar.neg { background: var(--neg); }
.bars .bar.s1 { background: var(--s1); } .bars .bar.s2 { background: var(--s2); } .bars .bar.s3 { background: var(--s3); } .bars .bar.s4 { background: var(--s4); }
.bars .stack { display: block; }
.plot { position: relative; }
.plot svg { width: 100%; height: auto; display: block; overflow: visible; touch-action: pan-y; }
.grid { stroke: var(--grid); stroke-width: 1; }
.base { stroke: var(--base); stroke-width: 1; }
.tick { fill: var(--muted); font-size: 11px; font-family: var(--mono); }
.ln { fill: none; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.ln.hero { stroke-width: 2.6; }
.ln.s1 { stroke: var(--s1); } .ln.s2 { stroke: var(--s2); } .ln.s3 { stroke: var(--s3); } .ln.s4 { stroke: var(--s4); }
.dot.s1 { fill: var(--s1); stroke: var(--surface); stroke-width: 2; }
.endlab { fill: var(--ink); font-size: 12px; font-weight: 600; }
.cross { stroke: var(--base); stroke-width: 1; opacity: 0; }
.tip { position: absolute; top: 0; background: var(--ink); color: var(--page); padding: .6rem .8rem; border-radius: 12px; font-size: .82rem; pointer-events: none; min-width: 11rem; }
.tip p { margin: 0 0 .35rem; opacity: .7; font-size: .76rem; }
.tip div { display: flex; align-items: center; gap: .45rem; line-height: 1.6; }
.tip b { margin-left: auto; padding-left: 1rem; font-family: var(--mono); }

/* ---------- pager + footer ---------- */
.pager { max-width: var(--wide); margin: 5rem auto 0; padding: 0 1.25rem; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.pager a { display: block; padding: 1.4rem 1.6rem; border-radius: 20px; background: var(--tint); text-decoration: none; font-weight: 600; font-size: 1.1rem; line-height: 1.3; }
.pager a.next { text-align: right; }
.pager small { display: block; font-family: var(--mono); font-weight: 400; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); margin-bottom: .4rem; }
.pager a:hover { filter: brightness(.97); }
.site-foot { margin-top: 6rem; border-top: 1px solid var(--rule); padding: 3rem 0 2rem; }
.site-foot .cols { max-width: var(--wide); margin: 0 auto; padding: 0 1.25rem; display: grid; grid-template-columns: 1.2fr 1fr 1.2fr; gap: 3rem; }
.site-foot h4 { margin: 0 0 .8rem; font-family: var(--mono); font-weight: 500; font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.site-foot p { color: var(--ink-2); font-size: .92rem; margin: .8rem 0 0; }
.site-foot .fine { color: var(--muted); font-size: .82rem; }
.study-links { list-style: none; margin: 0; padding: 0; columns: 1; font-size: .92rem; }
.study-links li { margin: .3rem 0; }
.study-links a { text-decoration: none; color: var(--ink-2); }
.study-links a:hover { color: var(--ink); text-decoration: underline; }
.legal { max-width: var(--wide); margin: 2.5rem auto 0; padding: 0 1.25rem; color: var(--muted); font-size: .82rem; }

/* ---------- responsive ---------- */
@media (max-width: 62rem) {
  .board-grid { grid-template-columns: repeat(7, 1fr); }
  .study-grid { grid-template-columns: repeat(2, 1fr); }
  .lessons { grid-template-columns: repeat(2, 1fr); }
  .flow { grid-template-columns: repeat(2, 1fr); }
  .fn-row { grid-template-columns: 1fr 16rem; }
  .flow li::after { display: none; }
  .site-foot .cols { grid-template-columns: 1fr; gap: 2rem; }
}
@media (max-width: 42rem) {
  .topbar nav a:not(.pill) { display: none; }
  .answers, .qa, .how, .pager, .study-grid, .lessons, .flow, .flow.branch { grid-template-columns: 1fr; }
  .board-grid { grid-template-columns: repeat(5, 1fr); }
  .study-band .hero { grid-template-columns: 1fr; }
  .study-band .art { width: 6rem; height: 6rem; order: -1; }
  .answer { min-height: 0; padding: 1.5rem; }
  .fn-row { grid-template-columns: 1fr; gap: .5rem; }
  .chart { padding: 1.2rem 1rem; }
  .bars .row { grid-template-columns: 1fr 4.2rem; grid-template-areas: "l v" "t t"; gap: .25rem .8rem; }
  .bars .lab { grid-area: l; } .bars .val { grid-area: v; } .bars .track, .bars .stack { grid-area: t; }
  .hero { padding-top: 1.5rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* ---------- line breaks: balanced headings, no orphans ---------- */
h1, h2, h3, h4, .lede, .qa p, .study strong, .answer h3, .answer p, .flow strong, .flow .t, .lessons strong, .lessons .t, .chart figcaption, .pager a, .sec-head p, .fn-row p, .stat span { text-wrap: balance; }
.prose p, .prose li, .study .q, .site-foot p { text-wrap: pretty; }

/* ---------- topbar extras ---------- */
.icon-btn { display: inline-grid; place-items: center; width: 2.2rem; height: 2.2rem; border: 0; border-radius: 999px; background: transparent; color: var(--ink-2); cursor: pointer; text-decoration: none; }
.icon-btn:hover { background: var(--rule); color: var(--ink); }
.icon-btn svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn .x { fill: currentColor; stroke: none; }
.icon-btn .sun { display: none; }
:root[data-theme="dark"] .icon-btn .sun { display: block; }
:root[data-theme="dark"] .icon-btn .moon { display: none; }
.foot-x { display: inline-flex; align-items: center; gap: .5rem; margin-top: 1rem; font-size: .92rem; text-decoration: none; color: var(--ink-2); }
.foot-x:hover { color: var(--ink); }
.foot-x svg { width: 1rem; height: 1rem; fill: currentColor; }
