/**
 * intro_test_3 — Centered billboard CRT-warmup intro.
 *
 *   1. Page contents hidden; cloned billboard floats center on black.
 *   2. CRT-style flicker → steady tuning static over the billboard.
 *   3. Welcome text fades in over the static.
 *   4. Stage scales beyond the viewport.
 *   5. Overlay fades out; page fades in.
 *
 * DOM is built by intro_test_3.js. The variant-agnostic <canvas id="intro">
 * from the header is hidden below.
 */

#intro.intro-canvas {
    display: none;
}

/* ── Hide page contents while the intro is mounted ────────────────────── */
body.intro-test-3-running {
    background: #000;
}

body.intro-test-3-running > .page-retro,
body.intro-test-3-running > .grain,
body.intro-test-3-running > .colour-band {
    opacity: 0;
}

body > .page-retro,
body > .grain,
body > .colour-band {
    transition: opacity .6s ease;
}

/* ── Overlay ──────────────────────────────────────────────────────────── */
.intro-test-3 {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: #000;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    opacity: 1;
    transition: opacity .6s ease;
}

.intro-test-3.is-fading {
    opacity: 0;
}

/* ── Stage (matches captured billboard rect, scales near the end) ─────── */
.intro-test-3-stage {
    position: relative;
    /* width + height set inline by JS from the real billboard's rect. */
    transform: scale(1);
    transform-origin: center;
    transition: transform .9s cubic-bezier(.5, 0, .85, .35);
    will-change: transform;
}

.intro-test-3-stage.is-expanded {
    transform: scale(10);
}

/* The cloned billboard sits as the bottom layer of the stage. Strip its
 * margin/spacing so it occupies the stage's exact bounds — the clone is
 * usually wrapped in .billboard-wrap which adds layout we don't want here. */
.intro-test-3-stage .billboard-wrap {
    margin: 0;
    padding: 0;
    max-width: none;
    width: 100%;
    height: 100%;
}

.intro-test-3-stage .billboard {
    margin: 0;
    width: 100%;
    height: 100%;
}

.intro-test-3-stage .dots,
.intro-test-3-stage .rv-tabs {
    display: none !important;
}

/* ── Static canvas — opacity is JS-driven during flicker, CSS-driven after */
.intro-test-3-static {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    -ms-interpolation-mode: nearest-neighbor;
    opacity: 0;
}

.intro-test-3-static.is-tuning {
    opacity: 1;
}

.intro-test-3.is-revealed .intro-test-3-static {
    opacity: 0;
    transition: opacity .6s ease;
}

/* ── Welcome text ─────────────────────────────────────────────────────── */
.intro-test-3-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4cqw;
    opacity: 0;
    transition: opacity .6s ease .15s;
    container-type: size;
    container-name: intro3;
}

.intro-test-3.is-revealed .intro-test-3-content {
    opacity: 1;
}

.intro-test-3-title {
    margin: 0;
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: .12em;
    text-transform: uppercase;
    font-size: clamp(1.25rem, 11cqh, 7rem);
    color: #e7eef5;
}

.intro-test-3-title span {
    color: #2dd4bf;
    text-shadow:
        0 0 6px rgba(45, 212, 191, 0.7),
        0 0 18px rgba(45, 212, 191, 0.55),
        0 0 36px rgba(45, 212, 191, 0.3);
}

.intro-test-3-strap {
    margin: clamp(.4rem, 2cqh, 1.4rem) 0 0;
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    font-weight: 400;
    letter-spacing: .32em;
    text-transform: uppercase;
    font-size: clamp(.6rem, 3cqh, 1.3rem);
    color: rgba(45, 212, 191, .85);
}

/* ── Skip control ─────────────────────────────────────────────────────── */
.intro-test-3-skip {
    position: absolute;
    left: 50%;
    bottom: max(2rem, env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    pointer-events: auto;
    background: transparent;
    border: 0;
    padding: .5rem .9rem;
    color: rgba(231, 238, 245, 0.45);
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .7rem;
    letter-spacing: .28em;
    text-transform: uppercase;
    cursor: pointer;
    opacity: 0;
    animation: intro-test-3-skip-in .6s ease .15s forwards;
    transition: color .2s ease, opacity .2s ease;
}

.intro-test-3-skip:hover,
.intro-test-3-skip:focus-visible {
    color: rgba(231, 238, 245, 0.9);
    outline: none;
}

.intro-test-3-skip:focus-visible {
    text-shadow: 0 0 6px rgba(45, 212, 191, 0.55);
}

.intro-test-3.is-fading .intro-test-3-skip {
    opacity: 0;
    pointer-events: none;
}

@keyframes intro-test-3-skip-in {
    to { opacity: 1; }
}
