/* ============================================================
   LegalDebug.com -- Sunset Warm Geometric Lens-Flare Theme
   ============================================================ */

/* --- CSS Custom Properties --- */
:root {
    /* Palette */
    --solar-flare: #FF6B35;
    --amber-horizon: #F7931E;
    --magenta-dusk: #D64292;
    --twilight-indigo: #2B1055;
    --peach-haze: #FDE8D0;
    --champagne-mist: #FFF5EB;
    --prism-gold: #FFD93D;
    --burnt-sienna: #A0522D;

    /* Fonts */
    --font-display: 'Dela Gothic One', cursive;
    --font-secondary: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-accent: 'Caveat', cursive;

    /* Gradients */
    --gradient-warm: linear-gradient(135deg, #FF6B35, #F7931E, #FFD93D);
    --gradient-dramatic: linear-gradient(135deg, #2B1055, #D64292, #FF6B35);
    --gradient-sunset: linear-gradient(135deg, #F7931E, #A0522D);

    /* Animations */
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-magnetic: cubic-bezier(0.25, 0.46, 0.45, 0.94);

    /* Magnetic vars (updated by JS) */
    --magnetic-x: 0px;
    --magnetic-y: 0px;

    /* Flare opacity */
    --flare-opacity: 0.8;
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: var(--font-body);
    font-size: 17px;
    font-weight: 400;
    line-height: 1.7;
    letter-spacing: 0.01em;
    color: var(--twilight-indigo);
    background-color: var(--champagne-mist);
    overflow-x: hidden;
}

/* --- Floating Navigation Pill --- */
.nav-pill {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
    display: flex;
    gap: 0.25rem;
    background: rgba(43, 16, 85, 0.85);
    backdrop-filter: blur(12px);
    border-radius: 50px;
    padding: 0.5rem 0.75rem;
    transition: transform 0.4s var(--ease-magnetic);
}

.nav-link {
    font-family: var(--font-secondary);
    font-size: 14px;
    font-weight: 600;
    color: var(--champagne-mist);
    text-decoration: none;
    padding: 0.4rem 0.9rem;
    border-radius: 30px;
    transition: background 0.3s ease, color 0.3s ease, transform 0.4s var(--ease-magnetic);
    transform: translate(var(--magnetic-x), var(--magnetic-y));
}

.nav-link:hover {
    background: var(--solar-flare);
    color: var(--champagne-mist);
}

/* --- Scene (Base) --- */
.scene {
    position: relative;
    min-height: 85vh;
    padding: 4rem 3rem;
    overflow: hidden;
}

/* --- Corner Ornaments --- */
.corner-ornament {
    position: absolute;
    display: flex;
    gap: 6px;
    align-items: center;
    z-index: 5;
}

.corner-top-left {
    top: 2rem;
    left: 2rem;
}

.corner-bottom-right {
    bottom: 2rem;
    right: 2rem;
}

.ornament-circle circle {
    fill: none;
    stroke: var(--prism-gold);
    stroke-width: 1;
    opacity: 0.4;
}

.ornament-triangle polygon {
    fill: none;
    stroke: var(--solar-flare);
    stroke-width: 1;
    opacity: 0.35;
}

.ornament-line line {
    stroke: var(--prism-gold);
    stroke-width: 1;
    opacity: 0.3;
}

/* --- Diagonal Rays Background --- */
.diagonal-rays {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background:
        repeating-linear-gradient(
            30deg,
            transparent,
            transparent 80px,
            rgba(255, 217, 61, 0.06) 80px,
            rgba(255, 217, 61, 0.06) 81px
        );
}

/* ============================================================
   SCENE 1: GOLDEN ARRIVAL (Hero)
   ============================================================ */
.scene-hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--peach-haze);
    background-image:
        radial-gradient(ellipse at 30% 40%, rgba(255, 107, 53, 0.15) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 60%, rgba(247, 147, 30, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(214, 66, 146, 0.08) 0%, transparent 40%);
}

.scene-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.scene-shapes .geo-shape {
    position: absolute;
    pointer-events: auto;
    filter: drop-shadow(0 4px 20px rgba(255, 107, 53, 0.3));
    transition: transform 0.4s var(--ease-magnetic), filter 0.3s ease;
    animation: slowRotate var(--rotate-duration, 30s) linear infinite;
    transform: translate(var(--magnetic-x, 0px), var(--magnetic-y, 0px));
}

.scene-shapes .geo-shape:hover {
    filter: drop-shadow(0 6px 30px rgba(255, 107, 53, 0.5));
    transform: translate(var(--magnetic-x, 0px), var(--magnetic-y, 0px)) scale(1.1);
}

.scene-shapes .geo-shape.reverse {
    animation-direction: reverse;
}

@keyframes slowRotate {
    from { transform: translate(var(--magnetic-x, 0px), var(--magnetic-y, 0px)) rotate(0deg); }
    to { transform: translate(var(--magnetic-x, 0px), var(--magnetic-y, 0px)) rotate(360deg); }
}

/* --- Lens Flare Effects --- */
.lens-flares {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.lens-flare {
    position: absolute;
    border-radius: 50%;
    background:
        radial-gradient(circle, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0) 10px),
        radial-gradient(circle, rgba(255, 107, 53, 0.4) 0%, rgba(255, 107, 53, 0) 40px),
        radial-gradient(circle, rgba(247, 147, 30, 0.15) 0%, rgba(247, 147, 30, 0) 120px);
    width: 240px;
    height: 240px;
    animation: flarePulse 3s ease-in-out infinite;
    opacity: var(--flare-opacity);
}

@keyframes flarePulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.flare-1 { top: 15%; left: 20%; animation-delay: 0s; }
.flare-2 { top: 35%; left: 65%; animation-delay: 0.6s; }
.flare-3 { top: 60%; left: 40%; animation-delay: 1.2s; }
.flare-4 { top: 25%; left: 80%; animation-delay: 1.8s; width: 180px; height: 180px; }
.flare-5 { top: 70%; left: 15%; animation-delay: 2.4s; width: 200px; height: 200px; }

/* --- Mini Flares --- */
.mini-flare {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--prism-gold) 0%, transparent 70%);
    animation: flarePulse 2.5s ease-in-out infinite;
}

