/* One look: cream paper, Bodoni for anything that speaks, DM Sans for anything that labels. */
:root {
  --paper: #F2EDE4;
  --paper-2: #EAE4D8;
  --sheet: #F8F4EC;
  --ink: #2E2C29;
  --text-2: #3A3733;
  --mid: #6B6560;
  --light: #A89F94;
  --line: #D8D1C4;
  --accent: #B5362A;
  --accent-soft: rgba(181,54,42,.12);
  --display: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
  --body: "DM Sans", "Helvetica Neue", Arial, sans-serif;
  --measure: 34rem;
  --rail: 56px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--body); font-size: 17px; line-height: 1.55; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: inherit; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); }
h1, h2, h3 { font-family: var(--display); font-weight: 500; letter-spacing: 0; margin: 0; }
p { margin: 0 0 1em; max-width: min(var(--measure), 100%); }
.label, .eyebrow, h2, .counter, .card-kicker, .rail-name, .year { font-family: var(--body); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mid); }
.hey { font-family: var(--display); font-style: italic; font-size: 20px; letter-spacing: 0; text-transform: none; color: var(--mid); margin-bottom: 1.4rem; }
.hello .hey { font-size: clamp(24px, 2.2vw, 32px); color: var(--ink); margin-bottom: 1.2rem; }
.textbtn { font: 500 11px var(--body); letter-spacing: 0.12em; text-transform: uppercase; color: var(--mid); background: transparent; border: 0; border-bottom: 1px solid transparent; padding: 4px 1px; cursor: pointer; }
.textbtn:hover { color: var(--ink); }
.textbtn.on { color: var(--ink); border-bottom-color: var(--ink); }
.btn { font: 500 13px var(--body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); background: transparent; border: 1px solid var(--ink); border-radius: 2px; padding: 11px 18px; cursor: pointer; transition: background .2s, color .2s; }
.btn:hover { background: var(--ink); color: var(--paper); }
.sheetbox { background: var(--sheet); border: 1px solid var(--line); border-radius: 3px; box-shadow: 0 1px 0 rgba(46,44,41,.05), 0 18px 40px -26px rgba(46,44,41,.45); }

/* rail */
.rail { position: fixed; left: 0; top: 0; bottom: 0; width: var(--rail); border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; padding: 28px 0 22px; gap: 18px; z-index: 5; }
.rail-name { writing-mode: vertical-rl; transform: rotate(180deg); }
.rail-line { flex: 1; width: 1px; background: var(--line); }
.rail-links { display: flex; flex-direction: column; gap: 14px; align-items: center; }
.rail-links a, .topbar-icons a { display: block; width: 18px; height: 18px; color: var(--mid); text-decoration: none; }
.rail-links a:hover, .topbar-icons a:hover { color: var(--ink); }
.rail-links svg, .topbar-icons svg { width: 18px; height: 18px; display: block; fill: currentColor; }
.rail-links img, .topbar-icons img { width: 18px; height: 20px; display: block; opacity: .75; }
.rail-links a:hover img, .topbar-icons a:hover img { opacity: 1; }
.topbar { display: none; }

/* layout */
.layout { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); margin-left: var(--rail); min-height: 100vh; }
.copy { padding: 12vh 6vw 10vh 5.5vw; }
.stage { position: sticky; top: 0; height: 100vh; overflow: hidden; }
.brainwrap { position: absolute; inset: 0; }
#brain { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; transform-origin: 50% 50%; will-change: transform; }
#brain.dragging { cursor: grabbing; }
#brain.hot { cursor: pointer; }
.stage.probing #brain { cursor: crosshair; }

