/* /trailer/ — the TerraPrinter trailer and its player, on the shared page shell (pages.css). */
@font-face {
    font-family: 'Bricolage Grotesque';
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url('/vendor/bricolage-grotesque@v9/bricolage-grotesque-latin.woff2') format('woff2');
}
.tpt {
    --tpt-ochre: #e3b04b;
    --tpt-teal: #2fa596;
    --tpt-ink: #f6f2e8;
    --tpt-dim: rgba(246, 242, 232, 0.62);
    --tpt-line: rgba(246, 242, 232, 0.12);
    --tpt-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color: var(--tpt-ink);
}
.tpt h1, .tpt h2, .tpt h3 { font-family: 'Schibsted Grotesk', 'Helvetica Neue', Arial, sans-serif; }
.tpt-kicker {
    font-family: var(--tpt-mono);
    font-size: 0.78rem;
    letter-spacing: 0.16em;
    color: var(--tpt-ochre);
    margin-bottom: 12px;
}
.tpt-title {
    font-size: clamp(2rem, 5vw, 3.4rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
    margin: 0 0 12px;
}
.tpt-lead { font-size: 1.08rem; line-height: 1.6; color: var(--tpt-dim); max-width: 44em; margin-bottom: 22px; }

/* ---- Player ---- */
.tpt-player {
    position: relative;
    aspect-ratio: 16 / 9;
    /* never taller than the window, so the controls stay on screen */
    width: min(100%, max(320px, (100vh - 300px) * 16 / 9));
    margin: 0 auto;
    background: #0b0e0d;
    border: 1px solid var(--tpt-line);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    outline: none;
    user-select: none;
    -webkit-user-select: none;
}
.tpt-player:focus-visible { box-shadow: 0 0 0 3px var(--tpt-teal), 0 24px 60px rgba(0, 0, 0, 0.45); }
.tpt-player video { display: block; width: 100%; height: 100%; object-fit: contain; background: #0b0e0d; }
.tpt-player:fullscreen { border: 0; border-radius: 0; aspect-ratio: auto; width: 100vw; height: 100vh; }
.tpt-player:-webkit-full-screen { border: 0; border-radius: 0; aspect-ratio: auto; width: 100vw; height: 100vh; }

/* Our own controls appear only once the script has taken over (the plain <video controls> works without it). */
.tpt-big, .tpt-controls, .tpt-end { display: none; }
.tpt-js .tpt-controls { display: flex; }
.tpt-js .tpt-big { display: grid; }

.tpt-big {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 92px;
    height: 92px;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: var(--tpt-teal);
    color: #04201c;
    font-size: 3.2rem;
    cursor: pointer;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    transition: transform 0.15s ease, background 0.15s ease, opacity 0.2s ease;
}
.tpt-big i { margin-left: 5px; }
.tpt-big:hover { transform: scale(1.06); background: #3cb8a8; }
.tpt-big:focus-visible { outline: 3px solid var(--tpt-ink); outline-offset: 3px; }
.tpt-started .tpt-big { opacity: 0; pointer-events: none; }

.tpt-controls {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 4px;
    padding: 34px 12px 8px;
    background: linear-gradient(to top, rgba(6, 9, 8, 0.88), rgba(6, 9, 8, 0));
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.tpt-started .tpt-controls { opacity: 1; pointer-events: auto; }
.tpt-started.tpt-idle .tpt-controls { opacity: 0; pointer-events: none; }
.tpt-started.tpt-idle { cursor: none; }

.tpt-btn {
    display: inline-grid;
    place-items: center;
    min-width: 40px;
    height: 40px;
    padding: 0 8px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--tpt-ink);
    font-size: 1.5rem;
    cursor: pointer;
}
.tpt-btn:hover { background: rgba(246, 242, 232, 0.12); }
.tpt-btn:focus-visible, .tpt-vol:focus-visible { outline: 2px solid var(--tpt-teal); outline-offset: 1px; }
.tpt-q { font-family: var(--tpt-mono); font-size: 0.78rem; letter-spacing: 0.04em; }
.tpt-time { font-family: var(--tpt-mono); font-size: 0.8rem; color: var(--tpt-ink); padding: 0 8px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tpt-space { flex: 1 1 auto; }

/* Scrub bar: a full-width row above the buttons. The range input sits on top of the drawn bar. */
.tpt-bar { position: relative; flex: 0 0 100%; height: 22px; margin-bottom: 2px; }
.tpt-track, .tpt-buf, .tpt-fill { position: absolute; left: 0; top: 9px; height: 4px; border-radius: 2px; pointer-events: none; }
.tpt-track { right: 0; background: rgba(246, 242, 232, 0.22); }
.tpt-buf { width: 0; background: rgba(246, 242, 232, 0.3); }
.tpt-fill { width: 0; background: var(--tpt-teal); }
.tpt-tick { position: absolute; top: 9px; width: 3px; height: 4px; margin-left: -1px; background: #0b0e0d; pointer-events: none; }
.tpt-seek {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 22px;
    margin: 0;
    padding: 0;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}
.tpt-seek::-webkit-slider-runnable-track { height: 22px; background: transparent; }
.tpt-seek::-moz-range-track { height: 22px; background: transparent; }
.tpt-seek::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: 4px; border: 0; border-radius: 50%; background: var(--tpt-ink); box-shadow: 0 0 0 3px rgba(47, 165, 150, 0.55); }
.tpt-seek::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: var(--tpt-ink); box-shadow: 0 0 0 3px rgba(47, 165, 150, 0.55); }
.tpt-seek:focus-visible { outline: 2px solid var(--tpt-teal); outline-offset: 2px; border-radius: 6px; }

.tpt-vol { width: 84px; height: 22px; accent-color: var(--tpt-teal); cursor: pointer; }
@media (max-width: 640px), (pointer: coarse) { .tpt-vol { display: none; } }

/* After the last frame: watch again, or go and make a model. */
.tpt-ended .tpt-end {
    position: absolute;
    inset: 0;
    display: flex;
    flex-wrap: wrap;
    align-content: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    background: rgba(6, 9, 8, 0.72);
}
.tpt-ended .tpt-controls, .tpt-ended .tpt-big { display: none; }

/* ---- Chapters ---- */
.tpt-chapters { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 16px 0 0; padding: 0; }
.tpt-chapters button {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    padding: 7px 12px;
    border: 1px solid var(--tpt-line);
    border-radius: 999px;
    background: rgba(246, 242, 232, 0.04);
    color: var(--tpt-ink);
    font-size: 0.9rem;
    cursor: pointer;
}
.tpt-chapters button span { font-family: var(--tpt-mono); font-size: 0.74rem; color: var(--tpt-dim); }
.tpt-chapters button:hover { border-color: rgba(47, 165, 150, 0.6); }
.tpt-chapters button:focus-visible { outline: 2px solid var(--tpt-teal); outline-offset: 2px; }
.tpt-chapters button.cur { border-color: var(--tpt-teal); background: rgba(47, 165, 150, 0.16); }
.tpt-keys { margin-top: 12px; font-size: 0.8rem; color: var(--tpt-dim); }
.tpt-keys kbd { font-family: var(--tpt-mono); font-size: 0.74rem; padding: 1px 6px; border: 1px solid var(--tpt-line); border-radius: 5px; background: rgba(246, 242, 232, 0.06); color: var(--tpt-ink); }
@media (pointer: coarse) { .tpt-keys { display: none; } }

/* ---- What is in it ---- */
.tpt-section { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--tpt-line); }
.tpt-section h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 800; letter-spacing: -0.01em; margin-bottom: 18px; }
.tpt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.tpt-grid article { padding: 18px; border: 1px solid var(--tpt-line); border-radius: 12px; background: rgba(246, 242, 232, 0.03); }
.tpt-grid i { font-size: 1.6rem; color: var(--tpt-teal); }
.tpt-grid h3 { font-size: 1.1rem; font-weight: 700; margin: 8px 0 6px; }
.tpt-grid p { margin: 0; font-size: 0.93rem; line-height: 1.55; color: var(--tpt-dim); }
.tpt-grid a { color: var(--tpt-ink); text-decoration: underline; text-decoration-color: rgba(47, 165, 150, 0.7); }
.tpt-ctas { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

@media (max-width: 640px) {
    .tpt-player { border-radius: 10px; }
    .tpt-big { width: 68px; height: 68px; font-size: 2.4rem; }
    .tpt-time { padding: 0 4px; font-size: 0.74rem; }
}
@media (prefers-reduced-motion: reduce) {
    .tpt-big, .tpt-controls { transition: none; }
}