/* --- Hero Content --- */
.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(6rem, 10vw, 14rem);
    line-height: 0.95;
    color: var(--twilight-indigo);
    margin-bottom: 2rem;
}

.title-line {
    display: block;
}

.letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(80px) rotate(-5deg);
    animation: letterIn 0.7s var(--ease-spring) forwards;
    transition: transform 0.4s var(--ease-magnetic);
}

.letter:nth-child(1) { animation-delay: 0.1s; }
.letter:nth-child(2) { animation-delay: 0.16s; }
.letter:nth-child(3) { animation-delay: 0.22s; }
.letter:nth-child(4) { animation-delay: 0.28s; }
.letter:nth-child(5) { animation-delay: 0.34s; }

.title-line:nth-child(2) .letter:nth-child(1) { animation-delay: 0.4s; }
.title-line:nth-child(2) .letter:nth-child(2) { animation-delay: 0.46s; }
.title-line:nth-child(2) .letter:nth-child(3) { animation-delay: 0.52s; }
.title-line:nth-child(2) .letter:nth-child(4) { animation-delay: 0.58s; }
.title-line:nth-child(2) .letter:nth-child(5) { animation-delay: 0.64s; }

@keyframes letterIn {
    to {
        opacity: 1;
        transform: translateY(0) rotate(0deg);
    }
}

.hero-tagline {
    font-family: var(--font-secondary);
    font-size: clamp(1rem, 2vw, 1.4rem);
    font-weight: 500;
    color: var(--burnt-sienna);
    opacity: 0;
    animation: fadeIn 1s ease 1.2s forwards;
    max-width: 600px;
    margin: 0 auto;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

/* ============================================================
   DIVIDER BANDS
   ============================================================ */
.divider-band {
    position: relative;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--champagne-mist);
}

.divider-flare {
    width: 160px;
    height: 60px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 107, 53, 0.3) 0%, rgba(247, 147, 30, 0.15) 40%, transparent 70%);
    margin: 0 -30px;
    animation: flarePulse 3s ease-in-out infinite;
}

.divider-flare:nth-child(1) { animation-delay: 0s; }
.divider-flare:nth-child(2) { animation-delay: 0.5s; }
.divider-flare:nth-child(3) { animation-delay: 1s; }
.divider-flare:nth-child(4) { animation-delay: 1.5s; }
.divider-flare:nth-child(5) { animation-delay: 2s; }

