/* H0 — mint on deep water. Every colour here was measured on the published PFP and banner. */
:root {
  --abyss: #050d10;
  --water: #0b1a1f;
  --water-2: #101f25;
  --weed: #103030;
  --weed-lit: #183838;
  --mint: #90f7e2;
  --mint-deep: #64c8b0;
  --ink: #d6f3ec;
  --dim: #7ba7a1;
  --dimmer: #4e736f;
  --panel: rgba(7, 21, 25, 0.76);
  --line: rgba(144, 247, 226, 0.14);
  --line-2: rgba(144, 247, 226, 0.28);
  --pixel: "Silkscreen", ui-monospace, monospace;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace;
  --ladder: 112px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--abyss);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body { overflow-x: hidden; }

#stage {
  position: fixed;
  inset: 0;
  z-index: 0;
}
#stage canvas { display: block; width: 100%; height: 100%; }
#stage.no-webgl {
  background:
    radial-gradient(120% 70% at 50% 0%, #15383b 0%, #0b1a1f 45%, #050d10 100%);
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    /* a veil over the third of the screen the text runs through, so the column reads without
       flattening the water on the other side */
    linear-gradient(90deg, rgba(5, 13, 16, 0.62) 0%, rgba(5, 13, 16, 0.5) 52%, transparent 82%),
    radial-gradient(130% 90% at 50% 10%, transparent 45%, rgba(5, 13, 16, 0.6) 100%),
    linear-gradient(180deg, rgba(5, 13, 16, 0.6) 0%, transparent 16%);
}

/* ── top bar ─────────────────────────────────────────────────────────────── */
.top {
  position: fixed;
  z-index: 4;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  backdrop-filter: blur(10px);
  background: linear-gradient(180deg, rgba(5, 13, 16, 0.82), rgba(5, 13, 16, 0));
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand img { width: 46px; height: auto; image-rendering: pixelated; display: block; }
.brand .tag {
  font-family: var(--pixel);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--dim);
  text-transform: lowercase;
}
.top .spacer { flex: 1; }

.pill {
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  border: 1px solid var(--line);
  padding: 5px 10px;
  white-space: nowrap;
}
.pill b { color: var(--mint-deep); font-weight: 400; }

a.btn { text-decoration: none; display: inline-block; }
button, .btn {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--abyss);
  background: var(--mint);
  border: 0;
  padding: 9px 16px;
  cursor: pointer;
  box-shadow: 3px 3px 0 rgba(144, 247, 226, 0.22);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
button:hover, .btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 rgba(144, 247, 226, 0.3); }
button:active { transform: translate(2px, 2px); box-shadow: 0 0 0 rgba(0,0,0,0); }
button.ghost {
  background: transparent;
  color: var(--mint);
  border: 1px solid var(--line-2);
  box-shadow: none;
}
button:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

/* ── the depth ladder: the navigation IS the water column ────────────────── */
.ladder {
  position: fixed;
  z-index: 3;
  left: 0; top: 0; bottom: 0;
  width: var(--ladder);
  padding: 92px 0 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
}
.ladder::before {
  content: "";
  position: absolute;
  right: 23.5px;
  top: 100px;
  bottom: 40px;
  width: 1px;
  background: linear-gradient(180deg, var(--line-2), rgba(144, 247, 226, 0.05));
}
.rung {
  pointer-events: auto;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  padding-right: 32px;
  text-decoration: none;
  color: var(--dimmer);
  font-family: var(--pixel);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: lowercase;
}
.rung .m {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dimmer);
  opacity: 0.7;
}
.rung::after {
  content: "";
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 7px; height: 7px;
  background: var(--weed-lit);
  outline: 1px solid rgba(144, 247, 226, 0.18);
}
.rung:hover { color: var(--mint-deep); }
.rung:hover::after { background: var(--mint-deep); }
.rung[aria-current="page"] { color: var(--mint); }
.rung[aria-current="page"]::after {
  background: var(--mint);
  box-shadow: 0 0 12px rgba(144, 247, 226, 0.8);
}

/* ── content ─────────────────────────────────────────────────────────────── */
main {
  position: relative;
  z-index: 2;
  margin-left: var(--ladder);
  padding: 104px 32px 88px;
  max-width: 860px;
}

h1, h2, h3 { font-family: var(--pixel); font-weight: 400; letter-spacing: 0.02em; }
h1 { font-size: 30px; line-height: 1.25; margin: 0 0 10px; color: var(--mint); }
h2 { font-size: 15px; margin: 0 0 14px; color: var(--mint-deep); letter-spacing: 0.1em; text-transform: lowercase; }
h3 { font-size: 12.5px; margin: 0 0 8px; color: var(--dim); letter-spacing: 0.1em; }
p { margin: 0 0 14px; color: var(--ink); max-width: 62ch; }
.lede { font-size: 17px; line-height: 1.55; color: var(--ink); }
.dim { color: var(--dim); }
a { color: var(--mint-deep); }

