/* 3d-splash.css: splash.html, the 3D intro.
   The page is a finished static layout by default (no JS, no WebGL). The hidden-until-revealed states exist only under
   html.js-splash, and html.splash-failsafe lifts them if splash.js never starts. WebGL scene: assets/js/3d/splash.js. */

:root {
  --bg: #070807;
  --bg-2: #0c0e0c;
  --ink: #ece7d8;
  --ink-dim: #a29d8e;
  --ink-faint: #7f7b6e;
  --accent: #d6ff3c;
  --accent-2: #7ee0c6;
  --line: rgba(214, 255, 60, 0.14);
  --line-strong: rgba(232, 228, 214, 0.12);
  --font-sans: "Instrument Sans", system-ui, sans-serif;
  --font-serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; background: var(--bg); }
body {
  color: var(--ink);
  font-family: var(--font-sans);
  letter-spacing: -0.011em;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  touch-action: pinch-zoom;                      /* one finger orbits the name, a pinch still zooms the page */
  overscroll-behavior: none;
}
body::before {                                   /* film grain, same as the site */
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 80;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
::selection { background: var(--accent); color: #11150a; }
a { color: inherit; text-decoration: none; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip { position: absolute; left: 12px; top: -48px; background: var(--accent); color: #111; padding: 8px 12px; z-index: 200; font-family: var(--font-mono); font-size: 12px; border-radius: 6px; }
.skip:focus { top: 56px; left: max(32px, env(safe-area-inset-left, 0px)); outline: 2px solid var(--ink); outline-offset: 2px; }

/* ---------- layers ---------- */
#stage { position: fixed; left: 0; top: 0; width: 100%; height: 100%; z-index: 0; display: block; pointer-events: none; }
html:not(.js-splash) #stage, html.no-webgl #stage, html.splash-failsafe:not(.gl) #stage { display: none; }
#field2d { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }

/* the quiet backdrop of the flat page (no WebGL): a soft glow and a big outlined monogram */
.ghost {
  position: fixed; left: -4vw; top: 50%;
  font-family: var(--font-serif);
  font-size: 42vw; line-height: 1;
  letter-spacing: -0.04em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(236, 231, 216, 0.06);
  white-space: nowrap;
  pointer-events: none; z-index: 1;
  transform: translateY(-50%);
  display: none;
}
html:not(.js-splash) .ghost, html.no-webgl .ghost, html.splash-failsafe:not(.gl) .ghost { display: block; }
html:not(.js-splash) body, html.no-webgl body, html.splash-failsafe:not(.gl) body {
  background: radial-gradient(70vmax 70vmax at 50% 55%, rgba(214, 255, 60, 0.07), rgba(126, 224, 198, 0.03) 35%, transparent 62%), var(--bg);
}

.corner {
  position: fixed; width: 22px; height: 22px; z-index: 5;
  border: 1px solid var(--accent);
  pointer-events: none;
}
.corner.tl { left: max(18px, env(safe-area-inset-left, 0px)); top: max(18px, env(safe-area-inset-top, 0px)); border-right: 0; border-bottom: 0; }
.corner.tr { right: max(18px, env(safe-area-inset-right, 0px)); top: max(18px, env(safe-area-inset-top, 0px)); border-left: 0; border-bottom: 0; }
.corner.bl { left: max(18px, env(safe-area-inset-left, 0px)); bottom: max(18px, env(safe-area-inset-bottom, 0px)); border-right: 0; border-top: 0; }
.corner.br { right: max(18px, env(safe-area-inset-right, 0px)); bottom: max(18px, env(safe-area-inset-bottom, 0px)); border-left: 0; border-top: 0; }

.cursor {
  position: fixed; left: 0; top: 0;
  width: 10px; height: 10px; margin: -5px 0 0 -5px;
  border-radius: 50%; background: var(--accent);
  pointer-events: none; z-index: 95; mix-blend-mode: difference;
  opacity: 0;
}
.cursor-ring {
  position: fixed; left: 0; top: 0;
  width: 36px; height: 36px; margin: -18px 0 0 -18px;
  border-radius: 50%; border: 1px solid rgba(214, 255, 60, 0.6);
  pointer-events: none; z-index: 95;
  opacity: 0;
}
html.has-cursor body { cursor: none; }
html.has-cursor .cursor, html.has-cursor .cursor-ring { opacity: 1; }          /* has-cursor is set on the first mouse move */
html.has-cursor a { cursor: none; }

/* ---------- preloader ---------- */
.pre {
  position: fixed; inset: 0; z-index: 60;
  display: none; place-items: center;
  pointer-events: none;
}
html.js-splash .pre { display: grid; }
html.js-splash.splash-failsafe .pre, html.js-splash.pre-done .pre { display: none; }
html.js-splash.no-webgl .pre { background: var(--bg); }      /* the flat page slides a panel away, as the 2D splash does */
.pre .big {
  font-family: var(--font-serif);
  font-size: clamp(60px, 12vw, 170px);
  line-height: 1; letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.pre .big small { font-size: 0.35em; color: var(--accent); vertical-align: top; margin-left: 0.1em; }
.digits { display: inline-flex; vertical-align: baseline; }
.dcell { position: relative; display: inline-block; width: 0.6em; height: 1em; line-height: 1; text-align: center; overflow: hidden; }
.dcell.lead { opacity: 0.14; }
.dcell.roll { -webkit-mask-image: linear-gradient(transparent 0, #000 18%, #000 82%, transparent 100%); mask-image: linear-gradient(transparent 0, #000 18%, #000 82%, transparent 100%); }
.dcell .strip { display: block; will-change: transform; }
.dcell .strip span { display: block; height: 1em; line-height: 1; }
.dcell.flip { overflow: visible; margin: 0 0.02em; }
.dcell .half { position: absolute; left: 0; right: 0; height: 50%; overflow: hidden; background: var(--bg-2); backface-visibility: hidden; }
.dcell .half.t { top: 0; border-radius: 0.05em 0.05em 0 0; transform-origin: 50% 100%; }
.dcell .half.b { bottom: 0; border-radius: 0 0 0.05em 0.05em; transform-origin: 50% 0; }
.dcell .half span { position: absolute; left: 0; right: 0; height: 200%; line-height: 1; text-align: center; }
.dcell .half.t span { top: 0; }
.dcell .half.b span { bottom: 0; }
.dcell .flap { visibility: hidden; }
.dcell.flip::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 0.012em; min-height: 2px; transform: translateY(-50%); background: var(--bg); z-index: 5; }
.pre .tag {
  position: absolute; left: 32px; bottom: 28px;
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-dim);
}
.pre .tag i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: 10px; }
.pre .hl, .pre .vl { position: absolute; background: var(--line-strong); }
.pre .hl { left: 0; right: 0; height: 1px; transform: scaleX(0); }
.pre .vl { top: 0; bottom: 0; width: 1px; transform: scaleY(0); }
.pre .hl.a { top: 20%; transform-origin: left; }
.pre .hl.b { top: 80%; transform-origin: right; }
.pre .vl.a { left: 20%; transform-origin: top; }
.pre .vl.b { left: 80%; transform-origin: bottom; }

/* ---------- the page ---------- */
.splash {
  position: fixed; inset: 0; z-index: 10;
  display: grid; grid-template-rows: auto 1fr auto;
  padding: calc(28px + env(safe-area-inset-top, 0px)) max(32px, env(safe-area-inset-right, 0px)) 52px max(32px, env(safe-area-inset-left, 0px));
  pointer-events: none;
}
.splash a, .splash .enter { pointer-events: auto; }

.bar {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-dim);
  position: relative; z-index: 3;
}
.bar b { color: var(--accent); font-weight: 500; }
.bar .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2); margin-right: 10px; vertical-align: middle; }

.centre {
  position: relative; z-index: 3;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  width: 100%; margin: 0 auto;
  text-align: center;
  min-height: 0;
}
.kicker {
  font-family: var(--font-mono); font-size: 12px;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent-2);
  margin-bottom: clamp(8px, 2.2vh, 24px); display: flex; align-items: center; justify-content: center; gap: 14px;
}
.kicker .rule { display: inline-block; width: 48px; height: 1px; background: var(--accent-2); transform-origin: right center; }
.kicker .rule.r { transform-origin: left center; }

