/* ==========================================================================
   The figures, drawn in the audit film's world
   Source: client_audit_v2, docs/design/visual-story/01-world.md and the
   recorded film. Printed things take the film's exact tokens; the table is
   the colour the recording shows. Every token is scoped to .fig, so the
   site's own --ink and --paper, and the chrome around the figures, stay as
   they are.
   ========================================================================== */

.fig {
    --f-table: #d5cec1;
    --f-paper: #eef1ec;
    --f-paper-2: #e2e7e0;
    --f-sheet: #f8faf6;
    --f-cream: #efe7d6;
    --f-ink: #17212b;
    --f-ink-2: #45525e;
    --f-ink-3: #6b7680;
    --f-rule: rgba(23, 33, 43, 0.28);
    --f-signal: #a3125c;
    --f-park: #dde4d3;
    --f-water: #cfdae1;
    --f-building: #dcdad3;
    --f-street: #aeb3b2;
    --f-street-major: #697074;
    --f-other: rgba(23, 33, 43, 0.42);
    /* The example store's brand, run through the film's own formula
       (web/scan/brand.ts) from a fictional accent, #4a7c62. */
    --f-brand: #4a7c62;
    --f-brand-wash: #c0d0c5;
    --f-brand-wall: #8d9c97;
    --f-brand-mid: #85a694; /* halfway from the wash to the brand: a bar a reader can see */
    --f-face: "Overpass", "Helvetica Neue", Arial, sans-serif;
    --f-mono: "JetBrains Mono", ui-monospace, monospace;
    --f-shadow: 0 2px 0 var(--f-cream), 0 3px 0 rgba(23, 33, 43, 0.14), 0 16px 26px -14px rgba(70, 55, 30, 0.5);
    margin: 0;
}

/* design-1: a figure with one card keeps about 832px; two-up figures and the
   outputs row take the column. */
.fig--map,
.fig--ai,
.fig--first {
    max-width: 52rem;
}

/* A still: the table, the sheets on it, and the paper band under the picture. */

.still {
    overflow: hidden;
    border-radius: 2px;
    background: var(--f-table);
    color: var(--f-ink);
    font-family: var(--f-face);
    font-variant-numeric: tabular-nums lining-nums;
}

.still-pic {
    padding: clamp(1rem, 3vw, 2.25rem);
}

.still-band {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 0.75rem clamp(1rem, 3vw, 2.5rem);
    padding: 1rem clamp(1rem, 2vw, 1.4rem) 1.1rem;
    border-top: 1px solid var(--f-rule);
    background: var(--f-paper);
}

.still-foot {
    grid-column: 1 / -1;
    padding-top: 0.6rem;
    border-top: 1px solid var(--f-rule);
    color: var(--f-ink-2);
    font-size: 0.8rem;
}

.still-band--foot {
    display: block;
    padding-top: 0;
}

.still-band--foot .still-foot {
    border-top: 0;
}

.still-cap__main {
    font-size: clamp(1.08rem, 1.7vw, 1.4rem);
    font-weight: 700;
    letter-spacing: -0.012em;
    line-height: 1.15;
    text-wrap: balance;
}

.still-cap__sub {
    margin-top: 0.4rem;
    color: var(--f-ink-2);
    font-size: 0.85rem;
    line-height: 1.4;
}

.still-key {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    gap: 0.3rem 1rem;
    margin: 0;
    padding: 0;
    color: var(--f-ink);
    font-size: 0.8rem;
    line-height: 1.3;
    list-style: none;
}

.still-key li {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
}

.still-key .key-mark {
    margin-top: 0.1em;
}

.key-mark,
.mark {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    overflow: visible;
}

/* Sheets lie a fraction of a degree off square, as the film places them. */
.tilt-a {
    rotate: -0.4deg;
}

.tilt-b {
    rotate: 0.35deg;
}

.card {
    padding: 1rem 1.1rem;
    background: var(--f-sheet);
    box-shadow: var(--f-shadow);
}

.card-title {
    margin-bottom: 0.75rem;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
}

.card-source {
    margin-top: 0.8rem;
    color: var(--f-ink-2);
    font-size: 0.8rem;
}

/* A board: the printed sheet with its tab card over the top edge. */

.boards,
.pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: clamp(1.25rem, 3vw, 2.25rem);
}

.boards--one {
    grid-template-columns: minmax(0, 1fr);
    max-width: 34rem;
    margin: 0 auto;
}

