/*
 * Atomic Tick - atomictick.com
 *
 * Hand-written CSS, no framework, no build step, no external request of any kind. The
 * whole site is a handful of files a static host can serve from disk, which is the right
 * shape for a page in front of a game whose own promise is that it works on whatever
 * phone you already own.
 *
 * The visual language comes from the game's own materials rather than from art that does
 * not exist yet: the tick ruler, the encoded map, the queue panel, the tick report. That
 * is deliberate. A page full of borrowed fantasy illustration would misrepresent a game
 * whose actual texture is text, grids, and numbers.
 *
 * There is deliberately no url() anywhere in this file. Every graphic is a gradient, an
 * inline SVG, or coloured monospace text, so there is no asset that can go missing and
 * no second request to make. If you ever add one, check-site.mjs verifies it exists.
 *
 * Layout of the file:
 *   1. Tokens              - four blocks, all restating the same 36 custom properties
 *   2. Base                - element defaults, focus, the two layout primitives
 *   3. Components          - ported from the original single-page site
 *   4. Multi-page additions - everything a six-page site needs that a one-pager did not
 */

/* ---------------------------------------------------------------------------
 * Tokens
 * ------------------------------------------------------------------------ */

:root {
  color-scheme: dark light;

  --bg: #0a0c10;
  --bg-2: #0e1218;
  --bg-3: #141a22;
  --bg-inset: #070a0d;
  --line: #202832;
  --line-2: #2d3846;
  --ink: #e9edf3;
  --ink-2: #a7b2c0;
  --ink-3: #78838f;

  --accent: #f2b03c;
  --accent-soft: rgba(242, 176, 60, 0.14);
  --accent-line: rgba(242, 176, 60, 0.4);
  --accent-hover: #f4bc59;
  --on-accent: #18120a;

  --cool: #63c9da;
  --good: #7fc98a;
  --warn: #eb9264;

  /* Map palette. Kept as tokens so the light theme can restate all of it at once. */
  --t-plain: #5d6a76;
  --t-grass: #6f8f6a;
  --t-road: #b28a4e;
  --t-floor: #8b8477;
  --t-forest: #3f7d52;
  --t-rubble: #8a7360;
  --t-shallow: #5aa3bd;
  --t-deep: #3f7ba3;
  --t-rock: #6b747e;
  --t-wall: #97a0aa;
  --t-door: #f2b03c;
  --t-void: #171d24;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 28px rgba(0, 0, 0, 0.28);

  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --wrap: 1140px;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

/*
 * Light theme.
 *
 * Warm paper rather than white. The game is read, often for several minutes at a time,
 * and a pure #fff sheet next to a dark amber accent is harsher than it needs to be.
 *
 * Two values differ from the original single-page stylesheet, both because they missed
 * WCAG AA by a hair against the warm background and both are used on small text:
 *   --ink-3   #6f7783 -> #5f6773   (3.99:1 -> 4.98:1 on --bg)
 *   --accent  #9a6510 -> #8f5d0d   (4.47:1 -> 5.07:1 on --bg)
 * --t-door tracks --accent because they are the same colour by intent, not by accident.
 * The dark theme already cleared AA everywhere and is unchanged.
 */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f3ee;
    --bg-2: #fffdfa;
    --bg-3: #efebe3;
    --bg-inset: #e9e4da;
    --line: #ddd6c9;
    --line-2: #c8c0b1;
    --ink: #171a1e;
    --ink-2: #4e5661;
    --ink-3: #5f6773;

    --accent: #8f5d0d;
    --accent-soft: rgba(154, 101, 16, 0.1);
    --accent-line: rgba(154, 101, 16, 0.35);
    --accent-hover: #7a4f0b;
    --on-accent: #fffaf0;

    --cool: #17707f;
    --good: #35744a;
    --warn: #9c4f22;

    --t-plain: #8d9198;
    --t-grass: #5f8256;
    --t-road: #9a7135;
    --t-floor: #8a8073;
    --t-forest: #2f6d43;
    --t-rubble: #7d6552;
    --t-shallow: #3c8aa8;
    --t-deep: #24618a;
    --t-rock: #797f88;
    --t-wall: #4d545c;
    --t-door: #8f5d0d;
    --t-void: #d9d3c8;

    --shadow: 0 1px 2px rgba(60, 50, 30, 0.1), 0 8px 24px rgba(60, 50, 30, 0.08);
  }
}

/* Explicit choice from the header toggle wins over the system preference, both ways. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0c10;
  --bg-2: #0e1218;
  --bg-3: #141a22;
  --bg-inset: #070a0d;
  --line: #202832;
  --line-2: #2d3846;
  --ink: #e9edf3;
  --ink-2: #a7b2c0;
  --ink-3: #78838f;
  --accent: #f2b03c;
  --accent-soft: rgba(242, 176, 60, 0.14);
  --accent-line: rgba(242, 176, 60, 0.4);
  --accent-hover: #f4bc59;
  --on-accent: #18120a;
  --cool: #63c9da;
  --good: #7fc98a;
  --warn: #eb9264;
  --t-plain: #5d6a76;
  --t-grass: #6f8f6a;
  --t-road: #b28a4e;
  --t-floor: #8b8477;
  --t-forest: #3f7d52;
  --t-rubble: #8a7360;
  --t-shallow: #5aa3bd;
  --t-deep: #3f7ba3;
  --t-rock: #6b747e;
  --t-wall: #97a0aa;
  --t-door: #f2b03c;
  --t-void: #171d24;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 28px rgba(0, 0, 0, 0.28);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f3ee;
  --bg-2: #fffdfa;
  --bg-3: #efebe3;
  --bg-inset: #e9e4da;
  --line: #ddd6c9;
  --line-2: #c8c0b1;
  --ink: #171a1e;
  --ink-2: #4e5661;
  --ink-3: #5f6773;
  --accent: #8f5d0d;
  --accent-soft: rgba(154, 101, 16, 0.1);
  --accent-line: rgba(154, 101, 16, 0.35);
  --accent-hover: #7a4f0b;
  --on-accent: #fffaf0;
  --cool: #17707f;
  --good: #35744a;
  --warn: #9c4f22;
  --t-plain: #8d9198;
  --t-grass: #5f8256;
  --t-road: #9a7135;
  --t-floor: #8a8073;
  --t-forest: #2f6d43;
  --t-rubble: #7d6552;
  --t-shallow: #3c8aa8;
  --t-deep: #24618a;
  --t-rock: #797f88;
  --t-wall: #4d545c;
  --t-door: #8f5d0d;
  --t-void: #d9d3c8;
  --shadow: 0 1px 2px rgba(60, 50, 30, 0.1), 0 8px 24px rgba(60, 50, 30, 0.08);
}

/* ---------------------------------------------------------------------------
 * Base
 * ------------------------------------------------------------------------ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/*
 * The design forbids motion that carries meaning (D-066), and the only motion here is
 * orientation courtesy. Honour the system setting by removing all of it.
 */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 650;
  text-wrap: balance;
}

