/* ============================================================
   haru.cam — a seven-reel cinematic descent
   Palette "Neon Marquee at Midnight"
   #0B0719 Velvet Black | #F4ECD8 Bone Cream | #FF2E93 Marquee Magenta
   #22F0C7 Aqua Tube | #FFB400 Sodium Amber | #6E5BFF Ultraviolet Indigo
   #1A1428 Bruise Plum
   Fonts: Limelight (deco display), Audiowide (futurist system),
          DM Mono (metadata/body), Cormorant Garamond italic (prose)
   ============================================================ */

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

:root {
    --velvet: #0B0719;
    --bone: #F4ECD8;
    --magenta: #FF2E93;
    --aqua: #22F0C7;
    --amber: #FFB400;
    --indigo: #6E5BFF;
    --plum: #1A1428;

    --neon: var(--magenta);
    --neon-rgb: 255, 46, 147;

    --chamfer: 32px;

    --deco: 'Limelight', 'Cormorant Garamond', serif;
    --futur: 'Audiowide', 'DM Mono', monospace;
    --mono: 'DM Mono', 'Courier New', monospace;
    --prose: 'Cormorant Garamond', Georgia, serif;

    --ease-iris: cubic-bezier(0.16, 1, 0.3, 1);
}

html {
    scroll-behavior: smooth;
}

html,
body {
    background: var(--velvet);
    color: var(--bone);
}

body {
    font-family: var(--mono);
    font-size: 15px;
    line-height: 24px;
    overflow-x: hidden;
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18'%3E%3Cpolygon points='3,2 14,9 3,16 6,9' fill='%2322F0C7'/%3E%3C/svg%3E") 4 9, auto;
}

/* Filmstrip perforated edges — left & right */
body::before,
body::after {
    content: "";
    position: fixed;
    top: 0;
    width: 12px;
    height: 100vh;
    z-index: 60;
    pointer-events: none;
    background:
        repeating-linear-gradient(
            to bottom,
            transparent 0 30px,
            #000 30px 36px
        ),
        linear-gradient(var(--velvet), var(--velvet));
    background-blend-mode: normal;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.9);
}

body::before { left: 0; }
body::after { right: 0; }

/* ============================================================
   IRIS-WIPE OVERLAY
   ============================================================ */
.iris {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 80;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.12s linear;
}

.iris.active {
    opacity: 1;
}

#irisCircle {
    transition: r 0.42s var(--ease-iris);
}

/* ============================================================
   VERTICAL ORIENTATION STRIP (right edge)
   ============================================================ */
.orient-strip {
    position: fixed;
    top: 0;
    right: 0;
    width: 64px;
    height: 100vh;
    z-index: 70;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 22px 0 18px;
    background: linear-gradient(to left, rgba(11, 7, 25, 0.95), rgba(11, 7, 25, 0.55));
    border-left: 1px solid rgba(244, 236, 216, 0.12);
}

.orient-mark {
    font-family: var(--futur);
    font-size: 13px;
    letter-spacing: 0.42em;
    color: var(--bone);
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    text-shadow:
        0 0 4px var(--aqua),
        0 0 11px var(--aqua),
        0 0 19px rgba(34, 240, 199, 0.4);
}

.orient-counter {
    font-family: var(--futur);
    font-size: 9px;
    letter-spacing: 0.16em;
    color: var(--aqua);
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    white-space: nowrap;
    text-shadow: 0 0 6px rgba(34, 240, 199, 0.6);
}

.orient-dots {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

.o-dot {
    width: 10px;
    height: 10px;
    background: transparent;
    border: 1px solid rgba(244, 236, 216, 0.35);
    transform: rotate(45deg);
    position: relative;
    transition: background 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
}

.o-dot span {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%) rotate(-45deg);
    font-family: var(--futur);
    font-size: 8px;
    letter-spacing: 0.1em;
    color: rgba(244, 236, 216, 0.4);
    opacity: 0;
    transition: opacity 0.3s ease;
    white-space: nowrap;
}

.o-dot.active {
    background: var(--neon);
    border-color: var(--neon);
    box-shadow:
        0 0 6px var(--neon),
        0 0 14px var(--neon),
        0 0 22px rgba(var(--neon-rgb), 0.5);
}

.o-dot.active span {
    opacity: 1;
    color: var(--neon);
}

