/* The Rabbit Hole — static sub-site styles. Tokens mirror onyxailabs.com globals.css (Design System v5). */
:root {
  --onyx-deep: 225 14% 9%; --onyx-surface: 224 16% 12%; --onyx-raised: 225 16% 15%; --onyx-border: 226 14% 20%;
  --onyx-glow: 239 84% 67%; --onyx-glow-dim: 255 40% 52%; --onyx-text: 220 30% 92%; --onyx-muted: 222 14% 70%; --onyx-faint: 223 10% 58%;
  --background: #14161c; --foreground: #dfe4ee;
  --hap-raise: 16px 16px 34px rgba(13,15,19,.9), -16px -16px 34px rgba(32,36,46,.55);
  --hap-raise-sm: 8px 8px 18px rgba(14,16,21,.9), -8px -8px 18px rgba(34,38,49,.55);
  --hap-inset: inset 5px 5px 11px rgba(14,16,21,.85), inset -5px -5px 11px rgba(34,38,49,.5);
  --hap-radius: 26px;
  /* Rabbit Hole semantic accents (model / code / human / ok) */
  --rh-model: 38 85% 62%; --rh-code: var(--onyx-glow); --rh-human: 14 78% 62%; --rh-ok: 158 45% 52%;
  --font-body: 'Space Grotesk', system-ui, sans-serif; --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}
.light {
  --onyx-deep: 220 20% 91%; --onyx-surface: 220 26% 93%; --onyx-raised: 220 26% 95%; --onyx-border: 220 14% 84%;
  --onyx-glow: 158 45% 52%; --onyx-glow-dim: 158 36% 44%; --onyx-text: 222 18% 24%; --onyx-muted: 222 10% 42%; --onyx-faint: 221 8% 48%;
  --background: #e7ebf2; --foreground: #333a48;
  --hap-raise: 16px 16px 34px #c7cdd9, -16px -16px 34px #ffffff;
  --hap-raise-sm: 8px 8px 18px #cbd1dc, -8px -8px 18px #ffffff;
  --hap-inset: inset 5px 5px 11px #cbd1dc, inset -5px -5px 11px #ffffff;
  --rh-model: 32 80% 42%; --rh-human: 10 70% 48%; --rh-ok: 158 45% 36%;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; transition: background-color .5s ease, color .5s ease; }
