/* radacuxiv — main styles
   The page is a sheet of paper. The UI is ink held by a paper keyline, so it
   reads on the sheet and on whatever the bubble shows behind it. In the net
   everything turns to phosphor. */

:root {
  --paper: #faf9f6;
  --abyss: #000207;
  --ink: #121317;
  --keyline: #faf9f6;
  --led: #2fd39a;
  --phos: #5cff9e;
  --phos-dim: #1f7a5e;
  --amber: #ffae3d;
  --elsh: 2;                 /* Handjet element shape: 2 squares → 8 dots during the journey */
  --scatter: 0;              /* 0 at rest → 1 while travelling (set by js) */
  --gutter: clamp(12px, 2.2vw, 26px);
  --font-ui: "Handjet", "Arial Narrow", "Roboto Condensed", system-ui, sans-serif;
  --kl-1: 0 0 1px var(--keyline), 1px 0 0 var(--keyline), -1px 0 0 var(--keyline), 0 1px 0 var(--keyline),
          0 -1px 0 var(--keyline), 1px 1px 0 var(--keyline), -1px -1px 0 var(--keyline), 1px -1px 0 var(--keyline), -1px 1px 0 var(--keyline);
  --kl-2: 0 0 2px var(--keyline), 2px 0 0 var(--keyline), -2px 0 0 var(--keyline), 0 2px 0 var(--keyline),
          0 -2px 0 var(--keyline), 1.5px 1.5px 0 var(--keyline), -1.5px -1.5px 0 var(--keyline), 1.5px -1.5px 0 var(--keyline),
          -1.5px 1.5px 0 var(--keyline);
  color-scheme: light;
}
html[lang="ja"] { --font-ui: "Handjet", "DotGothic16", "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif; }
html[lang="zh"] { --font-ui: "Handjet", "ZCOOL QingKe HuangYou", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif; }
html[lang="ja"], html[lang="zh"] { font-synthesis: none; }

*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  background: var(--paper);
  color: var(--ink);
  overflow: hidden;
  overscroll-behavior: none;
}
body {
  font: 400 16px/1.2 var(--font-ui);
  font-variation-settings: "ELSH" var(--elsh), "ELGR" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
html.i18n-pending [data-i18n] { visibility: hidden; }

:focus-visible {
  outline: 2px dashed var(--ink);
  outline-offset: 4px;
  box-shadow: 0 0 0 1px var(--keyline);
}

/* ---------- stage ---------- */
#stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  opacity: 1;
  transition: opacity 1.2s ease;
}
html.boot #stage { opacity: 0; }


/* ---------- a) brand: drawn in WebGL, this is its hit area ---------- */
.brand {
  position: fixed;
  z-index: 3;
  left: var(--bx, 50%);
  top: var(--by, 27%);
  width: var(--bw, 62vw);
  height: var(--bh, 14vw);
  transform: translate(-50%, -50%);
  margin: 0;
  display: grid;
  place-items: center;
  color: transparent;
  font: 900 clamp(48px, 11vw, 168px)/1 var(--font-ui);
  font-variation-settings: "ELSH" 2, "ELGR" 1;
  letter-spacing: 0;
  cursor: crosshair;   /* also makes iOS deliver taps to this non-link element */
  user-select: none;
  -webkit-user-select: none;
  border-radius: 6px;
}
html.voyage .brand { pointer-events: none; }
html.nogl .brand { color: var(--ink); text-shadow: var(--kl-2); width: auto; height: auto; }

/* ---------- b) the "antigestell" line: a failing tube (js drives the stutter) ---------- */
.marquee {
  position: fixed;
  z-index: 2;
  left: 50%;
  top: var(--my, 27%);
  width: 240vmax;
  padding: 5px 0 4px;
  transform: translate(-50%, -50%) rotate(-8.5deg);
  border-top: 1px solid #fff;
  border-bottom: 1px solid #fff;
  color: #fff;
  mix-blend-mode: difference;
  pointer-events: none;
  font: 400 17px/1 var(--font-ui);
  font-variation-settings: "ELSH" 8, "ELGR" 1;
  letter-spacing: .12em;
  white-space: nowrap;
  overflow: hidden;
  opacity: 0;
}
html.brand-hover .marquee { opacity: 1; }
html.voyage .marquee { opacity: 0; }
.marquee-track {
  display: flex;
  width: max-content;
  will-change: transform;    /* js runs it: fast, and at a jumpy 1–3 fps on paper */
}
.marquee-track span { padding: 0 .9em; }
.marquee-track i {
  display: inline-block;
  width: .5em;
  height: .5em;
  margin: 0 .2em;
  border: 1px solid currentColor;
  transform: translateY(-.05em) rotate(45deg);
}