.board {
    position: relative;
    padding-top: 1.7rem;
}

.board-tab {
    position: absolute;
    top: 0;
    left: 6%;
    right: 12%;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 0.75rem;
    padding: 0.4rem 0.7rem 0.45rem;
    border: 1.5px solid var(--f-ink);
    background: var(--f-sheet);
    box-shadow: 0 8px 14px -10px rgba(70, 55, 30, 0.6);
}

.board-tab__t {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.2;
}

.board-tab__l {
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.25;
}

.board-tab__p {
    grid-row: 1 / span 2;
    grid-column: 2;
    align-self: end;
    font-size: 0.95rem;
    font-weight: 700;
}

.board-sheet {
    padding: 2.4rem 0.4rem 0.4rem;
    background: var(--f-sheet);
    box-shadow: var(--f-shadow);
}

.plate,
.leaf-svg,
.film-tile {
    display: block;
    width: 100%;
    height: auto;
}

.defs-only {
    position: absolute;
    width: 0;
    height: 0;
}

/* The map, in the film's own washes; streets in two weights of grey ink. */

.g-sheet { fill: var(--f-sheet); }
.g-park { fill: var(--f-park); }
.g-bldg { fill: var(--f-building); }

.g-water {
    fill: none;
    stroke: var(--f-water);
    stroke-width: 13;
    stroke-linecap: round;
}

.g-minor {
    fill: none;
    stroke: var(--f-street);
    stroke-width: 0.6;
}

.g-major {
    fill: none;
    stroke: var(--f-street-major);
    stroke-width: 1.1;
    opacity: 0.75;
}

.g-fwy-out {
    fill: none;
    stroke: var(--f-street-major);
    stroke-width: 4.6;
    opacity: 0.8;
}

.g-fwy-in {
    fill: none;
    stroke: var(--f-sheet);
    stroke-width: 2.2;
}

.g-rail,
.g-rail-tick {
    fill: none;
    stroke: var(--f-ink-2);
    stroke-width: 0.8;
}

.g-neat {
    fill: none;
    stroke: var(--f-ink);
    stroke-width: 1.5;
}

.g-north path { fill: var(--f-ink); }

.g-n,
.g-label,
.g-credit {
    fill: var(--f-ink-2);
    font: 600 8.5px var(--f-face);
    text-anchor: middle;
}

.g-credit {
    font-weight: 400;
    font-size: 8px;
    text-anchor: end;
}

.g-place {
    fill: var(--f-ink);
    font: 700 13px var(--f-face);
    text-anchor: end;
}

.g-scale {
    fill: none;
    stroke: var(--f-ink);
    stroke-width: 1.5;
}

/* The marks: shape first, colour second. */

.cell-shadow { fill: rgba(70, 55, 30, 0.34); }
.cell-wall { fill: var(--f-brand-wall); }

.cell-top {
    fill: var(--f-brand-wash);
    stroke: rgba(23, 33, 43, 0.2);
    stroke-width: 0.6;
}

.hatch-bg { fill: var(--f-sheet); }

.hatch-line {
    fill: none;
    stroke: var(--f-other);
    stroke-width: 1.6;
}

.key-hatch { fill: var(--f-sheet); }
.disc { fill: var(--f-ink); }

.disc-num,
.num {
    font: 700 12px var(--f-face);
    text-anchor: middle;
    dominant-baseline: central;
}

.disc-num { fill: var(--f-sheet); }

.num {
    fill: var(--f-ink-2);
    font-weight: 600;
    paint-order: stroke;
    stroke: var(--f-sheet);
    stroke-width: 3px;
}

.num--key {
    font-size: 11px;
    stroke-width: 0;
}

.cross {
    fill: none;
    stroke: var(--f-signal);
    stroke-width: 1.6;
    stroke-linecap: round;
}

.open-square {
    fill: none;
    stroke: var(--f-ink-2);
    stroke-width: 1.4;
}

.store-rod {
    stroke: var(--f-ink);
    stroke-width: 1.5;
}

.store-mark {
    fill: var(--f-brand);
    stroke: var(--f-ink);
    stroke-width: 1.5;
}

/* Reviews, against the same grid */

.pair--rivals {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}

.rv--inline {
    grid-template-columns: 5.5rem minmax(0, 1fr) 4.5rem;
}

