/* Palette: #070d15 #0a1f1f #0b1420 #140b1f #1a6b4a #1a7a55 #234b8a #2b5daa #6b3a8a #7a3d9a #8a2a3a #8a8078 #9a2d3d #c4943a #d4cdc4 #ffffff */
/* === RESET & BASE === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: #0b1420;
    color: #d4cdc4;
    font-family: 'Source Serif 4', serif;
    font-size: clamp(1.05rem, 1.4vw, 1.25rem);
    line-height: 1.72;
    letter-spacing: 0.005em;
    overflow-x: hidden;
}

/* === HUD GRID OVERLAY === */
.hud-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    background-image:
        linear-gradient(to right, rgba(255,255,255,0.04) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 20% 20%;
}

/* === SIDEBAR NAVIGATION === */
.sidebar {
    position: fixed;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.lissajous-nav {
    margin-bottom: 12px;
}

.nav-labels {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nav-link {
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(0.65rem, 0.85vw, 0.8rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #8a8078;
    text-decoration: none;
    transition: color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: #d4cdc4;
}

/* === SECTIONS === */
.section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.section-genesis {
    background: #0b1420;
}

.section-substrate {
    background: #0a1f1f;
}

.section-iteration {
    background: #140b1f;
}

.section-artifact {
    background: #0b1420;
}

.section-trace {
    background: #070d15;
}

/* === CORNER BRACKETS === */
.corner-bracket {
    position: absolute;
    width: 24px;
    height: 24px;
    pointer-events: none;
}

.corner-bracket.top-left {
    top: 20px;
    left: 20px;
    border-top: 1px solid rgba(255,255,255,0.12);
    border-left: 1px solid rgba(255,255,255,0.12);
}

.corner-bracket.top-right {
    top: 20px;
    right: 20px;
    border-top: 1px solid rgba(255,255,255,0.12);
    border-right: 1px solid rgba(255,255,255,0.12);
}

.corner-bracket.bottom-left {
    bottom: 20px;
    left: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    border-left: 1px solid rgba(255,255,255,0.12);
}

.corner-bracket.bottom-right {
    bottom: 20px;
    right: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    border-right: 1px solid rgba(255,255,255,0.12);
}

/* === SCAN LINES === */
.scan-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: repeating-linear-gradient(
        transparent,
        transparent 2px,
        rgba(0,0,0,0.04) 2px,
        rgba(0,0,0,0.04) 4px
    );
    z-index: 3;
}

/* === CONTOUR CONTAINERS === */
.contour-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

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

/* === HERO === */
.hero-title-mask {
    position: relative;
    z-index: 4;
    mix-blend-mode: screen;
}

.hero-title {
    font-family: 'Archivo Black', sans-serif;
    font-size: clamp(4rem, 14vw, 16rem);
    letter-spacing: -0.03em;
    text-transform: uppercase;
    color: #0b1420;
    background: linear-gradient(135deg, #2b5daa, #1a7a55, #7a3d9a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    z-index: 4;
}

.hero-tagline {
    position: absolute;
    bottom: 60px;
    left: 80px;
    font-family: 'Source Serif 4', serif;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    color: #8a8078;
    z-index: 5;
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    animation: pulse-opacity 2s ease-in-out infinite;
}

@keyframes pulse-opacity {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* === CROSSHAIR === */
.crosshair {
    position: absolute;
    z-index: 5;
    animation: drift 20s ease-in-out infinite;
}

.section-genesis .crosshair {
    top: 50%;
    left: 50%;
}

@keyframes drift {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(8px, -6px); }
    50% { transform: translate(-4px, 8px); }
    75% { transform: translate(6px, 4px); }
}

/* === DATA STRIPS === */
.data-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
}

.data-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #8a8078;
}

.data-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #8a8078;
}

