/* Presentation only: no rule here can affect what the page says, only how it looks.
   The countdown text comes from `src/render.js` as data, one element per line, with the
   model's kind as the class name, so every rule below targets a kind, never a string. */

:root {
  color-scheme: light dark;
  --surface: #fbfaf8;
  --panel: #ffffff;
  --ink: #16181c;
  --ink-secondary: #55606e;
  --hairline: #e3e0d8;
  --measure: 38rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface: #14161a;
    --panel: #1b1e24;
    --ink: #ece9e3;
    --ink-secondary: #9aa4b2;
    --hairline: #2b2f37;
  }
}

body {
  margin: 0;
  padding: 2.25rem 1.5rem;
  background: var(--surface);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 16px;
  line-height: 1.45;
  text-wrap: pretty;
  -webkit-font-smoothing: antialiased;
}

#page {
  display: grid;
  justify-items: start;
  max-width: var(--measure);
  margin: 0 auto;
  gap: 0.1rem;
}

#page > .title {
  font-size: clamp(1.6rem, 1.15rem + 1.6vw, 2.15rem);
  font-weight: 650;
  letter-spacing: -0.015em;
  margin: 0 0 1.4rem;
}

#page > .counter,
#page > .counter-lead {
  font-size: clamp(1.05rem, 0.95rem + 0.4vw, 1.25rem);
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: 0.01em;
  margin: 0 0 0.45rem;
}

/* The weeks line is the main counter (§14 acceptance item 6), and the model gives it its own
   kind, so this rule names a ROLE rather than a position: reorder §6's counters and the
   emphasis follows the weeks line, not whichever line happens to land in slot one.
   Same specificity as the rule above (one id + one class), later in the sheet, so it wins. */
#page > .counter-lead {
  font-size: clamp(1.35rem, 1.1rem + 1.1vw, 1.9rem);
  font-weight: 600;
  margin: 0 0 1.1rem;
}

#page > .heading {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-secondary);
  margin: 1.6rem 0 0.6rem;
}

#page > .milestone {
  font-variant-numeric: lining-nums tabular-nums;
  font-weight: 550;
  margin: 0 0 0.3rem;
}

#page > .date {
  color: var(--ink-secondary);
  font-variant-numeric: lining-nums tabular-nums;
  margin: 0 0 0.3rem;
}

#page > .note {
  color: var(--ink-secondary);
  font-size: 0.85rem;
  margin: 0 0 0.3rem;
}

/* The two states that replace the countdown, plus the browse feature's own end-of-stream
   message, get a panel so the page never looks half-empty. */
#page > .expired,
#page > .error,
#page > .destination {
  border: 1px solid var(--hairline);
  background: var(--panel);
  border-radius: 0.9rem;
  padding: 1.05rem 1.25rem;
  margin: 1.2rem 0 0;
  box-shadow: 0 0.6rem 1.6rem -0.9rem rgba(0, 0, 0, 0.14);
}

#page > .expired,
#page > .destination {
  font-weight: 550;
}

#page > .error {
  font-weight: 600;
}

/* The browse controls (§12.3 row 9) are the page's only interactive elements, and the suite
   asserts that fact. They arrive as ONE row element (`.controls`) holding the offered chips, not
   as loose children: `#page` is a grid, and a grid gives every child its own row, which is why
   two loose chips would sit on top of each other. "Which controls exist" stays `app.js`'s
   decision; "where they sit" is the single rule below. No rule here names an order, so the
   stylesheet can neither conjure a control nor move a counter. */
#page > .controls {
  justify-self: start;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0.9rem 0 0;
}

#page > .controls > .control {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 550;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 0.6rem;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
}

#page > .controls > .control:hover {
  background: var(--hairline);
}

#page > .controls > .control:focus-visible {
  outline: 2px solid var(--ink-secondary);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  transition-duration: 0s;
}