.rv--inline .rv__num {
    grid-column: 3;
    color: var(--f-ink);
    font-weight: 600;
    text-align: right;
}

.rv-track {
    fill: none;
    stroke: var(--f-rule);
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}

.rv--reviews {
    grid-template-columns: 5.5rem minmax(0, 1fr) 7.25rem;
}

.card--first-place .rv-you,
.card--reviews .rv-you {
    fill: var(--f-brand-mid);
}

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

.rv {
    display: grid;
    grid-template-columns: 5.5rem minmax(0, 1fr);
    align-items: center;
    gap: 0.2rem 0.75rem;
}

.rv__name {
    font-weight: 700;
    font-size: 0.92rem;
}

.rv__bar {
    width: 100%;
    height: 0.8rem;
}

.rv-you {
    fill: var(--f-brand-wash);
    stroke: var(--f-ink);
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}

.rv-other {
    stroke: var(--f-ink);
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}

.rv__num {
    grid-column: 2;
    color: var(--f-ink-2);
    font-size: 0.8rem;
}

/* AI answers: an answer card above the matrix */

.answers {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(1rem, 2.5vw, 1.75rem);
}

.answers > .card--answer {
    max-width: none;
}

.ai-short {
    display: none;
}

.answer-head,
.answer-verdict {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
}

.answer-head {
    padding-bottom: 0.55rem;
    border-bottom: 1px solid var(--f-rule);
}

.answer-head .mark {
    width: 18px;
    height: 18px;
}

.answer-q {
    margin-top: 0.65rem;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.3;
}

.answer-text {
    margin-top: 0.5rem;
    color: var(--f-ink-2);
    font-size: 0.92rem;
    letter-spacing: 0.01em;
    line-height: 1.5;
}

.answer-text mark,
.answer-wash {
    padding: 0 0.15em;
    background: var(--f-brand-wash);
    color: var(--f-ink);
    font-weight: 700;
    fill: var(--f-brand-wash);
}

.answer-verdict {
    justify-content: flex-start;
    gap: 0.5rem;
    margin-top: 0.8rem;
}

.answer-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0.8rem 0 0;
    padding: 0;
    list-style: none;
}

.answer-tabs li {
    padding: 0.2rem 0.5rem;
    border: 1px solid var(--f-ink-3);
    background: var(--f-paper-2);
    box-shadow: 0 2px 0 rgba(23, 33, 43, 0.18);
    font-size: 0.8rem;
    font-weight: 600;
}

.answer-tabs .tab--own,
.tab-own {
    border-color: var(--f-ink);
    background: var(--f-brand);
    color: #ffffff;
    fill: var(--f-brand);
    stroke: var(--f-ink);
}

.answer-tabs .tab--own::before {
    content: "\25C6\00a0";
}

.ai-wrap {
    overflow-x: auto;
}

.ai-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.ai-table thead th {
    padding: 0 0.6rem 0.5rem;
    border-bottom: 1.5px solid var(--f-ink);
    font-weight: 700;
    text-align: left;
}

.ai-table tbody th {
    max-width: 17rem;
    padding: 0.6rem 0.75rem 0.6rem 0;
    font-weight: 600;
    text-align: left;
}

.ai-table tbody tr {
    border-bottom: 1px solid var(--f-rule);
}

.ai-table td {
    padding: 0.6rem;
    white-space: nowrap;
}

.ai-cell .mark {
    display: inline-block;
    margin-right: 0.4rem;
    vertical-align: -2px;
}

.ai-word {
    color: var(--f-ink-2);
    font-size: 0.82rem;
}

.ai-cell--skip .ai-word {
    color: var(--f-ink-2);
}

.ai-dash {
    display: none;
}

/* The website: leaves ruled every 250 words, and failed slips */