body { margin: 0; background: var(--background); color: var(--foreground); font-family: var(--font-body); -webkit-font-smoothing: antialiased; line-height: 1.6; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
::selection { background: hsl(var(--onyx-glow) / .25); }
.noise { position: fixed; inset: 0; z-index: 9999; pointer-events: none; opacity: .025; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* colour helpers */
.t-text { color: hsl(var(--onyx-text)); } .t-muted { color: hsl(var(--onyx-muted)); } .t-faint { color: hsl(var(--onyx-faint)); } .t-glow { color: hsl(var(--onyx-glow)); }
.t-model { color: hsl(var(--rh-model)); } .t-code { color: hsl(var(--rh-code)); } .t-human { color: hsl(var(--rh-human)); } .t-ok { color: hsl(var(--rh-ok)); }
.mono { font-family: var(--font-mono); }
.kicker { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: hsl(var(--onyx-glow)); }

/* ── nav ── */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 50; height: 64px; backdrop-filter: blur(20px); background: hsl(var(--onyx-deep) / .8); border-bottom: 1px solid hsl(var(--onyx-border) / .5); }
.nav-in { max-width: 80rem; margin: 0 auto; padding: 0 1.5rem; height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.nav-logo img { height: 40px; width: auto; display: block; }
.nav-links { display: none; gap: 1.6rem; align-items: center; font-size: .9rem; color: hsl(var(--onyx-muted)); }
.nav-links a:hover, .nav-links a.active { color: hsl(var(--onyx-text)); }
.nav-right { display: flex; align-items: center; gap: .6rem; }
.icon-btn { width: 38px; height: 38px; border-radius: 12px; border: 0; background: hsl(var(--onyx-surface)); color: hsl(var(--onyx-muted)); box-shadow: var(--hap-inset); cursor: pointer; display: grid; place-items: center; }
.icon-btn svg { width: 18px; height: 18px; }
@media (min-width: 1024px) { .nav-links { display: flex; } .nav-menu { display: none; } }
.mobile-menu { display: none; position: fixed; top: 64px; left: 0; right: 0; z-index: 49; background: hsl(var(--onyx-deep) / .97); border-bottom: 1px solid hsl(var(--onyx-border) / .5); padding: 1rem 1.5rem 1.5rem; }
.mobile-menu.open { display: block; }
.mobile-menu a { display: block; padding: .6rem 0; color: hsl(var(--onyx-muted)); font-size: 1rem; border-bottom: 1px solid hsl(var(--onyx-border) / .3); }

/* ── layout ── */
.wrap { max-width: 72rem; margin: 0 auto; padding: 0 1.5rem; }
.wrap-narrow { max-width: 48rem; margin: 0 auto; padding: 0 1.5rem; }
main { padding-top: 64px; }
.hero { position: relative; padding: 7rem 0 4rem; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -2; background: radial-gradient(ellipse at top, hsl(var(--onyx-glow) / .08), transparent 55%); }
.hero h1 { max-width: 44rem; font-size: clamp(2.4rem, 6vw, 4rem); line-height: 1.05; letter-spacing: -.02em; font-weight: 600; margin: .8rem 0 1.2rem; color: hsl(var(--onyx-text)); }
.hero .lede { font-size: 1.25rem; color: hsl(var(--onyx-muted)); max-width: 44rem; }
.hero .meta { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; margin-top: 1.5rem; font-family: var(--font-mono); font-size: .75rem; color: hsl(var(--onyx-faint)); }

/* ── cards / surfaces (haptic) ── */
.panel { border-radius: var(--hap-radius); background: hsl(var(--onyx-surface) / .6); border: 1px solid hsl(var(--onyx-border) / .35); box-shadow: var(--hap-raise-sm); padding: 1.5rem; transition: transform .35s ease, box-shadow .35s ease; }
.light .panel { border-color: rgba(255,255,255,.55); }
@media (min-width: 768px) { .panel { box-shadow: var(--hap-raise); } }
.panel.sm { border-radius: 18px; padding: 1.1rem 1.2rem; box-shadow: var(--hap-raise-sm); }
.panel.accent-model { border-color: hsl(var(--rh-model) / .5); } .panel.accent-code { border-color: hsl(var(--rh-code) / .5); } .panel.accent-human { border-color: hsl(var(--rh-human) / .5); } .panel.accent-ok { border-color: hsl(var(--rh-ok) / .5); }
.panel h4 { margin: 0 0 .4rem; font-size: 1rem; font-weight: 600; color: hsl(var(--onyx-text)); }
.panel p { margin: 0; font-size: .92rem; color: hsl(var(--onyx-muted)); }
.pill { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .7rem; border-radius: 999px; font-family: var(--font-mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: hsl(var(--onyx-muted)); background: hsl(var(--onyx-surface)); box-shadow: var(--hap-inset); }
.btn { display: inline-flex; align-items: center; gap: .5rem; padding: .85rem 1.4rem; border-radius: 18px; font-weight: 600; font-size: .95rem; cursor: pointer; border: 0; transition: transform .25s ease, box-shadow .25s ease; }
.btn.primary { background: hsl(var(--onyx-glow)); color: #fff; box-shadow: var(--hap-raise-sm), 0 0 24px hsl(var(--onyx-glow) / .18); }
.light .btn.primary { color: #10231b; }
.btn.secondary { background: hsl(var(--onyx-surface)); color: hsl(var(--onyx-text)); box-shadow: var(--hap-inset); }
.btn:hover { transform: translateY(-2px); }

/* ── chapter sections ── */
.section { padding: 4.5rem 0 1rem; scroll-margin-top: 80px; }
.section + .section { border-top: 1px solid hsl(var(--onyx-border) / .25); }
.section .kicker { margin-bottom: .6rem; }
.section h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); line-height: 1.15; letter-spacing: -.015em; font-weight: 600; color: hsl(var(--onyx-text)); margin: 0 0 1.6rem; max-width: 52rem; }
.visual { margin: 0 0 1.5rem; }
.takeaway { font-size: 1.05rem; font-style: italic; color: hsl(var(--onyx-glow)); margin: 1.3rem 0 .5rem; max-width: 52rem; }
.light .takeaway { color: hsl(var(--onyx-glow-dim)); }
.prose { max-width: 46rem; font-size: 1.05rem; color: hsl(var(--onyx-muted)); margin-top: 1.4rem; }
.prose p { margin: 0 0 1rem; }
.sources { max-width: 46rem; margin: .6rem 0 2rem; font-size: .8rem; }
.sources summary { cursor: pointer; font-family: var(--font-mono); letter-spacing: .1em; text-transform: uppercase; font-size: .68rem; color: hsl(var(--onyx-faint)); }
.sources ol { margin: .5rem 0 0; padding-left: 1.2rem; color: hsl(var(--onyx-faint)); word-break: break-all; }
.sources a { color: hsl(var(--onyx-muted)); text-decoration: underline; text-decoration-color: hsl(var(--onyx-border)); }
.divider { padding: 5rem 0 2rem; }
.divider .num { font-family: var(--font-mono); color: hsl(var(--onyx-glow)); letter-spacing: .2em; font-size: .8rem; }
.divider h2 { font-size: clamp(2rem, 4.5vw, 3rem); margin: .5rem 0 1rem; font-weight: 600; letter-spacing: -.02em; color: hsl(var(--onyx-text)); }
.divider p { font-size: 1.15rem; color: hsl(var(--onyx-muted)); max-width: 40rem; margin: 0 0 1rem; }
.discussion { padding: 3rem 0 2rem; }
.discussion ol { list-style: none; margin: 0; padding: 0; counter-reset: q; display: grid; gap: .8rem; }
.discussion li { counter-increment: q; display: grid; grid-template-columns: 3rem 1fr; gap: .8rem; align-items: start; font-size: 1.05rem; color: hsl(var(--onyx-text)); }
.discussion li::before { content: counter(q, decimal-leading-zero); font-family: var(--font-mono); color: hsl(var(--onyx-glow)); font-size: 1.1rem; padding-top: .1rem; }
.closer { padding: 5rem 0 6rem; text-align: left; }
.closer .big { font-size: clamp(2rem, 5vw, 3.4rem); font-style: italic; font-weight: 500; letter-spacing: -.02em; line-height: 1.1; color: hsl(var(--onyx-text)); margin: .5rem 0 1.2rem; white-space: pre-line; }
.closer .punch { font-size: 1.3rem; font-style: italic; color: hsl(var(--onyx-glow)); }

/* grids */
.grid { display: grid; gap: 1rem; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0,1fr)); } .grid.c3 { grid-template-columns: repeat(3, minmax(0,1fr)); } .grid.c4 { grid-template-columns: repeat(4, minmax(0,1fr)); } .grid.c5 { grid-template-columns: repeat(5, minmax(0,1fr)); } .grid.c6 { grid-template-columns: repeat(6, minmax(0,1fr)); }
@media (max-width: 900px) { .grid.c3, .grid.c4, .grid.c5, .grid.c6 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 560px) { .grid.c2, .grid.c3, .grid.c4, .grid.c5, .grid.c6 { grid-template-columns: 1fr; } }

/* stats */
.stat .big { font-family: var(--font-mono); font-size: clamp(2rem, 4vw, 3rem); font-weight: 600; color: hsl(var(--onyx-text)); line-height: 1; margin-bottom: .6rem; }
.stat.accent .big { color: hsl(var(--onyx-glow)); }
.stat .src { margin-top: .8rem; font-family: var(--font-mono); font-size: .68rem; color: hsl(var(--onyx-faint)); }

/* columns (lists) */
.col ul { margin: .4rem 0 0; padding-left: 1.1rem; color: hsl(var(--onyx-muted)); font-size: .92rem; } .col li { margin: .25rem 0; }

/* flow */
.flow { display: grid; gap: .6rem; grid-auto-flow: column; grid-auto-columns: minmax(0,1fr); align-items: stretch; }
@media (max-width: 760px) { .flow { grid-auto-flow: row; } }
.flow .step { position: relative; border-radius: 16px; padding: .9rem 1rem; background: hsl(var(--onyx-surface) / .6); border: 1px solid hsl(var(--onyx-border) / .4); box-shadow: var(--hap-raise-sm); }
.flow .step .tag { font-family: var(--font-mono); font-size: .62rem; letter-spacing: .14em; text-transform: uppercase; margin-bottom: .3rem; }
.flow .step h5 { margin: 0 0 .3rem; font-size: .95rem; color: hsl(var(--onyx-text)); } .flow .step p { margin: 0; font-size: .82rem; color: hsl(var(--onyx-muted)); }
.flow .step.model { border-color: hsl(var(--rh-model) / .55); } .flow .step.code { border-color: hsl(var(--rh-code) / .55); } .flow .step.human { border-color: hsl(var(--rh-human) / .55); }
.flow .step:not(:last-child)::after { content: "→"; position: absolute; right: -.75rem; top: 50%; transform: translateY(-50%); color: hsl(var(--onyx-faint)); font-size: .9rem; }
@media (max-width: 760px) { .flow .step:not(:last-child)::after { content: "↓"; right: auto; left: 50%; top: auto; bottom: -1rem; transform: translateX(-50%); } }
.legend { display: flex; gap: 1.2rem; flex-wrap: wrap; margin-top: .9rem; font-size: .8rem; color: hsl(var(--onyx-muted)); }
.legend span::before { content: ""; display: inline-block; width: .7rem; height: .7rem; border-radius: 3px; margin-right: .4rem; vertical-align: -1px; background: var(--sw); }

/* tables */
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; } .tbl-wrap { overflow-x: auto; border-radius: 18px; border: 1px solid hsl(var(--onyx-border) / .4); }
.tbl th { text-align: left; font-family: var(--font-mono); font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: hsl(var(--onyx-faint)); padding: .8rem .9rem; background: hsl(var(--onyx-surface) / .5); border-bottom: 1px solid hsl(var(--onyx-border) / .4); }
.tbl td { padding: .7rem .9rem; border-bottom: 1px solid hsl(var(--onyx-border) / .25); color: hsl(var(--onyx-muted)); vertical-align: top; }
.tbl td:first-child { color: hsl(var(--onyx-text)); font-weight: 600; white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.wrong { display: grid; gap: .5rem; margin-top: 1rem; }
.wrong .row { display: grid; grid-template-columns: 1fr auto 1.2fr; gap: .8rem; align-items: center; padding: .7rem 0; border-top: 1px solid hsl(var(--onyx-border) / .3); font-size: .92rem; }
.wrong .row .l { color: hsl(var(--onyx-text)); } .wrong .row .r { color: hsl(var(--onyx-muted)); } .wrong .row .a { color: hsl(var(--rh-human)); }
@media (max-width: 560px) { .wrong .row { grid-template-columns: 1fr; } .wrong .row .a { display: none; } }
.wrong-h { font-family: var(--font-mono); font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: hsl(var(--onyx-faint)); margin-top: 1.4rem; }

/* numbered */
.numbered { display: grid; grid-template-columns: 1fr; gap: .6rem; } .numbered.with-panel { grid-template-columns: 1.6fr 1fr; }
@media (max-width: 760px) { .numbered.with-panel { grid-template-columns: 1fr; } }
.numbered .items { display: grid; gap: .6rem; }
.numbered .item { display: grid; grid-template-columns: 2.2rem 1fr; gap: .6rem; padding: .8rem 1rem; border-radius: 14px; background: hsl(var(--onyx-surface) / .5); border: 1px solid hsl(var(--onyx-border) / .35); }
.numbered .item .n { font-family: var(--font-mono); color: hsl(var(--onyx-glow)); font-size: 1.1rem; }
.numbered .item h5 { margin: 0 0 .2rem; font-size: .95rem; color: hsl(var(--onyx-text)); } .numbered .item p { margin: 0; font-size: .85rem; color: hsl(var(--onyx-muted)); }

/* timeline / ladder */
.timeline { display: grid; gap: .6rem; grid-auto-flow: column; grid-auto-columns: minmax(0,1fr); }
@media (max-width: 760px) { .timeline { grid-auto-flow: row; } }
.timeline .st { padding: 1rem; border-radius: 16px; background: hsl(var(--onyx-surface) / .6); border: 1px solid hsl(var(--onyx-border) / .4); box-shadow: var(--hap-raise-sm); }
.timeline .st.last { border-color: hsl(var(--onyx-glow) / .6); }
.timeline .st .n { font-family: var(--font-mono); font-size: 1.6rem; color: hsl(var(--onyx-glow)); } .timeline .st h5 { margin: .3rem 0; color: hsl(var(--onyx-text)); font-size: .95rem; } .timeline .st p { margin: 0; font-size: .82rem; color: hsl(var(--onyx-muted)); } .timeline .st .when { margin-top: .6rem; font-family: var(--font-mono); font-size: .68rem; color: hsl(var(--onyx-faint)); text-transform: uppercase; letter-spacing: .1em; }
.ladder { display: grid; gap: .5rem; grid-auto-flow: column; grid-auto-columns: minmax(0,1fr); align-items: end; }
@media (max-width: 760px) { .ladder { grid-auto-flow: row; align-items: stretch; } .ladder .rung { min-height: auto !important; } }
.ladder .rung { padding: 1rem; border-radius: 16px; background: hsl(var(--onyx-surface) / .6); border: 1px solid hsl(var(--onyx-border) / .4); box-shadow: var(--hap-raise-sm); display: flex; flex-direction: column; }
.ladder .rung.model { border-color: hsl(var(--rh-model) / .6); } .ladder .rung.code { border-color: hsl(var(--rh-code) / .6); }
.ladder .rung .n { font-family: var(--font-mono); font-size: 1.4rem; color: hsl(var(--onyx-faint)); } .ladder .rung.model .n { color: hsl(var(--rh-model)); } .ladder .rung.code .n { color: hsl(var(--rh-code)); }
.ladder .rung h5 { margin: .3rem 0; color: hsl(var(--onyx-text)); font-size: .95rem; } .ladder .rung p { margin: 0 0 auto; font-size: .82rem; color: hsl(var(--onyx-muted)); }
.ladder .rung .foot { margin-top: .9rem; font-size: .85rem; font-weight: 600; color: hsl(var(--onyx-text)); } .ladder .rung .footl { font-family: var(--font-mono); font-size: .6rem; letter-spacing: .12em; text-transform: uppercase; color: hsl(var(--onyx-faint)); margin-top: .9rem; }
.ladder-axes { display: flex; justify-content: space-between; margin-top: .6rem; font-size: .8rem; color: hsl(var(--onyx-faint)); }

/* quadrant */
.quad { display: grid; grid-template-columns: auto 1fr 1fr; grid-template-rows: 1fr 1fr auto; gap: .6rem; }
.quad .axy { writing-mode: vertical-rl; transform: rotate(180deg); font-family: var(--font-mono); font-size: .62rem; letter-spacing: .14em; text-transform: uppercase; color: hsl(var(--onyx-faint)); text-align: center; }
.quad .axx { grid-column: span 1; font-family: var(--font-mono); font-size: .62rem; letter-spacing: .14em; text-transform: uppercase; color: hsl(var(--onyx-faint)); text-align: center; }
@media (max-width: 640px) { .quad { grid-template-columns: 1fr; grid-template-rows: auto; } .quad .axy, .quad .axx { display: none; } }

/* stories */
.story .k { font-family: var(--font-mono); font-size: .62rem; letter-spacing: .14em; text-transform: uppercase; color: hsl(var(--onyx-faint)); }
.story h4 { font-size: 1.2rem; margin: .4rem 0 .6rem; font-weight: 600; }
.story .lesson { margin-top: .9rem; font-weight: 600; color: hsl(var(--onyx-glow)); font-size: .9rem; }
.light .story .lesson { color: hsl(var(--onyx-glow-dim)); }

/* code */
.codeblock { font-family: var(--font-mono); font-size: .8rem; line-height: 1.55; padding: 1rem 1.2rem; border-radius: 16px; background: hsl(var(--onyx-deep)); border: 1px solid hsl(var(--onyx-border) / .5); color: hsl(var(--onyx-muted)); overflow-x: auto; white-space: pre; }
.light .codeblock { background: hsl(var(--onyx-raised)); }
.codeblock .c-model { color: hsl(var(--rh-model)); } .codeblock .c-code, .codeblock .c-blue { color: hsl(var(--rh-code)); } .codeblock .c-human, .codeblock .c-coral { color: hsl(var(--rh-human)); } .codeblock .c-bright { color: hsl(var(--onyx-text)); } .codeblock .c-dim { color: hsl(var(--onyx-faint)); } .codeblock .c-green { color: hsl(var(--rh-ok)); }

/* two pane */
.twopane { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; } @media (max-width: 760px) { .twopane { grid-template-columns: 1fr; } }
.twopane .pane h4 { font-size: 1.25rem; margin: .3rem 0 .8rem; } .twopane .pane ul { margin: 0; padding-left: 1.1rem; color: hsl(var(--onyx-muted)); font-size: .92rem; } .twopane .pane li { margin: .3rem 0; }

/* card (agenda) */
.agenda { display: grid; gap: .4rem; } .agenda .row { display: grid; grid-template-columns: 2.5rem 1fr auto; gap: 1rem; align-items: center; padding: .9rem 0; border-top: 1px solid hsl(var(--onyx-border) / .3); }
.agenda .row .n { font-family: var(--font-mono); color: hsl(var(--onyx-faint)); } .agenda .row .t { color: hsl(var(--onyx-text)); font-weight: 600; } .agenda .row .d { color: hsl(var(--onyx-muted)); font-size: .92rem; } .agenda .row .m { font-family: var(--font-mono); font-size: .72rem; color: hsl(var(--onyx-faint)); }
.agenda .rule { margin-top: 1.4rem; font-style: italic; color: hsl(var(--onyx-glow)); font-size: 1.05rem; }

/* steal */
.steal { display: grid; gap: .8rem; grid-template-columns: repeat(5, minmax(0,1fr)); } @media (max-width: 900px) { .steal { grid-template-columns: repeat(2, minmax(0,1fr)); } } @media (max-width: 560px) { .steal { grid-template-columns: 1fr; } }
.steal .s { padding: 1rem; border-radius: 16px; background: hsl(var(--onyx-surface) / .6); border: 1px solid hsl(var(--onyx-border) / .4); box-shadow: var(--hap-raise-sm); } .steal .s.last { border-color: hsl(var(--onyx-glow) / .6); }
.steal .s .n { font-family: var(--font-mono); color: hsl(var(--onyx-glow)); font-size: 1.3rem; } .steal .s h5 { margin: .3rem 0; color: hsl(var(--onyx-text)); } .steal .s p { margin: 0; font-size: .85rem; color: hsl(var(--onyx-muted)); }

/* generic text group (hand-composed slides) */
.textgroup { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.textgroup .tg { padding: .9rem 1rem; border-radius: 14px; background: hsl(var(--onyx-surface) / .5); border: 1px solid hsl(var(--onyx-border) / .35); font-size: .9rem; color: hsl(var(--onyx-muted)); white-space: pre-line; }
.textgroup .tg.h { color: hsl(var(--onyx-text)); font-weight: 600; }

/* widgets */
.widget { margin: 1.5rem 0; border-radius: var(--hap-radius); background: hsl(var(--onyx-surface) / .55); border: 1px solid hsl(var(--onyx-glow) / .35); box-shadow: var(--hap-raise); padding: 1.4rem; }
.widget .w-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 1rem; }
.widget .w-head h3 { margin: 0; font-size: 1.1rem; color: hsl(var(--onyx-text)); } .widget .w-head .pill { white-space: nowrap; }
.widget .w-foot { margin-top: 1rem; font-size: .8rem; color: hsl(var(--onyx-faint)); }
.widget input[type=text], .widget textarea, .widget select { width: 100%; font: inherit; font-size: .95rem; color: hsl(var(--onyx-text)); background: hsl(var(--onyx-deep)); border: 1px solid hsl(var(--onyx-border) / .5); border-radius: 12px; padding: .7rem .9rem; box-shadow: var(--hap-inset); }
.light .widget input[type=text], .light .widget textarea, .light .widget select { background: hsl(var(--onyx-raised)); }
.widget input[type=range] { width: 100%; accent-color: hsl(var(--onyx-glow)); }
.widget label { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: hsl(var(--onyx-faint)); display: block; margin-bottom: .35rem; }
.widget .btn { padding: .6rem 1rem; font-size: .85rem; }
.widget .row { display: flex; gap: .8rem; flex-wrap: wrap; align-items: end; }
.widget .readout { font-family: var(--font-mono); font-size: .85rem; color: hsl(var(--onyx-text)); }
.widget svg text { font-family: var(--font-mono); }

/* reveal */
.rv { opacity: 0; transform: translateY(26px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
.rv.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .rv { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }

/* chapter nav */
.chapnav { position: sticky; top: 64px; z-index: 40; background: hsl(var(--onyx-deep) / .85); backdrop-filter: blur(16px); border-bottom: 1px solid hsl(var(--onyx-border) / .4); }
.chapnav .wrap { display: flex; gap: 1rem; align-items: center; overflow-x: auto; height: 46px; font-family: var(--font-mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.chapnav a { color: hsl(var(--onyx-faint)); } .chapnav a:hover, .chapnav a.cur { color: hsl(var(--onyx-glow)); }
.chapnav .bar { position: absolute; left: 0; bottom: -1px; height: 2px; width: 0; background: hsl(var(--onyx-glow)); transition: width .15s linear; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; padding: 2rem 0 5rem; }
.pager a { display: block; padding: 1.2rem 1.4rem; border-radius: 18px; background: hsl(var(--onyx-surface) / .6); border: 1px solid hsl(var(--onyx-border) / .4); box-shadow: var(--hap-raise-sm); color: hsl(var(--onyx-text)); }
.pager a .k { display: block; font-family: var(--font-mono); font-size: .62rem; letter-spacing: .14em; text-transform: uppercase; color: hsl(var(--onyx-faint)); margin-bottom: .3rem; }
.pager a.next { text-align: right; }

/* footer */
footer { border-top: 1px solid hsl(var(--onyx-border) / .4); padding: 3rem 0; font-size: .85rem; color: hsl(var(--onyx-faint)); }
footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }

/* series landing */
.parts { display: grid; gap: 1rem; grid-template-columns: repeat(3, minmax(0,1fr)); } @media (max-width: 900px) { .parts { grid-template-columns: repeat(2, minmax(0,1fr)); } } @media (max-width: 560px) { .parts { grid-template-columns: 1fr; } }
.part { display: flex; flex-direction: column; min-height: 13rem; } .part .num { font-family: var(--font-mono); color: hsl(var(--onyx-glow)); font-size: .72rem; letter-spacing: .18em; } .part h3 { margin: .5rem 0 .4rem; font-size: 1.2rem; color: hsl(var(--onyx-text)); } .part p { font-size: .9rem; margin: 0 0 auto; } .part .meta { margin-top: 1rem; font-family: var(--font-mono); font-size: .66rem; color: hsl(var(--onyx-faint)); letter-spacing: .1em; text-transform: uppercase; }
.part.done .num::after { content: " · read"; color: hsl(var(--rh-ok)); }
.mascot { position: absolute; right: 0; top: 0; height: 100%; width: min(38vw, 560px); object-fit: cover; object-position: right center; opacity: .85; mask-image: linear-gradient(to left, black 45%, transparent 95%); -webkit-mask-image: linear-gradient(to left, black 45%, transparent 95%); pointer-events: none; z-index: -1; }
@media (max-width: 900px) { .mascot { display: none; } }