/* === SECTION HEADINGS === */
.section-heading {
    font-family: 'Archivo Black', sans-serif;
    font-size: clamp(2.5rem, 6vw, 5rem);
    letter-spacing: -0.03em;
    text-transform: uppercase;
    color: #d4cdc4;
    margin-bottom: 24px;
}

.section-text {
    color: #d4cdc4;
    max-width: 540px;
    margin-bottom: 20px;
}

.section-text:last-of-type {
    margin-bottom: 32px;
}

/* === SUBSTRATE LAYOUT === */
.substrate-layout {
    display: flex;
    width: 100%;
    height: 100%;
    min-height: 100vh;
    align-items: center;
}

.substrate-layout .contour-panel {
    width: 45%;
    height: 100vh;
    position: relative;
}

.substrate-layout .contour-panel .contour-svg {
    position: absolute;
    top: 0;
    left: 0;
}

.substrate-layout .content-panel {
    width: 55%;
    padding: 80px 80px 80px 60px;
}

/* === VINTAGE PHOTO === */
.vintage-photo {
    width: 100%;
    max-width: 400px;
    height: 240px;
    position: relative;
    border: 2px solid rgba(255,255,255,0.08);
    overflow: hidden;
    margin-top: 32px;
}

.vintage-photo .photo-inner {
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, #1a2a3a, #0d1820, #1a1a2a);
    filter: sepia(0.15) contrast(1.1) saturate(0.85) brightness(0.9);
}

.vintage-photo::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, transparent 60%, rgba(11,20,32,0.7) 100%);
    pointer-events: none;
}

/* === ITERATION LAYOUT === */
.iteration-layout {
    display: flex;
    width: 100%;
    min-height: 100vh;
    align-items: center;
}

.iteration-layout .content-panel {
    width: 50%;
    padding: 80px;
}

.iteration-canvases {
    width: 50%;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 80px 80px 80px 0;
}

.iter-canvas {
    position: relative;
    width: 100%;
    height: 180px;
    border: 1px solid rgba(255,255,255,0.06);
}

.iter-canvas .crosshair {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* === ARTIFACT LAYOUT === */
.artifact-layout {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    justify-content: center;
}

.artifact-image-wrap {
    width: 70%;
    margin: 32px 0;
}

.artifact-photo {
    width: 100%;
    max-width: none;
    height: 360px;
}

.artifact-photo .corner-bracket {
    z-index: 2;
}

.artifact-text {
    max-width: 640px;
    text-align: center;
}

.artifact-contour {
    z-index: 0;
}

/* === TRACE SECTION === */
.trace-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 80px;
}

.trace-contour {
    z-index: 0;
}

.lissajous-large {
    margin: 48px 0;
}

.contact-info {
    margin-top: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.contact-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #8a8078;
}

.contact-link {
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(0.85rem, 1vw, 1rem);
    color: #c4943a;
    text-decoration: none;
    letter-spacing: 0.05em;
    transition: color 0.3s ease;
}

.contact-link:hover {
    color: #d4cdc4;
}

/* === REVEAL ANIMATION === */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 800ms cubic-bezier(0.16, 1, 0.3, 1),
                transform 800ms cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* === MAGNETIC TRANSITION === */
.magnetic {
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* === REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
    .reveal {
        transform: none;
        transition: opacity 400ms ease;
    }
    .crosshair {
        animation: none;
    }
    .scroll-indicator {
        animation: none;
        opacity: 0.7;
    }
    .magnetic {
        transition: none;
    }
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .substrate-layout,
    .iteration-layout {
        flex-direction: column;
    }

    .substrate-layout .contour-panel,
    .substrate-layout .content-panel,
    .iteration-layout .content-panel,
    .iteration-canvases {
        width: 100%;
        padding: 40px 24px;
    }

    .substrate-layout .contour-panel {
        height: 40vh;
    }

    .hero-tagline {
        left: 24px;
        bottom: 80px;
    }

    .artifact-image-wrap {
        width: 100%;
    }

    .artifact-layout {
        padding: 40px 24px;
    }
}