/* the name. In the 3D scene this is only the slot the real letters are fitted to, its text is transparent. */
h1 {
  margin: 0; font-family: var(--font-serif); font-weight: 400;
  font-size: clamp(64px, min(18vw, 30vh), 340px);
  line-height: 0.92; letter-spacing: -0.025em;
  width: fit-content; max-width: 100%;
}
h1 .line { display: block; padding-bottom: 0.06em; }
h1 .word { display: inline-block; }
h1 .char { display: inline-block; will-change: transform, opacity; }
h1 .char.hot { color: var(--accent-2); text-shadow: 0 0 22px rgba(126, 224, 198, 0.6); }
h1 em { font-style: italic; color: var(--accent); }
h1 em .char.hot { color: var(--ink); text-shadow: 0 0 22px rgba(236, 231, 216, 0.5); }
html.js-splash:not(.dom-name):not(.splash-failsafe) h1, html.js-splash:not(.dom-name):not(.splash-failsafe) h1 em { color: transparent; user-select: none; }

.rail { display: flex; flex-direction: column; align-items: flex-start; text-align: left; max-width: min(400px, 27vw); }
.sub {
  margin: 0; font-size: clamp(15px, 1.3vw, 19px);
  color: var(--ink-dim); line-height: 1.5;
}
.sub strong { color: var(--ink); font-weight: 500; }
.sub .row { display: block; overflow: hidden; }
.sub .row > span { display: block; }
.stance {
  margin: clamp(10px, 1.6vh, 16px) 0 0; font-family: var(--font-serif); font-style: italic;
  font-size: clamp(21px, 1.95vw, 28px); line-height: 1.12; color: var(--ink);
}
.stance .w { display: inline-block; white-space: pre; }