/*
 * h4 upward had no styling at all in the original, so they carried a user-agent margin
 * that fought every grid gap they sat in. They are still worth avoiding - the checker's
 * no-skipped-levels rule means you rarely need them - but they no longer misbehave.
 */
h4,
h5,
h6 {
  margin: 0;
  line-height: 1.25;
  letter-spacing: -0.01em;
  font-weight: 650;
  font-size: 0.95rem;
}

p {
  /*
   * Deliberately zero. Vertical rhythm on this site comes from `display: grid; gap:` on
   * the parent, never from paragraph margins, so that a component's spacing is stated in
   * one place. A bare <p> inside a non-grid container will collide with its neighbour;
   * that is a signal you want .stack or one of the named layout classes.
   */
  margin: 0;
  text-wrap: pretty;
}

a {
  color: var(--cool);
  text-decoration-color: color-mix(in srgb, var(--cool) 45%, transparent);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: currentColor;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

/*
 * The header is sticky on wide screens, so a jump link would otherwise land its target
 * underneath it. On the original one-pager this was masked by the generous .section
 * padding; on a six-page site with in-page anchors it would bite immediately.
 */
[id] {
  scroll-margin-top: 5rem;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--accent);
  color: var(--on-accent);
  padding: 0.6rem 1rem;
  font-weight: 600;
  border-radius: 0 0 var(--radius-sm) 0;
}

.skip:focus {
  left: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/*
 * There is not a single <img> on this site today; every graphic is drawn in CSS. These
 * two rules exist so that the first one added does not burst out of its container. The
 * checker separately requires alt, width and height on every one.
 */
img,
svg,
video {
  max-width: 100%;
  height: auto;
}

img {
  display: block;
  border-radius: var(--radius-sm);
  background: var(--bg-3);
}

/* ---------------------------------------------------------------------------
 * Shared pieces
 * ------------------------------------------------------------------------ */

.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0;
}

.section {
  padding-block: clamp(3.5rem, 9vw, 6.5rem);
}

/* Two sections that belong together should not pay the gap twice. */
.section.tight {
  padding-top: 0;
}

.section-head {
  max-width: 62ch;
  display: grid;
  gap: 0.9rem;
  margin-bottom: clamp(2rem, 5vw, 3rem);
}

.section-head h2 {
  font-size: clamp(1.65rem, 4.2vw, 2.4rem);
}

.section-head p {
  color: var(--ink-2);
  font-size: 1.02rem;
}

/*
 * The tick ruler.
 *
 * The recurring motif of the whole site: evenly spaced marks with a taller mark every
 * fifth interval, like a measuring rule or a clock face opened flat. It is the shape of
 * the game - fixed, countable intervals that nothing can shift.
 */
.ruler {
  height: 12px;
  border-top: 1px solid var(--line);
  background-image:
    repeating-linear-gradient(to right, var(--line-2) 0 1px, transparent 1px 60px),
    repeating-linear-gradient(to right, var(--line) 0 1px, transparent 1px 12px);
  background-size: 100% 10px, 100% 5px;
  background-repeat: repeat-x;
  background-position: top left;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.72rem 1.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  font-size: 0.98rem;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

/*
 * The header call to action carries a short label on narrow screens. A two-word label
 * wraps to two lines at 390px and pushes the header bar out of shape; one word does not.
 * Both spans must always be present - each is hidden at exactly one of the two widths,
 * so shipping only one makes the label vanish at the other.
 */
.btn-short {
  display: none;
}

@media (max-width: 560px) {
  .btn-long {
    display: none;
  }

  .btn-short {
    display: inline;
  }
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}

/*
 * The hover shade is a token, not a fixed mix direction.
 *
 * Lightening the accent is right in the dark theme, where it is a bright amber carrying
 * near-black text, and exactly backwards in the light theme, where it is a dark brown
 * carrying near-white text - there, lightening dropped the label to 3.97:1. --accent-hover
 * moves away from the label in whichever direction that theme needs: 10.78:1 dark,
 * 6.84:1 light.
 */
.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-2);
}

.btn-ghost:hover {
  border-color: var(--ink-3);
  background: var(--bg-3);
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.88rem;
}

/* A bordered surface that deliberately resembles a panel in the game client. */
.panel {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.panel-head strong {
  color: var(--ink);
  font-weight: 600;
  letter-spacing: 0.06em;
}

/*
 * .panel supplies no padding of its own, because .queue, .report and .tick-rows all pad
 * their own rows. Any other panel body needs this.
 */
.panel-body {
  padding: 1.1rem 1.2rem;
  display: grid;
  gap: 0.8rem;
}

.panel-body p {
  color: var(--ink-2);
  font-size: 0.95rem;
}

.spacer {
  margin-left: auto;
}

figure {
  margin: 0;
}

figcaption {
  margin-top: 0.85rem;
  color: var(--ink-3);
  font-size: 0.84rem;
  font-family: var(--mono);
  line-height: 1.55;
}

/*
 * Inline code, blocks and keys. Absent from the original, which shipped one unstyled
 * <code> in a figcaption; any page explaining mechanics will use more.
 */
code,
kbd,
samp {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.08em 0.34em;
}

pre {
  margin: 0;
  padding: 1rem 1.15rem;
  background: var(--bg-inset);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.84rem;
  line-height: 1.55;
}

pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
}

kbd {
  box-shadow: 0 1px 0 var(--line-2);
}

/* ---------------------------------------------------------------------------
 * Header
 * ------------------------------------------------------------------------ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.75rem;
  min-height: 60px;
  padding-block: 0.5rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* The mark: five ticks with the fourth struck, i.e. one interval among many. */
.wordmark .mark {
  display: inline-block;
  width: 20px;
  height: 16px;
  flex: none;
  background-image:
    linear-gradient(var(--accent), var(--accent)),
    repeating-linear-gradient(to right, var(--ink-3) 0 2px, transparent 2px 6px);
  background-size: 2px 16px, 20px 10px;
  background-position: 12px 0, 0 3px;
  background-repeat: no-repeat, repeat-x;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.35rem;
  margin-left: auto;
}

.site-nav a {
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.92rem;
}

.site-nav a:hover {
  color: var(--ink);
}