/* ---------- c) projects ---------- */
.projects { position: fixed; inset: 0; z-index: 4; pointer-events: none; }
.project {
  --r: 60px;
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translate3d(calc(var(--x, -999px) - 50%), calc(var(--y, -999px) - var(--r)), 0);
  opacity: calc(1 - var(--scatter) * 1.6);
  will-change: transform;
}
html.voyage .project { pointer-events: none; }
html.far .project, html.far .brand { visibility: hidden; }
.project-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  pointer-events: auto;
  border-radius: 10px;
}
.project-hit {
  display: block;
  width: calc(var(--r) * 2);
  height: calc(var(--r) * 2);
  border-radius: 50%;
}
.project-name {
  margin-top: 2px;
  font: 700 clamp(22px, 2.1vw, 31px)/1 var(--font-ui);
  letter-spacing: .015em;
  text-shadow: var(--kl-2);
  white-space: nowrap;
}
.project-desc {
  margin-top: 4px;
  max-width: 15em;
  text-align: center;
  font: 400 clamp(15px, 1.15vw, 17px)/1.12 var(--font-ui);
  text-shadow: var(--kl-1);
}
.project-sub {
  margin-top: 6px;
  padding: 2px 8px 3px;
  pointer-events: auto;
  font: 500 14px/1 var(--font-ui);
  text-decoration: none;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: 0 0 0 1px var(--keyline);
}
.project-link:hover .project-name,
.project-link:focus-visible .project-name { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.project-sub:hover { background: var(--ink); color: var(--paper); }
html.nogl .project { position: static; transform: none; opacity: 1; margin: 0 auto 24px; }
html.nogl .projects { position: fixed; inset: 50% 0 auto 0; display: grid; justify-content: center; }
html.nogl .project-hit { display: none; }

/* ---------- e) language: a strip of the cube wall (cubes drawn in WebGL) ---------- */
.langs {
  position: fixed;
  z-index: 5;
  top: max(var(--gutter), env(safe-area-inset-top));
  right: max(var(--gutter), env(safe-area-inset-right));
  display: flex;
  gap: 2px;
}
.lang {
  position: relative;
  width: 54px;
  height: 54px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  color: var(--ink);
  /* square pixel letters (they never morph with the ride: always the crispest shape) */
  font: 800 22px/1 var(--font-ui);
  font-variation-settings: "ELSH" 2, "ELGR" 1;
  letter-spacing: .04em;
  /* a thin white keyline, square like the pixels (svg filter in index.html): readable
     over the cubes and the picture, without covering the cube animation */
  filter: url(#lang-ol);
}
.lang[aria-pressed="true"] { font-weight: 900; }
.lang[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  left: 17px;
  right: 17px;
  bottom: 7px;
  height: 3px;
  background: var(--ink);
  box-shadow: 0 0 0 1.5px var(--keyline);
}
html.nogl .lang { outline: 1px solid var(--ink); outline-offset: -6px; }

/* ---------- d) journey controls ---------- */
.journey {
  position: fixed;
  z-index: 5;
  left: 50%;
  bottom: max(var(--gutter), env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
}
.readout {
  display: grid;
  justify-items: end;
  gap: 3px;
  min-width: 6.4em;
  text-shadow: var(--kl-1);
}
.readout-beta {
  font: 600 23px/1 var(--font-ui);
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
  white-space: nowrap;
}
.readout-beta .beta { margin-right: .22em; }
.readout-beta .c { margin-left: .12em; }
.readout-state { font: 400 15px/1 var(--font-ui); white-space: nowrap; }

.switch {
  --s: 54px;
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: 10px;
}
.switch-plate {
  position: relative;
  display: block;
  width: var(--s);
  height: calc(var(--s) * 1.18);
  border: 3px solid var(--ink);
  border-radius: 11px;
  background: var(--paper);
  box-shadow: 0 0 0 1.5px var(--keyline), inset 0 0 0 1.5px var(--keyline);
  perspective: 220px;
}
.switch-plate::before {          /* lever pivot */
  content: "";
  position: absolute;
  left: 50%;
  bottom: 32%;
  width: 18px;
  height: 10px;
  margin-left: -9px;
  border: 2px solid var(--ink);
  border-radius: 50%;
}
.switch-lever {
  position: absolute;
  left: 50%;
  bottom: calc(32% + 5px);
  width: 6px;
  height: 36%;
  margin-left: -3px;
  border-radius: 3px;
  background: var(--ink);
  transform-origin: 50% 100%;
  transform: rotate(-26deg);
  transition: transform .26s cubic-bezier(.5, 1.9, .45, 1) .14s;
}
.switch-lever::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -8px;
  width: 15px;
  height: 15px;
  margin-left: -7.5px;
  border-radius: 50%;
  background: var(--ink);
}
.switch-guard {
  position: absolute;
  left: 12%;
  right: 12%;
  top: 7%;
  height: 62%;
  border: 2px solid var(--ink);
  border-radius: 7px 7px 3px 3px;
  background: repeating-linear-gradient(-45deg, rgba(18, 19, 23, .55) 0 2px, transparent 2px 6.5px);
  transform-origin: 50% 0;
  transform: rotateX(0deg);
  transition: transform .34s cubic-bezier(.3, .7, .2, 1) .2s;
}
.switch-led {
  position: absolute;
  left: 50%;
  bottom: 9%;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  transition: background .25s, box-shadow .4s;
}
.switch:hover .switch-guard { transform: rotateX(-28deg); transition-delay: 0s; }
.switch[aria-checked="true"] .switch-guard { transform: rotateX(-122deg); transition-delay: 0s; }
.switch[aria-checked="true"] .switch-lever { transform: rotate(26deg); }
.switch[aria-checked="true"] .switch-led { background: var(--led); box-shadow: 0 0 10px 2px var(--led); }
.switch-label {
  font: 700 16px/1 var(--font-ui);
  letter-spacing: .03em;
  text-shadow: var(--kl-1);
}

html.nogl .switch { opacity: .45; pointer-events: none; }

/* ---------- f) contact ---------- */
.contact {
  position: fixed;
  z-index: 5;
  left: max(var(--gutter), env(safe-area-inset-left));
  bottom: max(var(--gutter), env(safe-area-inset-bottom));
  max-width: calc(50vw - 170px);
  padding: 9px 15px 10px;
  font: 500 20px/1.15 var(--font-ui);
  font-style: normal;
  background: var(--paper);
  border: 4px solid var(--ink);
  box-shadow: 0 0 0 1.5px var(--keyline);
}
.contact-lead { font-size: .86em; font-weight: 400; letter-spacing: .01em; }
.contact a { font-weight: 800; text-decoration: none; white-space: nowrap; }
.contact a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- g) volume: a square box like the menu, a pixel speaker, a fader ---------- */
.vol {
  position: fixed;
  z-index: 6;
  right: max(var(--gutter), env(safe-area-inset-right));
  bottom: max(var(--gutter), env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  color: var(--ink);
  background: var(--paper);
  border: 3px solid var(--ink);
  box-shadow: 0 0 0 1.5px var(--keyline), 4px 4px 0 0 var(--ink);
}
.vol-mute {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: var(--ink);
  border: 0;
  background: none;
  cursor: pointer;
}
.vol-mute:hover, .vol-mute:focus-visible, .vol-mute[aria-pressed="true"] { background: var(--ink); color: var(--paper); outline: none; }
/* the speaker is drawn in whole pixels, like the menu's bars and the logo's voxels */
.vol-mute svg { width: 24px; height: 24px; fill: currentColor; stroke: none; shape-rendering: crispEdges; }
.vol-x { display: none; }
.vol[data-level="0"] .vol-w1, .vol[data-level="0"] .vol-w2, .vol[data-level="1"] .vol-w2 { display: none; }
.vol[data-level="0"] .vol-x { display: inline; }
.vol-range {
  width: 92px;
  height: 26px;
  margin: 0;
  background: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.vol-range:focus-visible { outline: 2px dashed var(--ink); outline-offset: 3px; }
/* the fader's slot: an ink line over a scale of ticks (the loader's faders, smaller) */
.vol-range::-webkit-slider-runnable-track {
  height: 9px;
  border-top: 3px solid var(--ink);
  background: repeating-linear-gradient(90deg, var(--ink) 0 1.5px, transparent 1.5px 10%) top / 100% 5px no-repeat;
}
.vol-range::-moz-range-track {
  height: 9px;
  border-top: 3px solid var(--ink);
  background: repeating-linear-gradient(90deg, var(--ink) 0 1.5px, transparent 1.5px 10%) top / 100% 5px no-repeat;
}
.vol-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 20px;
  margin-top: -11px;
  border: 0;
  border-radius: 0;
  background: var(--ink);
  box-shadow: 0 0 0 1.5px var(--paper), 2px 2px 0 1.5px var(--ink);
}
.vol-range::-moz-range-thumb { width: 10px; height: 20px; border: 0; border-radius: 0; background: var(--ink); box-shadow: 0 0 0 1.5px var(--paper), 2px 2px 0 1.5px var(--ink); }

/* ---------- fallback when WebGL2 is missing ---------- */
.nogl-note { display: none; }
html.nogl .nogl-note {
  display: block;
  position: fixed;
  left: 50%;
  top: 37%;
  width: min(30em, calc(100vw - 2 * var(--gutter)));
  transform: translateX(-50%);
  margin: 0;
  text-align: center;
}
html.nogl .vol { display: none; }

/* ---------- small screens ---------- */
@media (max-width: 640px) {
  .journey { left: auto; right: max(var(--gutter), env(safe-area-inset-right)); transform: none; gap: 10px; }
  .switch { --s: 46px; }
  .readout-beta { font-size: 20px; }
  .readout-state { font-size: 14px; }
  .readout { min-width: 5.2em; }
  .contact { max-width: calc(100vw - 2 * var(--gutter) - 230px); font-size: 17px; padding: 6px 10px 7px; border-width: 3px; }
  .lang { width: 46px; height: 46px; font-size: 19px; filter: url(#lang-ol-s); }
  .lang[aria-pressed="true"]::after { left: 14px; right: 14px; bottom: 6px; }
  .project-desc { max-width: 12em; }
  .vol { top: max(var(--gutter), env(safe-area-inset-top)); left: max(var(--gutter), env(safe-area-inset-left)); right: auto; bottom: auto; }
  .vol-range { width: 64px; }
}
@media (max-width: 420px) {
  .readout { display: none; }
  .contact { font-size: 15px; max-width: calc(100vw - 2 * var(--gutter) - 128px); }
}

@media (prefers-reduced-motion: reduce) {
  .switch-lever, .switch-guard { transition-duration: .01s; }
  html.building .build { animation-duration: .01s !important; }
}

/* ---------- i) the menu: one big button under the logo, a window that draws itself ---------- */
.menu {
  position: fixed;
  z-index: 7;
  left: 50%;
  top: var(--menu-y, 47%);
  width: 0;
  height: 0;
}
.menu-btn {
  position: absolute;
  left: 0;
  top: 0;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 26px 11px 20px;
  font: 800 25px/1 var(--font-ui);
  letter-spacing: .06em;
  color: var(--ink);
  background: var(--paper);
  border: 4px solid var(--ink);
  box-shadow: 0 0 0 1.5px var(--keyline), 5px 5px 0 0 var(--ink);
  cursor: pointer;
  white-space: nowrap;
  transition: transform .12s ease, box-shadow .12s ease, opacity .25s ease;
}
.menu-btn:hover, .menu-btn:focus-visible { transform: translate(calc(-50% - 2px), -2px); box-shadow: 0 0 0 1.5px var(--keyline), 7px 7px 0 0 var(--ink); }
.menu-btn:active { transform: translate(calc(-50% + 3px), 3px); box-shadow: 0 0 0 1.5px var(--keyline), 2px 2px 0 0 var(--ink); }
.menu-bars { display: grid; gap: 4px; }
.menu-bars i { display: block; width: 22px; height: 3px; background: currentColor; }
.menu-bars i:nth-child(2) { width: 15px; }
.menu[data-state="opening"] .menu-btn, .menu[data-state="open"] .menu-btn, .menu[data-state="closing"] .menu-btn { visibility: hidden; pointer-events: none; }
html.voyage .menu { pointer-events: none; }
html.voyage .menu * { pointer-events: none !important; }

.menu-panel, .menu-ghost {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, 0);
  width: min(440px, calc(100vw - 2 * var(--gutter)));
  padding: 46px 22px 22px;
  color: var(--ink);
  background: var(--paper);
  border: 4px solid var(--ink);
  box-shadow: 0 0 0 1.5px var(--keyline), 8px 8px 0 0 var(--ink);
  font-family: var(--font-ui);
}
.menu-ghost { pointer-events: none; mix-blend-mode: difference; background: #fff; color: #000; }
/* while the window draws itself it is an empty box (the button, stretching) */
.menu-panel.drawing { overflow: hidden; }
.menu-panel.drawing > * { visibility: hidden; }
.menu-panel.bar::before {
  content: attr(data-label);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 800 25px/1 var(--font-ui);
  letter-spacing: .06em;
  white-space: nowrap;
}
.menu-x {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  font: 400 34px/1 var(--font-ui);
  color: var(--ink);
  background: var(--paper);
  border: 3px solid var(--ink);
  cursor: pointer;
}
.menu-x span { transform: translateY(-2px); }
.menu-x:hover, .menu-x:focus-visible { background: var(--ink); color: var(--paper); outline: none; }
.menu-list { display: grid; gap: 12px; }
.menu-item {
  position: relative;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 16px 14px;
  text-decoration: none;
  border: 3px solid var(--ink);
  background: var(--paper);
  font: 700 25px/1.05 var(--font-ui);
  letter-spacing: .02em;
}
.menu-soon {
  flex: none;
  padding: 3px 7px 4px;
  font: 500 13px/1 var(--font-ui);
  letter-spacing: .08em;
  text-transform: uppercase;
  border: 1.5px dashed currentColor;
  transform: rotate(-2.5deg);
}
.menu-item:hover, .menu-item:focus-visible { background: var(--ink); color: var(--paper); outline: none; }
html.lite .menu-btn, html.lite .menu-panel { z-index: 8; }

/* ---------- i2) about: the menu's little sibling in the upper-left corner ----------
   Hidden at first; after three seconds of cruising it fades in (in held steps,
   like everything on the sheet) and stays. The window grows out of the button
   the menu's way (js/ui/menu.js), anchored at its left edge, and shoves the
   specimens too. 30% of the width, 50% of the height, the text scrolls. */
.about {
  position: fixed;
  z-index: 7;
  left: max(var(--gutter), env(safe-area-inset-left));
  top: max(var(--gutter), env(safe-area-inset-top));
  width: 0;
  height: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
html.about-on .about {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 2.8s steps(14, end), visibility 0s;
}
.about-btn {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px 7px 10px;
  font: 800 17px/1 var(--font-ui);
  font-variation-settings: "ELSH" 2, "ELGR" 1;
  letter-spacing: .06em;
  color: var(--ink);
  background: var(--paper);
  border: 3px solid var(--ink);
  box-shadow: 0 0 0 1.5px var(--keyline), 3px 3px 0 0 var(--ink);
  cursor: pointer;
  white-space: nowrap;
  transition: transform .12s ease, box-shadow .12s ease;
}
.about-btn:hover, .about-btn:focus-visible { transform: translate(-1px, -1px); box-shadow: 0 0 0 1.5px var(--keyline), 5px 5px 0 0 var(--ink); outline: none; }
.about-btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 1.5px var(--keyline), 1px 1px 0 0 var(--ink); }
/* a pixel "i": a square dot over a stem, in the menu bars' solid ink */
.about-mark { position: relative; display: block; width: 5px; height: 16px; }
.about-mark::before, .about-mark::after { content: ""; position: absolute; left: 0; width: 5px; background: currentColor; }
.about-mark::before { top: 0; height: 4px; }
.about-mark::after { top: 6px; height: 10px; }
.about[data-state="opening"] .about-btn, .about[data-state="open"] .about-btn, .about[data-state="closing"] .about-btn { visibility: hidden; pointer-events: none; }

.about-panel {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(0, 0);
  display: flex;
  flex-direction: column;
  width: max(30vw, 260px);
  height: max(50vh, 240px);
  max-width: calc(100vw - 2 * var(--gutter));
  padding: 38px 6px 12px 16px;
  color: var(--ink);
  background: var(--paper);
  border: 3px solid var(--ink);
  box-shadow: 0 0 0 1.5px var(--keyline), 6px 6px 0 0 var(--ink);
  font-family: var(--font-ui);
}
.about-panel.menu-ghost { pointer-events: none; mix-blend-mode: difference; background: #fff; color: #000; }
.about-panel.drawing { overflow: hidden; }
.about-panel.drawing > * { visibility: hidden; }
.about-panel.bar::before {
  content: attr(data-label);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 800 17px/1 var(--font-ui);
  letter-spacing: .06em;
  white-space: nowrap;
}
.about-x {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  padding: 0;
  font: 400 26px/1 var(--font-ui);
  color: var(--ink);
  background: var(--paper);
  border: 2.5px solid var(--ink);
  cursor: pointer;
}
.about-x span { transform: translateY(-2px); }
.about-x:hover, .about-x:focus-visible { background: var(--ink); color: var(--paper); outline: none; }
.about-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 10px;
  font: 400 15px/1.32 var(--font-ui);
  font-variation-settings: "ELSH" 2, "ELGR" 1;
  letter-spacing: .01em;
  scrollbar-width: thin;
  scrollbar-color: var(--ink) transparent;
}
.about-body::-webkit-scrollbar { width: 6px; }
.about-body::-webkit-scrollbar-thumb { background: var(--ink); }
.about-body:focus-visible { outline: 2px dashed var(--ink); outline-offset: 2px; box-shadow: none; }
.about-body p { margin: 0 0 .7em; }
.about-body b { font-weight: 800; }
.about-lead { font-weight: 600; }
.about-h {
  margin: 1.1em 0 .35em;
  padding-top: .5em;
  border-top: 2px solid var(--ink);
  font: 800 13px/1 var(--font-ui);
  letter-spacing: .14em;
  text-transform: uppercase;
}
.about-links a { font-weight: 800; text-underline-offset: 3px; }
.about-links a:hover { background: var(--ink); color: var(--paper); text-decoration: none; }
html[lang="ja"] .about-h, html[lang="zh"] .about-h { letter-spacing: .06em; }
@media (max-width: 640px) {
  /* the volume box takes the upper-left corner here: about sits just under it */
  .about { top: calc(max(var(--gutter), env(safe-area-inset-top)) + 52px); }
  .about-panel { width: calc(100vw - 2 * var(--gutter)); height: 50vh; }
}

/* ---------- j) the build-in: the page assembles itself over ~4 s after the loader ---------- */
html.building .langs, html.building .journey, html.building .contact, html.building .vol, html.building .menu-btn, html.building .project-name, html.building .project-desc, html.building .project-sub {
  animation: build-in .9s steps(6, end) both;
}
html.building .langs { animation-delay: 1.5s; }
html.building .menu-btn { animation-delay: 2.1s; }
html.building .project-name, html.building .project-desc, html.building .project-sub { animation-delay: 2.5s; }
html.building .journey { animation-delay: 2.8s; }
html.building .contact { animation-delay: 3.2s; }
html.building .vol { animation-delay: 3.5s; }
@keyframes build-in {
  0% { opacity: 0; clip-path: inset(0 100% 0 0); }
  30% { opacity: 1; clip-path: inset(0 70% 0 0); filter: invert(1); }
  45% { filter: none; }
  100% { opacity: 1; clip-path: inset(0 -20px 0 -20px); }
}
html.building .menu-btn { animation-name: build-in-centered; }
@keyframes build-in-centered {
  0% { opacity: 0; clip-path: inset(0 50% 0 50%); }
  40% { opacity: 1; clip-path: inset(0 30% 0 30%); filter: invert(1); }
  55% { filter: none; }
  100% { opacity: 1; clip-path: inset(-20px -20px -20px -20px); }
}

/* ---------- k) the calibration game on the loader ---------- */
.ld-cal {
  display: grid;
  justify-items: center;
  gap: 16px;
  width: min(620px, calc(100vw - 32px));
  padding: 4px 0;
}
.ld-cal[hidden] { display: none; }
.ld-msg { margin: 0; font: 600 23px/1.2 var(--font-ui); text-align: center; letter-spacing: .02em; }
.ld-scope {
  position: relative;
  width: 100%;
  height: clamp(150px, 30vh, 230px);
  background: #060709;
  border: 3px solid var(--ink);
  border-radius: 11px;
  box-shadow: 0 0 0 1.5px var(--keyline), inset 0 0 26px rgba(0, 0, 0, .9);
  overflow: hidden;
}
.ld-scope canvas { display: block; width: 100%; height: 100%; }
.ld-scope::after {        /* glass */
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 3px), radial-gradient(120% 90% at 50% 40%, transparent 60%, rgba(0, 0, 0, .55));
  pointer-events: none;
}
.ld-status {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  text-align: center;
  color: #faf9f6;
  font: 800 34px/1 var(--font-ui);
  letter-spacing: .06em;
  text-shadow: 0 0 12px rgba(255, 31, 143, .8);
  pointer-events: none;
}
.ld-cal.ld-locked .ld-scope { animation: ld-lock .45s ease-out; }
@keyframes ld-lock { 0% { box-shadow: 0 0 0 1.5px var(--keyline), 0 0 0 6px #ff1f8f, inset 0 0 26px rgba(0, 0, 0, .9); } 100% { box-shadow: 0 0 0 1.5px var(--keyline), 0 0 0 0 #ff1f8f, inset 0 0 26px rgba(0, 0, 0, .9); } }
.ld-sliders { display: grid; gap: 12px; width: min(460px, 100%); }
.ld-slider {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "label out" "range range";
  align-items: end;
  gap: 2px 12px;
}
.ld-sl-label { grid-area: label; font: 500 16px/1.1 var(--font-ui); }
.ld-sl-label sub { font-size: .75em; }
.ld-slider output { grid-area: out; font: 700 19px/1 var(--font-ui); font-variant-numeric: tabular-nums; letter-spacing: .03em; }
.ld-slider input {
  grid-area: range;
  width: 100%;
  height: 34px;
  margin: 0;
  background: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  touch-action: none;
}
/* the fader's slot: an ink line with a scale of ticks */
.ld-slider input::-webkit-slider-runnable-track {
  height: 14px;
  border-top: 3px solid var(--ink);
  background: repeating-linear-gradient(90deg, var(--ink) 0 1.5px, transparent 1.5px 5%) top / 100% 7px no-repeat;
}
.ld-slider input::-moz-range-track {
  height: 14px;
  border-top: 3px solid var(--ink);
  background: repeating-linear-gradient(90deg, var(--ink) 0 1.5px, transparent 1.5px 5%) top / 100% 7px no-repeat;
}
.ld-slider input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 30px;
  margin-top: -17px;
  background: var(--ink) linear-gradient(#ff1f8f, #ff1f8f) center / 3px 60% no-repeat;
  border: 2px solid var(--paper);
  box-shadow: 0 0 0 1.5px var(--ink), 3px 3px 0 0 var(--ink);
}
.ld-slider input::-moz-range-thumb {
  width: 14px;
  height: 28px;
  border-radius: 0;
  background: var(--ink) linear-gradient(#ff1f8f, #ff1f8f) center / 3px 60% no-repeat;
  border: 2px solid var(--paper);
  box-shadow: 0 0 0 1.5px var(--ink), 3px 3px 0 0 var(--ink);
}
.ld-slider input:focus-visible { outline: 2px dashed var(--ink); outline-offset: 4px; }
.ld-wasm { margin: 0; font: 500 18px/1 var(--font-ui); font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.ld-wasm-n { display: inline-block; min-width: 2ch; text-align: right; font-weight: 800; }
.ld-skip {
  margin-top: 2px;
  padding: 5px 13px 6px;
  font: 500 15px/1 var(--font-ui);
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  cursor: pointer;
}
.ld-skip:hover, .ld-skip:focus-visible { background: var(--ink); color: var(--paper); outline: none; }
.ld-spin-cal { display: none; margin: 20px 0 22px; }
.loader[data-phase="final"] .ld-sliders, .loader[data-phase="done"] .ld-sliders,
.loader[data-phase="final"] .ld-skip, .loader[data-phase="done"] .ld-skip { display: none; }
.loader[data-phase="final"] .ld-spin-cal { display: block; }
.loader[data-phase="done"] .ld-spin-cal { display: block; visibility: hidden; }
.loader[data-phase="hold"] .ld-sliders { opacity: .35; pointer-events: none; }
@media (max-width: 520px) {
  .ld-msg { font-size: 19px; }
  .ld-sl-label { font-size: 14px; }
}

/* ---------- l) the light version: static drawings, no WebGL ---------- */
.lite-paper, .lite-full { display: none; }
html.lite #stage { display: none; }
html.lite .lite-paper {
  display: block;
  position: fixed;
  inset: 0;
  background: var(--paper) url(../img/lite/paper.webp) center / cover no-repeat;
}
html.lite .brand {
  left: 50%;
  top: max(84px, 20vh);
  width: min(78vw, 820px);
  height: min(19vw, 200px);
  background: url(../img/lite/logo.webp) center / contain no-repeat;
}
html.lite .marquee { top: max(84px, 20vh); }
html.lite .projects {
  position: fixed;
  inset: auto 0 auto 0;
  top: calc(max(84px, 20vh) + min(19vw, 200px) + 90px);
  display: flex;
  justify-content: space-between;
  padding: 0 max(var(--gutter), 6vw);
  pointer-events: none;
}
html.lite .project { position: static; transform: none; opacity: 1; }
html.lite .project-hit { background: center / contain no-repeat; }
html.lite .project[data-kind="cymatic"] .project-hit { background-image: url(../img/lite/cymatic.webp); }
html.lite .project[data-kind="mobius"] .project-hit { background-image: url(../img/lite/mobius.webp); }
html.lite .project[data-kind="calabi"] .project-hit { background-image: url(../img/lite/calabi.webp); }
html.lite .project[data-kind="calabi"] { position: fixed; left: max(var(--gutter), 3vw); top: max(var(--gutter), 24vh); --r: 46px; }
html.lite .project { --r: 64px; }
html.lite .menu { top: calc(max(84px, 20vh) + min(19vw, 200px) / 2 + 30px); }
html.lite .journey, html.lite .vol { display: none; }
html.lite .lang {
  filter: none;
  background: #000;
  color: #fff;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #000;
  text-shadow: none;
  margin: 0 2px;
}
html.lite .lang[aria-pressed="true"]::after { background: #fff; box-shadow: none; }
html.lite .lite-full {
  display: block;
  position: fixed;
  z-index: 5;
  right: max(var(--gutter), env(safe-area-inset-right));
  bottom: max(var(--gutter), env(safe-area-inset-bottom));
  padding: 4px 11px 5px;
  font: 500 14px/1 var(--font-ui);
  text-decoration: none;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
}
html.lite .lite-full:hover { background: var(--ink); color: var(--paper); }
html.lite.nogl .lite-full { display: none; }
@media (max-width: 640px) {
  html.lite .projects {
    display: grid;
    grid-template-columns: 1fr 1fr;
    justify-items: center;
    row-gap: 14px;
    top: calc(max(84px, 20vh) + min(19vw, 200px) + 92px);
    padding: 0 var(--gutter);
  }
  html.lite .project { --r: 44px; }
  html.lite .project[data-kind="calabi"] { position: static; grid-column: 1 / -1; --r: 40px; }
  html.lite .project-desc { max-width: 11em; }
}
html.lite .brand { color: transparent; text-shadow: none; }
html.lite .project-hit { display: block; }
html.lite.nogl .nogl-note { top: auto; bottom: 64px; font-size: 14px; opacity: .7; }
@media (orientation: portrait) { html.lite .lite-paper { background-image: url(../img/lite/paper-portrait.webp); } }
