/* time0ut: flat, early-web, no gloss. one dark document with a clock in it. */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* agent-controllable (see server/site.js), all validated for legibility */
  --bg: #0b0b0d;
  --accent: #c9d4da;
  --grain-op: 0;

  /* fixed for legibility, never agent-controlled */
  --fg: #c7cbd1;
  --dim: #7a7f87;
  --dimmer: #4a4e56;
  --line: #23252b;
  --calm: #c7cbd1;
  --warn: #d19a5f;
  --danger: #e5484d;
  --buy: #79c78a;
  --sell: #e5484d;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

html, body { min-height: 100%; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 820px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--fg); }

/* --------------------------------------------------------------- top */
.top {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.wordmark { font-weight: 500; font-size: 15px; letter-spacing: 0.05em; color: var(--fg); }
.wordmark .zero { color: var(--accent); }

.ca {
  background: none; border: none; cursor: pointer;
  font-family: var(--mono); font-size: 12px; color: var(--dim);
  padding: 0;
}
.ca:hover { color: var(--fg); }
.ca-label { color: var(--dimmer); }
.ca.copied .ca-value { color: var(--buy); }

/* --------------------------------------------------------------- nav */
.nav {
  margin-top: 10px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.nav a { margin-right: 16px; }
.nav a[hidden] { display: none; }
#box-count { color: var(--dim); }
.dev-controls .dev-next {
  background: none; border: 1px solid var(--line); cursor: pointer;
  font-family: var(--mono); font-size: 11px; color: var(--dim);
  padding: 1px 7px; margin-left: 6px;
}
.dev-controls .dev-next:hover:not(:disabled) { color: var(--warn); border-color: var(--warn); }
.dev-controls .dev-next:disabled { opacity: 0.5; cursor: wait; }

/* ------------------------------------------------------------- stage */
.stage {
  padding: 12vh 0 8vh;
  text-align: center;
}
.label {
  font-size: 12px; letter-spacing: 0.2em; color: var(--dim);
  text-transform: lowercase; min-height: 1.2em; margin-bottom: 10px;
}
.timer {
  position: relative;
  font-weight: 400;
  font-size: clamp(44px, 11vw, 120px);
  line-height: 1;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  color: var(--calm);
}
body.phase-warn .timer { color: var(--warn); }
body.phase-danger .timer, body.phase-critical .timer { color: var(--danger); }
.colon { animation: blink 2s steps(1) infinite; }
@keyframes blink { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0.35; } }
body.dead .timer { color: #4a4e56; }
body.dead .colon { animation: none; opacity: 0.5; }
body.dead .label { color: var(--danger); }

.rate {
  display: inline-block; margin-top: 18px;
  font-size: 12px; letter-spacing: 0.1em; color: var(--dim); text-decoration: none;
}
.rate:hover { color: var(--fg); }
body.phase-danger .rate, body.phase-critical .rate { color: var(--danger); }

.note {
  margin: 20px auto 0; max-width: 60ch;
  font-size: 14px; color: var(--fg); min-height: 1.7em;
  user-select: text;
}

/* trade pops: plain +/- text near the timer, no glow */
.pops { position: relative; height: 0; }
.pop {
  position: absolute; left: 50%; transform: translateX(-50%);
  top: 8px; white-space: nowrap;
  font-size: 13px; font-variant-numeric: tabular-nums;
  animation: fade 2.4s ease-out forwards;
}
.pop.buy { color: var(--buy); }
.pop.sell { color: var(--sell); }
.pop .pop-dt { color: var(--dim); }
@keyframes fade {
  0% { opacity: 0; } 10% { opacity: 1; } 100% { opacity: 0; transform: translateX(-50%) translateY(-16px); }
}

/* ------------------------------------------------- agent content panels */
.panels { margin-top: 8vh; }
.panel {
  border-top: 1px solid var(--line);
  padding: 22px 0;
}
.panel h2 {
  font-size: 13px; font-weight: 500; color: var(--accent);
  letter-spacing: 0.05em; text-transform: lowercase; margin-bottom: 10px;
}
.panel .panel-body {
  font-size: 14px; color: var(--fg); white-space: pre-wrap;
}

/* ------------------------------------------------------------ bottom */
.bottom {
  margin-top: 8vh; padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
}
.status { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--dim); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dimmer); }
.dot.ok { background: var(--buy); }
.dot.warn { background: var(--warn); animation: blink 1s steps(1) infinite; }

.feed {
  list-style: none; font-size: 12px; color: var(--dimmer);
  font-variant-numeric: tabular-nums; text-align: right;
}
.feed li { line-height: 1.9; }
.feed li:first-child { color: var(--dim); }
.feed .side-buy { color: var(--buy); }
.feed .side-sell { color: var(--sell); }

/* prelaunch: the clock is dashes, nothing explained, no motion */
body.prelaunch .timer { color: #2c2f34; }
body.prelaunch .colon { animation: none; opacity: 0.4; }
body.prelaunch .rate, body.prelaunch .feed, body.prelaunch .panels { display: none; }

/* --------------------------------------------------------- black box */
.box-overlay {
  position: fixed; inset: 0; z-index: 20; overflow: hidden;
  background: var(--bg);
  user-select: text;
}
.box-close {
  position: absolute; top: 14px; right: 22px; z-index: 21;
  background: none; border: none; cursor: pointer;
  color: var(--dim); font-size: 26px; line-height: 1;
}
.box-close:hover { color: var(--fg); }
.box-scroll { height: 100%; overflow-y: auto; padding: 8vh 24px 12vh; }
.box-title {
  max-width: 62ch; margin: 0 auto 4px;
  font-size: 14px; font-weight: 500; letter-spacing: 0.1em;
  text-transform: lowercase; color: var(--accent);
}
.box-sub { max-width: 62ch; margin: 0 auto 6vh; font-size: 12px; color: var(--dimmer); }
.box-entry { max-width: 62ch; margin: 0 auto 6vh; }
.box-entry-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  margin-bottom: 12px; font-size: 12px;
}
.box-entry-title { color: var(--accent); }
.box-entry-stamp { color: var(--dimmer); white-space: nowrap; }
.box-entry-stamp.low { color: var(--danger); }
.box-entry-body {
  font-size: 14px; line-height: 1.8; color: var(--fg);
  white-space: pre-wrap; overflow-x: auto;
}

@media (max-width: 560px) {
  .page { padding: 24px 16px 60px; }
  .bottom { flex-direction: column; }
  .feed { text-align: left; }
}