/*
 * The current page.
 *
 * Two carriers, not one. `aria-current="page"` is what a screen reader announces, the
 * inset rule is what a sighted reader sees, and the colour lift is a third. Never the
 * colour alone. An inset box-shadow rather than a border or an underline because it does
 * not change the element's box, so nothing in the header shifts by a pixel between pages.
 */
.site-nav a[aria-current="page"] {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--accent);
}

/*
 * The home page is not a nav item - it is reached through the wordmark - so the wordmark
 * is what carries the marker there. Same inset rule, so the two read as one convention.
 */
.wordmark[aria-current="page"] {
  box-shadow: inset 0 -2px 0 var(--accent);
}

/*
 * Narrow screens: the nav wraps onto its own row rather than collapsing behind a button.
 *
 * This is a deliberate choice against the more fashionable option. A disclosure-button
 * nav needs JavaScript to open, an aria-expanded state to stay honest, a focus trap or
 * an Escape handler to be usable by keyboard, and it hides every destination on the site
 * behind an icon whose meaning is learned rather than read. A wrapped row needs none of
 * that: it is six links, all of them visible, and it works identically with JavaScript
 * off, with JavaScript broken, and while the page is still loading. Nothing here can
 * fail, because nothing here runs.
 *
 * The header also stops being sticky at this width. A two- or three-row header pinned to
 * the top of a 360px-tall viewport takes a third of the screen away from the thing the
 * visitor came to read, and that is a bad trade for the convenience of a nav they will
 * use once.
 */
@media (max-width: 860px) {
  .site-header {
    position: static;
  }

  .site-header .wrap {
    flex-wrap: wrap;
  }

  .site-nav {
    order: 3;
    flex-basis: 100%;
    margin-left: 0;
    flex-wrap: wrap;
    gap: 0.35rem 1.1rem;
    margin-top: 0.35rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--line);
  }

  /*
   * Taller rows and a real row gap. At 375px the six links wrap onto two rows, and at the
   * desktop values those rows finished 1.7px apart with a hit area of about 33.5px each -
   * clear of the 24px minimum, well under the 44px that stops a thumb mis-tapping the row
   * below. Desktop density is untouched; this only applies once the nav has wrapped.
   */
  .site-nav a {
    padding-block: 0.5rem;
  }

  /* The desktop rule pins this at 1.35rem; on a wrapped row it wants the free space. */
  .site-nav + .header-actions {
    margin-left: auto;
  }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-left: auto;
}

.site-nav + .header-actions {
  margin-left: 1.35rem;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
}

.theme-toggle:hover {
  color: var(--ink);
  background: var(--bg-3);
}

/*
 * An inline SVG rather than a half-moon character. The obvious glyphs for this control
 * are absent from plenty of default font stacks and fall back to a replacement box or,
 * worse, a colour emoji - on the one control whose whole job is to look deliberate.
 */
.theme-toggle svg {
  width: 15px;
  height: 15px;
  display: block;
}

/*
 * Touch targets in the header.
 *
 * This block has to sit after the .theme-toggle and .btn-sm definitions rather than with
 * the other narrow-screen header rules above: a media query adds no specificity, so a
 * 44px width declared earlier in the file would simply lose to the 34px declared later.
 *
 * At the desktop values the toggle is 34x34 and the two header buttons are about 35px
 * tall. Neither fails SC 2.5.8, which asks for 24x24 - but on a phone, where these are
 * pressed with a thumb rather than clicked, both are under the 44px comfortable target
 * and they sit 0.6rem apart.
 */
@media (max-width: 860px) {
  .theme-toggle {
    width: 44px;
    height: 44px;
  }

  .btn-sm {
    padding-block: 0.7rem;
  }
}

/* ---------------------------------------------------------------------------
 * Hero
 * ------------------------------------------------------------------------ */

.hero {
  padding-block: clamp(3rem, 9vw, 6rem) clamp(2.5rem, 6vw, 4rem);
  position: relative;
  overflow: hidden;
}

/* A very quiet grid behind the hero. Fades out well before it competes with text. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 34px 34px;
  opacity: 0.4;
  mask-image: radial-gradient(120% 90% at 70% 0%, #000 0%, transparent 70%);
  pointer-events: none;
}

/* Expects exactly two children: .hero-copy and one figure or panel. */
.hero .wrap {
  position: relative;
  display: grid;
  gap: clamp(2.5rem, 6vw, 4rem);
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
}

@media (max-width: 900px) {
  .hero .wrap {
    grid-template-columns: minmax(0, 1fr);
  }
}

.hero-copy {
  display: grid;
  gap: 1.4rem;
  justify-items: start;
}

.hero h1 {
  font-size: clamp(2.3rem, 7.2vw, 4rem);
  letter-spacing: -0.035em;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero .lead {
  font-size: clamp(1.02rem, 2.4vw, 1.18rem);
  color: var(--ink-2);
  max-width: 46ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/*
 * Stacked buttons of different widths read as an accident. Below this width, match them.
 *
 * The nowrap on .btn has to be lifted at the same time. A full-width button that may not
 * wrap can neither shrink nor break, and body's overflow-x: hidden then clips whatever
 * does not fit rather than letting the reader scroll to it - which at 320px cost the
 * longest hero label about 30px of itself.
 */
@media (max-width: 520px) {
  .hero-actions {
    width: 100%;
  }

  .hero-actions .btn {
    flex: 1 1 100%;
    white-space: normal;
    text-align: center;
  }
}

/* --- the tick instrument -------------------------------------------------- */

.tick-panel {
  font-family: var(--mono);
}

/* Definition lists carry a 1em user-agent margin that reads as dead space inside a panel. */
.tick-rows,
.report dl {
  margin: 0;
}

.tick-rows {
  display: grid;
  gap: 0;
}

.tick-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
}

.tick-row + .tick-row {
  border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}

.tick-row dt {
  color: var(--ink-3);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0;
}

.tick-row dd {
  margin: 0;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.tick-row dd.big {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.tick-row dd.lock {
  color: var(--accent);
}

.tick-meter {
  padding: 0.9rem 1rem 1.1rem;
  border-top: 1px solid var(--line);
}

.tick-bar {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: var(--bg-inset);
  border: 1px solid var(--line);
  overflow: hidden;
}

.tick-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(to right, color-mix(in srgb, var(--accent) 45%, transparent), var(--accent));
  transition: width 0.9s linear;
}

/*
 * Where in the interval orders stop being editable, as a fraction of the cadence:
 * (cadence - lockLead) / cadence. The default matches the 1800s/60s panel. A panel with
 * different numbers must override it, or the marker lies:
 *   <div class="tick-bar" style="--lock-at: 98.33%">   for 3600s / 60s
 */
.tick-bar-lock {
  position: absolute;
  top: -3px;
  bottom: -3px;
  left: var(--lock-at, 96.66%);
  width: 2px;
  background: var(--ink);
  opacity: 0.75;
}

.tick-legend {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.6rem;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ---------------------------------------------------------------------------
 * Cards
 * ------------------------------------------------------------------------ */

.card-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}

/*
 * auto-fit at 260px turns three cards into three narrow columns on a 1140px page whether
 * or not that is what you wanted. This variant asks for wider cards, so three of them
 * become two-plus-one instead.
 */
.card-grid.cols-2 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
}

.card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem;
  display: grid;
  gap: 0.7rem;
  align-content: start;
}

