/* ============================================
   gunsul.studio — Frutiger Aero + Sci-Fi HUD
   Hexagonal Honeycomb Construction Narrative
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --aurora-green: #00E5A0;
    --aurora-violet: #7B2FBE;
    --aurora-cyan: #00D4FF;
    --aurora-pink: #FF3CAC;
    --deep-space: #0A0E1A;
    --deep-sky: #0F1B3D;
    --panel-glass: rgba(140, 170, 220, 0.08);
    --panel-glass-strong: rgba(140, 170, 220, 0.12);
    --frost-white: #E8EDF5;
    --warm-glow: #FFB347;

    --gradient-aurora: linear-gradient(135deg, #00E5A0, #00D4FF, #7B2FBE);
    --gradient-warm: linear-gradient(160deg, #FF3CAC, #FFB347, #00E5A0);
    --gradient-glass: linear-gradient(180deg, rgba(140,170,220,0.12), rgba(140,170,220,0.03));
    --gradient-sky: radial-gradient(ellipse at 50% 20%, #0F1B3D, #0A0E1A);

    --font-display: 'Roboto Slab', serif;
    --font-secondary: 'Zilla Slab', serif;
    --font-body: 'IBM Plex Sans', sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;

    --hex-clip: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
}

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

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

body {
    background: var(--gradient-sky);
    background-attachment: fixed;
    color: var(--frost-white);
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(0.95rem, 1.2vw, 1.15rem);
    line-height: 1.65;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- Background Hex Grid --- */
#hex-grid-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.15;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='112' height='194' viewBox='0 0 112 194'%3E%3Cpolygon points='56,2 108,50 108,146 56,194 4,146 4,50' fill='none' stroke='%2300D4FF' stroke-width='0.5' opacity='0.3'/%3E%3C/svg%3E");
    background-size: 112px 194px;
    animation: hexGridPulse 8s ease-in-out infinite;
}

@keyframes hexGridPulse {
    0%, 100% { opacity: 0.1; }
    50% { opacity: 0.2; }
}