/* ---------- bottom ---------- */
.foot { position: relative; z-index: 3; display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.enter {
  display: inline-flex; align-items: center; gap: 18px;
  font-family: var(--font-mono); font-size: 12px;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink);
  padding: 10px 0; margin-top: clamp(4px, 1.2vh, 14px);
}
.enter .ring { position: relative; width: 64px; height: 64px; display: grid; place-items: center; }
.enter .ring svg.orbit { position: absolute; inset: 0; width: 100%; height: 100%; }
.enter .ring svg.orbit circle { fill: none; stroke: var(--accent); stroke-width: 1; stroke-dasharray: 6 10; opacity: 0.7; }
.enter .ring svg.orbit circle.inner { stroke: rgba(232, 228, 214, 0.28); stroke-dasharray: none; }
.enter .ring svg.arrow { width: 18px; height: 18px; stroke: var(--accent); fill: none; stroke-width: 1.5; }
.enter .label { position: relative; overflow: hidden; display: inline-block; }
.enter .label span { display: block; transition: transform 0.5s var(--ease); }
.enter .label span.b { position: absolute; left: 0; top: 100%; color: var(--accent); }
.enter:hover .label span.a, .enter:focus-visible .label span.a { transform: translateY(-100%); }
.enter:hover .label span.b, .enter:focus-visible .label span.b { transform: translateY(-100%); }
.enter:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; border-radius: 40px; }
html.js-splash:not(.live):not(.splash-failsafe) .enter { pointer-events: none; }      /* not clickable while the loader runs */

