/* ---------- header ---------- */
.top { border-bottom: 1px solid var(--line); }
.top-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; padding-top: 16px; padding-bottom: 16px; }
.wordmark { font-weight: 800; font-size: 15px; letter-spacing: .14em; text-decoration: none; color: var(--text); }
.status { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.status li { white-space: nowrap; }
.dot { color: var(--a); }
.tbtn {
  background: none; border: 0; padding: 4px 0; cursor: pointer;
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--text);
  border-bottom: 1px solid var(--line);
}
.tbtn:hover { color: var(--a); border-color: var(--a); }
.tbtn[aria-pressed="true"][data-sound-toggle] { color: var(--a); }

/* ---------- buttons ---------- */
.btn {
  background: var(--a); color: var(--bg); border: 1px solid var(--a);
  padding: 10px 18px; font-weight: 700; font-size: 13px; letter-spacing: .18em; text-transform: uppercase;
  cursor: pointer; border-radius: 0;
}
.btn:hover { background: var(--text); border-color: var(--text); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: transparent; color: var(--a); border-color: var(--a); }

/* ---------- hero ---------- */
.hero { padding: clamp(40px, 7vw, 96px) 0 clamp(48px, 7vw, 88px); position: relative; }
.kicker { margin: 0 0 18px; color: var(--a); }
.h1 {
  font-family: var(--display); font-weight: 800; color: var(--text);
  font-size: clamp(30px, 5.6vw, 76px); line-height: 1.02; letter-spacing: -.02em; margin: 0;
}
.clock-wrap { position: relative; margin: clamp(20px, 3vw, 36px) 0 clamp(24px, 3vw, 40px); }
.pulse {
  position: absolute; left: -10%; right: 10%; top: -30%; bottom: -30%; z-index: -1;
  background: radial-gradient(closest-side, rgba(255, 59, 47, .22), rgba(255, 59, 47, 0) 70%);
  animation: pulse var(--pulse) ease-in-out infinite;
  pointer-events: none;
}
.clock {
  display: flex; flex-wrap: wrap; align-items: flex-start; row-gap: 8px;
  font-weight: 800; color: var(--text);
  font-size: clamp(48px, 10vw, 156px); line-height: .95; letter-spacing: -.04em;
}
.clock .unit { display: flex; flex-direction: column; }
.clock .num { font-variant-numeric: tabular-nums; }
.clock .ulbl { font-size: 11px; font-weight: 500; letter-spacing: .24em; color: var(--muted); margin-top: 10px; padding-left: .2em; }
.clock .colon { color: var(--a); padding: 0 .02em; margin: 0 -.06em; }
.clock .secs .num { color: var(--a); }
.clock .cs { font-size: .24em; color: var(--muted); font-weight: 500; letter-spacing: 0; align-self: flex-start; margin-top: .3em; margin-left: .25em; min-width: 3ch; }
.clock-pre { color: var(--a); padding-right: .12em; }
html.last10 .clock .num { color: var(--a); }
html.last10 .clock .num.glitch::before, html.last10 .clock .num.glitch::after { display: none; }

.lead { max-width: 62ch; font-size: clamp(15px, 1.4vw, 18px); color: var(--text-2); margin: 0 0 clamp(28px, 4vw, 48px); }