/* --- Particle Canvas --- */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* --- Scenes --- */
.scene {
    position: relative;
    width: 100%;
    min-height: 100vh;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.scene-tall {
    min-height: 150vh;
}

.scene-inner {
    position: relative;
    width: 100%;
    max-width: 1400px;
    height: 100%;
    min-height: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

/* --- Hex Cell Base --- */
.hex-cell {
    position: relative;
    clip-path: var(--hex-clip);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), filter 0.4s ease;
    opacity: 0;
    transform: scale(0.8);
}

.hex-cell.visible {
    opacity: 1;
    transform: scale(1);
}

.hex-glass {
    position: absolute;
    inset: 0;
    background: var(--gradient-glass);
    clip-path: var(--hex-clip);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.hex-gloss {
    position: absolute;
    inset: 0;
    clip-path: var(--hex-clip);
    background: linear-gradient(135deg, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0.05) 50%, transparent 100%);
    pointer-events: none;
    z-index: 5;
}

.hex-content {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 15%;
    text-align: center;
}

/* --- Edge Draw Animation --- */
@keyframes hexEdgeDraw {
    0% {
        clip-path: polygon(50% 50%, 50% 50%, 50% 50%, 50% 50%, 50% 50%, 50% 50%);
        opacity: 0;
    }
    30% {
        clip-path: polygon(25% 0%, 75% 0%, 75% 0%, 50% 50%, 50% 50%, 25% 0%);
        opacity: 0.5;
    }
    100% {
        clip-path: var(--hex-clip);
        opacity: 1;
    }
}

.hex-cell.animate-in {
    animation: hexMaterialize 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes hexMaterialize {
    0% {
        opacity: 0;
        transform: scale(0.3);
        filter: brightness(2) saturate(0);
    }
    40% {
        opacity: 0.6;
        transform: scale(0.9);
        filter: brightness(1.5) saturate(0.5);
    }
    100% {
        opacity: 1;
        transform: scale(1);
        filter: brightness(1) saturate(1);
    }
}

/* --- SCENE 1: THE VIEWPORT --- */
#scene-viewport {
    background: var(--deep-space);
    min-height: 100vh;
}

/* Rosette Layout */
.hex-rosette {
    position: relative;
    width: 70vmin;
    height: 70vmin;
    max-width: 700px;
    max-height: 700px;
}

.hex-rosette .hex-center {
    position: absolute;
    width: 28%;
    height: 32%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    z-index: 10;
}

.hex-rosette .hex-center.visible {
    transform: translate(-50%, -50%) scale(1);
}

.hex-seed {
    border: none;
}

.hex-seed .hex-glass {
    background: linear-gradient(180deg, rgba(0, 229, 160, 0.12), rgba(0, 212, 255, 0.06));
}

/* Ring 1 positions (6 hexes around center) */
.hex-r1 {
    position: absolute;
    width: 20%;
    height: 23%;
    z-index: 5;
}

.hex-r1-0 { top: 10%; left: 50%; transform: translate(-50%, -50%) scale(0.8); }
.hex-r1-1 { top: 27%; left: 78%; transform: translate(-50%, -50%) scale(0.8); }
.hex-r1-2 { top: 63%; left: 78%; transform: translate(-50%, -50%) scale(0.8); }
.hex-r1-3 { top: 80%; left: 50%; transform: translate(-50%, -50%) scale(0.8); }
.hex-r1-4 { top: 63%; left: 22%; transform: translate(-50%, -50%) scale(0.8); }
.hex-r1-5 { top: 27%; left: 22%; transform: translate(-50%, -50%) scale(0.8); }

.hex-r1.visible {
    transform: translate(-50%, -50%) scale(1) !important;
}

/* Ring 2 positions (12 outer hexes) */
.hex-r2 {
    position: absolute;
    width: 14%;
    height: 16%;
    z-index: 3;
}

.hex-r2-0  { top: 0%;  left: 36%; transform: translate(-50%, -50%) scale(0.8); }
.hex-r2-1  { top: 0%;  left: 64%; transform: translate(-50%, -50%) scale(0.8); }
.hex-r2-2  { top: 15%; left: 90%; transform: translate(-50%, -50%) scale(0.8); }
.hex-r2-3  { top: 38%; left: 97%; transform: translate(-50%, -50%) scale(0.8); }
.hex-r2-4  { top: 62%; left: 97%; transform: translate(-50%, -50%) scale(0.8); }
.hex-r2-5  { top: 85%; left: 90%; transform: translate(-50%, -50%) scale(0.8); }
.hex-r2-6  { top: 95%; left: 64%; transform: translate(-50%, -50%) scale(0.8); }
.hex-r2-7  { top: 95%; left: 36%; transform: translate(-50%, -50%) scale(0.8); }
.hex-r2-8  { top: 85%; left: 10%; transform: translate(-50%, -50%) scale(0.8); }
.hex-r2-9  { top: 62%; left: 3%;  transform: translate(-50%, -50%) scale(0.8); }
.hex-r2-10 { top: 38%; left: 3%;  transform: translate(-50%, -50%) scale(0.8); }
.hex-r2-11 { top: 15%; left: 10%; transform: translate(-50%, -50%) scale(0.8); }

.hex-r2.visible {
    transform: translate(-50%, -50%) scale(1) !important;
}

/* Domain title typewriter */
.domain-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(1.2rem, 3vw, 2.2rem);
    letter-spacing: 0.02em;
    color: var(--frost-white);
    white-space: nowrap;
    overflow: hidden;
    border-right: 2px solid var(--aurora-cyan);
}

.domain-title.typed {
    border-right-color: transparent;
}

.domain-subtitle {
    font-family: var(--font-secondary);
    font-weight: 500;
    font-size: clamp(0.7rem, 1.5vw, 1rem);
    color: var(--aurora-cyan);
    opacity: 0;
    transition: opacity 0.6s ease 0.3s;
    margin-top: 0.3em;
}

.domain-subtitle.show {
    opacity: 1;
}

/* Gauges */
.gauge-readout {
    position: relative;
    width: 80%;
    max-width: 80px;
    aspect-ratio: 1;
}

.gauge-svg {
    width: 100%;
    height: 100%;
}