/* ============================================================
   SCENE 2: PRISMATIC DISCOVERY
   ============================================================ */
.scene-spotlight {
    min-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--champagne-mist);
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(214, 66, 146, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 30%, rgba(255, 107, 53, 0.1) 0%, transparent 40%);
}

.spotlight-shape {
    position: relative;
    width: clamp(320px, 50vw, 600px);
    z-index: 5;
    transition: transform 0.4s var(--ease-magnetic);
    transform: translate(var(--magnetic-x, 0px), var(--magnetic-y, 0px));
}

.hexagon-svg {
    width: 100%;
    height: auto;
}

.hexagon-svg polygon {
    fill: url(#hexGrad);
    stroke: rgba(255, 107, 53, 0.3);
    stroke-width: 1;
}

.scene-spotlight .hexagon-svg polygon {
    fill: none;
}

.scene-spotlight .spotlight-shape::before {
    content: '';
    position: absolute;
    top: -5%;
    left: -5%;
    width: 110%;
    height: 110%;
    background: var(--gradient-warm);
    opacity: 0.25;
    clip-path: polygon(50% 0%, 100% 29%, 100% 71%, 50% 100%, 0% 71%, 0% 29%);
    z-index: -1;
}

.hexagon-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
    text-align: center;
    z-index: 10;
    mix-blend-mode: normal;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 4rem);
    color: var(--twilight-indigo);
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.section-text {
    font-family: var(--font-body);
    font-size: 17px;
    color: var(--twilight-indigo);
    line-height: 1.7;
    margin-bottom: 1rem;
}

/* Orbiting shapes */
.orbiting-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.orbiting-shapes .orbit-shape {
    position: absolute;
    pointer-events: auto;
    filter: drop-shadow(0 4px 20px rgba(255, 107, 53, 0.3));
    transition: transform 0.4s var(--ease-magnetic), filter 0.3s ease;
}

.orbiting-shapes .orbit-shape:hover {
    filter: drop-shadow(0 6px 30px rgba(255, 107, 53, 0.5));
    transform: scale(1.1);
}

/* Vertex flares */
.flare-vertices {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
}

.vertex-flare {
    position: absolute;
    width: 20px;
    height: 20px;
}

/* Scene entrance animation */
.scene-spotlight .spotlight-shape {
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.8s ease, transform 0.8s var(--ease-spring);
}

.scene-spotlight.in-view .spotlight-shape {
    opacity: 1;
    transform: scale(1) translate(var(--magnetic-x, 0px), var(--magnetic-y, 0px));
}

/* ============================================================
   SCENE 3: TANGRAM UNFOLD
   ============================================================ */
.scene-scatter {
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--peach-haze);
    background-image:
        radial-gradient(ellipse at 60% 30%, rgba(255, 217, 61, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 30% 70%, rgba(255, 107, 53, 0.1) 0%, transparent 40%);
}

.tangram-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.tangram-piece {
    position: absolute;
    transition: transform 1s var(--ease-spring), opacity 0.8s ease;
    transform: translate(var(--magnetic-x, 0px), var(--magnetic-y, 0px));
}

.tangram-piece svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 4px 20px rgba(255, 107, 53, 0.3));
}

/* Initial clustered positions */
.piece-1 { width: 160px; top: 20%; left: 15%; }
.piece-2 { width: 120px; top: 30%; left: 55%; }
.piece-3 { width: 140px; top: 55%; left: 25%; }
.piece-4 { width: 100px; top: 15%; left: 75%; }
.piece-5 { width: 130px; top: 65%; left: 65%; }
.piece-6 { width: 110px; top: 45%; left: 10%; }
.piece-7 { width: 90px; top: 70%; left: 45%; }
.piece-8 { width: 100px; top: 40%; left: 80%; }