.pair--site {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.leaves {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
    align-items: start;
}

.leaf-card {
    padding: 0.8rem;
}

.leaf-card .card-title {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.leaf {
    fill: var(--f-sheet);
    stroke: var(--f-rule);
    stroke-width: 1;
}

.leaf-rule {
    fill: none;
    stroke: var(--f-ink);
    stroke-width: 2;
}

.leaf-prod {
    fill: var(--f-paper-2);
    stroke: var(--f-ink-2);
    stroke-width: 1;
}

.leaf-empty {
    fill: none;
    stroke: var(--f-ink-2);
    stroke-width: 1.2;
    stroke-dasharray: 3 3;
}

.leaf-count {
    margin-top: 0.5rem;
    color: var(--f-ink-2);
    font-size: 0.8rem;
}

.leaf-count strong {
    color: var(--f-ink);
}

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

/* A failed check's slip carries a swallow-tailed flag in the signal ink. */
.slip {
    position: relative;
    padding: 0.7rem 2.6rem 0.7rem 0.9rem;
    background: var(--f-sheet);
    box-shadow: var(--f-shadow);
}

.slip::after {
    position: absolute;
    top: 0;
    right: 0.8rem;
    width: 0.95rem;
    height: 1.5rem;
    background: var(--f-signal);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 72%, 0 100%);
    content: "";
}

.flag {
    fill: var(--f-signal);
}

.slip-text {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.35;
}

.slip-sev {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.35rem;
    color: var(--f-ink-2);
    font-size: 0.8rem;
}

.wedge {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: var(--f-ink);
    stroke-width: 1.2;
}

.wedge path {
    fill: var(--f-ink);
    stroke: none;
}

.wedge--high {
    stroke: var(--f-signal);
}

.wedge--high path {
    fill: var(--f-signal);
}

/* The last frame: the card the film ends on. The table runs the full width
   of the page behind it, the one change of pace in the letter. */

.fig--first .still {
    overflow: visible;
}

.fig--first .still-pic {
    box-shadow: 0 0 0 100vmax var(--f-table);
    clip-path: inset(0 -100vmax);
    padding-block: clamp(2rem, 5vw, 4rem);
}

.fig--first .still-band {
    box-shadow: 0 0 0 100vmax var(--f-paper);
    clip-path: inset(0 -100vmax);
}

.fig--first .first-card {
    padding: clamp(1.5rem, 3vw, 2.5rem);
}

.fig--first .first-card__finding {
    max-width: none;
    font-size: clamp(1.35rem, 2.4vw, 1.95rem);
}

.still--bare .still-pic {
    padding: clamp(1.25rem, 3vw, 2.5rem);
}

.first-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem clamp(1.25rem, 3vw, 2.25rem);
    padding: clamp(1.25rem, 2.5vw, 2rem);
}

.first-card__label {
    grid-column: 1 / -1;
    color: var(--f-ink-2);
    font-size: 0.85rem;
    font-weight: 600;
}

.first-card__finding {
    max-width: 38rem;
    font-size: clamp(1.2rem, 1.9vw, 1.6rem);
    font-weight: 700;
    letter-spacing: -0.012em;
    line-height: 1.25;
}

.first-card__action {
    grid-column: 1 / -1;
    padding-top: 0.9rem;
    border-top: 1px solid var(--f-rule);
    color: var(--f-ink-2);
}

.first-card__action span {
    color: var(--f-ink);
    font-weight: 700;
}

/* What you get back: the film, the web report and the PDF, each a picture.
   The three cells share rows (subgrid), so the pictures are one height and
   the titles and lines start on one baseline. */

.outputs {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    align-items: start;
    gap: 0 clamp(1.5rem, 3vw, 2.25rem);
}

.out {
    display: grid;
    grid-row: span 3;
    grid-template-rows: subgrid;
}

.out__art {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    overflow: hidden;
    border-radius: 2px;
    background: var(--f-table);
}

.out__art--film {
    justify-content: flex-start;
}

.tile-still {
    display: block;
    width: 100%;
    height: auto;
}

/* The tile's foot: paper like its caption band, holding Pause. */
.film-foot {
    padding: 0 0.75rem 0.75rem;
    background: var(--f-paper);
}

.out__title {
    margin-top: 1rem;
    font-size: 1.35rem;
    line-height: 1.15;
}

.out p {
    margin-top: 0.4rem;
    color: var(--ink-soft);
    line-height: 1.6;
}

.out__short {
    display: none;
}

/* Pause in the site's secondary style (the outlined nav button). */
.film-toggle {
    padding: 0.5rem 0.95rem;
    background: transparent;
    color: var(--ink);
    font-size: 0.9rem;
    cursor: pointer;
}

.film-toggle:hover,
.film-toggle:focus-visible {
    border-color: var(--ink);
    background: var(--ink);
    color: var(--white);
}