.card .num {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--accent);
}

/*
 * h3 or h4, because the level depends on what the card is nested under, not on what the
 * card is. A card sitting directly beneath a section h2 heads at h3; a card inside a
 * group that already has its own h3 heads at h4. Both look identical, which is the point
 * - the outline is corrected without the page changing.
 */
.card :is(h3, h4) {
  font-size: 1.08rem;
}

.card p {
  color: var(--ink-2);
  font-size: 0.95rem;
}

/*
 * A card that is itself a link. Without these it would inherit the global link colour and
 * underline, and the whole card would read as one enormous hyperlink.
 */
a.card {
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

a.card:hover {
  border-color: var(--accent-line);
  background: var(--bg-3);
}

a.card :is(h3, h4) {
  color: var(--ink);
}

/* ---------------------------------------------------------------------------
 * The four-beat rhythm
 * ------------------------------------------------------------------------ */

.rhythm {
  display: grid;
  gap: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-2);
}

/* .rhythm is four beats by name and by default. Three is the only other shape used. */
.rhythm.beats-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 820px) {
  .rhythm,
  .rhythm.beats-3 {
    grid-template-columns: minmax(0, 1fr);
  }
}

.beat {
  padding: 1.5rem 1.35rem;
  display: grid;
  gap: 0.65rem;
  align-content: start;
  border-right: 1px solid var(--line);
  position: relative;
}

.beat:last-child {
  border-right: 0;
}

@media (max-width: 820px) {
  .beat {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .beat:last-child {
    border-bottom: 0;
  }
}

.beat .when {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.beat .when::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--line-2);
  flex: none;
}

.beat.is-boundary .when::before {
  background: var(--accent);
}

.beat.is-boundary .when {
  color: var(--accent);
}

.beat h3 {
  font-size: 1.05rem;
}

.beat p {
  color: var(--ink-2);
  font-size: 0.92rem;
}

/* ---------------------------------------------------------------------------
 * Split layout used by the queue, map and report sections
 * ------------------------------------------------------------------------ */

.split {
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  align-items: center;
}

.split.reverse {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
}

@media (max-width: 900px) {
  .split,
  .split.reverse {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Copy always precedes its illustration once they stack. */
  .split.reverse .split-copy {
    order: -1;
  }
}

.split-copy {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.split-copy h2 {
  font-size: clamp(1.55rem, 3.8vw, 2.15rem);
}

.split-copy p {
  color: var(--ink-2);
  font-size: 1rem;
}

/* The house bullet: a short accent dash rather than a disc. */
.tick-list {
  display: grid;
  gap: 0.6rem;
  margin: 0.2rem 0 0;
  padding: 0;
  list-style: none;
}

.tick-list li {
  position: relative;
  padding-left: 1.5rem;
  color: var(--ink-2);
  font-size: 0.95rem;
}

.tick-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 9px;
  height: 2px;
  background: var(--accent);
}

/* ---------------------------------------------------------------------------
 * Queue panel
 * ------------------------------------------------------------------------ */

.queue {
  font-family: var(--mono);
  font-size: 0.84rem;
}

.queue-row {
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr) auto;
  gap: 0.5rem 0.9rem;
  align-items: baseline;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}

.queue-row:last-of-type {
  border-bottom: 0;
}