/* Scattered positions when in view */
.scene-scatter.in-view .piece-1 { transform: translate(calc(var(--magnetic-x, 0px) + 20px), calc(var(--magnetic-y, 0px) - 15px)); transition-delay: 0ms; }
.scene-scatter.in-view .piece-2 { transform: translate(calc(var(--magnetic-x, 0px) - 30px), calc(var(--magnetic-y, 0px) + 20px)); transition-delay: 100ms; }
.scene-scatter.in-view .piece-3 { transform: translate(calc(var(--magnetic-x, 0px) + 25px), calc(var(--magnetic-y, 0px) + 30px)); transition-delay: 200ms; }
.scene-scatter.in-view .piece-4 { transform: translate(calc(var(--magnetic-x, 0px) - 15px), calc(var(--magnetic-y, 0px) - 25px)); transition-delay: 300ms; }
.scene-scatter.in-view .piece-5 { transform: translate(calc(var(--magnetic-x, 0px) + 35px), calc(var(--magnetic-y, 0px) + 10px)); transition-delay: 400ms; }
.scene-scatter.in-view .piece-6 { transform: translate(calc(var(--magnetic-x, 0px) - 20px), calc(var(--magnetic-y, 0px) - 35px)); transition-delay: 500ms; }
.scene-scatter.in-view .piece-7 { transform: translate(calc(var(--magnetic-x, 0px) + 10px), calc(var(--magnetic-y, 0px) + 25px)); transition-delay: 600ms; }
.scene-scatter.in-view .piece-8 { transform: translate(calc(var(--magnetic-x, 0px) - 25px), calc(var(--magnetic-y, 0px) - 10px)); transition-delay: 700ms; }

.tangram-text-blocks {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
    max-width: 650px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.tangram-text-block {
    background: rgba(255, 245, 235, 0.85);
    backdrop-filter: blur(8px);
    padding: 2.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 107, 53, 0.15);
}

/* ============================================================
   SCENE 4: LENS FLARE CORRIDOR
   ============================================================ */
.scene-corridor {
    min-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--champagne-mist);
    position: relative;
}

.scene-corridor::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        repeating-linear-gradient(
            30deg,
            transparent,
            transparent 80px,
            rgba(255, 217, 61, 0.04) 80px,
            rgba(255, 217, 61, 0.04) 81px
        );
    pointer-events: none;
}

.corridor-text {
    position: relative;
    z-index: 10;
    max-width: 600px;
    margin: 0 auto;
    padding: 3rem;
}

.corridor-body {
    font-family: var(--font-body);
    font-size: 1.25rem;
    line-height: 1.8;
    color: var(--twilight-indigo);
    margin-bottom: 2rem;
}

/* Annotations with Caveat font */
.annotated {
    position: relative;
    border-bottom: 2px dashed var(--prism-gold);
    cursor: default;
}

.annotation {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    font-family: var(--font-accent);
    font-size: 20px;
    color: var(--solar-flare);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s var(--ease-spring);
    pointer-events: none;
}

.annotated:hover .annotation {
    opacity: 1;
    transform: translateX(-50%) translateY(-10px);
}

/* Corridor flares */
.corridor-flares {
    position: absolute;
    top: 0;
    height: 100%;
    width: 25%;
    z-index: 5;
    pointer-events: none;
}

.left-flares { left: 0; }
.right-flares { right: 0; }

.corridor-flare-cluster {
    position: relative;
    margin: 4rem 0;
}

.corridor-flare {
    width: 180px;
    height: 180px;
}

.left-flares .corridor-flare-cluster:nth-child(1) { margin-left: 10%; }
.left-flares .corridor-flare-cluster:nth-child(2) { margin-left: 5%; }
.left-flares .corridor-flare-cluster:nth-child(3) { margin-left: 15%; }
.right-flares .corridor-flare-cluster:nth-child(1) { margin-left: auto; margin-right: 10%; }
.right-flares .corridor-flare-cluster:nth-child(2) { margin-left: auto; margin-right: 5%; }
.right-flares .corridor-flare-cluster:nth-child(3) { margin-left: auto; margin-right: 15%; }

.corridor-flare-cluster .mini-flare {
    position: absolute;
}

.corridor-flare-cluster .mini-flare:nth-child(2) { top: 20px; left: 40px; }
.corridor-flare-cluster .mini-flare:nth-child(3) { top: 50px; left: 80px; }
.corridor-flare-cluster .mini-flare:nth-child(4) { top: 10px; left: 100px; }
.corridor-flare-cluster .mini-flare:nth-child(5) { top: 60px; left: 30px; }

/* ============================================================
   SCENE 5: THE DEBUG
   ============================================================ */
.scene-debug {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--twilight-indigo);
    background-image:
        radial-gradient(ellipse at 50% 50%, rgba(214, 66, 146, 0.15) 0%, transparent 60%);
}