.t-edge { fill: var(--f-cream); }
.t-still { fill: var(--f-ink); font: 400 18px var(--f-face); }
.t-still--head { font-size: 20px; font-weight: 700; }
.t-still--title { font-size: 26px; font-weight: 700; }
.t-still--row { font-weight: 600; }
.t-still--muted { fill: var(--f-ink-2); }
.t-wedge circle { fill: none; stroke: var(--f-ink); stroke-width: 1.4; }
.t-wedge path { fill: var(--f-ink); }
.t-wedge--high circle { stroke: var(--f-signal); }
.t-wedge--high path { fill: var(--f-signal); }

/* The film tile's own type and inks, in its 400-wide frame. No text under
   14 units: at a phone's width that is still 12px. */

.t-table { fill: var(--f-table); }
.t-band { fill: var(--f-paper); }
.t-sheet { fill: var(--f-sheet); filter: drop-shadow(0 6px 6px rgba(70, 55, 30, 0.28)); }
.t-prod { fill: var(--f-paper-2); stroke: var(--f-ink-2); stroke-width: 1; }
.t-empty { fill: none; stroke: var(--f-ink-2); stroke-width: 1.2; stroke-dasharray: 3 3; }
.film-progress { fill: var(--f-ink); }

.t-hair,
.t-rule {
    fill: none;
    stroke: var(--f-rule);
    stroke-width: 1;
}

.t-rule {
    stroke: var(--f-ink);
    stroke-width: 2;
}

.t-head,
.t-quote,
.t-cap {
    fill: var(--f-ink);
    font: 700 15px var(--f-face);
}

.t-quote { font-size: 15px; letter-spacing: 0.01em; }
.t-body { fill: var(--f-ink-2); font: 400 14px var(--f-face); letter-spacing: 0.01em; }
.t-small { fill: var(--f-ink-2); font: 400 14px var(--f-face); }
.t-small--end { text-anchor: end; }
.t-cap { font-size: 16px; letter-spacing: -0.01em; }
.t-cap-sub { fill: var(--f-ink-2); font: 400 14px var(--f-face); }

/* Without motion (or asked for less), the tile holds the menu beat. */
.film-cap { opacity: 0; }
.film-cap--2 { opacity: 1; }

.film-drop {
    transform-box: fill-box;
    transform-origin: 50% 50%;
}

/* The loop: 15 s, three beats, the film's own easings. The camera pans the
   table between beats; marks and cards are set down, never faded in place.
   Pause (main.js) sets --film-play to paused for every part at once. */
.film-tile.is-paused {
    --film-play: paused;
}

@media (prefers-reduced-motion: no-preference) {
    .film-tile .film-cam { animation: film-cam 15s infinite; }
    .film-tile .area--read .film-row { animation: film-land 15s infinite both; }
    .film-tile .r0 { animation-delay: 0.5s; }
    .film-tile .r1 { animation-delay: 0.9s; }
    .film-tile .film-drop--answer { animation: film-drop-answer 15s infinite; }
    .film-tile .film-drop--first { animation: film-drop-first 15s infinite; }
    .film-tile .film-cap { animation: 15s step-end infinite; }
    .film-tile .film-cap--1 { animation-name: film-cap-1; }
    .film-tile .film-cap--2 { animation-name: film-cap-2; }
    .film-tile .film-cap--3 { animation-name: film-cap-3; }
    .film-tile .film-cap--4 { animation-name: film-cap-4; }
    .film-tile .film-progress {
        transform-box: fill-box;
        transform-origin: 0 50%;
        animation: film-progress 15s linear infinite;
    }

    .film-tile .film-cam,
    .film-tile .area--read .film-row,
    .film-tile .film-drop,
    .film-tile .film-cap,
    .film-tile .film-progress {
        animation-play-state: var(--film-play, running);
    }
}

/* Nothing moves under reduced motion, so there is nothing to pause. */
@media (prefers-reduced-motion: reduce) {
    .film-toggle {
        display: none;
    }
}

@keyframes film-cam {
    0%, 33.3% { transform: translateX(0); animation-timing-function: cubic-bezier(0.42, 0, 0.16, 1); }
    41.3%, 66.7% { transform: translateX(-400px); animation-timing-function: cubic-bezier(0.42, 0, 0.16, 1); }
    74.7%, 100% { transform: translateX(-800px); }
}

@keyframes film-land {
    0% { opacity: 0; transform: translateY(-12px); }
    0.1% { opacity: 1; transform: translateY(-12px); animation-timing-function: cubic-bezier(0.35, 0.5, 0.7, 0.8); }
    2.4% { transform: translateY(0); }
    55% { opacity: 1; transform: translateY(0); }
    55.1%, 100% { opacity: 0; }
}

