/* laterro.com: the site's page layouts only (home, server, news, rules, FAQ, 404) and its pictures (assets/art/, made
   by laterro/site/art/build.py: the game captures on the home page, the painted "Morning road" town in the inner
   pages' band). The tokens and components (header, buttons, windows, status pill, footer) are in ui.css, which every
   page loads first. Use only ui.css tokens here (laterro/site/dev/check-shared.mjs checks it).

   Motion: the home page's hero crossfades its game pictures (opacity only; site.js swaps .on, pauses while the hero is
   off screen or the tab hidden, and never starts under prefers-reduced-motion, where ui.css also stops every
   transition). */

/* ---------- home: the hero (game pictures, the headline, the main button) ---------- */
.home .site-footer { margin-top: 0; }
.hero-reel {
  position: relative; overflow: hidden; display: flex; align-items: flex-end;
  height: clamp(520px, calc(100svh - 150px), 820px); background: var(--l-bar-b);
}
.reel, .page-band > picture { position: absolute; inset: 0; display: block; }
.reel > picture { position: absolute; inset: 0; display: block; opacity: 0; transition: opacity 1.8s ease-in-out; }
.reel > picture.on { opacity: 1; }
.reel img, .page-band > picture img { display: block; width: 100%; height: 100%; object-fit: cover; }
.reel img { object-position: 50% 42%; }
.hero-reel::after {   /* the dusk under the headline: white text stays readable over any picture */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 66%; pointer-events: none;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--l-bar-b) 72%, transparent) 55%, color-mix(in srgb, var(--l-bar-b) 94%, transparent));
}
.hero-copy { position: relative; z-index: 2; padding-bottom: clamp(28px, 6vh, 60px); text-align: center; }
.hero-copy h1 {
  margin: 0 auto 22px; max-width: 22ch; font-size: clamp(2.3rem, 5.2vw, 4rem); line-height: 1.04;
  color: var(--l-bar-ink); text-shadow: 0 2px 18px rgba(0,0,0,.6);
}
.cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 12px; margin: 0; }
.hero-line { margin: 14px 0 0; color: var(--l-bar-muted); }
.hero-copy .touch-note { margin-left: auto; margin-right: auto; text-align: left; }
/* The hero's state (site.js heroState(); the table there and in docs/states.md "Site"): [data-cta][data-state] out | in
   | demo, [data-touch] on a touch-only device; no data-state (no script) is the HTML as shipped. The demo's answer can
   turn out into demo after the first paint, so both states lay out every button either one shows, in two cells: cell
   a the main button (out: Register, demo: the demo's), cell b the second (out: Play, demo: the demo's own Register). A
   button the state does not show keeps its room invisibly and no button changes place, and the two lines share one
   cell the same way: nothing moves when the answer arrives. Signed in, and on a touch-only device (never the demo),
   there is nothing to keep room for. */
.cta[data-state] { display: grid; grid-template-areas: "a b"; }
.cta[data-state="in"] { grid-template-areas: "b"; }
.cta[data-state] > :is([data-demo-link], [data-cta-register]) { grid-area: a; }
.cta[data-state] > :is([data-play], [data-demo]:not([data-demo-link])) { grid-area: b; }
.cta[data-state="out"] > [data-demo], .cta[data-state="demo"] > :not([data-demo]) { visibility: hidden; }
.cta[data-state="in"] > :not([data-play]), .cta[data-touch] > [data-demo] { display: none; }
.hero-lines { display: grid; }
.hero-lines > .hero-line { grid-area: 1 / 1; }
[data-cta][data-state="out"] ~ .hero-lines > [data-demo], [data-cta][data-state="demo"] ~ .hero-lines > [data-demo-off] { visibility: hidden; }
[data-cta]:is([data-state="in"], [data-touch]) ~ .hero-lines > [data-demo] { display: none; }
/* the notes: why Play is blocked (status.js) not beside the demo's button (its own sandbox; Play is not shown); the
   phone note (ui.css) only to a signed-out visitor, it says "register here" */