.panel {
  background: var(--panel);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  padding: 22px;
  margin: 0 0 20px;
  position: relative;
}
.panel::before, .panel::after {
  content: "";
  position: absolute;
  width: 5px; height: 5px;
  background: var(--mint);
  opacity: 0.5;
}
.panel::before { top: -1px; left: -1px; }
.panel::after { bottom: -1px; right: -1px; }

/* the one big number, then a register of lines — never a row of four tiles */
.reading { display: flex; align-items: baseline; gap: 10px; }
.reading .n {
  font-family: var(--pixel);
  font-size: 58px;
  line-height: 1;
  color: var(--mint);
  text-shadow: 0 0 26px rgba(144, 247, 226, 0.4);
}
.reading .u { font-family: var(--pixel); font-size: 17px; color: var(--mint-deep); }
.reading .n.empty { font-family: var(--mono); font-size: 26px; color: var(--dim); text-shadow: none; position: relative; top: -8px; }
.reading-label {
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  margin: 6px 0 0;
}

.register { border-top: 1px solid var(--line); }
.register .row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.register .row .k { color: var(--dim); }
.register .row .v { color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.register .row .v.mint { color: var(--mint-deep); }

.steps { counter-reset: s; margin: 0; padding: 0; list-style: none; }
.steps li {
  counter-increment: s;
  position: relative;
  padding: 0 0 18px 42px;
  border-left: 1px solid var(--line);
  margin-left: 9px;
}
.steps li:last-child { border-left-color: transparent; padding-bottom: 0; }
.steps li::before {
  content: counter(s, decimal-leading-zero);
  position: absolute;
  left: -10px; top: 0;
  width: 20px; height: 20px;
  display: grid; place-items: center;
  background: var(--water);
  border: 1px solid var(--line-2);
  font-family: var(--pixel);
  font-size: 9px;
  color: var(--mint-deep);
}
.steps b { color: var(--mint-deep); font-weight: 400; }

.flow {
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--dim);
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 0 0 18px;
  overflow-x: auto;
  white-space: nowrap;
}
.flow b { color: var(--mint); font-weight: 400; }

/* tabs inside the Veil tool: switching one MOVES THE CAMERA, it does not reload a page */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin: 0 0 20px; flex-wrap: wrap; }
.tabs a {
  font-family: var(--pixel);
  font-size: 11px;
  letter-spacing: 0.1em;
  padding: 10px 15px;
  color: var(--dimmer);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tabs a:hover { color: var(--mint-deep); }
.tabs a[aria-current="true"] { color: var(--mint); border-bottom-color: var(--mint); }

label { display: block; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); margin: 0 0 6px; }
input, select {
  width: 100%;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink);
  background: rgba(5, 13, 16, 0.6);
  border: 1px solid var(--line);
  padding: 10px 12px;
}
input:focus, select:focus { outline: none; border-color: var(--line-2); }
.field { margin: 0 0 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.out {
  font-size: 12px;
  color: var(--mint-deep);
  background: rgba(5, 13, 16, 0.55);
  border: 1px solid var(--line);
  padding: 12px;
  word-break: break-all;
  white-space: pre-wrap;
  margin: 14px 0 0;
  max-height: 260px;
  overflow: auto;
}
.out .k { color: var(--dim); }

.note { font-size: 12.5px; color: var(--dim); }
.scale { font-size: 12.5px; }
.scale .row { display: flex; gap: 14px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.scale .row span:first-child { width: 90px; color: var(--mint-deep); font-variant-numeric: tabular-nums; }
.scale .row span:last-child { color: var(--dim); }

footer {
  position: relative;
  z-index: 2;
  margin-left: var(--ladder);
  padding: 0 32px 40px;
  max-width: 860px;
  color: var(--dimmer);
  font-size: 12px;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
footer a { color: var(--dimmer); text-decoration: none; }
footer a:hover { color: var(--mint-deep); }

@media (max-width: 1040px) {
  .brand .tag { display: none; }
}

@media (max-width: 860px) {
  :root { --ladder: 0px; }
  .ladder {
    top: auto; bottom: 0; left: 0; right: 0;
    width: auto; height: 58px;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    padding: 0 8px;
    background: rgba(5, 13, 16, 0.9);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
  }
  .ladder::before { display: none; }
  .rung { flex-direction: column; gap: 4px; padding: 0; }
  .rung::after { position: static; transform: none; }
  .rung .m { display: none; }
  main { padding: 92px 16px 92px; }
  footer { padding: 0 16px 92px; }
  .grid2 { grid-template-columns: 1fr; }
  .reading .n { font-size: 44px; }
  .reading .n.empty { font-size: 30px; }
  .top { padding: 12px 14px; gap: 8px; }
  .pill { font-size: 10.5px; padding: 4px 8px; }
  h1 { font-size: 23px; }
}