.queue-row .pos {
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.queue-row .what {
  color: var(--ink);
}

.queue-row .at {
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.queue-row .meta {
  grid-column: 2 / -1;
  font-size: 0.76rem;
  color: var(--ink-3);
}

.queue-row .meta.warn {
  color: var(--warn);
}

.queue-row.is-locked {
  background: var(--accent-soft);
  border-left: 2px solid var(--accent);
  padding-left: calc(1rem - 2px);
}

.queue-row.is-locked .at {
  color: var(--accent);
}

/*
 * The accent wash lifts the row's background far enough that --ink-3 stops clearing
 * 4.5:1 on it in the dark theme (3.79:1). The secondary text on the locked row - and
 * only on the locked row, where the rest of the panel is fine at 4.87:1 - moves up one
 * step to --ink-2, which measures 6.80:1 there.
 */
.queue-row.is-locked .pos,
.queue-row.is-locked .meta {
  color: var(--ink-2);
}

.queue-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  padding: 0.7rem 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.76rem;
  color: var(--ink-3);
}

.tag {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.tag.on {
  border-color: var(--accent-line);
  color: var(--accent);
}

/* ---------------------------------------------------------------------------
 * Map
 * ------------------------------------------------------------------------ */

.map-frame {
  container-type: inline-size;
  padding: clamp(0.6rem, 2vw, 1.1rem);
  background: var(--bg-inset);
  border-radius: 0 0 var(--radius) var(--radius);
  overflow-x: auto;
}

.map {
  font-family: var(--mono);
  /*
   * A monospace advance is about 0.6em, so 0.2em of tracking makes a cell 0.8em wide,
   * and a 0.8 line box makes it 0.8em tall. A square on the grid then renders as an
   * actual square, which matters for a game where Chebyshev distance is a rule rather
   * than a flourish. 34 columns at 0.8em is 27.2em, so sizing the font at 100cqw/27.2
   * fills whatever width the figure is given, at any viewport, with no breakpoints.
   *
   * The cqw unit resolves against .map-frame's container-type. That ancestor is
   * load-bearing: without it the map falls back to the clamp floor and shrinks to 7px.
   */
  font-size: clamp(7px, 3.6cqw, 20px);
  line-height: 0.8;
  letter-spacing: 0.2em;
  display: block;
  min-width: max-content;
  user-select: none;
}

/*
 * Rows are blocks, so the newlines that make the generated markup readable collapse away
 * instead of being drawn. `white-space: pre` therefore sits on the runs, where it is
 * needed to keep runs of blank void cells from collapsing, and nowhere else - putting it
 * on the container would render every source newline as a second, empty line.
 */
.map .row {
  display: block;
  height: 0.8em;
}

.map i {
  font-style: normal;
  white-space: pre;
}

/*
 * The complete terrain vocabulary, one letter per type, kept whole even where a letter
 * is not currently on any map in the site. It mirrors the engine's terrain set, so
 * dropping the unused member (.z, void) would leave eleven of twelve types coloured and
 * the twelfth silently inheriting body text the first time a map used it.
 */
.map .p { color: var(--t-plain); }
.map .g { color: var(--t-grass); }
.map .d { color: var(--t-road); }
.map .l { color: var(--t-floor); }
.map .v { color: var(--t-forest); }
.map .u { color: var(--t-rubble); }
.map .s { color: var(--t-shallow); }
.map .w { color: var(--t-deep); }
.map .k { color: var(--t-rock); }
.map .b { color: var(--t-wall); }
.map .o { color: var(--t-door); }
.map .z { color: var(--t-void); }

/* The queued route, and the character standing at its start. */
.map .rt {
  background: color-mix(in srgb, var(--accent) 26%, transparent);
  color: var(--ink);
  border-radius: 2px;
}

.map .me {
  color: var(--on-accent);
  background: var(--accent);
  font-weight: 700;
  border-radius: 2px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  padding: 0.8rem 1rem;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--ink-2);
  background: var(--bg-2);
  border-radius: 0 0 var(--radius) var(--radius);
}

.legend span {
  white-space: nowrap;
}

.legend b {
  font-weight: 700;
  margin-right: 0.35rem;
}

/*
 * The terrain hue is scoped to the glyph, not to the whole entry.
 *
 * The map palette is chosen to read as terrain against the inset panel, and several of
 * those hues land between 3:1 and 4.5:1 against the legend's own background - fine for a
 * one-character colour swatch, not fine for the label word next to it. Painting the word
 * as well would have put "plain", "forest", "rock", "deep water" and "rubble" below the
 * normal-text threshold in the dark theme, and six entries below it in the light theme.
 * So <b> keeps the hue and the word inherits --ink-2 (8.74:1 dark, 7.31:1 light). The
 * swatch is decoration sitting immediately beside the name it stands for; the name is
 * what has to be readable.
 */
.legend .p b { color: var(--t-plain); }
.legend .g b { color: var(--t-grass); }
.legend .d b { color: var(--t-road); }
.legend .l b { color: var(--t-floor); }
.legend .v b { color: var(--t-forest); }
.legend .u b { color: var(--t-rubble); }
.legend .s b { color: var(--t-shallow); }
.legend .w b { color: var(--t-deep); }
.legend .k b { color: var(--t-rock); }
.legend .b b { color: var(--t-wall); }
.legend .o b { color: var(--t-door); }
.legend .z b { color: var(--t-void); }

/*
 * Impassable terrain carries a second, non-colour cue so the walkable/blocked distinction
 * never depends on colour alone. The design requires this of the clients, and a marketing
 * page that ignored it would be advertising something the game does not do.
 */
.legend .blocked b::after {
  content: " \00d7";
  color: var(--ink-3);
}

.map-frame + .legend {
  border-radius: 0;
}

/* ---------------------------------------------------------------------------
 * Tick report
 * ------------------------------------------------------------------------ */

.report {
  font-family: var(--mono);
  font-size: 0.84rem;
}

.report-row {
  display: grid;
  grid-template-columns: 11.5rem minmax(0, 1fr);
  gap: 0.35rem 1rem;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
}

.report-row:last-child {
  border-bottom: 0;
}

@media (max-width: 560px) {
  .report-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.15rem;
  }
}

.report-row dt {
  color: var(--ink-3);
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  margin: 0;
}

.report-row dd {
  margin: 0;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.report-row dd .hl {
  color: var(--accent);
}

.report-row dd .dim {
  color: var(--ink-3);
}

/*
 * A resolved action either worked or it did not, and both are ordinary. The original had
 * only the success half; a report showing nothing but successes is a brochure.
 * Both carry a glyph as well as a colour - write them as
 *   <span class="ok">Success</span>   <span class="bad">Failed</span>
 */
.report-row dd .ok,
.report-row dd .bad {
  font-weight: 700;
}

.report-row dd .ok {
  color: var(--good);
}

.report-row dd .ok::before {
  content: "\2713\00a0";
}

.report-row dd .bad {
  color: var(--warn);
}

.report-row dd .bad::before {
  content: "\00d7\00a0";
}

/* ---------------------------------------------------------------------------
 * Plain-spoken section
 * ------------------------------------------------------------------------ */

.plain {
  background: var(--bg-2);
  border-block: 1px solid var(--line);
}

.plain-grid {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3rem);
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

@media (max-width: 820px) {
  .plain-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.plain-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}

.plain-list li {
  display: grid;
  grid-template-columns: 1.4rem minmax(0, 1fr);
  gap: 0.7rem;
  color: var(--ink-2);
  font-size: 0.96rem;
}

.plain-list li::before {
  font-family: var(--mono);
  font-weight: 700;
  line-height: 1.6;
}

.plain-list.no li::before {
  content: "\00d7";
  color: var(--warn);
}

.plain-list.yes li::before {
  content: "\2713";
  color: var(--good);
}

/* ---------------------------------------------------------------------------
 * FAQ
 * ------------------------------------------------------------------------ */

.faq {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-2);
}

.faq details {
  border-bottom: 1px solid var(--line);
}

.faq details:last-child {
  border-bottom: 0;
}

.faq summary {
  padding: 1rem 1.2rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.98rem;
  list-style: none;
  display: flex;
  gap: 1rem;
  align-items: baseline;
  justify-content: space-between;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  font-family: var(--mono);
  color: var(--accent);
  font-size: 1.05rem;
  flex: none;
}

.faq details[open] summary::after {
  content: "\2212";
}

.faq summary:hover {
  background: var(--bg-3);
}

/* Required wrapper: a bare <p> inside <details> gets none of this padding. */
.faq .answer {
  padding: 0 1.2rem 1.2rem;
  color: var(--ink-2);
  font-size: 0.96rem;
  display: grid;
  gap: 0.7rem;
  max-width: 72ch;
}

/* ---------------------------------------------------------------------------
 * Closing call to action
 * ------------------------------------------------------------------------ */

.cta {
  text-align: center;
  border-top: 1px solid var(--line);
  background:
    radial-gradient(120% 100% at 50% 0%, var(--accent-soft) 0%, transparent 60%),
    var(--bg);
}

.cta .inner {
  display: grid;
  gap: 1.3rem;
  justify-items: center;
  max-width: 60ch;
  margin-inline: auto;
}

.cta h2 {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
}

.cta p {
  color: var(--ink-2);
}