.orient-foot {
    font-family: var(--futur);
    font-size: 8px;
    letter-spacing: 0.22em;
    color: rgba(244, 236, 216, 0.45);
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

/* ============================================================
   REEL STACK — scroll-snap filmstrip
   ============================================================ */
.reel-stack {
    scroll-snap-type: y mandatory;
}

.reel {
    position: relative;
    width: 100vw;
    min-height: 100vh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding: 0 84px 0 12px;
    background: radial-gradient(120% 100% at 10% 0%, rgba(110, 91, 255, 0.10), transparent 60%),
                radial-gradient(140% 120% at 90% 100%, rgba(var(--neon-rgb), 0.07), transparent 55%),
                var(--velvet);
}

/* per-reel dominant neon */
.reel--magenta { --neon: #FF2E93; --neon-rgb: 255, 46, 147; }
.reel--aqua    { --neon: #22F0C7; --neon-rgb: 34, 240, 199; }
.reel--amber   { --neon: #FFB400; --neon-rgb: 255, 180, 0; }
.reel--indigo  { --neon: #6E5BFF; --neon-rgb: 110, 91, 255; }

/* giant clipped art-deco numeral on left margin */
.reel-numeral {
    position: absolute;
    left: -0.18em;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--deco);
    font-size: clamp(240px, 34vw, 360px);
    line-height: 0.74;
    color: var(--amber);
    opacity: 0.22;
    pointer-events: none;
    user-select: none;
    text-shadow:
        0 0 4px var(--amber),
        0 0 14px rgba(255, 180, 0, 0.4);
    z-index: 0;
}

/* fractured 12-column grid */
.reel-grid {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1480px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: repeat(6, 1fr);
    gap: 14px 18px;
    min-height: 84vh;
    align-content: center;
}

/* ----- ticker rail (film edge metadata) ----- */
.ticker-rail {
    grid-column: 11 / 13;
    grid-row: 1 / 7;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
    border-left: 1px dashed rgba(244, 236, 216, 0.2);
    padding: 8px 0 8px 10px;
    font-family: var(--futur);
    font-size: 9px;
    letter-spacing: 0.14em;
    color: rgba(244, 236, 216, 0.55);
}

.ticker-rail span {
    display: block;
    text-align: right;
    position: relative;
    padding-right: 14px;
    text-shadow: 0 0 6px rgba(var(--neon-rgb), 0.35);
}

.ticker-rail span::after {
    content: "";
    position: absolute;
    right: 0;
    top: 50%;
    width: 4px;
    height: 4px;
    background: var(--neon);
    transform: translateY(-50%) rotate(45deg);
    box-shadow: 0 0 5px var(--neon);
}

/* ============================================================
   SECTION HEADERS — marquee bulbs + diagonal title
   ============================================================ */
.reel-head {
    grid-column: 2 / 10;
    grid-row: 1 / 3;
    align-self: end;
    padding-bottom: 8px;
}

.marquee-rule {
    display: flex;
    gap: 10px;
    margin: 6px 0;
    padding-left: 4px;
}

.marquee-rule span {
    --lit: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(244, 236, 216, 0.12);
    box-shadow: inset 0 0 0 2px rgba(11, 7, 25, 0.7);
    transition: background 0.18s ease, box-shadow 0.22s ease;
    transition-delay: calc(var(--i) * 60ms);
}

.reel-head.is-revealed .marquee-rule span {
    background: var(--neon);
    box-shadow:
        inset 0 0 0 2px rgba(11, 7, 25, 0.55),
        0 0 5px var(--neon),
        0 0 11px var(--neon),
        0 0 18px rgba(var(--neon-rgb), 0.5);
}

.reel-title {
    font-family: var(--deco);
    font-weight: 400;
    text-transform: uppercase;
    line-height: 1;
    color: var(--bone);
    margin: 14px 0;
    font-size: clamp(2.2rem, 5.4vw, 4.6rem);
    letter-spacing: 0.02em;
    font-feature-settings: "ss01";
}

/* diagonal axis */
.diag {
    display: inline-block;
    transform: rotate(-14deg);
    transform-origin: 0% 100%;
    margin-left: -0.4em;
}

/* ============================================================
   NEON GLOW
   ============================================================ */
.neon {
    position: relative;
    color: var(--bone);
    text-shadow:
        0 0 4px var(--neon),
        0 0 11px var(--neon),
        0 0 19px var(--neon),
        0 0 40px rgba(var(--neon-rgb), 0.55);
    -webkit-text-stroke: 1px rgba(var(--neon-rgb), 0.8);
    animation: flicker 6s infinite steps(1);
}

.neon::after {
    content: attr(data-text);
    position: absolute;
    left: 0;
    top: 0;
    color: var(--neon);
    mix-blend-mode: screen;
    opacity: 0.3;
    pointer-events: none;
    -webkit-text-stroke: 0;
}

.reel:nth-of-type(1) .neon { animation-duration: 4.2s; animation-delay: -0.3s; }
.reel:nth-of-type(2) .neon { animation-duration: 7.1s; animation-delay: -1.4s; }
.reel:nth-of-type(3) .neon { animation-duration: 5.6s; animation-delay: -2.2s; }
.reel:nth-of-type(4) .neon { animation-duration: 8.4s; animation-delay: -0.9s; }
.reel:nth-of-type(5) .neon { animation-duration: 4.8s; animation-delay: -3.1s; }
.reel:nth-of-type(6) .neon { animation-duration: 6.7s; animation-delay: -1.9s; }
.reel:nth-of-type(7) .neon { animation-duration: 5.2s; animation-delay: -0.6s; }

@keyframes flicker {
    0%   { opacity: 1; }
    7%   { opacity: 0.4; }
    9%   { opacity: 1; }
    53%  { opacity: 1; }
    55%  { opacity: 0.6; }
    57%  { opacity: 1; }
    100% { opacity: 1; }
}

/* ============================================================
   CHAMFERED PANELS — sharp-angle clip-path grammar
   ============================================================ */
.chamfer {
    clip-path: polygon(
        0 0,
        100% 0,
        100% calc(100% - var(--chamfer)),
        calc(100% - var(--chamfer)) 100%,
        0 100%
    );
}

.chamfer-mirror {
    clip-path: polygon(
        var(--chamfer) 0,
        100% 0,
        100% 100%,
        0 100%,
        0 var(--chamfer)
    );
}

.chamfer:hover,
.chamfer-mirror:hover {
    --chamfer: 8px;
}

/* ----- anchor panel (reel I) ----- */
.anchor-panel {
    grid-column: 3 / 10;
    grid-row: 3 / 6;
    background: linear-gradient(135deg, var(--plum), rgba(26, 20, 40, 0.6));
    border: 1px solid rgba(var(--neon-rgb), 0.25);
    padding: 30px 36px;
    align-self: center;
    transition: clip-path 0.3s ease;
}

.kicker {
    font-family: var(--futur);
    font-size: 10px;
    letter-spacing: 0.3em;
    color: var(--neon);
    margin-bottom: 16px;
    text-shadow: 0 0 7px rgba(var(--neon-rgb), 0.5);
}

.lede {
    font-family: var(--mono);
    font-size: 16px;
    line-height: 26px;
    color: var(--bone);
    max-width: 52ch;
    text-align: right;
    margin-left: auto;
}

/* ============================================================
   PULL QUOTES
   ============================================================ */
.pull-quote {
    grid-column: 3 / 10;
    grid-row: 3 / 7;
    align-self: center;
    background: linear-gradient(160deg, rgba(26, 20, 40, 0.85), rgba(11, 7, 25, 0.4));
    border: 1px solid rgba(var(--neon-rgb), 0.22);
    padding: 40px 48px 34px;
    position: relative;
    transition: clip-path 0.3s ease;
}

.quote-mark {
    position: absolute;
    top: -0.32em;
    left: 0.1em;
    font-family: var(--deco);
    font-size: clamp(5rem, 11vw, 9rem);
    line-height: 1;
    color: var(--neon);
    text-shadow:
        0 0 8px var(--neon),
        0 0 22px rgba(var(--neon-rgb), 0.55);
    opacity: 0.85;
}

.pull-quote p {
    font-family: var(--prose);
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1.5rem, 3vw, 2.4rem);
    line-height: 1.34;
    color: var(--bone);
    max-width: 24ch;
    margin: 0.4em 0 0.8em auto;
    text-align: right;
}

.pull-quote cite {
    display: block;
    font-family: var(--futur);
    font-style: normal;
    font-size: 10px;
    letter-spacing: 0.22em;
    color: var(--neon);
    text-align: right;
    text-shadow: 0 0 6px rgba(var(--neon-rgb), 0.5);
}

/* ============================================================
   PLATE FIGURES — CSS-constructed "images"
   ============================================================ */
.plate {
    grid-column: 3 / 10;
    grid-row: 2 / 7;
    align-self: center;
    background: linear-gradient(150deg, var(--plum), rgba(11, 7, 25, 0.5));
    border: 1px solid rgba(var(--neon-rgb), 0.22);
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: clip-path 0.3s ease;
}

.plate-art {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background:
        repeating-linear-gradient(0deg, rgba(var(--neon-rgb), 0.05) 0 1px, transparent 1px 4px),
        radial-gradient(circle at center, rgba(var(--neon-rgb), 0.14), transparent 70%),
        #06040f;
    overflow: hidden;
    border: 1px solid rgba(var(--neon-rgb), 0.3);
}

/* viewfinder reticle (reel III) */
.ring {
    position: absolute;
    border: 1px solid var(--neon);
    border-radius: 50%;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 8px rgba(var(--neon-rgb), 0.6), inset 0 0 8px rgba(var(--neon-rgb), 0.3);
}

.ring.r1 { width: 56%; height: 92%; }
.ring.r2 { width: 30%; height: 50%; }

.cross-h,
.cross-v {
    position: absolute;
    background: var(--neon);
    box-shadow: 0 0 6px var(--neon);
}

.cross-h { left: 8%; right: 8%; top: 50%; height: 1px; transform: translateY(-50%); }
.cross-v { top: 6%; bottom: 6%; left: 50%; width: 1px; transform: translateX(-50%); }

.corner-mark {
    position: absolute;
    width: 22px;
    height: 22px;
    border: 2px solid var(--neon);
    box-shadow: 0 0 7px rgba(var(--neon-rgb), 0.6);
}

.corner-mark.tl { left: 10px; top: 10px; border-right: none; border-bottom: none; }
.corner-mark.tr { right: 10px; top: 10px; border-left: none; border-bottom: none; }
.corner-mark.bl { left: 10px; bottom: 10px; border-right: none; border-top: none; }
.corner-mark.br { right: 10px; bottom: 10px; border-left: none; border-top: none; }

.scanline {
    position: absolute;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(var(--neon-rgb), 0.9), transparent);
    box-shadow: 0 0 12px rgba(var(--neon-rgb), 0.7);
    animation: scan 4.6s linear infinite;
}

@keyframes scan {
    0% { top: -4px; }
    100% { top: 100%; }
}

/* marquee art (reel VI) */
.marquee-art {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
    padding: 18px 24px;
}

.m-row {
    height: 8px;
    background:
        repeating-linear-gradient(
            90deg,
            var(--neon) 0 8px,
            transparent 8px 22px
        );
    box-shadow: 0 0 8px rgba(var(--neon-rgb), 0.6);
    filter: drop-shadow(0 0 4px var(--neon));
}

.m-sign {
    display: flex;
    justify-content: center;
    gap: clamp(6px, 1.4vw, 18px);
}

.m-letter {
    font-family: var(--deco);
    font-size: clamp(2rem, 6vw, 5rem);
    color: var(--bone);
    text-shadow:
        0 0 4px var(--neon),
        0 0 12px var(--neon),
        0 0 24px rgba(var(--neon-rgb), 0.6);
    animation: bulbchase 1.9s steps(1) infinite;
    animation-delay: calc(var(--d) * -0.24s);
}

@keyframes bulbchase {
    0% { opacity: 1; }
    14% { opacity: 0.35; }
    18% { opacity: 1; }
    100% { opacity: 1; }
}

figcaption,
.plate figcaption {
    font-family: var(--mono);
    font-size: 13px;
    line-height: 20px;
    color: rgba(244, 236, 216, 0.78);
    text-align: right;
    max-width: 52ch;
    margin-left: auto;
    transform: translateX(18px);
}

/* ============================================================
   PROSE BLOCK — Cormorant italic artist note (reel IV)
   ============================================================ */
.prose-block {
    grid-column: 3 / 10;
    grid-row: 3 / 7;
    align-self: center;
    background: linear-gradient(140deg, var(--bone), #ece2c8);
    color: var(--velvet);
    padding: 36px 44px;
    border: 1px solid rgba(11, 7, 25, 0.5);
    box-shadow: 0 0 30px rgba(110, 91, 255, 0.25);
    transition: clip-path 0.3s ease;
}

.prose-block p {
    font-family: var(--prose);
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1.25rem, 2.4vw, 1.9rem);
    line-height: 1.42;
    color: #1a1428;
    max-width: 52ch;
    margin-left: auto;
    text-align: right;
}

/* ============================================================
   END-CARD SLATE (reel VII)
   ============================================================ */
.reel--end {
    justify-content: center;
}

.reel--end .reel-grid {
    place-items: center;
    grid-template-rows: 1fr;
}

.end-slate {
    grid-column: 3 / 11;
    background: var(--bone);
    color: var(--velvet);
    padding: 60px 80px;
    text-align: center;
    border: 2px solid var(--velvet);
    box-shadow: 0 0 40px rgba(110, 91, 255, 0.3);
    transition: clip-path 0.3s ease;
}

.end-line-1 {
    font-family: var(--deco);
    font-size: clamp(3rem, 8vw, 6rem);
    color: var(--velvet);
    letter-spacing: 0.04em;
    margin-bottom: 10px;
}

.end-line-2 {
    font-family: var(--futur);
    font-size: clamp(0.8rem, 1.6vw, 1.1rem);
    letter-spacing: 0.4em;
    color: var(--velvet);
    margin-bottom: 18px;
}

.end-line-3 {
    font-family: var(--futur);
    font-size: clamp(0.7rem, 1.3vw, 0.95rem);
    letter-spacing: 0.34em;
    color: rgba(26, 20, 40, 0.7);
}

/* ============================================================
   SPROCKET ZIG-ZAG DIVIDERS between reels
   ============================================================ */
.sprocket-div {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 26px;
    z-index: 5;
    background:
        linear-gradient(135deg, var(--velvet) 50%, transparent 50%) repeat-x,
        linear-gradient(-135deg, var(--velvet) 50%, transparent 50%) repeat-x;
    background-size: 36px 26px, 36px 26px;
    background-position: 0 100%, 18px 100%;
    filter: drop-shadow(0 -2px 0 rgba(var(--neon-rgb), 0.25));
}

/* ============================================================
   FADE-REVEAL ENTRANCE
   ============================================================ */
.reveal {
    opacity: 0;
    clip-path: inset(50% 0 50% 0);
    transition:
        opacity 1.1s var(--ease-iris),
        clip-path 1.1s var(--ease-iris);
}

.reveal.is-revealed {
    opacity: 1;
}

/* keep panel chamfer when revealed (override the inset reveal clip with the chamfer) */
.anchor-panel.is-revealed { clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--chamfer)), calc(100% - var(--chamfer)) 100%, 0 100%); }
.plate.chamfer.is-revealed { clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--chamfer)), calc(100% - var(--chamfer)) 100%, 0 100%); }
.end-slate.is-revealed { clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--chamfer)), calc(100% - var(--chamfer)) 100%, 0 100%); }
.pull-quote.chamfer.is-revealed { clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--chamfer)), calc(100% - var(--chamfer)) 100%, 0 100%); }
.pull-quote.chamfer-mirror.is-revealed { clip-path: polygon(var(--chamfer) 0, 100% 0, 100% 100%, 0 100%, 0 var(--chamfer)); }
.prose-block.chamfer-mirror.is-revealed { clip-path: polygon(var(--chamfer) 0, 100% 0, 100% 100%, 0 100%, 0 var(--chamfer)); }
.plate.chamfer-mirror.is-revealed { clip-path: polygon(var(--chamfer) 0, 100% 0, 100% 100%, 0 100%, 0 var(--chamfer)); }

