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

html {
    scroll-snap-type: y proximity;
    scroll-behavior: smooth;
    background: #0a0a14;
}

body {
    background: #0a0a14;
    color: #e8e2f0;
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.4vw, 1.25rem);
    line-height: 1.75;
    letter-spacing: 0.01em;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* === Noise SVG (hidden) === */
.noise-svg {
    position: absolute;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* === Noise Overlay === */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 100;
    pointer-events: none;
    opacity: 0.04;
    mix-blend-mode: overlay;
    filter: url(#noise);
    background: rgba(255,255,255,0.5);
}

/* === Marble Veins === */
.marble-veins {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    pointer-events: none;
    opacity: 0.1;
}

.vein {
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.vein-1 {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    animation: drawVein 10s ease-in-out 0s forwards;
}
.vein-2 {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    animation: drawVein 12s ease-in-out 2s forwards;
}
.vein-3 {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    animation: drawVein 8s ease-in-out 4s forwards;
}
.vein-4 {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    animation: drawVein 11s ease-in-out 6s forwards;
}

@keyframes drawVein {
    to { stroke-dashoffset: 0; }
}

/* === Chrome Orbs === */
.chrome-orb {
    position: fixed;
    border-radius: 50%;
    background: conic-gradient(from 180deg, #ff78dc, #00e5ff, #b8ff00, #ff78dc);
    filter: blur(0.5px);
    z-index: 2;
    pointer-events: none;
    animation: spin 20s linear infinite;
}

.orb-1 {
    width: 18px;
    height: 18px;
    top: 15%;
    right: 12%;
}
.orb-2 {
    width: 22px;
    height: 22px;
    bottom: 25%;
    left: 8%;
}
.orb-3 {
    width: 16px;
    height: 16px;
    top: 60%;
    right: 30%;
}

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

/* === Navigation Indicator === */
.nav-indicator {
    position: fixed;
    bottom: 32px;
    left: 32px;
    z-index: 200;
    cursor: pointer;
}

.nav-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(30, 26, 46, 0.7); /* #1e1a2e */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 120, 220, 0.3);
    position: relative;
}

.nav-dot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(255, 120, 220, 0.4);
    transform: translate(-50%, -50%) scale(1);
    animation: pulse 2.5s ease-out infinite;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.6;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.8);
        opacity: 0;
    }
}

.nav-menu {
    position: absolute;
    bottom: 48px;
    background: #1e1a2e;
    left: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 400ms ease, transform 400ms ease, visibility 400ms;
}

.nav-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-link {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(0.65rem, 0.9vw, 0.85rem);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: #e8e2f0;
    text-decoration: none;
    white-space: nowrap;
    transition: color 400ms ease;
    background-image: linear-gradient(#ff78dc, #ff78dc);
    background-size: 0% 1px;
    background-repeat: no-repeat;
    background-position: left bottom;
    transition: background-size 400ms ease, color 400ms ease;
}

.nav-link:hover {
    color: #ff78dc;
    background-size: 100% 1px;
}

/* === Chambers === */
.chamber {
    min-height: 100vh;
    scroll-snap-align: start;
    position: relative;
    display: flex;
    align-items: center;
    z-index: 10;
}

.chamber-content {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 6vw;
}

/* === Spacers === */
.spacer {
    height: 200vh;
    position: relative;
    z-index: 0;
}
.spacer-small {
    height: 50vh;
}

/* === Chamber 1: Hero === */
.chamber-1 {
    background: #0a0a14;
    justify-content: center;
}

.chamber-1 .chamber-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-weight: 400;
    font-size: clamp(5rem, 14vw, 13rem);
    letter-spacing: -0.04em;
    line-height: 1.0;
    color: #e8e2f0;
}

.hero-subtitle {
    margin-top: 2rem;
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(0.65rem, 0.9vw, 0.85rem);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: #9a8fb8;
    min-height: 1.5em;
}

.cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: #ff78dc;
    vertical-align: text-bottom;
    margin-left: 2px;
    animation: blink 1.0s step-end infinite;
}

.cursor.fade-out {
    animation: none;
    opacity: 0;
    transition: opacity 800ms ease;
}

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

/* === Chamber 2: Thesis === */
.chamber-2 {
    background: #12101e;
}

.column-fragment {
    position: absolute;
    right: 4vw;
    top: 50%;
    transform: translateY(-50%);
    width: 160px;
    height: 480px;
    opacity: 0.06;
    z-index: 0;
    pointer-events: none;
}

.thesis-content {
    max-width: 40%;
    padding: 0 6vw;
}

.section-heading {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(2.4rem, 5vw, 5rem);
    letter-spacing: -0.04em;
    line-height: 1.15;
    color: #e8e2f0;
    margin-bottom: 2.5rem;
}

.body-text {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.4vw, 1.25rem);
    line-height: 1.75;
    letter-spacing: 0.01em;
    color: #e8e2f0;
    max-width: 42ch;
    margin-bottom: 1.5rem;
}

/* === Chamber 3: Process === */
.chamber-3 {
    background: #0a0a14;
    min-height: auto;
    padding: 15vh 0;
}

.process-content {
    display: flex;
    flex-direction: column;
    gap: 6rem;
}

.process-step {
    max-width: 42ch;
}

.step-1 { margin-left: 8%; }
.step-2 { margin-left: 22%; }
.step-3 { margin-left: 36%; }

.step-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(0.65rem, 0.9vw, 0.85rem);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: #ff78dc;
    display: block;
    margin-bottom: 1rem;
}

.iteration-counter {
    margin-left: 8%;
    margin-top: 2rem;
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(0.65rem, 0.9vw, 0.85rem);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: #9a8fb8;
    min-height: 1.5em;
}

.cursor-counter {
    background: #00e5ff;
}

/* === Chamber 4: Vision === */
.chamber-4 {
    background: linear-gradient(180deg, #2a1040 0%, rgba(255, 120, 220, 0.13) 100%);
    justify-content: center;
}

.vision-content {
    display: flex;
    justify-content: center;
}

.vision-text {
    font-family: 'Playfair Display', serif;
    font-weight: 400;
    font-size: clamp(2.4rem, 5vw, 5rem);
    letter-spacing: -0.04em;
    line-height: 1.15;
    color: #e8e2f0;
    max-width: 20ch;
    text-align: center;
}

.highlight {
    color: #b8ff00;
}

/* === Scroll Reveal === */
.chamber-content > * {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1200ms cubic-bezier(0.16, 1, 0.3, 1),
                transform 1200ms cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: calc(var(--stagger, 0) * 150ms);
}

.chamber.revealed .chamber-content > * {
    opacity: 1;
    transform: translateY(0);
}

/* Process steps have stagger on children */
.process-step {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1200ms cubic-bezier(0.16, 1, 0.3, 1),
                transform 1200ms cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: calc(var(--stagger, 0) * 150ms);
}

.chamber.revealed .process-step {
    opacity: 1;
    transform: translateY(0);
}

.iteration-counter {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1200ms cubic-bezier(0.16, 1, 0.3, 1),
                transform 1200ms cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: calc(var(--stagger, 0) * 150ms);
}

.chamber.revealed .iteration-counter {
    opacity: 1;
    transform: translateY(0);
}

/* === Responsive === */
@media (max-width: 768px) {
    .thesis-content {
        max-width: 90%;
    }
    .step-1 { margin-left: 4%; }
    .step-2 { margin-left: 10%; }
    .step-3 { margin-left: 16%; }
    .column-fragment {
        display: none;
    }
}
