@font-face { font-family: "Plex"; src: url("/assets/fonts/ibm-plex-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex"; src: url("/assets/fonts/ibm-plex-mono-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --ground: #0c0d0e;
  --surface: #141517;
  --ink: #eef0ec;
  --muted: #8f949a;
  --red: #d0202a;
  --red-ink: #ff4a52;     /* red used as text on the ground: lifted for contrast */
  --line: #2c2f32;
  --gutter: clamp(16px, 4vw, 48px);
  --measure: 76ch;
  --step: clamp(56px, 9vw, 112px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--ground); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 15px/1.6 "Plex", ui-monospace, Menlo, Consolas, monospace; }
pre { font: inherit; margin: 0; }
a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--red-ink); }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--red-ink); outline-offset: 3px; }
h2, h3 { font-weight: 600; font-size: 15px; margin: 0; letter-spacing: 0; }
h2::before { content: "## "; color: var(--red-ink); }
h3::before { content: "### "; color: var(--muted); }
.red { color: var(--red-ink); font-weight: 600; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--gutter); top: 12px; z-index: 5; background: var(--ground); padding: 8px 12px; }

/* 1. threshold: the banner's field, the PFP's button on a solid panel in the middle */
.threshold { position: relative; min-height: 100svh; display: grid; place-items: center; overflow: hidden; padding: 48px var(--gutter); }
.field { position: absolute; inset: 0; color: var(--red); font-size: 22px; line-height: 1.15; white-space: pre; overflow: hidden; user-select: none; opacity: .9; }
.field b { color: var(--ink); font-weight: 400; }
.door { position: relative; background: var(--ground); padding: clamp(20px, 4vw, 44px) clamp(16px, 4vw, 48px) clamp(24px, 4vw, 40px); display: grid; justify-items: center; gap: 14px; text-align: center; box-shadow: 0 0 0 1px var(--line); }
.button { color: var(--red); font-size: min(20px, calc((100vw - 2 * var(--gutter) - 32px) / 20.6)); line-height: 1.12; white-space: pre; text-align: left; }
.button b { color: var(--ink); font-weight: 600; }
.premise { margin: 18px 0 0; font-size: 17px; text-wrap: balance; }
.warning { margin: 0; color: var(--muted); font-size: 12px; letter-spacing: .04em; max-width: 34ch; }
.enter { margin-top: 10px; display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; font-weight: 600; color: var(--red-ink); text-decoration: none; }
.enter:hover { color: var(--ink); }

main > section, .foot { max-width: calc(var(--measure) + 2 * var(--gutter)); margin: 0 auto; padding: var(--step) var(--gutter) 0; }

/* 2. status row */
.status { padding-top: clamp(40px, 6vw, 72px) !important; }
.row { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; }
.row span { white-space: nowrap; color: var(--muted); }
.row b { color: var(--ink); font-weight: 600; }
.row b[data-state="running"], .row b[data-state="live"] { color: var(--red-ink); }
.disclaimer { margin: 18px 0 0; font-size: 11px; line-height: 1.7; color: var(--muted); letter-spacing: .03em; border-top: 1px solid var(--line); padding-top: 14px; }

/* 3. archive */
.head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 20px; }
.sort { display: flex; gap: 4px; }
.sort button { min-height: 44px; padding: 0 8px; color: var(--muted); }
.sort button::before { content: "[ "; } .sort button::after { content: " ]"; }
.sort button[aria-pressed="true"] { color: var(--ink); font-weight: 600; }
.lede { margin: 10px 0 0; color: var(--muted); max-width: 64ch; }
.keypad { margin: 22px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.keypad label { color: var(--muted); }
.keypad input { width: 5ch; min-height: 44px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 0; font: 600 15px "Plex", monospace; text-transform: uppercase; text-align: center; }
.keypad input:focus-visible { border-color: var(--red-ink); outline: none; }
.keypad button { min-height: 44px; padding: 0 12px; background: var(--red); color: var(--ink); font-weight: 600; }
.keypad output { color: var(--red-ink); min-height: 1.6em; }
.files { list-style: none; margin: 18px 0 0; padding: 0; border-top: 1px solid var(--line); }
.files li { border-bottom: 1px solid var(--line); }
.files li.empty { padding: 14px 0; color: var(--muted); }
.files > li > button { width: 100%; min-height: 48px; display: grid; grid-template-columns: 4ch minmax(0, 1fr) 7ch 11ch; gap: 0 16px; align-items: center; padding: 10px 0; text-align: left; }
.files > li > button:hover .name, .files > li > button[aria-expanded="true"] .name { color: var(--red-ink); }
.files .code { color: var(--red-ink); font-weight: 600; }
.files .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); }
.files .kind, .files .date { color: var(--muted); font-size: 13px; }
.files .date { text-align: right; }
.reader { margin: 0; background: var(--surface); border: 1px solid var(--line); border-top: 0; }
.reader header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 16px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.reader header button { min-height: 44px; padding: 0 6px; color: var(--ink); }
.reader header button::before { content: "[ "; } .reader header button::after { content: " ]"; }
.reader pre { padding: 20px 16px 24px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.55; }
.reader footer { padding: 0 16px 16px; font-size: 13px; color: var(--muted); }
.reader footer:empty { display: none; }

/* 4. prophecies */
.prophecies { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 2px; }
.prophecies li { display: grid; grid-template-columns: 4ch 1fr; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.prophecies span { color: var(--red-ink); font-weight: 600; }

/* 5. mechanism */
.arrows { margin: 20px 0 0; padding: 14px 16px; background: var(--surface); border-left: 2px solid var(--red); font-size: 14px; line-height: 1.6; }
.arrows p { margin: 0; padding: 4px 0 4px calc(var(--d) * 4ch + 2ch); text-indent: -2ch; }
.plain { margin: 20px 0 0; max-width: 64ch; font-size: 16px; }
.mechanism h3 { margin-top: 28px; }
.see { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; color: var(--muted); }
.see li::before { content: "- "; color: var(--muted); }
.see span, .see a { color: var(--ink); }

/* 6. footer */
.foot { padding-bottom: 64px; }
.foot p { margin: 0; padding-top: 22px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.foot button { min-height: 44px; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.foot .small { border: 0; padding-top: 4px; color: var(--red-ink); min-height: 1.6em; }

@media (max-width: 640px) {
  body { font-size: 14px; }
  .field { font-size: 16px; }
  .files > li > button { grid-template-columns: 3.5ch minmax(0, 1fr); grid-template-rows: auto auto; gap: 2px 12px; }
  .files .kind { grid-column: 2; grid-row: 2; }
  .files .date { grid-column: 2; grid-row: 2; text-align: right; }
  .arrows p { padding-left: calc(var(--d) * 2ch + 2ch); }
  .premise { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
html { scroll-behavior: smooth; }

.files li.reader-row { border-bottom: 0; }


.door-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; margin-top: 10px; }
.door-links .enter { margin-top: 0; }
.enter.alt { color: var(--ink); }
.enter.alt:hover { color: var(--red-ink); }
.foot a { min-height: 44px; display: inline-flex; align-items: center; color: var(--ink); }