[data-cta][data-state="demo"] ~ .play-note, [data-cta]:is([data-state="in"], [data-state="demo"]) ~ .touch-note { display: none; }
.play-note {
  margin: 14px auto 0; max-width: 46ch; font-size: .95rem; color: var(--l-ink); text-align: left;
  background: var(--l-paper); border-left: 3px solid var(--l-down); border-radius: 0 4px 4px 0; padding: 8px 12px;
}
[data-server="maintenance"] .play-note { border-left-color: var(--l-warn); }
.play-note.nudge { animation: nudge .35s ease-in-out; }
@keyframes nudge { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* ---------- home: the server at a glance (the status pill first, no player count: owner, 2026-10-27) ---------- */
.facts-strip {
  background: var(--l-paper); border-bottom: 1px solid var(--l-inner);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--l-metal) 35%, transparent);
}
.strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 14px 22px;
  margin: 0; padding: 18px 0;
}
.strip > div { padding-left: 12px; border-left: 2px solid var(--l-metal); }
.strip dt { font-size: .8rem; color: var(--l-muted); }
.strip dd { margin: 2px 0 0; font-weight: 700; font-size: .95rem; line-height: 1.35; }
.strip .status { font-size: .95rem; }
.facts-strip .server-note { margin: 0 0 16px; font-size: .95rem; }

/* ---------- home: the sections under it ---------- */
.band { padding: var(--l-s7) 0; }
.band.paper { background: var(--l-paper); border-top: 1px solid var(--l-line); border-bottom: 1px solid var(--l-line); }
.band h2 { margin: 0 0 var(--l-s5); font-size: clamp(1.8rem, 3.2vw, 2.4rem); }
.band .lede { margin: calc(-1 * var(--l-s3)) 0 var(--l-s5); color: var(--l-muted); }
.more { margin: var(--l-s6) 0 0; font-weight: 700; }
/* Why play here: six reasons, a name in the display face and one or two plain lines */
.reasons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px 44px; margin: 0; }
.reasons dt { margin: 0 0 6px; font: 700 1.3rem/1.2 var(--l-display); color: var(--l-wordmark); }
.reasons dd { margin: 0; max-width: 36ch; }
/* Start playing: a sequence, so numbered (brass numerals in the display face) */
.steps { list-style: none; counter-reset: step; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 44px; margin: 0; padding: 0; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 40px 1fr; column-gap: 10px; align-content: start; }
.steps li::before { content: counter(step); grid-row: span 2; font: 700 2.3rem/1 var(--l-display); color: var(--l-gold); }
.steps strong { font-size: 1.06rem; }
.steps p { margin: 2px 0 0; color: var(--l-muted); }
.needs { margin: var(--l-s6) 0 0; padding-top: var(--l-s4); border-top: 1px solid var(--l-line); }
/* the screenshots */
.shots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--l-s4); }
.shots figure { margin: 0; }
.shots img {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 9;
  border: 1px solid var(--l-frame); border-radius: 4px; box-shadow: var(--l-shadow);
}
.shots figcaption { margin-top: 6px; font-size: .9rem; color: var(--l-muted); }
/* Recent changes, How the server is run */
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 56px; align-items: start; }
.changes { list-style: none; margin: 0; padding: 0; }
.changes li { display: grid; grid-template-columns: 10em 1fr; gap: 4px 16px; padding: 12px 0; border-top: 1px solid var(--l-line); }
.changes li:last-child { border-bottom: 1px solid var(--l-line); }
.changes time { color: var(--l-muted); font-size: .92rem; padding-top: 1px; }
.changes p { margin: 0; }
/* owner text that does not exist yet: a loud placeholder, never mistaken for copy (RFC 0029 D4) */
.owner-todo {
  display: inline-block; padding: 4px 10px; font-weight: 700; color: var(--l-ink);
  border: 2px dashed var(--l-warn); border-radius: 4px; background: color-mix(in srgb, var(--l-warn) 12%, var(--l-paper));
}
p.owner-todo { display: block; margin: 0 0 10px; }

/* the facts as shaded rows (the Server page's windows) */
/* /server/: one flat summary in two columns and a three-column list of commands. No window frames here: a page
   of facts reads as a table. */
.summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 44px; align-items: start; margin: 10px 0 60px; }
.summary h2 { margin: 0; padding: 9px 12px; font-family: inherit; font-size: .95rem; font-weight: 700; line-height: 1.3; background: var(--l-row); border-bottom: 1px solid var(--l-frame); }
.keyfacts { display: grid; grid-template-columns: minmax(8.5em, 32%) 1fr; margin: 0; font-size: .94rem; }
.keyfacts > * { margin: 0; padding: 9px 12px; border-bottom: 1px solid var(--l-line); }
.keyfacts dt { font-weight: 700; }
.v-warn { color: var(--l-warn); font-weight: 700; }
.v-down { color: var(--l-down); font-weight: 700; }
.cmd-section h2 { margin: 0 0 26px; }
.cmd-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px 56px; margin: 0 0 30px; }
.cmd-grid dt { padding-bottom: 5px; border-bottom: 2px solid var(--l-metal); font-weight: 700; letter-spacing: .03em; }
.cmd-grid dd { margin: 8px 0 0; color: var(--l-muted); max-width: 36ch; }
.facts {
  display: grid; grid-template-columns: max-content 1fr; margin: 0; font-size: .94rem;
  border: 1px solid var(--l-line); border-radius: 3px; overflow: hidden;
}
.facts dt, .facts dd { margin: 0; padding: 7px 12px; }
.facts dt { font-weight: 700; font-size: .9rem; }
.facts dt:nth-of-type(odd), .facts dt:nth-of-type(odd) + dd { background: var(--l-row); }

/* ---------- inner pages: a slim band of the painting, then windows on parchment ---------- */
.page { position: relative; padding: 0 0 24px; }
.page-band { position: relative; height: 190px; overflow: hidden; background: var(--l-sky-a); border-bottom: 1px solid var(--l-inner); }
.page-band > picture img { object-position: 60% 82%; }
.page-band > picture::after { content: ""; position: absolute; inset: 0; background: var(--l-art-dim); }
.page > .wrap { padding-top: 30px; }
.page .lede { color: var(--l-muted); font-size: 1.08rem; max-width: 60ch; }
.page .win { margin: 0 0 24px; }
.prose { max-width: calc(72ch + 32px); }
.prose li { margin: .3em 0; }
.prose h4 { font: 700 1.02rem/1.3 var(--l-sans); margin: 1.3em 0 .3em; }
.prose .win h3 { margin-top: 0; font: 700 1.5rem/1.2 var(--l-display); color: var(--l-wordmark); }
.post-meta { color: var(--l-muted); font-size: .88rem; margin: -2px 0 12px; }
.rules { margin: 0; padding-left: 1.2em; }
.rules li:first-child { margin-top: 0; }
.rules li:last-child { margin-bottom: 0; }
.rules li { margin: .55em 0; }
details.faq { border-bottom: 1px solid var(--l-line); padding: 2px 0; }
details.faq:last-of-type { border-bottom: 0; }
details.faq summary { cursor: pointer; padding: 10px 0; font: 700 1.04rem/1.35 var(--l-sans); }
details.faq summary::marker { color: var(--l-metal); }
details.faq[open] summary { color: var(--l-wordmark); }
details.faq > div { padding: 0 0 12px; }

/* the Server page: two columns of windows, then the commands and the owner's lines across */

/* ---------- 761 to 1020 px ---------- */
@media (max-width: 1020px) {
  .reasons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cmd-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* ---------- phones: one column ---------- */
@media (max-width: 760px) {
  .hero-reel { height: clamp(460px, 76svh, 620px); }
  .hero-copy h1 { font-size: clamp(2rem, 9vw, 2.6rem); margin-bottom: 18px; }
  .cta .btn { flex: 1 1 100%; }
  .cta[data-state] { grid-template-areas: "a" "b"; justify-content: stretch; }
  .cta[data-state="in"] { grid-template-areas: "b"; }
  .band { padding: 36px 0; }
  .steps, .shots, .cols, .summary { grid-template-columns: 1fr; }
  .reasons { grid-template-columns: 1fr; gap: 22px; }
  .changes li { grid-template-columns: 1fr; }
  .facts { grid-template-columns: minmax(0, 38%) 1fr; }
  .cmd-grid { grid-template-columns: 1fr; gap: 22px; }
  .page-band { height: 120px; }
}

/* ---------- print ---------- */
@media print {
  .cta, .cta[data-state], .reel, .page-band, .hero-reel::after { display: none; }
  .hero-reel { height: auto; background: none; }
  .hero-copy h1 { color: var(--l-ink); text-shadow: none; }
}
