/* ═══════════════════════════════════════════════════════════
   THE CINEMATIC ARCHIVE — videos.php
   ═══════════════════════════════════════════════════════════

   The old archive was 127 identical white cards in three columns, each holding
   a full X embed. Three things were wrong with it and only one was cosmetic:

     1. It was ~21,000 px tall and every row looked like every other row, so it
        could be scrolled but not scanned.
     2. Every card was a third-party iframe, so the page cost tens of MB.
     3. Nothing on it said which year you were in except a 2rem heading.

   So the structure changed, not the paint. The year is now the largest object
   on the page and doubles as the navigation. Below it the videos are a dense
   index — 127 tiles you can take in at a glance — and the embed is built only
   for the one you click. Zero iframes on load.

   Every colour, size, space and duration here comes from style.css tokens.
   Zero !important. */

/* ─── Shell ─────────────────────────────────────────────── */
.archive-page main { padding: 0 0 var(--space-10); }

.skip-link {
    position: absolute;
    left: var(--space-4);
    top: calc(var(--space-4) * -4);
    z-index: 50;
    background: var(--accent);
    color: var(--accent-ink);
    font-weight: var(--fw-black);
    font-size: var(--fs-sm);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-pill);
    transition: top var(--dur-fast) var(--ease);
}
.skip-link:focus { top: var(--space-4); }

/* ─── Masthead ──────────────────────────────────────────── */
.arc-mast {
    position: relative;
    overflow: hidden;
    padding: var(--space-10) var(--space-7) var(--space-7);
    border-bottom: 1px solid var(--border);
    text-align: center;
}

/* The ember bed. It rises from the bottom edge because that is where the year
   numeral sits — the glow reads as the thing the year is climbing out of. */
.arc-glow {
    position: absolute;
    inset: auto 0 -40% 0;
    height: 90%;
    background: var(--flame-soft);
    pointer-events: none;
    filter: blur(2px);
}
.arc-mast > *:not(.arc-glow) { position: relative; }

.arc-over {
    font-size: var(--fs-xs);
    font-weight: var(--fw-black);
    letter-spacing: 0.34em;
    text-transform: uppercase;
    color: var(--accent-deep);
    margin-bottom: var(--space-3);
}
.theme-dark .arc-over { color: var(--accent-bright); }

/* The year, and the largest thing on the site. Anton only — it is the whole
   reason that face was self-hosted. font-weight is pinned to 400 because Anton
   ships one weight and a synthesised bold at this size looks like a smudge. */
.arc-year { margin: 0; line-height: 0.82; }
.arc-year-num {
    display: block;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(5rem, 21vw, 15rem);
    letter-spacing: -0.03em;
    color: var(--accent-deep);            /* fallback, declared first */
}
/* Gradient fill only where the ground is dark enough to carry it. Every stop of
   --flame clears 5:1 on ash; on cream the gold crown would be ~1.6:1, so the
   light theme keeps the solid deep-ember above. */
@supports ((background-clip: text) or (-webkit-background-clip: text)) {
    .theme-dark .arc-year-num {
        background: var(--flame);
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
    }
}

.arc-meta {
    margin-top: var(--space-4);
    font-size: var(--fs-sm);
    color: var(--text-3);
    letter-spacing: 0.02em;
}
.arc-meta strong { color: var(--text-1); font-weight: var(--fw-black); }
.arc-sep { color: var(--accent); margin: 0 var(--space-2); }

/* ─── Year switcher ─────────────────────────────────────── */
/* Numerals, not pills. The years are the archive's chapters and they are set at
   a size that says so; the unselected ones are outlined rather than filled, so
   the current year is the only solid mass in the row. */
.arc-switch {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: baseline;
    gap: var(--space-5);
    margin-top: var(--space-6);
}
.arc-switch-y {
    position: relative;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: var(--fs-xl);
    letter-spacing: 0.01em;
    color: var(--text-3);
    text-decoration: none;
    padding-bottom: var(--space-2);
    transition: color var(--dur-fast) var(--ease);
}
.arc-switch-y::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 3px;
    border-radius: var(--radius-pill);
    background: var(--flame);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--dur-base) var(--ease-out);
}
.arc-switch-y:hover { color: var(--text-1); }
.arc-switch-y:hover::after,
.arc-switch-y.is-current::after { transform: scaleX(1); }
.arc-switch-y.is-current { color: var(--text-1); }
.theme-dark .arc-switch-y.is-current { color: var(--accent-bright); }