/* the always-on loops are CSS (splash.js sets html.idle once the name has settled, html.idle-calm for calm / reduced motion) */
@keyframes spin  { to { transform: rotate(360deg); } }
@keyframes spinr { to { transform: rotate(-360deg); } }
@keyframes nudge { 50% { transform: translateX(4px); } }
@keyframes cpulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0.2; } }
html.idle .enter .orbit circle { transform-box: fill-box; transform-origin: center; }
html.idle .enter .orbit .outer { animation: spin 12s linear infinite; }
html.idle .enter .orbit .inner { animation: spinr 20s linear infinite; }
html.idle-calm .enter .orbit .outer { animation-duration: 40s; }
html.idle-calm .enter .orbit .inner { animation-duration: 60s; }
html.idle:not(.idle-calm) .enter .arrow { animation: nudge 1.8s ease-in-out infinite; }
html.idle:not(.idle-calm) .corner { animation: cpulse 2.8s ease-in-out infinite; }
html.idle:not(.idle-calm) .corner.tr { animation-delay: 0.35s; }
html.idle:not(.idle-calm) .corner.bl { animation-delay: 0.7s; }
html.idle:not(.idle-calm) .corner.br { animation-delay: 1.05s; }
html.idle:not(.idle-calm) .bar .dot { animation: blink 1.4s steps(1) infinite; }

.progress {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-faint);
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
}
.progress .track { width: 160px; height: 1px; background: var(--line-strong); position: relative; overflow: hidden; }
.progress .fill { position: absolute; inset: 0; background: var(--accent); transform-origin: left; transform: scaleX(1); }
.progress .num { color: var(--ink-dim); font-variant-numeric: tabular-nums; }

.ticker {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 2;
  border-top: 1px solid var(--line-strong);
  padding: 10px 0; overflow: hidden;
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-dim);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 64px, #000 calc(100% - 64px), transparent 100%);      /* the words fade out before the corner brackets */
  mask-image: linear-gradient(90deg, transparent 0, #000 64px, #000 calc(100% - 64px), transparent 100%);
}
.ticker .track { display: flex; gap: 48px; white-space: nowrap; width: max-content; animation: tick 70s linear infinite; }
.ticker b { color: var(--accent-2); font-weight: 500; }
.ticker span::after { content: "·"; margin-left: 48px; color: var(--ink-faint); }
@keyframes tick { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker .track { animation-duration: 220s; } }
html[data-calm] .ticker .track { animation-duration: 220s; }