/* ruled grid */
.grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1px; background: var(--line); border: 1px solid var(--line);
  list-style: none; margin: 0; padding: 0;
}
.grid > .cell { background: var(--bg); padding: clamp(18px, 2vw, 28px); min-width: 0; }
.cell p { margin: 0; }
.strip .label { margin-bottom: 14px; }
.big.acc { color: var(--a); }
.big { font-size: clamp(26px, 3vw, 38px); font-weight: 800; color: var(--text); letter-spacing: -.02em; line-height: 1.1; }
.cap { margin-top: 10px !important; font-size: 13px; color: var(--muted); }
.bar { height: 6px; background: var(--line); margin-top: 16px; }
.bar i { display: block; height: 100%; width: 0; background: var(--a); }
.cities { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.cities li { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; border-bottom: 1px dashed var(--line); color: var(--muted); }
.cities li:last-child { border-bottom: 0; }
.cities b { color: var(--text); font-weight: 700; }
.cities .mine { color: var(--text); }
.cities .mine b { color: var(--a); }

.post-banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px;
  border: 1px solid var(--a); padding: 14px 18px; margin-bottom: 32px; background: rgba(255, 59, 47, .06);
}
.post-banner p { margin: 0; flex: 1 1 280px; color: var(--text); font-size: 14px; }
.post-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- tape ---------- */
.tape { overflow: hidden; padding: 18px 0; }
.tape-track {
  display: flex; width: max-content; background: var(--a); color: var(--bg);
  transform: rotate(-1.4deg); font-weight: 800; font-size: 14px; letter-spacing: .14em; padding: 10px 0; margin-left: -60px;
  animation: tape 38s linear infinite;
}
.tape-track span { white-space: nowrap; padding-right: 0; }
@keyframes tape { from { transform: rotate(-1.4deg) translateX(0); } to { transform: rotate(-1.4deg) translateX(-50%); } }

/* ---------- sections ---------- */
.sec { padding-top: var(--sec); }
.sec-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; margin-bottom: clamp(24px, 3vw, 40px); border-bottom: 1px solid var(--line); padding-bottom: 16px; }
.sec-head h2 { font-family: var(--display); font-weight: 800; font-size: clamp(26px, 3.4vw, 44px); line-height: 1.05; color: var(--text); margin: 0; letter-spacing: -.02em; }
.sec-head .label { margin: 0; }
.sec-n { color: var(--a); font-family: var(--mono); font-size: .5em; vertical-align: .55em; margin-right: .4em; letter-spacing: .1em; }
h3 { font-family: var(--display); font-weight: 500; font-size: 19px; color: var(--text); margin: 0 0 10px; letter-spacing: -.01em; }

.steps .code { font-size: 12px; letter-spacing: .16em; margin-bottom: 18px !important; font-weight: 700; }
.steps .cell p:last-child { color: var(--text-2); font-size: 14px; }

/* origin */
.origin { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: clamp(16px, 2vw, 28px); }
.origin-l { display: grid; gap: clamp(16px, 2vw, 28px); align-content: start; }
.card { background: var(--panel); border: 1px solid var(--line); padding: clamp(18px, 2vw, 28px); }
.card p { margin: 0 0 12px; font-size: 14px; }
.card p:last-child { margin-bottom: 0; }
.card .label { margin-bottom: 16px; }
.card-acc { border-color: var(--a); }
.quote { font-family: var(--display); font-weight: 800; font-size: clamp(20px, 2.2vw, 28px) !important; color: var(--text); line-height: 1.15; }
.orig { color: var(--muted); font-style: italic; }
.foot { color: var(--muted); font-size: 13px !important; border-top: 1px dashed var(--line); padding-top: 12px; }
.live { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; border-top: 1px dashed var(--line); padding-top: 12px; }
.live .label { margin: 0; }
.live b { color: var(--a); font-size: 18px; }

/* terminal panels */
.term { background: var(--term); border: 1px solid var(--line); font-size: 13px; position: relative; min-width: 0; }
.term-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 16px; border-bottom: 1px solid var(--line); color: var(--text); font-weight: 700; letter-spacing: .1em; font-size: 12px; }
.term-head .label { font-size: 11px; }
.log { min-height: 360px; display: flex; flex-direction: column; }
.log-lines { list-style: none; margin: 0; padding: 14px 16px 4px; flex: 1; overflow: hidden; }
.log-lines li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: rise .5s ease-out both; color: var(--text-2); line-height: 1.75; }
.log-lines .t { color: var(--faint); margin-right: 1.4ch; }
.log-lines .lv { display: inline-block; width: 5ch; margin-right: 1ch; font-weight: 700; }
.lv-INFO { color: var(--muted); }
.lv-WARN { color: var(--warn); }
.lv-CRIT, .lv-FAIL { color: var(--a); }
.cursor { display: block; width: 9px; height: 16px; background: var(--text); margin: 0 16px 16px; }