.reel-head.reveal { clip-path: none; }
.reel-head.reveal.is-revealed { clip-path: none; }

@media (prefers-reduced-motion: reduce) {
    .reveal,
    .reveal.is-revealed {
        transition: none;
        opacity: 1;
        clip-path: none;
    }
    .neon,
    .m-letter,
    .scanline,
    .iris #irisCircle {
        animation: none !important;
    }
    html { scroll-behavior: auto; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
    .reel { padding: 0 56px 0 12px; }
    .orient-strip { width: 48px; }
    .reel-grid {
        grid-template-columns: repeat(6, 1fr);
        grid-template-rows: auto;
        min-height: auto;
        gap: 18px;
        padding: 90px 0 60px;
    }
    .reel-head { grid-column: 1 / 7; }
    .anchor-panel,
    .pull-quote,
    .plate,
    .prose-block,
    .end-slate { grid-column: 1 / 7; }
    .ticker-rail {
        grid-column: 1 / 7;
        grid-row: auto;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px 16px;
        border-left: none;
        border-top: 1px dashed rgba(244, 236, 216, 0.2);
        padding: 10px 0 0;
        align-items: center;
    }
    .ticker-rail span { text-align: left; }
    .reel-numeral { font-size: 180px; opacity: 0.14; }
    .diag { margin-left: -0.1em; }
}

@media (max-width: 560px) {
    .reel-title { font-size: 2rem; }
    .diag { transform: rotate(-9deg); }
    .pull-quote p { max-width: none; }
    figcaption, .plate figcaption { transform: none; }
}
