/*
 * KSL Animations — site styles.
 *
 * Hand-authored. The build never writes this file.
 *
 * The palette is the KSL brand palette, taken from docs/branding/README.md in the KSL repository, and the
 * names are the ones used there so the two can be compared without translation. Light only, by decision:
 * the animation canvas renders on white in both the desktop viewer and the browser, and the example
 * layouts were colored against white, so a dark page around a white canvas would misrepresent the thing
 * it is framing.
 *
 * No web fonts. The system stack renders immediately, costs no request, and reaches no third party.
 */

:root {
    --indigo: #4338CA;
    --indigo-light: #C7D2FE;
    --amber: #F59E0B;
    --deep: #1E1B4B;
    --ink: #111827;
    --navy: #0F172A;
    --muted: #6B7280;
    --line: #E5E7EB;
    --paper: #FFFFFF;

    --measure: 68ch;          /* a comfortable line length for prose */
    --gutter: clamp(1rem, 4vw, 2.5rem);
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-text-size-adjust: 100%;
}

.wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: var(--gutter);
}

/* ── header ─────────────────────────────────────────────────────────────────────────────────────── */

header.site {
    border-bottom: 1px solid var(--line);
}

header.site .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding-block: 1.25rem;
}

header.site img { display: block; width: 200px; height: auto; }

nav.site a {
    color: var(--indigo);
    text-decoration: none;
    font-weight: 600;
    margin-left: 1.25rem;
}

nav.site a:hover { text-decoration: underline; }

/* ── prose ──────────────────────────────────────────────────────────────────────────────────────── */

h1 {
    font-size: clamp(1.9rem, 5vw, 2.75rem);
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin: 0 0 0.6em;
    color: var(--deep);
}

h2 {
    font-size: clamp(1.25rem, 3vw, 1.6rem);
    line-height: 1.25;
    letter-spacing: -0.01em;
    margin: 2.5rem 0 0.6rem;
    color: var(--deep);
}

p { max-width: var(--measure); }

.lede {
    font-size: clamp(1.05rem, 2.2vw, 1.25rem);
    color: var(--muted);
}

a { color: var(--indigo); }

/* A short amber rule under a heading — the accent the brand reserves for events. */
.rule {
    width: 3.5rem;
    height: 3px;
    background: var(--amber);
    border: 0;
    margin: 0 0 1.75rem;
}

/* ── notice ─────────────────────────────────────────────────────────────────────────────────────── */

.notice {
    border: 1px solid var(--line);
    border-left: 3px solid var(--amber);
    background: #FFFBEB;
    border-radius: 6px;
    padding: 1rem 1.25rem;
    max-width: var(--measure);
}

.notice :first-child { margin-top: 0; }
.notice :last-child { margin-bottom: 0; }

/* ── landing page ───────────────────────────────────────────────────────────────────────────────── */

.hero { padding-top: 1rem; }

.hero h1 { max-width: 20ch; }

/* Sits under the hero player: what the reader is looking at, in one line. */
.caption {
    margin-top: -1.5rem;
    margin-bottom: 2.5rem;
    font-size: 0.9rem;
    color: var(--muted);
    max-width: var(--measure);
}

.actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin: 1.75rem 0 0;
}

.btn {
    display: inline-block;
    padding: 0.6rem 1.15rem;
    border: 1px solid var(--indigo);
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    color: var(--indigo);
    background: var(--paper);
}

.btn:hover { background: #EEF2FF; }

.btn.primary { background: var(--indigo); color: #fff; }
.btn.primary:hover { background: var(--deep); border-color: var(--deep); }

/* Three steps, or a handful of capabilities: the same grid serves both. */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.grid h3 {
    margin: 0 0 0.4rem;
    font-size: 1rem;
    color: var(--deep);
}

.grid p { margin: 0; max-width: none; font-size: 0.95rem; }

/* A numbered step in the pipeline. The number is decoration, so it is hidden from a screen reader. */
.step .num {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--amber);
    margin-bottom: 0.35rem;
}

/* ── the animation ──────────────────────────────────────────────────────────────────────────────── */

/*
 * The canvas renders on white in both the desktop viewer and the browser, and the example layouts were
 * colored against white. So the animation is framed as a sheet it sits on rather than being blended into
 * the page — the frame says "this is the model", and keeps that surface honest whatever the page around it
 * does later.
 *
 * The height follows the animation's own shape. The player measures the model and publishes its ratio as
 * --ksl-aspect on this element, because a box of a fixed height has no idea what is going into it: a wide
 * model in a tall window fitted to the width and left a third of the frame empty underneath. max-height
 * still governs how large it may get on a big screen, and the fallback ratio covers the moment before the
 * trace has loaded.
 */
.player {
    aspect-ratio: var(--ksl-aspect, 8 / 5);
    max-height: min(70vh, 560px);
    min-height: 320px;
    margin: 1.75rem 0 2.5rem;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}

/* ── gallery cards ──────────────────────────────────────────────────────────────────────────────── */

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr));
    gap: 1.25rem;
    margin-top: 2rem;
}

.card {
    display: block;
    padding: 0 0 1.25rem;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: inherit;
    text-decoration: none;
    transition: border-color .12s ease, transform .12s ease;
}

/*
 * A frame from the middle of the run, chosen for having something in it. `cover` crops rather than
 * letterboxes: the posters are already trimmed to their content, so their proportions differ from model to
 * model, and a row of cards with white bands of varying height reads as a mistake.
 */
.card .shot {
    display: block;
    width: 100%;
    height: 170px;
    object-fit: cover;
    object-position: left top;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}

.card > :not(.shot) { margin-inline: 1.4rem; }

.card:hover {
    border-color: var(--indigo);
    transform: translateY(-2px);
}

/* The heading is a card title here, not a section break, so it drops the page-level spacing. */
.card h2 {
    margin: 1.1rem 0 0.4rem;
    font-size: 1.05rem;
    line-height: 1.3;
    color: var(--indigo);
}

.card p { margin: 0; max-width: none; font-size: 0.95rem; color: var(--ink); }
.card .meta { margin-top: 0.75rem; font-size: 0.8rem; color: var(--muted); }

/* ── previous / next ────────────────────────────────────────────────────────────────────────────── */

nav.pager {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 3rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line);
    font-weight: 600;
}

/* Keeps a lone "next" hard right when there is no "previous" — the first animation in the set. */
nav.pager .next:only-child { margin-left: auto; }

nav.pager a { text-decoration: none; max-width: 22rem; }
nav.pager a:hover { text-decoration: underline; }

/* ── footer ─────────────────────────────────────────────────────────────────────────────────────── */

footer.site {
    border-top: 1px solid var(--line);
    margin-top: 4rem;
    color: var(--muted);
    font-size: 0.9rem;
}

footer.site .wrap { padding-block: 1.5rem; }
footer.site p { max-width: none; }
