@font-face { font-family: Anybody; src: url(/shared/fonts/anybody.woff2) format("woff2"); font-weight: 100 900; font-stretch: 50% 150%; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url(/shared/fonts/instrument-sans.woff2) format("woff2"); font-weight: 400 600; font-display: swap; }
:root { color-scheme: dark; --ink: #eaf0fa; --soft: #aab6cb; --lamp: #f5bd78; --line: #ffffff1f; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: #0e1422; color: var(--ink); font: 400 1.06rem/1.5 "Instrument Sans", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }
h1, h2, h3, .name { font-family: Anybody, system-ui, sans-serif; font-weight: 300; letter-spacing: -0.015em; }
h1 { font-size: clamp(2.6rem, 6vw, 4.5rem); line-height: 1; }
h3 { font-size: 1.5rem; line-height: 1.2; }
a { color: inherit; text-underline-offset: 4px; }
:focus-visible { outline: 2px solid var(--lamp); outline-offset: 3px; }
button, .b { font: inherit; color: inherit; min-height: 44px; padding: 0 1rem; background: #ffffff12; border: 0; border-radius: 4px; cursor: pointer; display: inline-flex; align-items: center; text-align: left; text-decoration: none; transition: background 0.15s; }
button:hover, .b:hover { background: #ffffff24; }
.main { background: var(--lamp); color: #1a2030; font-weight: 600; }
.main:hover { background: #ffd29a; }
button:disabled { opacity: 0.35; cursor: default; }

header { display: flex; flex-wrap: wrap; gap: 0 1.5rem; align-items: center; padding: 0.6rem clamp(1.1rem, 4vw, 3rem); }
header a { min-height: 44px; display: inline-flex; align-items: center; }
.name { margin-right: auto; font-size: 1.3rem; text-decoration: none; }
#lang { display: flex; gap: 1.1rem; }
#lang button { padding: 0; background: none; border-radius: 0; opacity: 0.75; border-bottom: 2px solid transparent; transition: opacity 0.15s; }
#lang button:hover, #lang [aria-pressed="true"] { opacity: 1; }
#lang [aria-pressed="true"] { border-color: var(--lamp); }
main { max-width: 74rem; margin: 0 auto; padding: clamp(1.8rem, 7vh, 5rem) clamp(1.1rem, 4vw, 3rem) 5rem; }
.lead { font-size: 1.25rem; color: var(--soft); max-width: 44ch; margin: 0.9rem 0 2.5rem; }
#shelf li { display: grid; grid-template-columns: 300px minmax(0, 1fr) auto; gap: 2.1rem; align-items: center; padding: 1.4rem 0; border-top: 1px solid var(--line); }
#shelf svg { width: 100%; border-radius: 6px; background: radial-gradient(80% 90% at 50% 60%, #33435f, #161f33); }
#shelf p, #how p, dd { color: var(--soft); max-width: 52ch; margin-top: 0.25rem; }
.later { color: var(--soft); }
section { margin-top: 4rem; }
section h2 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); line-height: 1.1; }
#how ol { counter-reset: n; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: 1.8rem 2.6rem; margin: 1.6rem 0 1.8rem; }
#how li { counter-increment: n; padding-top: 0.9rem; border-top: 1px solid var(--line); }
#how b { font-weight: 600; }
#how b::before { content: counter(n) "  "; color: var(--lamp); white-space: pre; }
dl { margin-top: 1.2rem; }
dl div { display: grid; grid-template-columns: 14rem minmax(0, 1fr); gap: 0.2rem 2rem; padding: 0.7rem 0; border-top: 1px solid var(--line); }
dt { font-weight: 600; }
dd { margin: 0; }

#talk { position: fixed; inset: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; background: radial-gradient(95% 100% at 62% 48%, #1d2840 68%, #0e1422 115%); }
#slide { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 1.9rem; align-items: center; padding: 4vh 5vw 0; min-height: 0; overflow: auto; }
#slide h2 { font-size: clamp(2rem, 4.2vw, 3.75rem); line-height: 1.05; text-wrap: balance; }
#slide p { font-size: clamp(1.1rem, 1.6vw, 1.45rem); color: #d3dceb; margin-top: 1.25rem; max-width: 32ch; }
#slide .said { min-height: 1.5em; color: var(--lamp); }
#slide svg { display: block; width: 100%; max-height: 78vh; }
#slide .b { margin-top: 1.25rem; }
.acts { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.5rem; }
svg text { font: 500 17px "Instrument Sans", system-ui, sans-serif; fill: var(--ink); }
svg text.d { fill: #161c2b; }
svg text.s { fill: var(--soft); font-size: 16px; paint-order: stroke; stroke: #1d2840; stroke-width: 6px; }
svg g { transition: opacity 0.3s; }
.new { animation: in 0.5s ease-out; }
@keyframes in { from { opacity: 0; } }
#foot { display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; align-items: center; padding: 0.9rem clamp(1.1rem, 2vw, 1.7rem) 1.25rem; }
#dots { display: flex; margin: 0 auto; }
#dots button { background: none; width: 44px; padding: 0; justify-content: center; }
#dots span { width: 22px; height: 4px; border-radius: 2px; background: #ffffff3a; overflow: hidden; }
#dots i { display: block; height: 100%; background: var(--lamp); transition: width 0.4s; }
#dots:not(.chapters) [aria-current] i { width: 100% !important; }
#dots:not(.chapters) button:not([aria-current]) i { width: 0 !important; }
#dots.chapters { gap: 0.6rem; }
#dots.chapters button { width: 8.2rem; flex-direction: column; justify-content: center; align-items: stretch; gap: 6px; border-radius: 0; }
#dots.chapters span { width: 100%; }
#dots small { font-size: 0.95rem; color: var(--soft); }
#dots [aria-current] small { color: var(--ink); }
.idle { cursor: none; }
#foot { transition: opacity 0.4s; }
.idle #foot { opacity: 0; }
.stage text { font-size: 25px; }
.stage .text text { paint-order: stroke; stroke: #1d2840; stroke-width: 8px; }
.stage rect { fill: #24314c; stroke: #ffffff66; transition: fill 0.3s; }
.stage path { stroke: #ffffff88; stroke-width: 2.5; transition: stroke 0.3s; }
.stage .line text { fill: var(--soft); paint-order: stroke; stroke: #1d2840; stroke-width: 9px; }
.stage .box, .stage .line { transition: none; }
.stage .box > *, .stage .line > * { transition: opacity 0.3s, fill 0.3s, stroke 0.3s; }
.stage .dash path { stroke-dasharray: 5 7; }
.stage .soft text, text.soft { fill: #c3cee0; }
.stage .lamp text { fill: var(--lamp); }
.stage .lit rect, .stage .hot rect { fill: var(--lamp); stroke: #fff0d8; }
.stage .lit text, .stage .box.hot text { fill: #161c2b; }
.stage .dim rect { fill: #24314c; stroke: #ffffff30; }
.stage .box.dim text { fill: #aab6cb; }
.stage .dim path { stroke: #ffffff30; }
.stage .hot path { stroke: var(--lamp); stroke-width: 3.5; }
.stage .faint > text, .stage .faint > .icon { opacity: 0.4; }
.stage .bare text { stroke: none; }
.stage .box.dim .icon { stroke: #aab6cb; }
#slide .late.soon { animation-delay: 1.5s; }
#slide .late { animation: in 0.4s 3.4s both; }
.stage .panel rect { fill: #0e1422; }
.stage > g:last-child circle { fill: #fff; }
.stage .icon { fill: none; stroke: var(--ink); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.stage .lit .icon, .stage .box.hot .icon { stroke: #161c2b; stroke-width: 1.9; }
.stage .thread path { stroke: #ffffff30; }
.stage .draw path, .stage .draw rect { stroke: none; }
.stage .wall { fill: #141d31; }
.stage .draw .wall { stroke: #ffffff40; stroke-width: 2; }
.stage .glass { fill: #2f4267; }
.stage .lamp1, .stage .lamp2 { fill: var(--lamp); }
.stage .lamp2 { opacity: 0.75; }
.stage .door, .stage .edge2 { fill: #5d6f93; }
.stage .body { fill: #5d6f93; }
.stage .beam { fill: #f5bd7838; }
.stage .draw .edge, .stage .draw .thin { fill: none; stroke: #8797b8; stroke-width: 4; stroke-linecap: round; }
.stage .draw .thin { stroke: #ffffff26; stroke-width: 2; }
.stage .k0 text { fill: #f5bd78; }
.stage .k1 text { fill: #ff9d84; }
.stage .k2 text { fill: #7fd6c2; }
.stage .k3 text { fill: #b9a8f5; }

@media (max-width: 860px) {
  #shelf li { grid-template-columns: minmax(0, 1fr); gap: 0.9rem; justify-items: start; }
  #shelf svg { max-width: 340px; }
  dl div { grid-template-columns: minmax(0, 1fr); }
  #slide { grid-template-columns: minmax(0, 1fr); align-content: start; gap: 0.75rem; padding: 1.25rem 0.75rem 0; }
  #say { padding: 0 0.5rem; }
  #slide svg { max-height: 46vh; }
  svg text, svg text.s { font-size: 22px; }
  #say { min-height: 15.5rem; }
  #slide svg.stage { max-height: none; }
  #dots.chapters button { width: auto; flex: 1; }
  #dots small { display: none; }
  #foot { gap: 0.4rem; }
  #dots { order: -1; width: 100%; justify-content: center; }
  #back { margin-left: auto; }
  #full { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