.debug-circle {
    position: relative;
    width: clamp(350px, 70vw, 800px);
    height: clamp(350px, 70vw, 800px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.debug-circle-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.debug-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 5rem);
    color: var(--champagne-mist);
    position: relative;
    z-index: 10;
    margin-bottom: 1rem;
}

.debug-text {
    font-family: var(--font-secondary);
    font-size: 1.2rem;
    color: var(--peach-haze);
    position: relative;
    z-index: 10;
    opacity: 0.8;
}

.bug-shape {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    height: 60%;
    z-index: 6;
}

.bug-fragment {
    position: absolute;
    transition: all 2.5s var(--ease-spring);
}

.bug-fragment svg {
    width: 100%;
    height: 100%;
}

/* Debug scene: fragments burst outward when in view */
.scene-debug.in-view .bug-fragment {
    opacity: 0.7;
}

.scene-debug.debugged .bug-fragment {
    border-radius: 50%;
}

/* ============================================================
   SCENE 6: SUNSET RESOLVE
   ============================================================ */
.scene-resolve {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 6rem;
    background: linear-gradient(180deg, var(--amber-horizon) 0%, var(--burnt-sienna) 100%);
    position: relative;
}

.resolve-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.resolve-shape {
    position: absolute;
    transition: all 2s var(--ease-spring);
    filter: drop-shadow(0 4px 20px rgba(255, 107, 53, 0.3));
}

/* Shapes converge to bottom center when in view */
.scene-resolve.in-view .resolve-shape {
    bottom: 15% !important;
    left: 50% !important;
    transform: translateX(-50%);
}

.resolve-flares {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
}

.resolve-flare {
    opacity: 0;
    transition: opacity 1.5s ease;
}

.scene-resolve.in-view .resolve-flare {
    opacity: 0.8;
}

.resolve-flare:nth-child(1) { top: 30%; left: 25%; width: 200px; height: 200px; }
.resolve-flare:nth-child(2) { top: 50%; left: 60%; width: 250px; height: 250px; }
.resolve-flare:nth-child(3) { top: 70%; left: 40%; width: 180px; height: 180px; }

.resolve-title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 6vw, 8rem);
    color: var(--champagne-mist);
    position: relative;
    z-index: 10;
    margin-bottom: 1.5rem;
    text-shadow: 0 4px 30px rgba(255, 107, 53, 0.4);
}

.resolve-subtitle {
    font-family: var(--font-secondary);
    font-size: clamp(1rem, 2vw, 1.3rem);
    color: var(--champagne-mist);
    opacity: 0.85;
    position: relative;
    z-index: 10;
    max-width: 500px;
    text-align: center;
    line-height: 1.6;
}

/* ============================================================
   SPARKLE EFFECTS
   ============================================================ */
.sparkle-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

.sparkle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--prism-gold);
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    animation: sparkleAnim 1.2s ease forwards;
    opacity: 0;
}

@keyframes sparkleAnim {
    0% { opacity: 0; transform: scale(0) rotate(0deg); }
    25% { opacity: 1; transform: scale(1) rotate(45deg); }
    75% { opacity: 1; transform: scale(1) rotate(90deg); }
    100% { opacity: 0; transform: scale(0) rotate(180deg); }
}

/* ============================================================
   GENERAL SCENE ANIMATIONS (Scroll-triggered)
   ============================================================ */
.scene:not(.scene-hero) .section-title,
.scene:not(.scene-hero) .section-text {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s var(--ease-spring);
}

.scene.in-view .section-title,
.scene.in-view .section-text {
    opacity: 1;
    transform: translateY(0);
}

.scene.in-view .section-text {
    transition-delay: 0.2s;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .hero-title {
        font-size: clamp(3rem, 12vw, 6rem);
    }

    .nav-pill {
        top: 1rem;
        right: 1rem;
        padding: 0.4rem 0.5rem;
    }

    .nav-link {
        font-size: 12px;
        padding: 0.3rem 0.6rem;
    }

    .scene {
        padding: 3rem 1.5rem;
    }

    .spotlight-shape {
        width: 90vw;
    }

    .corridor-flares {
        display: none;
    }

    .corridor-text {
        padding: 2rem 1rem;
    }

    .tangram-text-blocks {
        padding: 3rem 1rem;
    }

    .corner-ornament {
        display: none;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: clamp(2.5rem, 14vw, 4rem);
    }

    .section-title {
        font-size: clamp(1.5rem, 6vw, 2.5rem);
    }
}
