/* Layout: real American pictures flip full-bleed from 1776 to today. INDUSTRIALIZE sits alone, big, in the middle, set
   straight on the pictures with no plate or keyline (2026-11-13): it starts in ink on Light Cream, turns cream while the
   pictures play, and each picture carries the smallest even dim that lets it pass the contrast rule (hero/dims.py). The
   year sits big in the bottom right as the loader and each picture's title small in the bottom left, over a soft shadow
   along the bottom edge. At today the pictures clear to plain Light Cream and only the wordmark stays, in ink. Years and
   titles in Rhymes Text (Newsreader stands in). */
:root {
  --blue: #0A3161;      /* Old Glory Blue: the ground behind the pictures (drawings are shown whole on it) */
  --red: #B31942;       /* Old Glory Red: the keyboard focus ring */
  --cream: #FEFFF4;     /* Light Cream: the year and titles on the pictures, and the ground at today */
  --ink: #1E1E1C;       /* the wordmark and the address at today */
  --mute: #5E5E5A;      /* the category line at today, 6.4 : 1 on cream */
  --shade: 30, 30, 28;                      /* the bottom-edge shadow, ink at low alpha */
  --f-mark: "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --f-display: "Rhymes Text", "Newsreader", Georgia, "Times New Roman", serif;
  --f-text: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --f-letter: "Barlow Semi Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --gut-l: max(16px, env(safe-area-inset-left, 0px));
  --gut-r: max(16px, env(safe-area-inset-right, 0px));
  --m: min(200px, calc((100vw - var(--gut-l) - var(--gut-r)) / 8.6), 20vh);   /* the wordmark: 7.65 em wide on its plate */
  --yz: clamp(56px, calc(var(--m) * 0.78), 164px);                            /* the year */
  --yw: calc(var(--yz) * 2.2);                                                /* the year's width */
  --yh: calc(var(--yz) * 0.8);                                                /* the year, tall */
  color-scheme: light;
}
html, body { height: 100%; }
body { margin: 0; background: var(--cream); color: var(--ink); overflow: hidden; font-family: var(--f-text);
       -webkit-font-smoothing: antialiased; transition: background-color 500ms ease; }
body.live { background: var(--blue); }

.stage { position: fixed; inset: 0; overflow: hidden; background: var(--cream); transition: background-color 500ms ease; }
body.live .stage { background: var(--blue); transition: background-color 100ms linear; }

/* the pictures */
.frames { position: absolute; inset: 0; transition: opacity 400ms ease; }
.frame { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover;
         opacity: 0; transition: opacity 100ms linear; will-change: opacity; }
.frame.on { opacity: 1; }
body.still *, body.still *::before { transition: none !important; }

/* each picture's even dim, set per frame from hero/dims.json, so the cream wordmark reads on it */
.dim { position: absolute; inset: 0; background: rgb(var(--shade)); opacity: 0; pointer-events: none;
       transition: opacity 100ms linear; }

/* a soft shadow along the bottom edge, so the year and the title read on any picture */
.shade { position: absolute; left: 0; right: 0; bottom: 0; height: max(30vh, calc(var(--yh) + 140px)); pointer-events: none;
         background: linear-gradient(to top, rgba(var(--shade), 0.58), rgba(var(--shade), 0.3) 42%, rgba(var(--shade), 0));
         transition: opacity 400ms ease; }

/* the wordmark, alone in the middle */
.center { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
          padding-left: var(--gut-l); padding-right: var(--gut-r);
          padding-block: calc(env(safe-area-inset-top, 0px) + 64px) calc(env(safe-area-inset-bottom, 0px) + 64px);
          pointer-events: none; }
.block { max-width: 100%; }
.mark { margin: 0; font: 700 var(--m)/0.86 var(--f-mark); letter-spacing: -0.01em; color: var(--ink); white-space: nowrap;
        padding: calc(var(--m) * 0.2) calc(var(--m) * 0.3) calc(var(--m) * 0.13); text-align: center;
        transition: color 500ms ease; }
body.live .mark { color: var(--cream); transition: color 100ms linear; }

/* the year, big in the bottom right: it is the loader */
.yearmark { position: absolute; right: var(--gut-r); bottom: calc(env(safe-area-inset-bottom, 0px) + 18px);
            opacity: 0; transition: opacity 600ms ease; }
body.live .yearmark { opacity: 1; transition: opacity 100ms linear; }
.year { display: block; font: 400 var(--yz)/0.8 var(--f-display); letter-spacing: -0.02em; text-align: right;
        font-variant-numeric: lining-nums tabular-nums; color: var(--cream);
        text-shadow: 0 2px 18px rgba(var(--shade), 0.45); }

/* the picture's title, small, in the bottom left */
.title { position: absolute; left: var(--gut-l); bottom: calc(env(safe-area-inset-bottom, 0px) + 18px); margin: 0;
         max-width: min(520px, calc(100vw - var(--gut-l) - var(--gut-r) - var(--yw) - 32px));
         color: var(--cream); font: 400 clamp(15px, 1.15vw, 18px)/1.25 var(--f-display); letter-spacing: -0.005em;
         text-wrap: balance; text-shadow: 0 1px 10px rgba(var(--shade), 0.6);
         opacity: 0; transition: opacity 250ms ease; }
.title.on { opacity: 1; }

/* today: the category line and the address, small, in the bottom corners (the guide's footer style) */
.foot { position: absolute; bottom: calc(env(safe-area-inset-bottom, 0px) + 18px); margin: 0;
        max-width: calc(50vw - var(--gut-l) - 12px); font: 400 clamp(15px, 1.2vw, 19px)/1.3 var(--f-display);
        letter-spacing: -0.005em; text-wrap: balance; color: var(--ink);
        opacity: 0; pointer-events: none; transition: opacity 600ms ease 250ms; }
.foot-l { left: var(--gut-l); }
.foot-r { right: var(--gut-r); text-align: right; }
body.done .foot { opacity: 1; pointer-events: auto; }

/* today: plain Light Cream, the wordmark in ink */
body.done .frames, body.done .dim, body.done .shade, body.done .yearmark, body.done .title, body.done .btn { opacity: 0; pointer-events: none; }
body.done .mark { color: var(--ink); }
body.done .dim { transition: opacity 400ms ease; }
body:not(.live) .shade { opacity: 0; }

@media (max-width: 640px) {
  :root { --m: calc((100vw - var(--gut-l) - var(--gut-r)) / 8); }
  .title { max-width: calc(100vw - var(--gut-l) - var(--gut-r)); font-size: 14px;
           bottom: calc(env(safe-area-inset-bottom, 0px) + 18px + var(--yh) + 12px); }
}
@media (prefers-reduced-motion: reduce) {
  .frame, .frames, .dim, .shade, .block, .mark, .yearmark, .title, .btn, .foot, .stage, body { transition: none !important; }
}
