  :root {
    --ink:        #131e1d;
    --ink-2:      #1b2827;
    --stone:      #efe6d2;
    --stone-dim:  #c9c0ac;
    --gold:       #e6c77e;
    --teal:       #2f5e5b;
    --dormant:    #8a8a82;

    --bg:         var(--ink);
    --bg-2:       var(--ink-2);
    --fg:         var(--stone);
    --fg-quiet:   #9aa8a5;
    --rule:       rgba(230,199,126,.24);
    --accent:     var(--gold);
    --plate-dim:  .34;

    --display: "Hoefler Text","Iowan Old Style","Palatino Linotype",Palatino,Georgia,serif;
    --ui: "Avenir Next",Avenir,"Helvetica Neue",system-ui,sans-serif;
    --data: ui-monospace,"SF Mono",Menlo,monospace;

    --measure: 34rem;
    --step: clamp(2.2rem, 5vw, 4.5rem);
  }
  @media (prefers-color-scheme: light) {
    :root {
      --bg: #e7dcc4; --bg-2: #f2ead8;
      --fg: #17201d; --fg-quiet: #5c6a63;
      --rule: rgba(47,94,91,.28);
      --accent: #8a6b28;
      --plate-dim: .18;
    }
  }
  :root[data-theme="dark"] {
    --bg: var(--ink); --bg-2: var(--ink-2);
    --fg: var(--stone); --fg-quiet: #9aa8a5;
    --rule: rgba(230,199,126,.24);
    --accent: var(--gold);
    --plate-dim: .34;
  }
  :root[data-theme="light"] {
    --bg: #e7dcc4; --bg-2: #f2ead8;
    --fg: #17201d; --fg-quiet: #5c6a63;
    --rule: rgba(47,94,91,.28);
    --accent: #8a6b28;
    --plate-dim: .18;
  }

  * { box-sizing: border-box; }
  body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: var(--ui);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
  }
  img { max-width: 100%; display: block; }

  .wrap { width: min(100% - 2.5rem, 62rem); margin-inline: auto; }
  .col  { max-width: var(--measure); }

  h1,h2,h3 { font-family: var(--display); font-weight: 400; text-wrap: balance; margin: 0; }
  h2 { font-size: clamp(1.6rem, 3.2vw, 2.5rem); line-height: 1.15; letter-spacing: -.01em; }
  h3 { font-size: 1.35rem; line-height: 1.2; }
  p  { margin: 0; }

  .eyebrow {
    font-size: .69rem; font-weight: 600; letter-spacing: .22em; text-transform: uppercase;
    color: var(--accent); margin: 0 0 .9rem;
  }
  .rule { height: 1px; background: var(--rule); border: 0; margin: 0; }

  /* diamond: the stone the courtyard is paved with, used as the page's marker */
  .dia {
    width: 7px; height: 7px; flex: none; transform: rotate(45deg);
    border: 1px solid var(--accent); margin-top: .55rem;
  }

  section { padding-block: var(--step); }

  /* &#9472;&#9472; hero: the game's own verb, as the page's first interaction &#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472; */
  header.hero { padding-block: clamp(3rem, 8vw, 6rem) var(--step); }
  .wordmark {
    font-family: var(--display);
    font-size: clamp(3.6rem, 13vw, 8.5rem);
    line-height: .9; letter-spacing: -.03em; margin: 0;
  }
  .tagline {
    font-family: var(--display); font-style: italic;
    font-size: clamp(1.1rem, 2.4vw, 1.5rem);
    color: var(--fg); margin-top: 1rem; max-width: 30ch;
  }
  .hero-meta {
    display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; margin-top: 1.6rem;
    font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--fg-quiet);
  }

  /* &#9472;&#9472; the restorer &#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472; */
  .restorer { margin-top: clamp(2rem, 5vw, 3.2rem); }
  .stage {
    position: relative; overflow: hidden;
    background: var(--bg-2); border: 1px solid var(--rule);
    /* The plates are 9:16. On a phone a 16/10 crop leaves a letterbox slot of a
       painting, so the stage keeps more height until there is width to spend. */
    aspect-ratio: 4 / 5;
  }
  @media (min-width: 40rem) { .stage { aspect-ratio: 16 / 10; } }
  .stage img {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
    object-position: 50% 42%;
  }
  /* no filter: bgr-1-0 is the painted 0% state, so the art is already the
     dormant one &mdash; dimming it again would stop matching the game */
  .stage .live { clip-path: inset(0 0 0 var(--split, 50%)); }
  .seam {
    position: absolute; top: 0; bottom: 0; left: var(--split, 50%);
    width: 1px; background: var(--gold);
    box-shadow: 0 0 22px 3px rgba(230,199,126,.55);
    pointer-events: none;
  }
  .seam::after {
    content: ""; position: absolute; top: 50%; left: 50%;
    width: 34px; height: 34px; transform: translate(-50%,-50%) rotate(45deg);
    border: 1px solid var(--gold); background: rgba(19,30,29,.35);
    backdrop-filter: blur(2px);
  }
  .stage input[type="range"] {
    position: absolute; inset: 0; width: 100%; height: 100%;
    margin: 0; opacity: 0; cursor: ew-resize;
  }
  .stage input:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
  .stage figcaption {
    position: absolute; inset: auto 0 0 0; display: flex; justify-content: space-between;
    padding: .7rem .9rem;
    font-size: .64rem; letter-spacing: .2em; text-transform: uppercase;
    color: var(--stone); background: linear-gradient(transparent, rgba(10,18,17,.85));
    pointer-events: none;
  }
  .restorer > p {
    margin-top: .8rem; font-size: .8rem; color: var(--fg-quiet);
    letter-spacing: .02em;
  }

  /* &#9472;&#9472; prose &#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472; */
  .lede { font-size: 1.12rem; margin-top: 1.1rem; }
  .lede + .lede { margin-top: 1rem; }

  .split { display: grid; gap: clamp(1.6rem, 4vw, 3rem); align-items: center; }
  @media (min-width: 46rem) { .split { grid-template-columns: 1fr 20rem; } }
  .shot {
    border: 1px solid var(--rule);
    /* a 9:16 phone shot in a single-column layout would otherwise run taller
       than the screen it is being read on */
    max-height: 78vh; width: auto; margin-inline: auto;
  }

  /* &#9472;&#9472; chapters &#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472; */
  .chapters { display: grid; gap: 1px; background: var(--rule); margin-top: 2rem; }
  @media (min-width: 46rem) { .chapters { grid-template-columns: 1fr 1fr; } }
  .chapter { background: var(--bg); padding: 1.4rem; display: grid; gap: 1rem; }
  @media (min-width: 30rem) { .chapter { grid-template-columns: 7.5rem 1fr; } }
  .plate { position: relative; aspect-ratio: 3 / 4; overflow: hidden; }
  .plate img {
    width: 100%; height: 100%; object-fit: cover;
    filter: saturate(calc(1 - var(--plate-dim))) brightness(.86);
    transition: filter .8s ease, transform .8s ease;
  }
  .chapter:hover .plate img, .chapter:focus-within .plate img {
    filter: none; transform: scale(1.03);
  }
  .numeral {
    position: absolute; left: 0; bottom: 0; padding: .2rem .45rem;
    font-family: var(--data); font-size: .7rem; color: var(--stone);
    background: rgba(10,18,17,.72);
  }
  .chapter-text { display: grid; gap: .45rem; align-content: start; }
  .arch { font-size: .88rem; color: var(--fg-quiet); }
  .beat { font-family: var(--display); font-style: italic; font-size: .95rem; }

  /* &#9472;&#9472; lists &#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472; */
  ul.plain { list-style: none; padding: 0; margin: 1.4rem 0 0; display: grid; gap: .85rem; }
  ul.plain li { display: flex; gap: .85rem; align-items: flex-start; }
  ul.plain strong { font-weight: 600; }
  .absent li { color: var(--fg-quiet); }
  .absent .dia { border-color: var(--fg-quiet); }

  /* &#9472;&#9472; spec table for editors &#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472; */
  .specs { margin-top: 1.8rem; overflow-x: auto; }
  table { border-collapse: collapse; width: 100%; font-size: .86rem; }
  th, td { text-align: left; padding: .72rem .9rem; border-bottom: 1px solid var(--rule); }
  th {
    font-size: .66rem; letter-spacing: .16em; text-transform: uppercase;
    color: var(--accent); font-weight: 600; white-space: nowrap;
  }
  td { font-variant-numeric: tabular-nums; }
  td:first-child { color: var(--fg-quiet); width: 42%; }

  .band { background: var(--bg-2); }

  footer { padding-block: var(--step); font-size: .78rem; color: var(--fg-quiet); }
  footer .wordmark-sm { font-family: var(--display); font-size: 1.4rem; color: var(--fg); }

  /* Entrance animation, not a scroll reveal.
     The first version set opacity:0 on every section and relied on an
     IntersectionObserver to undo it. In a throttled or hidden tab the observer
     never fires and its failsafe timer never runs, so every section below the
     hero stayed blank &mdash; measured in a browser, not theorised. A CSS
     animation with fill-mode both cannot strand content: the worst case is that
     it has already finished. */
  .rise { animation: rise .8s cubic-bezier(.2,.7,.3,1) both; }
  .rise-2 { animation-delay: .12s; }
  .rise-3 { animation-delay: .24s; }
  .rise-4 { animation-delay: .36s; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
  }
  @media (prefers-reduced-motion: reduce) {
    .rise { animation: none; }
    .plate img { transition: none; }
  }

  /* ---- sound ------------------------------------------------------------
     Off until asked, and the file is not even fetched until then: a 3 MB
     download nobody requested is a worse first impression than silence, and
     every browser blocks audible autoplay anyway. The control says which state
     it is in, not which state it would move to. */
  .sound {
    position: fixed; right: 1rem; bottom: 1rem; z-index: 20;
    display: inline-flex; align-items: center; gap: .6rem;
    padding: .55rem .9rem;
    font: inherit; font-size: .68rem; letter-spacing: .18em; text-transform: uppercase;
    color: var(--fg); background: color-mix(in srgb, var(--bg) 86%, transparent);
    border: 1px solid var(--rule); border-radius: 0;
    cursor: pointer; backdrop-filter: blur(6px);
    transition: color .3s ease, border-color .3s ease;
  }
  .sound:hover, .sound:focus-visible { border-color: var(--accent); color: var(--accent); }
  .sound:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
  .sound .wave { display: inline-flex; align-items: flex-end; gap: 2px; height: 11px; }
  .sound .wave i {
    width: 2px; height: 3px; background: currentColor; display: block;
    transform-origin: bottom;
  }
  .sound[aria-pressed="true"] .wave i { animation: bar 1.1s ease-in-out infinite; }
  .sound[aria-pressed="true"] .wave i:nth-child(2) { animation-delay: .18s; }
  .sound[aria-pressed="true"] .wave i:nth-child(3) { animation-delay: .36s; }
  .sound[aria-pressed="true"] .wave i:nth-child(4) { animation-delay: .54s; }
  @keyframes bar { 0%,100% { height: 3px; } 50% { height: 11px; } }
  @media (prefers-reduced-motion: reduce) {
    .sound[aria-pressed="true"] .wave i { animation: none; height: 7px; }
  }
  @media (max-width: 30rem) { .sound { right: .75rem; bottom: .75rem; } }

/* ---- document pages (privacy, support) -------------------------------- */
.doc { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.doc h1 {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(2rem, 4.5vw, 3rem); line-height: 1.1; margin: 0;
}
.doc h2 { font-size: 1.3rem; margin-top: 2.4rem; }
.doc p, .doc li { margin-top: .9rem; }
.doc ul { padding-left: 1.1rem; }
.doc a { color: var(--accent); text-underline-offset: .2em; }
.doc .updated {
  font-size: .7rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--fg-quiet); margin-top: .8rem;
}
.backlink {
  display: inline-block; margin-bottom: 2rem;
  font-size: .7rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--fg-quiet); text-decoration: none;
}
.backlink:hover, .backlink:focus-visible { color: var(--accent); }
.qa { border-top: 1px solid var(--rule); padding-top: 1.2rem; margin-top: 1.6rem; }
.qa h3 { font-size: 1.05rem; }