.arc-switch-n {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: var(--fs-2xs);
    font-weight: var(--fw-bold);
    color: var(--text-3);
    margin-left: var(--space-2);
    vertical-align: super;
}
.arc-switch-foot { margin: var(--space-10) 0 0; }

/* ─── The index ─────────────────────────────────────────── */
/* auto-fill at 190px puts 5–6 across on a desktop instead of 3, which is what
   turns 127 rows of scrolling into ~22 rows of scanning. */
.arc-grid {
    list-style: none;
    margin: var(--space-8) auto 0;
    padding: 0 var(--space-7);
    max-width: 1500px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
}
/* A hairline lattice rather than 127 floating cards: the 1px grid gap IS the
   rule between tiles, so the index reads as one object. */
.arc-cell { background: var(--surface-page); }

.arc-tile {
    position: relative;
    display: block;
    overflow: hidden;
    padding: var(--space-5) var(--space-4) var(--space-4);
    min-height: 118px;
    text-decoration: none;
    background: var(--surface-page);
    transition: background var(--dur-fast) var(--ease);
}
.arc-tile:hover { background: var(--surface-2); }

/* The running number, ghosted and oversized. It gives the grid its rhythm and
   tells you how deep into the year you are without costing a row of chrome. */
.arc-num {
    position: absolute;
    top: -0.18em;
    right: 0.06em;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 3.4rem;
    line-height: 1;
    color: var(--border);
    transition: color var(--dur-base) var(--ease);
    pointer-events: none;
}
.arc-tile:hover .arc-num,
.arc-tile:focus-visible .arc-num { color: var(--ember-700); }
.theme-dark .arc-tile:hover .arc-num,
.theme-dark .arc-tile:focus-visible .arc-num { color: var(--ink-700); }

.arc-tile-body { position: relative; display: block; }

.arc-date {
    display: block;
    font-size: var(--fs-sm);
    font-weight: var(--fw-bold);
    line-height: var(--lh-snug);
    color: var(--text-1);
}

.arc-cue {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-3);
    font-size: var(--fs-2xs);
    font-weight: var(--fw-black);
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--text-3);
    transition: color var(--dur-fast) var(--ease);
}
.arc-cue-i {
    width: 0; height: 0;
    border-left: 8px solid currentColor;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
}
.arc-tile:hover .arc-cue { color: var(--accent-deep); }
.theme-dark .arc-tile:hover .arc-cue { color: var(--accent-bright); }

/* A flame bar banked along the bottom edge, growing on approach. Bottom edge so
   the heat reads upward, consistent with the rest of the site. */
.arc-tile::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 3px;
    background: var(--flame);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--dur-base) var(--ease-out);
}
.arc-tile:hover::after,
.arc-tile:focus-visible::after { transform: scaleX(1); }

/* ─── Opened embed ──────────────────────────────────────── */
/* The cell takes the whole row so the embed is never squeezed into a 190px
   column, and so the reader's eye is not asked to find it in a lattice. */
.arc-cell.is-open {
    grid-column: 1 / -1;
    background: var(--surface-2);
}
.arc-cell.is-open .arc-tile { background: var(--surface-2); }
.arc-cell.is-open .arc-tile::after { transform: scaleX(1); }
.arc-cell.is-open .arc-cue { color: var(--accent-deep); }
.theme-dark .arc-cell.is-open .arc-cue { color: var(--accent-bright); }

.arc-panel {
    display: flex;
    justify-content: center;
    padding: var(--space-4) var(--space-4) var(--space-6);
    border-top: 1px solid var(--border);
}
.arc-panel > * { max-width: 550px; width: 100%; }

.arc-loading {
    color: var(--text-3);
    font-size: var(--fs-sm);
    padding: var(--space-6) 0;
    text-align: center;
}

/* ─── Narrow screens ────────────────────────────────────── */
@media (max-width: 768px) {
    .arc-mast { padding: var(--space-7) var(--space-4) var(--space-5); }
    .arc-grid { padding: 0 var(--space-4); grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
    .arc-num { font-size: 2.6rem; }
    .arc-switch { gap: var(--space-4); }
}