.gauge-track {
    fill: none;
    stroke: rgba(140, 170, 220, 0.15);
    stroke-width: 4;
}

.gauge-fill {
    fill: none;
    stroke: var(--aurora-green);
    stroke-width: 4;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: center;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.gauge-fill-alt {
    stroke: var(--aurora-violet);
}

.gauge-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-mono);
    font-size: clamp(0.6rem, 1vw, 0.85rem);
    color: var(--aurora-green);
}

/* Data readouts */
.data-readout {
    display: flex;
    flex-direction: column;
    gap: 0.2em;
}

.data-label {
    font-family: var(--font-secondary);
    font-weight: 600;
    font-size: clamp(0.5rem, 0.8vw, 0.7rem);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(232, 237, 245, 0.5);
}

.data-value {
    font-size: clamp(0.7rem, 1.2vw, 1rem);
    color: var(--aurora-cyan);
}

.data-unit {
    font-family: var(--font-mono);
    font-size: 0.7em;
    color: rgba(232, 237, 245, 0.4);
}

.mono {
    font-family: var(--font-mono);
}

.tiny {
    font-size: clamp(0.5rem, 0.7vw, 0.65rem);
    color: var(--aurora-cyan);
    opacity: 0.7;
}

/* Progress bars */
.progress-bar-container {
    width: 80%;
    display: flex;
    flex-direction: column;
    gap: 0.3em;
    align-items: center;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(140, 170, 220, 0.1);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    background: var(--gradient-aurora);
    background-size: 200% 100%;
    border-radius: 3px;
    transition: width 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    animation: auroraShift 3s linear infinite;
}

.progress-bar.active::after {
    width: var(--progress);
}

.progress-label {
    font-size: clamp(0.45rem, 0.7vw, 0.6rem);
    color: rgba(232, 237, 245, 0.5);
}

@keyframes auroraShift {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

/* Mini elements for ring 2 */
.mini-progress {
    width: 70%;
    height: 4px;
    background: rgba(140, 170, 220, 0.1);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.mini-progress::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    background: var(--gradient-warm);
    background-size: 200% 100%;
    border-radius: 2px;
    transition: width 1.2s ease;
    animation: auroraShift 3s linear infinite;
}

.mini-progress.active::after {
    width: var(--progress);
}

.mini-gauge {
    width: 30px;
    height: 30px;
    border: 2px solid rgba(0, 229, 160, 0.3);
    border-top-color: var(--aurora-green);
    border-radius: 50%;
    animation: miniSpin 4s linear infinite;
}

.mini-gauge.alt {
    border-top-color: var(--aurora-pink);
    border-color: rgba(255, 60, 172, 0.3);
    animation-duration: 6s;
    animation-direction: reverse;
}

@keyframes miniSpin {
    to { transform: rotate(360deg); }
}

/* Scroll chevron */
.scroll-chevron {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    animation: chevronBounce 2s ease-in-out infinite;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.scroll-chevron.show {
    opacity: 0.6;
}

@keyframes chevronBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(8px); }
}

/* --- SCENE 2: THE ASSEMBLY FLOOR --- */
#scene-assembly {
    padding: 4rem 0;
}

.hex-strip-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0;
    align-items: center;
}

.hex-strip-row {
    display: flex;
    justify-content: center;
    gap: 0;
    width: 100%;
    max-width: 1200px;
}

.hex-strip-row.offset {
    margin-top: -3vw;
    margin-left: 6.5vw;
}

.hex-strip-row .hex-cell {
    width: 13vw;
    height: 15vw;
    min-width: 100px;
    min-height: 115px;
    max-width: 170px;
    max-height: 196px;
    flex-shrink: 0;
    margin: 0 -0.5vw;
}

.hex-strip-row .hex-cell.wide {
    width: 80%;
    max-width: 900px;
    height: 8vw;
    min-height: 70px;
    max-height: 100px;
}

/* Vintage photo placeholders */
.vintage-photo {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    clip-path: var(--hex-clip);
}

.photo-aurora-overlay {
    position: absolute;
    inset: 0;
    mix-blend-mode: color;
    opacity: 0.6;
}

