:root {
  color-scheme: dark;
  --bg: #05070d;
  --ink: #ece6d8;
  --muted: #8c8a80;
  --line: #2a2f3d;
  --accent: #ffb547;
  --accent-2: #5cc8ff;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); transition: border-color .15s; }
a:hover, a:focus-visible { border-bottom-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(56px, 11vw, 120px);
  letter-spacing: -0.03em;
  line-height: 0.95;
  text-transform: lowercase;
}

/* 404 */
body.notfound { display: grid; place-items: center; text-align: center; padding: 0 16px; }
body.notfound main { padding: 2rem 0; }

/* Home */
#scene {
  position: fixed; inset: 0; width: 100%; height: 100%;
  display: block; z-index: 0;
}
#scene-fallback {
  display: none;
  position: fixed; left: 0; top: 0; width: 100%; height: 70%;
  z-index: 0; padding: 0 16px;
}
html[data-webgl="no"] #scene { display: none; }
html[data-webgl="no"] #scene-fallback { display: block; }

body.home main { position: relative; z-index: 1; pointer-events: none; }
.stage {
  position: fixed; inset: 0; z-index: 1;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  padding: 0 clamp(16px, 4vw, 56px) clamp(20px, 4vh, 44px);
  pointer-events: none;
}
.stage::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 45%;
  background: linear-gradient(to bottom, transparent, rgba(5, 7, 13, .7));
  z-index: -1; pointer-events: none;
}
.intro, .corner { pointer-events: none; }
.subtitle { margin: 14px 0 0; font-size: clamp(18px, 2.4vw, 22px); color: var(--ink); }
.caption {
  margin: 10px 0 0; max-width: 64em;
  font: 12px/1.7 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.links { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 0; }
.links li + li::before { content: "\00b7"; color: var(--muted); margin: 0 .7em; }
.links a { pointer-events: auto; padding-bottom: 1px; }

.corner { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; flex: none; }
.copy { margin: 0; font: 12px/1 var(--mono); letter-spacing: .08em; color: var(--muted); }
.sound {
  pointer-events: auto;
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; min-width: 44px; padding: 0 18px;
  background: transparent; color: var(--ink);
  border: 1px solid var(--line); border-radius: 999px;
  font: 13px/1 system-ui, sans-serif; letter-spacing: .04em; cursor: pointer;
  transition: border-color .2s, color .2s;
}
.sound:hover { border-color: var(--muted); }
.sound[data-wanted] { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.sound[data-on] { border-color: var(--accent); color: var(--accent); }
.sound .wave { opacity: .35; }
.sound[data-on] .wave { opacity: 1; }

@media (max-width: 640px) {
  .stage { flex-direction: column; align-items: stretch; justify-content: flex-end; gap: 18px; padding: 0 16px 20px; }
  .stage::before { height: 55%; }
  .corner { flex-direction: row; align-items: center; justify-content: space-between; }
  .caption { font-size: 11px; }
}

/* Inner pages (/made/ and entries) */
body.inner .banner { display: block; width: 100%; height: 72px; }
@media (max-width: 480px) { body.inner .banner { height: clamp(56px, 15vw, 72px); } }
.banner .baseline, .banner .tick-major, .banner .tick-minor {
  stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke;
}
.banner .tick-major { stroke-width: 1.4; }
.banner .trace {
  fill: none; stroke: var(--accent); stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke;
}
.banner .rim { fill: none; stroke: var(--muted); stroke-width: 1.4; opacity: .6; vector-effect: non-scaling-stroke; }
.banner .spoke { stroke: var(--muted); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.banner .marker, .banner .dot { fill: var(--accent); }

body.inner .masthead, body.inner .column { max-width: 720px; margin: 0 auto; padding: 0 16px; }
body.inner .masthead { padding-top: 20px; }
.wordmark {
  font: 500 28px/1 var(--serif); letter-spacing: -0.02em; text-transform: lowercase;
  border-bottom: 0;
}
.wordmark:hover, .wordmark:focus-visible { color: var(--accent); }
body.inner h1 { margin: 48px 0 0; font-size: clamp(40px, 8vw, 64px); text-transform: none; }
body.inner .prose { margin-top: 20px; color: var(--muted); font-size: 18px; }
body.inner .prose p { margin: 0 0 1em; }
body.inner .prose a { color: var(--ink); }

.made { list-style: none; margin: 32px 0 0; padding: 0; border-top: 1px solid var(--line); }
.made li { padding: 24px 0; border-bottom: 1px solid var(--line); }
.made h2 { margin: 0; font-size: 18px; font-weight: 600; line-height: 1.35; }
.made h2 a { color: var(--ink); }
.made .desc { margin: 6px 0 0; color: var(--muted); }
.meta {
  display: flex; flex-wrap: wrap; gap: 4px 0; margin: 10px 0 0;
  font: 12px/1.6 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}
.meta > * + *::before { content: "\00b7"; color: var(--muted); margin: 0 .8em; display: inline-block; }
.meta a { color: var(--muted); }
.meta a:hover, .meta a:focus-visible { color: var(--ink); }
body.inner .column > .meta { margin-top: 14px; }
.back { margin: 40px 0 0; }

.foot { margin: 72px 0 0; padding: 24px 0 40px; border-top: 1px solid var(--line); }
.foot .links { margin: 0; font-size: 15px; }
.foot .copy { margin-top: 16px; }