/* ---------- exit layers ---------- */
.flash {
  position: fixed; inset: 0; z-index: 70; pointer-events: none; opacity: 0;
  background: radial-gradient(60vmax 60vmax at 50% 46%, rgba(244, 255, 180, 0.95), rgba(214, 255, 60, 0.55) 30%, rgba(214, 255, 60, 0) 70%);
}
.veil { position: fixed; inset: 0; z-index: 92; pointer-events: none; opacity: 0; background: #000; }
.curtain { position: fixed; inset: 0; z-index: 90; pointer-events: none; display: none; grid-template-columns: repeat(var(--bars, 26), 1fr); }
html.no-webgl .curtain { display: grid; }
.curtain span { background: var(--accent); transform: scaleY(0); transform-origin: bottom; margin-inline: -0.5px; }
.curtain span:nth-child(even) { background: var(--bg-2); }

/* ---------- hidden-until-revealed states (only when splash.js runs) ---------- */
html.js-splash .bar > *, html.js-splash .kicker, html.js-splash .stance, html.js-splash .enter,
html.js-splash .progress, html.js-splash .ticker, html.js-splash .corner, html.js-splash .ghost { opacity: 0; }
html.js-splash .kicker .rule { transform: scaleX(0); }
html.js-splash .sub .row > span { transform: translateY(110%); }
html.js-splash.splash-failsafe .bar > *, html.js-splash.splash-failsafe .kicker, html.js-splash.splash-failsafe .stance,
html.js-splash.splash-failsafe .enter, html.js-splash.splash-failsafe .progress, html.js-splash.splash-failsafe .ticker,
html.js-splash.splash-failsafe .corner { opacity: 1; }
html.js-splash.splash-failsafe .kicker .rule { transform: none; }
html.js-splash.splash-failsafe .sub .row > span { transform: none; }

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  .rail { max-width: none; width: 100%; }
  .foot { position: relative; }
  .progress { position: absolute; right: 0; bottom: 16px; }
  .foot::before {                                   /* a quiet floor under the text, so the mirrored floor never competes with it */
    content: ""; position: absolute; left: -32px; right: -32px; top: -96px; bottom: -12px; z-index: -1; pointer-events: none;
    background: linear-gradient(to top, rgba(7, 8, 7, 0.96) 35%, rgba(7, 8, 7, 0.7) 70%, rgba(7, 8, 7, 0));
  }
  .sub, .stance { text-shadow: 0 0 14px rgba(7, 8, 7, 0.95); }
}
@media (min-width: 641px) and (max-width: 900px) and (orientation: portrait) {
  h1 { font-size: clamp(96px, min(24vw, 26vh), 230px); }        /* tablets held upright: the name uses the width */
}
@media (max-width: 640px) {
  .splash { padding: calc(20px + env(safe-area-inset-top, 0px)) max(18px, env(safe-area-inset-right, 0px)) calc(48px + env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px)); }
  .corner { width: 14px; height: 14px; }
  .corner.tl { left: max(6px, env(safe-area-inset-left, 0px)); top: max(6px, env(safe-area-inset-top, 0px)); }
  .corner.tr { right: max(6px, env(safe-area-inset-right, 0px)); top: max(6px, env(safe-area-inset-top, 0px)); }
  .corner.bl { left: max(6px, env(safe-area-inset-left, 0px)); bottom: max(6px, env(safe-area-inset-bottom, 0px)); }
  .corner.br { right: max(6px, env(safe-area-inset-right, 0px)); bottom: max(6px, env(safe-area-inset-bottom, 0px)); }
  .bar { font-size: 12px; letter-spacing: 0.14em; }
  .bar .mid { display: none; }
  .kicker { font-size: 12px; gap: 10px; }
  .kicker .rule { width: 26px; }
  .ticker { font-size: 12px; }
  h1 { font-size: clamp(64px, min(26vw, 20vh), 150px); }
  .sub { font-size: 16px; }
  .stance { font-size: 23px; }
  .enter .ring { width: 54px; height: 54px; }
  .progress .track { width: 96px; }
  .pre .tag { left: 18px; bottom: 22px; }
  .ghost { font-size: 70vw; }
  .foot::before { left: -18px; right: -18px; }
}
@media (max-height: 760px) and (min-width: 901px) {
  .sub { font-size: 15px; }
  .stance { font-size: 21px; margin-top: 8px; }
  .enter { padding: 4px 0; }
  .enter .ring { width: 52px; height: 52px; }
}
@media (max-height: 560px) {
  .splash { padding-top: calc(14px + env(safe-area-inset-top, 0px)); padding-bottom: 42px; }
  .corner { width: 16px; height: 16px; }
  .corner.tl, .corner.tr { top: 6px; }
  .corner.bl, .corner.br { bottom: 6px; }
  .kicker { display: none; }
  h1 { font-size: clamp(48px, min(22vh, 30vw), 160px); }
  .sub { font-size: 13px; line-height: 1.35; }
  .stance { margin-top: 4px; font-size: 17px; }
  .enter { padding: 2px 0; margin-top: 2px; }
  .enter .ring { width: 40px; height: 40px; }
  .progress { display: none; }
}
@media (max-height: 560px) and (orientation: landscape) { .rail { max-width: min(330px, 40vw); } }
@media (hover: none) { .cursor, .cursor-ring { display: none; } }

/* Windows high contrast and other forced-colour modes: no canvas, the real text of the name carries the page */
@media (forced-colors: active) {
  #stage, .ghost, .cursor, .cursor-ring { display: none; }
  html.js-splash:not(.dom-name):not(.splash-failsafe) h1, html.js-splash:not(.dom-name):not(.splash-failsafe) h1 em { color: CanvasText; user-select: auto; }
}