/* story */
.story h1 { font-size: clamp(34px, 3.9vw, 56px); line-height: 1.04; margin-bottom: 1.6rem; max-width: 15ch; }
.story h1 em { font-style: italic; color: var(--accent); }
.story p { font-size: 17.5px; color: var(--text-2); }
.scrollhint { font-size: 13px; color: var(--light); margin-top: 3rem; letter-spacing: 0.04em; }
.longer { margin: 1.4rem 0 0; max-width: var(--measure); }
.longer summary { cursor: pointer; font-family: var(--display); font-style: italic; font-size: 17px; color: var(--mid); list-style: none; display: inline-flex; align-items: center; gap: 8px; }
.longer summary::-webkit-details-marker { display: none; }
.longer summary::before { content: ''; width: 7px; height: 7px; border-right: 1px solid var(--mid); border-bottom: 1px solid var(--mid); transform: rotate(-45deg); transition: transform .2s; }
.longer[open] summary::before { transform: rotate(45deg); }
.longer div { padding-top: 1rem; }
.longer p { font-size: 16.5px; color: var(--text-2); }
.who { display: flex; gap: 18px; align-items: center; margin-top: 2.4rem; padding-top: 1.6rem; border-top: 1px solid var(--line); max-width: var(--measure); }
.who img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.who img[hidden] { display: none; }
.who p { margin: 0; }
.who-name { font-family: var(--display); font-size: 20px; }
.who-lines { font-size: 15px; color: var(--mid); margin-top: 2px; }
.who-links { margin-top: 8px; font-size: 14px; }
.who-links a { margin-right: 14px; }
.who-links a[hidden] { display: none; }

/* lists and dossiers */
section + section { margin-top: 9vh; }
h2 { margin-bottom: 1.4rem; }
.piece-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.piece-list li { border-bottom: 1px solid var(--line); }
.piece-list .head { padding: 16px 10px 16px 0; display: grid; grid-template-columns: 22px 64px 1fr; gap: 12px; align-items: baseline; cursor: pointer; transition: background .25s; }
.piece-list li:hover .head, .piece-list li.on .head { background: var(--paper-2); }
.piece-list .chip { width: 11px; height: 11px; border-radius: 2px; display: inline-block; transform: translateY(1px); margin-left: 4px; }
.piece-list .chip.hollow { border: 1px dashed var(--ink); background: transparent; }
.piece-list .t { font-family: var(--display); font-size: 21px; line-height: 1.2; }
.piece-list .d { font-size: 15px; color: var(--mid); margin: 4px 0 0; max-width: 100%; }
.dossier { display: none; padding: 4px 0 20px 98px; }
.piece-list li.open .dossier { display: block; }
.dossier p { font-size: 15px; color: var(--text-2); margin: 0 0 .7em; }
.dossier p b { font-family: var(--body); font-weight: 500; color: var(--mid); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; display: block; margin-bottom: 2px; }
.dossier figure { margin: 10px 0 12px; }
.dossier figure img { display: block; max-width: 100%; border: 1px solid var(--line); border-radius: 2px; background: var(--sheet); }
.dossier figcaption { font-size: 12.5px; color: var(--light); margin-top: 6px; }
.dossier .l { font-size: 14px; margin-top: 6px; }
.dossier .l a { margin-right: 14px; }
.contact p { font-size: 16.5px; }
.contact-links a { margin-right: 18px; font-family: var(--display); font-size: 18px; }
.fine { font-size: 13px; color: var(--light); margin-top: 3rem; }

/* stage furniture */
.loading { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font: 12px var(--body); letter-spacing: 0.14em; text-transform: uppercase; color: var(--light); display: flex; gap: 10px; align-items: center; }
.loading span { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: .25; transform: scale(.8); } 50% { opacity: 1; transform: scale(1); } }
.loading.off { display: none; }
.counter { position: absolute; left: 28px; top: 28px; }
.minis { position: absolute; left: 28px; top: 50px; display: flex; gap: 16px; opacity: 0; transition: opacity .4s; }
.minis.on { opacity: 1; }
.hint { position: absolute; right: 28px; bottom: 26px; font-size: 12.5px; color: var(--light); letter-spacing: 0.04em; transition: opacity .6s; }
.hint.off { opacity: 0; }
.caption { position: absolute; left: 50%; bottom: 88px; transform: translateX(-50%); font-family: var(--display); font-style: italic; font-size: 17px; color: var(--mid); white-space: nowrap; opacity: 0; transition: opacity .3s; pointer-events: none; }
.caption.on { opacity: 1; }
.views { position: absolute; right: 24px; top: 26px; display: flex; gap: 14px; }
.labels { position: absolute; inset: 0; pointer-events: none; }
.labels .q { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; border: 1px dashed var(--ink); color: var(--ink); font: italic 14px var(--display); display: flex; align-items: center; justify-content: center; background: rgba(242,237,228,.75); opacity: 0; transition: opacity .25s; pointer-events: auto; cursor: pointer; }
.labels .q.on { opacity: 1; }
.labels .e { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: var(--ink); color: var(--paper); font: 500 10.5px var(--body); display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px var(--paper); transition: opacity .2s; }
.floatlabel { position: absolute; transform: translate(-50%, -140%); font: italic 14px var(--display); color: var(--paper); background: var(--ink); padding: 3px 10px; border-radius: 2px; white-space: nowrap; opacity: 0; transition: opacity .2s; pointer-events: none; }
.floatlabel.on { opacity: 1; }
.regiontip { position: absolute; font: 12px var(--body); color: var(--mid); background: rgba(242,237,228,.85); padding: 3px 7px; border-radius: 2px; white-space: nowrap; opacity: 0; transition: opacity .15s; pointer-events: none; transform: translate(14px, 14px); }
.regiontip.on { opacity: 1; }
.mute { position: absolute; right: 24px; bottom: 50px; width: 28px; height: 28px; border: 0; background: transparent; color: var(--light); cursor: pointer; padding: 4px; }
.mute:hover { color: var(--ink); }
.mute svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; }
.mute .wave { transition: opacity .2s; }
.mute.off .wave { opacity: 0; }
.mute.off .cross { opacity: 1; }
.mute .cross { opacity: 0; }