/*
 * The radial above is centred at 50% 0%, which is exactly where the eyebrow sits, so the
 * eyebrow is the one piece of text on the page standing on undiluted --accent-soft.
 * --ink-3 measures 4.03:1 there in the dark theme; --ink-2 measures 7.24:1.
 */
.cta .eyebrow {
  color: var(--ink-2);
}

/* ---------------------------------------------------------------------------
 * Footer
 * ------------------------------------------------------------------------ */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-2);
  padding-block: clamp(2.5rem, 6vw, 3.5rem);
  font-size: 0.9rem;
}

.footer-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
}

/* The about blurb plus three link columns. */
.footer-grid.cols-4 {
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
}

@media (max-width: 980px) {
  .footer-grid.cols-4 {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .footer-grid,
  .footer-grid.cols-4 {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.75rem;
  }
}

.site-footer h2 {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
  margin-bottom: 0.8rem;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.site-footer a {
  color: var(--ink-2);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.footer-about p {
  color: var(--ink-3);
  font-size: 0.88rem;
  max-width: 40ch;
  margin-top: 0.85rem;
}

.footer-bottom {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.5rem;
  justify-content: space-between;
  color: var(--ink-3);
  font-size: 0.82rem;
}

/* ---------------------------------------------------------------------------
 * Interior document pages (privacy, and anything else that is mostly prose)
 * ------------------------------------------------------------------------ */

.doc {
  padding-block: clamp(2.5rem, 7vw, 4.5rem) clamp(3rem, 8vw, 5rem);
}

/* Every direct child gets the same gap, which is why the headings compensate below. */
.doc .inner {
  max-width: 74ch;
  display: grid;
  gap: 1.15rem;
}

.doc h1 {
  font-size: clamp(1.9rem, 5.5vw, 2.7rem);
  margin-bottom: 0.3rem;
}

.doc h2 {
  font-size: 1.2rem;
  margin-top: 1.75rem;
}

.doc h3 {
  font-size: 1rem;
  margin-top: 1rem;
}

.doc p,
.doc li {
  color: var(--ink-2);
}

.doc ul,
.doc ol {
  margin: 0;
  padding-left: 1.3rem;
  display: grid;
  gap: 0.5rem;
}

.doc .updated {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-3);
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  display: block;
  overflow-x: auto;
}

.doc th,
.doc td {
  text-align: left;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  color: var(--ink-2);
}

.doc th {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* A centred single-panel page: 404, and anything else with one thing to say. */
.stage {
  display: grid;
  gap: 1.5rem;
  justify-items: center;
  text-align: center;
  padding-block: clamp(3rem, 10vw, 6rem);
}

.stage .panel {
  width: min(100%, 560px);
  text-align: left;
}

/* ===========================================================================
 * MULTI-PAGE ADDITIONS
 *
 * Everything above was written for one long landing page and four short legal
 * documents. Everything below is what a seven-page site needs that a one-pager did
 * not: a way to open an interior page, a way to state build status without spin, and
 * a way to leave a page for the next one.
 *
 * Two rules hold throughout, and both are house rules rather than taste:
 *   - No meaning is ever carried by colour alone. Every state that matters carries a
 *     word and a glyph as well as a hue. The game's own clients are required to do
 *     this; a site that did not would be advertising something untrue.
 *   - No new tokens. If a value is not in the four blocks at the top of this file, it
 *     is derived with color-mix() from something that is, so both themes stay correct
 *     without either being written twice.
 * ======================================================================== */

/* ---------------------------------------------------------------------------
 * Page header - the opening block of every interior page
 * ------------------------------------------------------------------------ */

.page-header {
  padding-block: clamp(2.5rem, 7vw, 4.25rem) clamp(1.75rem, 4vw, 2.75rem);
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}

/* The same quiet grid as the hero, at half strength. An interior page is not an entrance. */
.page-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 34px 34px;
  opacity: 0.25;
  mask-image: radial-gradient(120% 90% at 80% 0%, #000 0%, transparent 65%);
  pointer-events: none;
}

.page-header .wrap {
  position: relative;
  display: grid;
  gap: 1rem;
}

.page-header h1 {
  font-size: clamp(2rem, 5.6vw, 3.1rem);
  letter-spacing: -0.03em;
  max-width: 20ch;
}

.page-header h1 em {
  font-style: normal;
  color: var(--accent);
}

.page-header .lead {
  color: var(--ink-2);
  font-size: clamp(1rem, 2.2vw, 1.13rem);
  max-width: 60ch;
}

/*
 * The optional meta row: short factual pairs under the lead. Two carriers again - the
 * label is a word, not an icon, so nothing here depends on recognising a symbol.
 */
.page-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
  margin: 0.35rem 0 0;
  padding: 0.85rem 0 0;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.74rem;
  list-style: none;
}

.page-meta li {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.page-meta .k {
  color: var(--ink-3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.page-meta .v {
  color: var(--ink);
}

/* ---------------------------------------------------------------------------
 * Status list - what is built, what is designed, what has not been started
 *
 * The most important component on this site. It is what lets a page put "tick
 * resolution: built in code" next to "public server: not started" on one line each,
 * with no adjective doing work in between. The state is a word first, a glyph second
 * and a colour third; drop the colour entirely and it still reads correctly.
 * ------------------------------------------------------------------------ */

.status-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-2);
}

.status-item {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: 0.35rem 1.5rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 65%, transparent);
}

.status-item:last-child {
  border-bottom: 0;
}

@media (max-width: 620px) {
  .status-item {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.4rem;
  }
}

.status-item .state {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  margin: 0;
}

.status-item .state::before {
  font-weight: 700;
  flex: none;
}

/* Written and working in the private codebase, with tests, in development. */
.status-item .state.built {
  color: var(--good);
}

.status-item .state.built::before {
  content: "\2713";
}

/* Being worked on now. */
.status-item .state.progress {
  color: var(--accent);
}

.status-item .state.progress::before {
  content: "\2192";
}

/* Written down as design, with no code behind it. */
.status-item .state.designed {
  color: var(--cool);
}

.status-item .state.designed::before {
  content: "\00b7";
}

/* Not started. Not a promise that it will be. */
.status-item .state.later {
  color: var(--ink-3);
}

.status-item .state.later::before {
  content: "\2013";
}

/*
 * h3 or h4, because the level depends on nesting rather than on the component. A list of
 * status items sitting directly under a section h2 heads its items at h3; a list that a
 * .subhead h3 has already grouped and named heads its items at h4, so that navigating by
 * heading tells a screen-reader user which entries belong to which group. The two render
 * identically on purpose.
 */
.status-item :is(h3, h4) {
  font-size: 1rem;
}

.status-item p {
  color: var(--ink-2);
  font-size: 0.93rem;
}

/*
 * A phase card grid, for the same information at a coarser grain. Same .state
 * vocabulary, same glyphs, so a reader learns it once.
 */
.phase-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

.phase {
  display: grid;
  gap: 0.7rem;
  align-content: start;
  padding: 1.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
}

.phase .state {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  margin: 0;
}

.phase .state::before {
  font-weight: 700;
  flex: none;
}

.phase .state.built { color: var(--good); }
.phase .state.built::before { content: "\2713"; }
.phase .state.progress { color: var(--accent); }
.phase .state.progress::before { content: "\2192"; }
.phase .state.designed { color: var(--cool); }
.phase .state.designed::before { content: "\00b7"; }
.phase .state.later { color: var(--ink-3); }
.phase .state.later::before { content: "\2013"; }

.phase h3 {
  font-size: 1.08rem;
}

.phase p {
  color: var(--ink-2);
  font-size: 0.95rem;
}

/* A phase whose contents are a list rather than a paragraph. */
.phase .tick-list li {
  font-size: 0.92rem;
}

/* ---------------------------------------------------------------------------
 * Spec list - term and description, at prose weight
 *
 * .report-row already does this, but in mono, inside a panel, at 11.5rem. This is the
 * version for a page that is explaining a rule rather than showing a machine's output.
 * ------------------------------------------------------------------------ */

.spec {
  margin: 0;
  display: grid;
  gap: 0;
}

.spec > div {
  display: grid;
  grid-template-columns: minmax(0, 14rem) minmax(0, 1fr);
  gap: 0.35rem 1.75rem;
  padding: 0.95rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}

.spec > div:last-child {
  border-bottom: 0;
}

@media (max-width: 640px) {
  .spec > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.25rem;
  }
}

.spec dt {
  margin: 0;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.95rem;
}

.spec dd {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.95rem;
}

/* Boxed variant, for when the list is the whole point of a section. */
.spec.boxed {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
  padding: 0 1.2rem;
}

/* ---------------------------------------------------------------------------
 * Comparison table
 *
 * Two columns of claims, side by side. On narrow screens it becomes stacked rows with
 * the column heading repeated as a label on each cell, because a two-column table
 * scrolled sideways on a phone is a table nobody reads.
 *
 * Markup, and the data-label attributes are not optional:
 *   <div class="table-scroll">
 *     <table class="compare">
 *       <caption>How a Tick differs from a turn</caption>
 *       <thead><tr><th scope="col">Question</th><th scope="col">Atomic Tick</th>
 *                  <th scope="col">A real-time game</th></tr></thead>
 *       <tbody>
 *         <tr><th scope="row">Who moves first</th>
 *             <td data-label="Atomic Tick">Nobody. Every order resolves at the boundary.</td>
 *             <td data-label="A real-time game">Whoever clicked first.</td></tr>
 *       </tbody>
 *     </table>
 *   </div>
 * ------------------------------------------------------------------------ */

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.compare {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}

.compare caption {
  caption-side: top;
  text-align: left;
  padding-bottom: 0.7rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.compare th,
.compare td {
  text-align: left;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  color: var(--ink-2);
}

.compare thead th {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  border-bottom-color: var(--line-2);
  white-space: nowrap;
}

.compare tbody th[scope="row"] {
  color: var(--ink);
  font-weight: 600;
  width: 1%;
  white-space: nowrap;
}

.compare tbody tr:last-child th,
.compare tbody tr:last-child td {
  border-bottom: 0;
}

/* Yes and no in a cell carry a glyph, so the answer survives being printed in grey. */
.compare .yes {
  color: var(--good);
}

.compare .yes::before {
  content: "\2713\00a0";
}

.compare .no {
  color: var(--warn);
}

.compare .no::before {
  content: "\00d7\00a0";
}

@media (max-width: 700px) {
  .compare,
  .compare thead,
  .compare tbody,
  .compare tr,
  .compare th,
  .compare td {
    display: block;
  }

  /* A table-caption child of a display:block parent generates an anonymous table
     wrapper around itself. Make it an ordinary block instead. */
  .compare caption {
    display: block;
  }

  /*
   * Removed outright rather than clipped.
   *
   * `display: block` above takes the table role out of the accessibility tree in every
   * engine, and once it is gone `<th scope="col">` associates with nothing. A clipped
   * thead is then not a set of column headers - it is a loose run of four words read out
   * ahead of the first row. Every <td> in every one of these tables carries a data-label
   * that ::before prints as the cell's own column name, so the information is already
   * where it needs to be, on the cell.
   */
  .compare thead {
    display: none;
  }

  .compare tbody tr {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-2);
    padding: 0.25rem 0;
    margin-bottom: 0.75rem;
  }

  .compare tbody tr:last-child {
    margin-bottom: 0;
  }

  .compare tbody th[scope="row"] {
    width: auto;
    white-space: normal;
    border-bottom: 1px solid var(--line);
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    padding-bottom: 0.6rem;
  }

  .compare tbody td {
    border-bottom: 0;
    padding-block: 0.55rem 0.15rem;
  }

  /* The column heading, restated per cell, so a stacked row still says whose claim it is. */
  .compare tbody td::before {
    content: attr(data-label);
    display: block;
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-3);
    margin-bottom: 0.2rem;
  }

  .compare tbody td:not([data-label])::before {
    content: none;
  }
}

