/* The apex: one split-flap board (flap.js) on a dark wall, and the 404. Geist Mono is self-hosted (OFL). */
@font-face { font-family: "Geist Mono"; src: url("/fonts/geist-mono.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
:root { --bg: #0a0a0c; --ink: #f3ead6; --amber: #ffb43a; --dim: #8a8892; --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --w: min(128px, 12.5vw, calc((100vw - 40px) / 7.3)); --h: calc(var(--w) * 1.48); --r: calc(var(--w) * .08); --fold: 36ms; color-scheme: dark; }
html, body { margin: 0; }
body { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); color: var(--ink); font: 13px/1.6 var(--mono); -webkit-font-smoothing: antialiased;
  background-image: radial-gradient(ellipse 80% 60% at 50% 45%, #17161c, transparent 70%); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
a { color: var(--dim); text-decoration: none; }
a:hover { color: var(--ink); }
a:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 6px; }
main { flex: 1; display: grid; place-items: center; padding: 24px 12px; }

/* The board: a dark housing with four bolts, the flaps, and a status line. */
.board { position: relative; padding: calc(var(--w) * .28) calc(var(--w) * .26) calc(var(--w) * .2); border-radius: calc(var(--w) * .2);
  background: linear-gradient(180deg, #1a191f, #111014); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 0 0 1px #000, 0 30px 80px rgba(0, 0, 0, .7), 0 0 120px rgba(255, 180, 58, .06); }
.board::before, .board::after { content: ""; position: absolute; top: calc(var(--w) * .1); width: 6px; height: 6px; border-radius: 50%; background: #2a2930; box-shadow: inset 0 1px 1px rgba(0, 0, 0, .8), 0 1px 0 rgba(255, 255, 255, .05); }
.board::before { left: calc(var(--w) * .1); }
.board::after { right: calc(var(--w) * .1); }
.flaps { display: flex; gap: calc(var(--w) * .1); }

.flap { position: relative; display: grid; place-items: center; width: var(--w); height: var(--h); border-radius: var(--r); perspective: calc(var(--w) * 6);
  font: 700 calc(var(--h) * .74) / 1 var(--mono); color: var(--ink); background: linear-gradient(180deg, #2a2930 0 49.5%, #0b0b0d 49.5% 50.5%, #212026 50.5%);
  box-shadow: 0 2px 0 #000, 0 calc(var(--w) * .06) calc(var(--w) * .12) rgba(0, 0, 0, .6); }
/* Two hinge pins at the split. */
.flap::before, .flap::after { content: ""; position: absolute; z-index: 3; top: calc(50% - 3px); width: 3px; height: 6px; background: #3b3a42; border-radius: 1px; }
.flap::before { left: -1px; }
.flap::after { right: -1px; }
.live { display: block; background: #0b0b0d; }
.h { position: absolute; left: 0; right: 0; height: calc(50% - 1px); overflow: hidden; backface-visibility: hidden; }
.h i { display: block; height: var(--h); line-height: var(--h); text-align: center; font-style: normal; }
.top { top: 0; border-radius: var(--r) var(--r) 0 0; background: linear-gradient(180deg, #2c2b32, #26252b); transform-origin: 50% 100%; }
.bottom { bottom: 0; border-radius: 0 0 var(--r) var(--r); background: linear-gradient(180deg, #1f1e24, #252429); transform-origin: 50% 0; }
.bottom i { margin-top: calc(var(--h) / -2); }
.top i { text-shadow: 0 1px 0 rgba(0, 0, 0, .3); }
.leaf { z-index: 2; visibility: hidden; }
.go .leaf.top { visibility: visible; animation: fold-top var(--fold) ease-in forwards; }
.go .leaf.back { visibility: visible; animation: fold-bottom var(--fold) var(--fold) ease-out both; }
@keyframes fold-top { from { transform: rotateX(0); filter: brightness(1); } to { transform: rotateX(-90deg); filter: brightness(.55); } }
@keyframes fold-bottom { from { transform: rotateX(90deg); filter: brightness(1.4); } to { transform: rotateX(0); filter: brightness(1); } }

.status { display: flex; align-items: center; gap: 14px; margin-top: calc(var(--w) * .2); padding: 0 2px; font-size: clamp(10px, 1.6vw, 13px); text-transform: uppercase; letter-spacing: .14em; color: var(--dim); }
.status .on { color: var(--amber); text-shadow: 0 0 12px rgba(255, 180, 58, .45); }
.status .grow { flex: 1; height: 1px; background: repeating-linear-gradient(90deg, #2a2930 0 4px, transparent 4px 8px); }
.status .clock { color: var(--amber); font-variant-numeric: tabular-nums; text-shadow: 0 0 12px rgba(255, 180, 58, .45); }

footer { display: flex; justify-content: center; gap: 18px; padding: 16px; color: #807e88; font-size: 12px; }
footer a { color: #807e88; display: inline-block; padding: 6px 4px; margin: -6px -4px; }
footer a:hover { color: var(--ink); }

.lost { text-align: center; max-width: 420px; }
.lost h1 { font-size: 28px; letter-spacing: -.02em; margin: 0 0 8px; color: var(--amber); }
.lost p { color: var(--dim); margin: 0; }
.lost a { color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .go .leaf { animation: none; visibility: hidden; } }