/* card: a sheet of paper */
.card { position: absolute; left: 24px; bottom: 24px; width: min(380px, calc(100% - 48px)); padding: 18px 20px 16px; opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s; pointer-events: none; }
.card.on { opacity: 1; transform: none; pointer-events: auto; }
.card-close { position: absolute; right: 10px; top: 6px; border: 0; background: transparent; font-size: 20px; line-height: 1; color: var(--light); cursor: pointer; display: none; }
.card.selected .card-close { display: block; }
.card-kicker { margin: 0 0 6px; }
.card[data-kind="missing"] .card-kicker { color: var(--accent); }
.card-title { font-size: 23px; line-height: 1.15; margin-bottom: 8px; }
.card-body { font-size: 14.5px; line-height: 1.5; color: var(--text-2); margin: 0 0 6px; }
.card-status { font-size: 13px; color: var(--mid); margin: 0; }
.card-signal { display: none; width: 100%; height: 72px; margin-top: 12px; }
.card-signal-label { display: none; font-size: 12px; color: var(--light); margin: 4px 0 0; }
.card.selected .card-signal, .card.selected .card-signal-label { display: block; }
.card-links { margin: 10px 0 0; font-size: 14px; }
.card-links a { margin-right: 14px; }
.card-links:empty { display: none; }


/* sections: scroll-linked choreography on the right */
section { scroll-margin-top: 10vh; }
.hello { min-height: 76vh; display: flex; flex-direction: column; justify-content: center; width: 136%; position: relative; z-index: 2; }
.hello h1 { font-size: clamp(40px, 4.4vw, 66px); line-height: 1.02; margin: 0 0 1.5rem; max-width: 15ch; }
.hello .lead { max-width: 34rem; font-size: 20px; }
.hello .toc:empty { display: none; }
.scrollcue { display: inline-block; width: 22px; height: 36px; border: 1px solid var(--line); border-radius: 11px; margin-top: 2.6rem; position: relative; }
.scrollcue span { position: absolute; left: 50%; top: 7px; width: 3px; height: 7px; margin-left: -1.5px; border-radius: 2px; background: var(--mid); animation: cue 1.8s ease-in-out infinite; }
@keyframes cue { 0%, 100% { transform: translateY(0); opacity: 1; } 60% { transform: translateY(12px); opacity: 0; } 61% { transform: translateY(0); opacity: 0; } }
.portrait { position: absolute; left: 50%; top: 47%; transform: translate(-50%, -50%); height: min(74%, 620px); aspect-ratio: 3 / 4; border-radius: 999px 999px 6px 6px; background: var(--sheet); overflow: hidden; box-shadow: 0 0 0 1px var(--line), 0 0 0 9px var(--paper), 0 0 0 10px var(--line), 0 30px 60px -36px rgba(46,44,41,.55); }
.portrait::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(ellipse 70% 62% at 50% 42%, transparent 55%, rgba(242,237,228,.55) 100%); pointer-events: none; }
.portrait img, .portrait svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.portrait img, .who-photo img { filter: saturate(.82) sepia(.12) contrast(1.03); }
.portrait { pointer-events: none; will-change: opacity, transform; }
.portrait[hidden] { display: none; }
.hello .lead { font-size: 19px; color: var(--text-2); }
.hello .toc { font-size: 15px; color: var(--mid); margin-top: 1.4rem; }
.when { font-family: var(--display); font-style: italic; font-size: 16px; letter-spacing: 0; text-transform: none; color: var(--light); margin-left: 10px; }
.rail-dots { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.rail-dots a { width: 6px; height: 6px; border-radius: 50%; background: var(--line); display: block; transition: background .3s, transform .3s; }
.rail-dots a.on { background: var(--ink); transform: scale(1.3); }

/* work: grouped by area */
.area { margin-bottom: 2.2rem; }
.area h3 { font-family: var(--body); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--light); margin: 0 0 6px; }
.piece-list .then { font-family: var(--display); font-style: italic; font-size: 15px; color: var(--mid); margin: 6px 0 0; }