/* ---------------------------------------------------------------------------
 * Laws - numbered principles
 *
 * The design laws are numbered and the numbers are load-bearing: they are how the
 * design documents refer to each other. The number is real content, so it lives in the
 * markup rather than in a CSS counter.
 * ------------------------------------------------------------------------ */

.law-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}

.law {
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr);
  gap: 0.6rem 1rem;
  align-content: start;
  padding: 1.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
}

/* The number sits in its own column and spans both rows of copy beside it. */
.law .n {
  grid-row: 1 / span 2;
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  padding-top: 0.1em;
  margin: 0;
}

.law h3 {
  font-size: 1.05rem;
  align-self: center;
}

.law p {
  color: var(--ink-2);
  font-size: 0.94rem;
}

/* A law with a consequence spelled out underneath it. */
.law .because {
  grid-column: 2;
  font-size: 0.88rem;
  color: var(--ink-3);
  border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  padding-top: 0.7rem;
}

@media (max-width: 480px) {
  .law {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.55rem;
  }

  .law .n {
    grid-row: auto;
  }

  .law .because {
    grid-column: 1;
  }
}

/* ---------------------------------------------------------------------------
 * Pull quote / principle block
 *
 * One sentence, set large, with a rule beside it. Not a testimonial - there is nobody
 * to quote yet - so it takes a <blockquote> only when it really is a quotation and a
 * plain <p class="pull"> otherwise.
 * ------------------------------------------------------------------------ */