@keyframes film-drop-answer {
    0%, 41.2% { opacity: 0; transform: translateY(-10px) rotate(-1deg); }
    41.3% { opacity: 1; transform: translateY(-10px) rotate(-1deg); animation-timing-function: cubic-bezier(0.35, 0.5, 0.7, 0.8); }
    45.8%, 99.9% { opacity: 1; transform: none; }
    100% { opacity: 0; }
}

@keyframes film-drop-first {
    0%, 74.6% { opacity: 0; transform: translateY(-10px) rotate(1deg); }
    74.7% { opacity: 1; transform: translateY(-10px) rotate(1deg); animation-timing-function: cubic-bezier(0.35, 0.5, 0.7, 0.8); }
    79.2%, 99.9% { opacity: 1; transform: none; }
    100% { opacity: 0; }
}

/* Each caption changes as its card lands: the menu's leaves by 1.2 s, the
   answer at 45.8%, the first fix at 79.2%. */
@keyframes film-cap-1 { 0% { opacity: 1; } 8%, 100% { opacity: 0; } }
@keyframes film-cap-2 { 0% { opacity: 0; } 8% { opacity: 1; } 45.8%, 100% { opacity: 0; } }
@keyframes film-cap-3 { 0% { opacity: 0; } 45.8% { opacity: 1; } 79.2%, 100% { opacity: 0; } }
@keyframes film-cap-4 { 0% { opacity: 0; } 79.2%, 100% { opacity: 1; } }
@keyframes film-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* The systems' marks: each beside its name, on white card, with clear space. */

.sys {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.sys-logo {
    flex-shrink: 0;
    height: 1.1em;
    width: auto;
}

.logo-note {
    margin-top: 0.4rem;
    color: var(--f-ink-2);
    font-size: 0.8rem;
}

/* The hero: two cards on the table with room around them, the answer
   up and to the left, the first fix down and to the right. Card type is
   14px or more. */

.hero-table {
    overflow: hidden;
    border-radius: 2px;
    background: var(--f-table);
}

.hero-art .logo-note {
    margin-top: 0.6rem;
}

.spread {
    display: grid;
    padding: clamp(1.25rem, 2vw, 1.75rem);
    row-gap: 1.5rem;
}

.spread-answer {
    width: 82%;
    rotate: -0.6deg;
}

.spread-first {
    justify-self: end;
    width: 72%;
    rotate: 0.7deg;
}

/* The answer's sources are told in the AI figure; the hero keeps the
   question, the answer and the three systems asked. */
.hero-art .answer-tabs {
    display: none;
}

.hero-art .answer-systems,
.hero-art .first-card__label {
    font-size: 0.875rem;
}

.answer-systems {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.9rem;
    margin-top: 0.9rem;
    padding-top: 0.7rem;
    border-top: 1px solid var(--f-rule);
    font-size: 0.8rem;
}

.answer-systems p {
    color: var(--f-ink-2);
}

.answer-systems ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.9rem;
    margin: 0;
    padding: 0;
    list-style: none;
    font-weight: 600;
}

.hero-first {
    padding: 1.1rem 1.25rem;
}

.hero-first__finding {
    margin-top: 0.4rem;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.3;
}

.hero-first__step {
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--f-rule);
    color: var(--f-ink-2);
    font-size: 0.95rem;
}

/* owner-7, copy-2: the hero card says it is an example, first, on the card. */
.hero-art {
    color: var(--f-ink);
    font-family: var(--f-face);
}

.card-example {
    margin-top: 0.3rem;
    color: var(--f-ink-2);
    font-family: var(--f-face);
    font-size: 0.8125rem;
}

/* --- Responsive --------------------------------------------------------- */

@media (max-width: 1120px) {
    .outputs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: none;
        row-gap: 1.75rem;
    }

    .out {
        grid-row: auto;
        grid-template-rows: none;
    }

    .out--film {
        grid-column: 1 / -1;
        max-width: 35rem;
    }
}

/* design-8: below 720px the map drops its scale bar and credit line.
   owner-6: the tallest figures get shorter on a phone. The answer's source
   chips go (the matrix card's sources line says the same), the key sets in
   two columns, and the failed-check slips tighten. */