/* now */
.now-lines { list-style: none; margin: 0 0 1.4rem; padding: 0; max-width: var(--measure); }
.now-lines li { position: relative; padding-left: 22px; margin-bottom: .7em; font-size: 16.5px; color: var(--text-2); }
.now-lines li::before { content: ''; position: absolute; left: 0; top: .62em; width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--ink); }
.now-lines li:first-child::before { background: var(--accent); border-color: var(--accent); }
.photos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: var(--measure); }
.photos figure { margin: 0; }
.photos img, .photos .ph { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border: 1px solid var(--line); border-radius: 2px; background: var(--sheet); }
.photos .ph { display: flex; align-items: center; justify-content: center; font: italic 14px var(--display); color: var(--light); border-style: dashed; }
.photos figcaption { font-size: 12.5px; color: var(--light); margin-top: 6px; }

/* the question */
.q { font-family: var(--display); font-size: clamp(24px, 2.4vw, 34px); line-height: 1.2; margin-bottom: 1.4rem; max-width: 20ch; }
.choices { display: flex; flex-wrap: wrap; gap: 10px 22px; max-width: var(--measure); }
.choices button { font: italic 24px var(--display); color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid var(--line); padding: 2px 0 4px; cursor: pointer; transition: border-color .2s, color .2s; }
.choices button:hover { border-bottom-color: var(--ink); }
.choices button.on { color: var(--accent); border-bottom-color: var(--accent); }
.statecard { margin-top: 1.6rem; max-width: var(--measure); border-left: 2px solid var(--accent); padding: 4px 0 4px 18px; }
.statecard[hidden] { display: none; }
.statecard p { font-size: 17px; color: var(--text-2); margin: 0; }
.statecard-foot { margin-top: 6px !important; font-size: 13px !important; color: var(--light) !important; }

/* build: two versions */
.tabs { display: flex; gap: 18px; margin: -.4rem 0 1.4rem; }
.tabs .textbtn { font-size: 12px; }
.picked { font-family: var(--display); font-style: italic; font-size: 17px; color: var(--accent); margin-bottom: 1rem; }
.picked[hidden] { display: none; }
#build-story p, #build-mech p { font-size: 17px; color: var(--text-2); }
#build-mech p b { font-family: var(--body); font-weight: 500; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--mid); display: block; margin-bottom: 2px; }
#build-mech[hidden], #build-story[hidden] { display: none; }
.replay { font-size: 13px; color: var(--light); margin-top: .6rem; }
.replay a { text-decoration-color: var(--line); }

/* contact */
.who-photo { width: 84px; height: 84px; border-radius: 50%; border: 1px dashed var(--line); display: flex; align-items: center; justify-content: center; font: italic 13px var(--display); color: var(--light); flex: none; overflow: hidden; }
.who-photo img { width: 100%; height: 100%; object-fit: cover; }
.looking { font-size: 16.5px; color: var(--text-2); margin-top: 1.6rem; }
.looking b { font-family: var(--display); font-weight: 400; font-style: italic; }
.contact-links { margin-top: 1rem; }