.pull {
  margin: 0;
  padding: 0.4rem 0 0.4rem 1.35rem;
  border-left: 3px solid var(--accent);
  font-size: clamp(1.15rem, 2.8vw, 1.5rem);
  line-height: 1.35;
  letter-spacing: -0.015em;
  font-weight: 600;
  color: var(--ink);
  text-wrap: balance;
  max-width: 34ch;
}

.pull.wide {
  max-width: 52ch;
}

/* Attribution, when there genuinely is one. */
.pull-cite {
  display: block;
  margin-top: 0.85rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-style: normal;
  font-weight: 400;
}

/* ---------------------------------------------------------------------------
 * Callouts
 *
 * Two flavours plus a neutral, which is all this site needs. Each carries a label word,
 * so the difference between them is readable rather than merely visible — a reader who
 * cannot distinguish the border colours still gets "Not built yet" in words.
 *
 *   <p class="callout status"><span class="label">Where this is</span>
 *      Tick resolution runs in development. Nothing is deployed.</p>
 *
 *   <div class="callout unbuilt"><p class="label">Not built yet</p>
 *      <p>There is no server, no account and nothing to sign in to.</p></div>
 * ------------------------------------------------------------------------ */

.callout {
  padding: 1rem 1.15rem;
  border: 1px solid var(--accent-line);
  border-left-width: 3px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--ink-2);
  font-size: 0.93rem;
  display: grid;
  gap: 0.5rem;
}

.callout strong {
  color: var(--ink);
}

/*
 * Works on a <p class="label"> and on an inline <span class="label"> alike.
 *
 * --ink-2 rather than --ink-3 because the plain callout's background is the accent wash,
 * which lifts far enough that --ink-3 falls to 4.03:1 on it in the dark theme. The .info
 * flavour swaps that background for --bg-3 and takes --ink-3 back below.
 */
.callout .label {
  display: block;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin: 0;
}

/* Neutral: an aside, a definition, a pointer somewhere else. */
.callout.info {
  border-color: var(--line-2);
  background: var(--bg-3);
}

/* On --bg-3 the quieter label still clears AA: 4.53:1 dark, 4.81:1 light. */
.callout.info .label {
  color: var(--ink-3);
}

/*
 * Honest status: what exists today, stated plainly. Cool rather than amber, because
 * amber is the site's emphasis colour and this is not an alarm - it is a fact.
 */
.callout.status {
  border-color: color-mix(in srgb, var(--cool) 45%, transparent);
  background: color-mix(in srgb, var(--cool) 9%, transparent);
}

.callout.status .label {
  color: var(--cool);
}

.callout.status .label::before {
  content: "\00b7\00a0";
  font-weight: 700;
}

/*
 * Not built yet. The one variant this site will use most, and the one it must never
 * soften: no server, no account, no demo, no waitlist.
 */
.callout.unbuilt {
  border-color: color-mix(in srgb, var(--warn) 50%, transparent);
  background: color-mix(in srgb, var(--warn) 10%, transparent);
}

.callout.unbuilt .label {
  color: var(--warn);
}

.callout.unbuilt .label::before {
  content: "\00d7\00a0";
  font-weight: 700;
}

/* ---------------------------------------------------------------------------
 * On-page contents
 * ------------------------------------------------------------------------ */

.toc {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
  padding: 1.1rem 1.25rem;
}

.toc h2 {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
  counter-reset: toc;
}

.toc li {
  counter-increment: toc;
  display: grid;
  grid-template-columns: 1.9rem minmax(0, 1fr);
  gap: 0.6rem;
}

.toc li::before {
  content: counter(toc, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
  line-height: 1.9;
}

.toc a {
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.95rem;
}

.toc a:hover {
  color: var(--ink);
  text-decoration: underline;
}

/* ---------------------------------------------------------------------------
 * Prev / next
 *
 * The pages are meant to be read in order, so every one of them says what came before
 * and what comes next. Either half may be omitted; the flex justification keeps a lone
 * "next" on the right where it belongs.
 * ------------------------------------------------------------------------ */

.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
  align-items: start;
  margin-top: clamp(2.5rem, 6vw, 4rem);
  padding-top: 1.35rem;
  border-top: 1px solid var(--line);
  font-size: 0.95rem;
}

.pager a {
  color: var(--ink-2);
  text-decoration: none;
  display: grid;
  gap: 0.25rem;
  max-width: 24ch;
}

.pager a:hover {
  color: var(--ink);
}

.pager a:hover .where {
  text-decoration: underline;
}

.pager .dir {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.pager .where {
  font-weight: 600;
  color: var(--ink);
}

/* A lone next link still sits on the right, with nothing to be pushed by. */
.pager .next {
  text-align: right;
  margin-left: auto;
}

/* ---------------------------------------------------------------------------
 * Small utilities
 *
 * Each of these replaces an inline style= that the original site repeated. They exist
 * so that the same decision is not made five times in five files.
 * ------------------------------------------------------------------------ */

.stack {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.stack.tight {
  gap: 0.6rem;
}

.stack.loose {
  gap: 1.6rem;
}

/* A section-level subheading in the mono label style. Use instead of .eyebrow on an h3. */
.subhead {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
  margin: 0 0 1rem;
}

.measure {
  max-width: 62ch;
}

.measure-sm {
  max-width: 46ch;
}

.muted {
  color: var(--ink-2);
}

.dimmed {
  color: var(--ink-3);
}

.title-lg {
  font-size: clamp(1.9rem, 5.5vw, 2.7rem);
}

/*
 * Keeps a short phrase from being split across a line break. Used on the hero
 * eyebrow, where the clauses are separated by middots and a break inside one
 * reads as a break between them.
 *
 * Only for phrases short enough that they can never be wider than the narrowest
 * supported viewport — at 320px a nowrap span longer than about 30 characters
 * becomes the thing that pushes the page into horizontal scroll.
 */
.nowrap {
  white-space: nowrap;
}

/* ---------------------------------------------------------------------------
 * Print
 *
 * Nobody prints a marketing page, but somebody will print the privacy page, and the
 * design laws are the kind of thing that ends up on a wall.
 * ------------------------------------------------------------------------ */

@media print {
  .site-header,
  .site-footer,
  .skip,
  .theme-toggle,
  .cta,
  .pager,
  .hero::before,
  .page-header::before {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
  }

  .panel,
  .card,
  .phase,
  .law,
  .status-item,
  .callout {
    break-inside: avoid;
  }

  a[href^="https://"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    color: #555;
  }
}