.photo-aurora-overlay.green {
    background: linear-gradient(135deg, #0A0E1A, #00E5A0);
}

.photo-aurora-overlay.violet {
    background: linear-gradient(135deg, #0A0E1A, #7B2FBE);
}

.photo-aurora-overlay.cyan {
    background: linear-gradient(135deg, #0A0E1A, #00D4FF);
}

.photo-aurora-overlay.pink {
    background: linear-gradient(135deg, #0A0E1A, #FF3CAC);
}

/* Generate vintage photo patterns with gradients */
.photo-rocket {
    background: linear-gradient(170deg, #1a1a2e 0%, #2d2d44 30%, #1a1a2e 50%, #3d3d5c 70%, #1a1a2e 100%);
    filter: sepia(0.3) contrast(1.2) brightness(0.9);
}

.photo-bridge {
    background: linear-gradient(45deg, #2a2a3e 0%, #1a1a2e 25%, #3a3a5e 50%, #1a1a2e 75%, #2a2a3e 100%);
    filter: sepia(0.3) contrast(1.2) brightness(0.9);
}

.photo-factory {
    background: linear-gradient(90deg, #1e1e34 0%, #2e2e4a 20%, #1e1e34 40%, #3e3e5a 60%, #2e2e4a 80%, #1e1e34 100%);
    filter: sepia(0.3) contrast(1.2) brightness(0.9);
}

.photo-arch {
    background: radial-gradient(circle at 30% 40%, #3a3a5e, #1a1a2e 60%);
    filter: sepia(0.3) contrast(1.2) brightness(0.9);
}

.photo-crane {
    background: linear-gradient(135deg, #1e1e34, #3e3e5a 40%, #1e1e34 60%, #2e2e4a);
    filter: sepia(0.3) contrast(1.2) brightness(0.9);
}

.photo-scaffold {
    background: repeating-linear-gradient(0deg, #1a1a2e 0px, #1a1a2e 4px, #2d2d44 4px, #2d2d44 8px);
    filter: sepia(0.3) contrast(1.2) brightness(0.9);
}

.photo-blueprint {
    background: linear-gradient(180deg, #0a1628, #0d2040 50%, #0a1628);
    filter: sepia(0.2) contrast(1.1) brightness(0.8);
}

.photo-tower {
    background: linear-gradient(0deg, #1a1a2e, #2d2d44 30%, #3d3d5c 60%, #2d2d44 80%, #1a1a2e);
    filter: sepia(0.3) contrast(1.2) brightness(0.9);
}

.photo-dam {
    background: linear-gradient(180deg, #2a2a3e 0%, #1a1a2e 50%, #2a3a4e 100%);
    filter: sepia(0.3) contrast(1.2) brightness(0.9);
}

.photo-tunnel {
    background: radial-gradient(ellipse at center, #3a3a5e, #1a1a2e 70%);
    filter: sepia(0.3) contrast(1.2) brightness(0.9);
}

.photo-launch {
    background: linear-gradient(0deg, #1a1a2e, #3d3d5c 20%, #1a1a2e 50%, #2a2a3e);
    filter: sepia(0.3) contrast(1.2) brightness(0.9);
}

.photo-radar {
    background: conic-gradient(from 0deg, #1a1a2e, #2d2d44, #1a1a2e, #3d3d5c, #1a1a2e);
    filter: sepia(0.3) contrast(1.2) brightness(0.9);
}

.photo-pipe {
    background: repeating-linear-gradient(90deg, #1a1a2e 0px, #2d2d44 3px, #1a1a2e 6px);
    filter: sepia(0.3) contrast(1.2) brightness(0.9);
}

.photo-antenna {
    background: linear-gradient(0deg, #1a1a2e, #2a2a3e 50%, #3d3d5c 80%, #1a1a2e);
    filter: sepia(0.3) contrast(1.2) brightness(0.9);
}

.photo-rivet {
    background: radial-gradient(circle at 50% 50%, #3a3a5e 10%, #1a1a2e 50%);
    filter: sepia(0.3) contrast(1.2) brightness(0.9);
}

.photo-dome {
    background: radial-gradient(ellipse at 50% 0%, #3d3d5c 0%, #1a1a2e 70%);
    filter: sepia(0.3) contrast(1.2) brightness(0.9);
}

.photo-space {
    background: radial-gradient(ellipse at 30% 60%, #2d2d44, #0A0E1A 60%);
    filter: sepia(0.3) contrast(1.2) brightness(0.9);
}

.photo-zoom {
    animation: slowZoom 20s ease-in-out infinite alternate;
}

@keyframes slowZoom {
    0% { transform: scale(1); }
    100% { transform: scale(1.15); }
}

/* Data cells in assembly */
.hex-data-cell .hex-glass {
    background: linear-gradient(180deg, rgba(0, 212, 255, 0.06), rgba(140, 170, 220, 0.03));
}

/* Timeline bar */
.timeline-bar {
    display: flex;
    width: 100%;
    height: 20px;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(140, 170, 220, 0.05);
}

.timeline-segment {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: rgba(0, 229, 160, 0.1);
    border-right: 1px solid rgba(0, 212, 255, 0.2);
}

.timeline-segment.active {
    background: linear-gradient(90deg, rgba(0, 229, 160, 0.2), rgba(0, 212, 255, 0.2));
}

.timeline-segment span {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    color: var(--aurora-cyan);
    opacity: 0.7;
}

/* Counter animation */
.counter {
    transition: none;
}

/* --- SCENE 3: THE BLUEPRINT CHAMBER --- */
#scene-blueprint {
    min-height: 100vh;
}

.hex-ring-formation {
    position: relative;
    width: 80vmin;
    height: 80vmin;
    max-width: 800px;
    max-height: 800px;
}

.hex-ring-formation .hex-center {
    position: absolute;
    width: 42%;
    height: 48%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    z-index: 10;
}

.hex-ring-formation .hex-center.visible {
    transform: translate(-50%, -50%) scale(1);
}

.hex-ring-formation .hex-center .hex-glass {
    background: linear-gradient(180deg, rgba(0, 229, 160, 0.08), rgba(123, 47, 190, 0.05));
}

.blueprint-text {
    text-align: left;
    padding: 5%;
}

.blueprint-heading {
    font-family: var(--font-secondary);
    font-weight: 600;
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    letter-spacing: 0.01em;
    color: var(--frost-white);
    margin-bottom: 0.8em;
    background: var(--gradient-aurora);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.blueprint-body {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(0.8rem, 1.1vw, 1rem);
    line-height: 1.8;
    color: rgba(232, 237, 245, 0.85);
    margin-bottom: 1em;
}

.blueprint-body em {
    color: var(--warm-glow);
    font-style: italic;
    -webkit-text-fill-color: var(--warm-glow);
}

/* Peripheral hex positions */
.hex-peripheral {
    position: absolute;
    width: 24%;
    height: 28%;
    z-index: 5;
}

.hex-p-0 { top: 5%;  left: 50%;  transform: translate(-50%, -50%) scale(0.8); }
.hex-p-1 { top: 27%; left: 82%;  transform: translate(-50%, -50%) scale(0.8); }
.hex-p-2 { top: 67%; left: 82%;  transform: translate(-50%, -50%) scale(0.8); }
.hex-p-3 { top: 90%; left: 50%;  transform: translate(-50%, -50%) scale(0.8); }
.hex-p-4 { top: 67%; left: 18%;  transform: translate(-50%, -50%) scale(0.8); }
.hex-p-5 { top: 27%; left: 18%;  transform: translate(-50%, -50%) scale(0.8); }

.hex-peripheral.visible {
    transform: translate(-50%, -50%) scale(1) !important;
}

/* Spinning gauge */
.spinning-gauge {
    width: 80%;
    max-width: 100px;
    aspect-ratio: 1;
}

.spinning-gauge svg {
    width: 100%;
    height: 100%;
}

.gauge-inner-track {
    fill: none;
    stroke: rgba(140, 170, 220, 0.1);
    stroke-width: 3;
}

.gauge-inner-fill {
    fill: none;
    stroke: var(--aurora-pink);
    stroke-width: 3;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: center;
}

.spinning {
    animation: spinGauge 8s linear infinite;
}

.spinning-reverse {
    animation: spinGauge 12s linear infinite reverse;
}

@keyframes spinGauge {
    to { transform: rotate(270deg); }
}

/* Aurora ribbon animation */
.aurora-ribbon-box {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.aurora-ribbon {
    position: absolute;
    width: 200%;
    height: 30%;
    top: 35%;
    left: -50%;
    background: var(--gradient-aurora);
    background-size: 300% 100%;
    opacity: 0.5;
    border-radius: 50%;
    animation: ribbonFlow 6s ease-in-out infinite, auroraShift 4s linear infinite;
    filter: blur(8px);
}

.aurora-ribbon.delay {
    top: 45%;
    height: 25%;
    opacity: 0.3;
    animation-delay: -2s;
    background: var(--gradient-warm);
    background-size: 300% 100%;
}

@keyframes ribbonFlow {
    0%, 100% { transform: translateX(-10%) scaleY(1); }
    50% { transform: translateX(10%) scaleY(1.3); }
}

/* Mini particle canvas in blueprint */
.mini-particle-canvas {
    width: 100%;
    height: 100%;
}

/* Progress fill animation */
.progress-fill-anim {
    width: 80%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5em;
}

.progress-bar-lg {
    width: 100%;
    height: 10px;
    background: rgba(140, 170, 220, 0.1);
    border-radius: 5px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--gradient-warm);
    background-size: 200% 100%;
    border-radius: 5px;
    transition: width 2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    animation: auroraShift 3s linear infinite;
}

.progress-bar-fill.active {
    width: 87%;
}

.progress-pct {
    font-size: clamp(0.6rem, 0.9vw, 0.8rem);
    color: var(--warm-glow);
}

/* Hex grid overlay animation */
.hex-grid-overlay-anim {
    width: 80%;
    max-width: 120px;
    aspect-ratio: 1;
}

.hex-pattern-anim {
    width: 100%;
    height: 100%;
}

.hex-outline-anim {
    fill: none;
    stroke: var(--aurora-cyan);
    stroke-width: 1;
    opacity: 0.6;
    animation: hexPulseOutline 4s ease-in-out infinite;
}

.hex-outline-anim.delay {
    animation-delay: -1.3s;
    stroke: var(--aurora-green);
}

.hex-outline-anim.delay2 {
    animation-delay: -2.6s;
    stroke: var(--aurora-violet);
}

@keyframes hexPulseOutline {
    0%, 100% { opacity: 0.2; stroke-width: 0.5; }
    50% { opacity: 0.8; stroke-width: 1.5; }
}

/* --- SCENE 4: THE ARCHIVE VAULT --- */
#scene-archive {
    padding: 6rem 2rem;
    align-items: flex-start;
}

.archive-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

.hex-archive {
    position: relative;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), filter 0.4s ease;
    cursor: pointer;
}

.hex-archive .hex-content {
    padding: 20% 15% 15%;
    gap: 0.5em;
}

.hex-archive .vintage-photo {
    width: 70%;
    aspect-ratio: 1;
    clip-path: var(--hex-clip);
    margin-bottom: 0.5em;
}

.hex-archive:hover {
    transform: scale(1.1) !important;
    z-index: 20;
    filter: brightness(1.2);
}

.hex-archive:hover .vintage-photo {
    filter: none;
}

.hex-archive:hover .photo-aurora-overlay {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hex-border-ring {
    position: absolute;
    inset: -3px;
    clip-path: var(--hex-clip);
    background: transparent;
    z-index: 4;
    transition: background 0.4s ease;
}

.hex-archive:hover .hex-border-ring {
    background: var(--gradient-aurora);
    background-size: 300% 300%;
    animation: borderRotate 2s linear infinite;
    opacity: 0.6;
}

@keyframes borderRotate {
    0% { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

.hex-archive .hex-glass {
    z-index: 5;
}

.hex-lg {
    height: 35vw;
    max-height: 350px;
}

.hex-md {
    height: 28vw;
    max-height: 280px;
}

.hex-sm {
    height: 22vw;
    max-height: 220px;
}

.archive-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(0.7rem, 1.2vw, 1rem);
    letter-spacing: 0.02em;
    color: var(--frost-white);
}

.archive-desc {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(0.55rem, 0.8vw, 0.75rem);
    color: rgba(232, 237, 245, 0.6);
    line-height: 1.4;
}

/* --- SCENE 5: THE OBSERVATORY --- */
#scene-observatory {
    min-height: 100vh;
    overflow: hidden;
}

#scene-observatory .scene-inner {
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.observatory-aurora {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.observatory-aurora::before,
.observatory-aurora::after {
    content: '';
    position: absolute;
    width: 200%;
    height: 60%;
    left: -50%;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0;
    transition: opacity 1s ease;
}

.observatory-aurora.active::before {
    top: 10%;
    background: linear-gradient(90deg, transparent, #00E5A0, #00D4FF, #7B2FBE, transparent);
    animation: auroraWave 8s ease-in-out infinite;
    opacity: 0.3;
}

.observatory-aurora.active::after {
    top: 30%;
    background: linear-gradient(90deg, transparent, #FF3CAC, #FFB347, #00E5A0, transparent);
    animation: auroraWave 10s ease-in-out infinite reverse;
    opacity: 0.2;
}

@keyframes auroraWave {
    0% { transform: translateX(-20%) scaleY(0.8); }
    50% { transform: translateX(20%) scaleY(1.3); }
    100% { transform: translateX(-20%) scaleY(0.8); }
}

/* Floating hex cells */
.floating-hexes {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.hex-float {
    position: absolute;
    width: 8vw;
    height: 9.2vw;
    min-width: 60px;
    min-height: 69px;
    max-width: 120px;
    max-height: 138px;
    opacity: 0;
    transition: opacity 1s ease;
}

.hex-float.drift {
    opacity: 0.15;
}

.hex-float-0 { top: 15%; left: 10%; animation: floatDrift0 15s ease-in-out infinite; }
.hex-float-1 { top: 25%; left: 75%; animation: floatDrift1 18s ease-in-out infinite; }
.hex-float-2 { top: 60%; left: 20%; animation: floatDrift2 20s ease-in-out infinite; }
.hex-float-3 { top: 70%; left: 65%; animation: floatDrift3 14s ease-in-out infinite; }
.hex-float-4 { top: 45%; left: 50%; animation: floatDrift4 22s ease-in-out infinite; }

@keyframes floatDrift0 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(20px, -15px) rotate(3deg); }
    66% { transform: translate(-10px, 10px) rotate(-2deg); }
}

@keyframes floatDrift1 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(-15px, 20px) rotate(-3deg); }
    66% { transform: translate(10px, -10px) rotate(2deg); }
}

@keyframes floatDrift2 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(25px, -20px) rotate(4deg); }
}

@keyframes floatDrift3 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(-20px, -10px) rotate(-4deg); }
    66% { transform: translate(15px, 15px) rotate(3deg); }
}

@keyframes floatDrift4 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-15px, 25px) rotate(-3deg); }
}

/* Observatory text - word by word reveal */
.observatory-text {
    position: relative;
    z-index: 5;
    text-align: center;
    max-width: 700px;
    padding: 2rem;
}

.obs-word {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.5rem, 6vw, 5rem);
    letter-spacing: 0.02em;
    display: inline-block;
    margin: 0 0.15em;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.obs-word.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Hex wireframe background */
.hex-wireframe-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 2s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='112' height='194' viewBox='0 0 112 194'%3E%3Cpolygon points='56,2 108,50 108,146 56,194 4,146 4,50' fill='none' stroke='%2300D4FF' stroke-width='0.3' opacity='0.15'/%3E%3C/svg%3E");
    background-size: 112px 194px;
    animation: hexWireframePulse 6s ease-in-out infinite;
}

.hex-wireframe-bg.show {
    opacity: 0.3;
}

@keyframes hexWireframePulse {
    0%, 100% { opacity: 0; }
    50% { opacity: 0.3; }
}

.observatory-domain {
    position: relative;
    z-index: 5;
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(1rem, 2vw, 1.5rem);
    letter-spacing: 0.05em;
    color: var(--aurora-cyan);
    opacity: 0;
    transition: opacity 1s ease;
    margin-top: 2rem;
}

.observatory-domain.show {
    opacity: 0.5;
}

.observatory-links {
    position: absolute;
    bottom: 2rem;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 10;
}

.hex-link {
    position: relative;
    width: 80px;
    height: 92px;
    clip-path: var(--hex-clip);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--aurora-cyan);
    opacity: 0.15;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.hex-link:hover {
    opacity: 0.8;
    transform: scale(1.1);
}

.hex-link .hex-glass {
    background: rgba(0, 212, 255, 0.05);
}

.hex-link span {
    position: relative;
    z-index: 3;
    font-size: 0.55rem;
    letter-spacing: 0.1em;
}

/* --- Aurora Ribbon Dividers --- */
.aurora-divider {
    position: fixed;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.aurora-divider::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-aurora);
    background-size: 300% 100%;
    animation: auroraShift 4s linear infinite;
    filter: blur(2px);
}

.aurora-divider::after {
    content: '';
    position: absolute;
    inset: -4px 0;
    background: var(--gradient-aurora);
    background-size: 300% 100%;
    animation: auroraShift 4s linear infinite;
    filter: blur(12px);
    opacity: 0.5;
}

.divider-1 { top: 100vh; }
.divider-2 { top: 200vh; }
.divider-3 { top: 300vh; }
.divider-4 { top: 450vh; }

.aurora-divider.active {
    opacity: 0.7;
}

/* --- Responsive Breakpoints --- */

/* Tablet */
@media (max-width: 1200px) {
    .hex-rosette {
        width: 80vmin;
        height: 80vmin;
    }

    .hex-r2 {
        display: none;
    }

    .hex-strip-row .hex-cell {
        width: 16vw;
        height: 18.5vw;
    }

    .hex-strip-row.offset {
        margin-left: 8vw;
    }

    .archive-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .hex-rosette {
        width: 90vw;
        height: 90vw;
    }

    .hex-r1 {
        width: 24%;
        height: 28%;
    }

    .hex-r2 {
        display: none;
    }

    .hex-strip-container {
        overflow-x: auto;
        padding: 1rem;
    }

    .hex-strip-row {
        flex-wrap: nowrap;
        justify-content: flex-start;
    }

    .hex-strip-row .hex-cell {
        width: 30vw;
        height: 34.6vw;
        min-width: 120px;
        min-height: 138px;
    }

    .hex-strip-row.offset {
        margin-left: 15vw;
        margin-top: -8vw;
    }

    .hex-ring-formation {
        width: 95vw;
        height: 95vw;
    }

    .hex-peripheral {
        width: 28%;
        height: 32%;
    }

    .archive-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .hex-lg, .hex-md, .hex-sm {
        height: 60vw;
        max-height: 300px;
    }

    .obs-word {
        font-size: clamp(1.8rem, 8vw, 3rem);
    }

    .observatory-links {
        padding: 0 1rem;
    }

    .hex-link {
        width: 60px;
        height: 69px;
    }

    .blueprint-text {
        padding: 8%;
    }

    .blueprint-heading {
        font-size: clamp(0.9rem, 4vw, 1.3rem);
    }

    .blueprint-body {
        font-size: clamp(0.7rem, 2.5vw, 0.9rem);
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .hex-rosette .hex-center {
        width: 35%;
        height: 40%;
    }

    .domain-title {
        font-size: clamp(0.9rem, 5vw, 1.4rem);
    }

    .hex-r1 {
        width: 22%;
        height: 25%;
    }

    .hex-strip-row .hex-cell {
        width: 40vw;
        height: 46vw;
    }

    .hex-ring-formation .hex-center {
        width: 55%;
        height: 63%;
    }

    .hex-peripheral {
        width: 22%;
        height: 25%;
    }
}

/* --- Selection and scrollbar --- */
::selection {
    background: rgba(0, 229, 160, 0.3);
    color: var(--frost-white);
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--deep-space);
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 212, 255, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 212, 255, 0.5);
}