/* stage: the paper strip, the weather words, the mechanics labels */
.paper { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 104px; display: block; transform: translateY(110%); pointer-events: none; }
.weather, .mech { position: absolute; inset: 0; pointer-events: none; }
.weather span { position: absolute; transform: translate(-50%, -50%); font: italic 22px var(--display); color: var(--mid); white-space: nowrap; opacity: 0; }
.weather span.chip { font: 500 11px var(--body); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink); background: var(--sheet); border: 1px solid var(--line); border-radius: 2px; padding: 3px 7px; transform: translate(-50%, -160%); transition: opacity .5s; }
.mech .m { position: absolute; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 8px; opacity: 0; transition: opacity .4s; white-space: nowrap; }
.mech .m.on { opacity: 1; }
.mech .m i { width: 20px; height: 20px; border-radius: 50%; background: var(--ink); color: var(--paper); font: 500 11px var(--body); display: flex; align-items: center; justify-content: center; font-style: normal; }
.mech .m b { font: 500 11px var(--body); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink); background: var(--sheet); border: 1px solid var(--line); border-radius: 2px; padding: 3px 7px; }
.stage.quiet .views, .stage.quiet .hint, .stage.quiet .counter { opacity: 0; pointer-events: none; }
.views, .hint, .counter { transition: opacity .4s; }
@media (prefers-reduced-motion: reduce) { .scrollcue span { animation: none; } }

.noscript { margin: 20vh auto; max-width: 30rem; text-align: center; }

/* mobile */
@media (max-width: 900px) {
  :root { --rail: 0px; }
  .rail { display: none; }
  .topbar { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; position: sticky; top: 0; z-index: 6; background: rgba(242,237,228,.94); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
  .topbar-name { font-family: var(--display); font-size: 17px; text-decoration: none; white-space: nowrap; }
  .topbar-right { display: flex; align-items: center; gap: 8px; }
  .topbar-links { white-space: nowrap; }
  .topbar-links a { font-size: 12.5px; color: var(--mid); text-decoration: none; margin-left: 10px; }
  .topbar-icons { display: flex; gap: 10px; margin-left: 4px; }
  .layout { grid-template-columns: 1fr; margin-left: 0; }
  .stage { order: -1; position: sticky; top: 49px; height: 46vh; min-height: 300px; z-index: 3; background: var(--paper); border-bottom: 1px solid var(--line); }
  .copy { padding: 6vh 18px 10vh; position: relative; z-index: 1; }
  .hello { min-height: 0; display: block; width: auto; }
  .hello h1 { font-size: clamp(30px, 8.6vw, 42px); }
  .hello .hey { font-size: 22px; }
  .hello .lead { font-size: 17px; }
  .portrait { height: 84%; box-shadow: 0 0 0 1px var(--line), 0 0 0 6px var(--paper), 0 0 0 7px var(--line); }
  .scrollcue { display: none; }
  .counter { left: 14px; top: 12px; }
  .hint { display: none; }
  .views { left: 10px; right: 10px; top: auto; bottom: 8px; justify-content: center; flex-wrap: wrap; gap: 10px; }
  .card { left: 10px; right: 10px; bottom: 34px; width: auto; padding: 12px 14px 10px; }
  .card-body { font-size: 13.5px; }
  .card-signal { height: 56px; }
  .caption { bottom: 40px; font-size: 14px; max-width: 90%; white-space: normal; text-align: center; }
  .piece-list .head { grid-template-columns: 20px 56px 1fr; gap: 8px; }
  .piece-list .t { font-size: 19px; }
  .dossier { padding-left: 0; }
  .q { font-size: 24px; }
  .choices button { font-size: 20px; }
  .paper { height: 72px; }
  .weather span { font-size: 17px; }
  .photos { grid-template-columns: 1fr 1fr; }
}
@media (pointer: coarse) { #brain { touch-action: pan-y; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .loading span { animation: none; } }

/* without WebGL the page still reads: a still of the brain */
.no-webgl .views, .no-webgl .hint, .no-webgl .counter, .no-webgl #brain, .no-webgl .labels, .no-webgl .paper, .no-webgl .weather, .no-webgl .mech, .no-webgl .replay { display: none !important; }
.still { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); width: min(86%, 760px); height: auto; }
.still-note { position: absolute; left: 28px; right: 28px; bottom: 28px; font-size: 13px; color: var(--light); max-width: 34rem; margin: 0; }
@media (max-width: 900px) { .still { width: 92%; } .still-note { left: 16px; right: 16px; bottom: 12px; font-size: 12px; } }
.labels .edot { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: #D9B25A; box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px #D9B25A; opacity: 0; transition: opacity .4s; }
.labels .edot.on { opacity: 1; animation: edot 1.6s ease-in-out infinite; }
@keyframes edot { 0%, 100% { box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px #D9B25A; } 50% { box-shadow: 0 0 0 2px var(--paper), 0 0 0 9px rgba(217,178,90,0); } }