/* stakes */
.stamp-row { display: flex; justify-content: flex-end; margin: -8px 0 28px; }
.stamp {
  display: inline-flex; flex-direction: column; align-items: center; gap: 4px;
  border: 4px solid var(--a); color: var(--a); padding: 12px 22px;
  font-weight: 800; font-size: clamp(16px, 2vw, 24px); letter-spacing: .14em;
  transform: rotate(-7deg); animation: breathe 3.2s ease-in-out infinite;
}
.stamp small { font-size: 11px; letter-spacing: .24em; font-weight: 500; }
.stats .stat { font-weight: 800; color: var(--a); font-size: clamp(34px, 4vw, 54px); line-height: 1; letter-spacing: -.03em; margin-bottom: 14px !important; }
.stats .cell p:nth-child(2) { font-size: 14px; color: var(--text-2); }
.stats .src { margin-top: 14px !important; }
.cols3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: clamp(20px, 3vw, 40px); margin-top: clamp(32px, 4vw, 56px); }
.cols3 > div { border-top: 2px solid var(--a); padding-top: 18px; }
.cols3 p { margin: 0; font-size: 14px; }

/* bunker */
.chat-lines { list-style: none; margin: 0; padding: 12px 16px; height: 340px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--faint) transparent; }
.chat-lines li { padding: 3px 0; line-height: 1.55; word-wrap: break-word; overflow-wrap: anywhere; display: flex; gap: 10px; align-items: baseline; }
.chat-lines li > div { flex: 1; min-width: 0; }
.chat-lines .t { color: var(--faint); font-size: 11px; }
.chat-lines .who { color: var(--ok); font-weight: 700; margin-right: 1ch; }
.chat-lines .me .who { color: var(--a); }
.chat-lines .sys { color: var(--muted); font-style: italic; }
.chat-lines .rep { background: none; border: 0; padding: 0; color: var(--faint); cursor: pointer; font-size: 11px; letter-spacing: .1em; opacity: 0; }
.chat-lines li:hover .rep, .chat-lines .rep:focus-visible { opacity: 1; }
.chat-lines .rep:hover { color: var(--a); }
@media (hover: none) { .chat-lines .rep { opacity: .6; } }
.chat-form { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding: 10px 16px; }
.chat-form .prompt { color: var(--a); font-weight: 700; }
.chat-form input { flex: 1; min-width: 0; background: transparent; border: 0; padding: 8px 0; outline: none; color: var(--text); }
.chat-form input::placeholder { color: var(--faint); }
.chat-form .count { color: var(--faint); font-size: 11px; min-width: 3ch; text-align: right; }
.chat-status { margin: 0; padding: 0 16px 10px; color: var(--muted); font-size: 11px; letter-spacing: .1em; min-height: 1.6em; }
.scramble { color: var(--a) !important; }

/* quest */
.quest-body { padding: clamp(22px, 3.5vw, 48px); }
.quest-body > p { max-width: 70ch; }
.h2 { font-family: var(--display); font-weight: 800; color: var(--text); font-size: clamp(26px, 3.4vw, 44px); line-height: 1.05; margin: 10px 0 18px; letter-spacing: -.02em; }
.key-form { margin-top: 28px; max-width: 560px; }
.key-form .label { display: block; margin-bottom: 8px; }
.key-row { display: flex; gap: 0; }
.key-row input {
  flex: 1; min-width: 0; background: var(--panel); border: 1px solid var(--line); border-right: 0;
  padding: 12px 14px; color: var(--ok); letter-spacing: .12em; text-transform: uppercase; outline: none; border-radius: 0;
}
.key-row input:focus { border-color: var(--a); }
.reply { color: var(--muted); margin: 14px 0 0; min-height: 1.6em; }
.reply.ok { color: var(--ok); }
.reply.bad { color: var(--a); }
.root-link { margin: 12px 0 0; }
.root-link a { color: var(--ok); text-decoration-color: var(--ok); }
.qstats { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 11px; color: var(--faint); letter-spacing: .14em; text-transform: uppercase; }
.qstats b { color: var(--text-2); font-weight: 700; }