@media (max-width: 720px) {
    .plate .g-scale,
    .plate .g-label,
    .plate .g-credit {
        display: none;
    }

    .fig--ai .answer-tabs {
        display: none;
    }

    .plate .g-n {
        display: none;
    }

    /* design-1: a 12px name under each logo in the matrix heads. */
    .ai-table thead .sys {
        flex-direction: column;
        gap: 0.2rem;
    }

    .ai-short {
        display: block;
        color: var(--f-ink);
        font-size: 0.75rem;
        font-weight: 600;
        line-height: 1.1;
        white-space: nowrap;
    }

    /* owner-5: the rivals and site figures, shorter: tighter spacing and a
       shorter leaf, nothing taken out. */
    .pair--rivals,
    .pair--site {
        gap: 0.75rem;
    }

    .pair--rivals .card-source {
        margin-top: 0.5rem;
        font-size: 0.75rem;
    }

    .leaves {
        gap: 0.6rem;
    }

    .leaf-card .card-title {
        margin-bottom: 0.35rem;
    }

    .leaf-svg {
        width: auto;
        max-width: 100%;
        max-height: 10.5rem;
        margin: 0 auto;
    }

    .leaf-count {
        margin-top: 0.3rem;
    }
    .pair--rivals .card,
    .leaf-card {
        padding: 0.75rem 0.85rem;
    }

    .pair--rivals .card-title {
        margin-bottom: 0.5rem;
        font-size: 0.92rem;
    }

    .pair--rivals .rv-list {
        gap: 0.45rem;
    }

    .rv--reviews {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "name num"
            "bar bar";
        row-gap: 0.2rem;
    }

    .rv--reviews .rv__name { grid-area: name; }
    .rv--reviews .rv__bar { grid-area: bar; }

    .rv--reviews .rv__num {
        grid-area: num;
        font-size: 0.8rem;
    }

    .slip-sev {
        margin-top: 0.15rem;
    }

    /* design-8: the film, then the two stills side by side, one short line each. */
    .out__long {
        display: none;
    }

    .out__short {
        display: block;
    }

    .out--still .out__title {
        margin-top: 0.6rem;
        font-size: 1.05rem;
    }

    .out--still p {
        margin-top: 0.2rem;
        font-size: 0.875rem;
        line-height: 1.4;
    }

    .still-band .still-key {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.25rem 0.75rem;
    }

    .slips {
        gap: 0.45rem;
    }

    .slip {
        padding: 0.55rem 2.3rem 0.55rem 0.75rem;
    }

    .slip-text {
        font-size: 0.875rem;
    }
}

/* design-2: below 480px the keys set in one column, as the others do. */
@media (max-width: 480px) {
    .still-band .still-key {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .still-band,
    .boards,
    .pair,
    .pair--rivals,
    .pair--site,
    .first-card {
        grid-template-columns: 1fr;
    }

    /* The hero stacks: the answer, then the first fix, both full width. */
    .spread {
        padding: 1rem;
        row-gap: 1rem;
    }

    .spread-answer,
    .spread-first {
        width: auto;
        rotate: none;
    }

    /* design-3, design-1: on a phone each question runs the full width, its
       three dots in a row beneath, under the systems' marks and short names.
       The long names and words stay for screen readers. */
    .ai-table,
    .ai-table thead,
    .ai-table tbody {
        display: block;
    }

    .ai-table tr {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        align-items: center;
    }

    .ai-table thead td {
        display: none;
    }

    .ai-table thead th,
    .ai-table td {
        padding: 0.3rem 0.25rem 0.55rem;
        text-align: center;
    }

    .ai-table tbody th {
        grid-column: 1 / -1;
        max-width: none;
        padding: 0.6rem 0 0.15rem;
        font-size: 0.875rem;
    }

    .ai-table .sys {
        justify-content: center;
    }

    .ai-name,
    .ai-word {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .ai-cell .mark {
        margin-right: 0;
    }

    .ai-dash {
        display: inline;
        color: var(--f-ink-2);
    }
}

@media (max-width: 440px) {
    .still-pic {
        padding: 0.85rem;
    }

    .board-sheet {
        padding-top: 2.6rem;
    }

    .board-tab {
        left: 3%;
        right: 5%;
    }


    /* design-11: the map's numerals stay at 12px or more on a phone. */
    .plate .num,
    .plate .disc-num {
        font-size: 13.5px;
    }
}