/* ---------- footer ---------- */
.foot-site { margin-top: var(--sec); border-top: 1px solid var(--line); padding: clamp(24px, 4vw, 48px) 0 28px; overflow: hidden; }
.giant {
  font-family: var(--display); font-weight: 900; margin: 0 0 24px; line-height: .9;
  font-size: clamp(26px, 8.4vw, 116px); letter-spacing: -.05em; color: rgba(232, 230, 225, .07); white-space: nowrap;
}
.giant::before { color: rgba(255, 59, 47, .35); }
.giant::after { color: rgba(124, 247, 255, .25); }
.foot-row { display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between; font-size: 13px; color: var(--muted); }
.foot-row p { margin: 0; }
.foot-r { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.foot-r a { color: var(--text-2); }

/* ---------- T-0 stage ---------- */
.t0 { position: fixed; inset: 0; z-index: 80; background: #000; color: var(--text); overflow: hidden; display: flex; flex-direction: column; }
.t0[hidden] { display: none; }
.t0 p { margin: 0; }
.t0 .bars { display: flex; height: 18vh; min-height: 70px; flex: none; }
.t0 .bars i { flex: 1; }
.t0 .bars2 { display: flex; height: 3vh; flex: none; }
.t0 .bars2 i { flex: 1; }
.t0 .noise { position: absolute; inset: 0; opacity: .22; pointer-events: none; image-rendering: pixelated; width: 100%; height: 100%; }
.t0 .stage1 { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2vh; padding: 16px; text-align: center; }
.t0.shake .stage1, .t0.shake .bars { animation: shake .12s steps(2) infinite; }
.t0 .err { font-weight: 800; letter-spacing: .14em; font-size: clamp(14px, 2.4vw, 28px); animation: strobe .18s steps(1) infinite; }
@keyframes strobe { 0%, 49% { opacity: 1; color: var(--text); } 50%, 100% { opacity: .2; color: var(--a); } }
.t0 .zero { font-weight: 800; color: var(--a); font-size: clamp(64px, 18vw, 260px); line-height: .9; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.t0 .glyphs { font-size: clamp(12px, 1.8vw, 20px); letter-spacing: .1em; color: var(--ghost); white-space: nowrap; overflow: hidden; max-width: 100%; font-variant-numeric: tabular-nums; }
.t0 .under { position: absolute; left: 16px; top: 12px; font-size: 28px; color: var(--text); }
.t0 .after { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; padding: var(--pad); max-width: var(--max); margin: 0 auto; animation: unblur 1.6s ease-out both; }
@keyframes unblur { from { opacity: 0; filter: blur(14px); } to { opacity: 1; filter: none; } }
.t0 .after .kicker { color: var(--ok); }
.t0 .after h2 { font-family: var(--display); font-weight: 900; font-size: clamp(38px, 8vw, 120px); line-height: .95; letter-spacing: -.03em; margin: 0 0 24px; }
.t0 .after p { max-width: 58ch; font-size: clamp(15px, 1.5vw, 19px); color: var(--text-2); margin: 0 0 32px; }
.t0 .actions { display: flex; flex-wrap: wrap; gap: 12px; }
.t0 .online { position: absolute; right: var(--pad); bottom: 20px; font-size: 12px; letter-spacing: .16em; color: var(--muted); text-transform: uppercase; }
.t0 .online b { color: var(--ok); }
.t0 .wav { position: absolute; left: var(--pad); bottom: 20px; font-size: 11px; letter-spacing: .14em; color: var(--faint); text-transform: uppercase; }
.t0 .wav a { color: var(--faint); }

/* ---------- small screens ---------- */
@media (max-width: 720px) {
  .status { gap: 4px 14px; font-size: 11px; }
  .clock .ulbl { font-size: 9px; letter-spacing: .14em; margin-top: 6px; }
  .stamp-row { justify-content: center; margin-top: 0; }
  .tape-track { font-size: 12px; }
}
@media (max-width: 420px) {
  .clock { letter-spacing: -.06em; }
  .clock .colon { padding: 0; }
  .clock .cs { flex-basis: 100%; margin: 0; font-size: 18px; }
  .log-lines li { font-size: 11px; }
  .log-lines .t { margin-right: .8ch; }
  .chat-form .count { display: none; }
}
