/* ============================================
   simulai.tech - Design System
   Colors: #0B1120, #2A3B4D, #00E5CC, #F5A623,
           #F0EDE8, #8899AA, #0D1B3E, #0A2A2A, #FF5470
   Fonts: Outfit, Albert Sans, Azeret Mono
   ============================================ */

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

:root {
    --deep-void: #0B1120;
    --slate-steel: #2A3B4D;
    --signal-cyan: #00E5CC;
    --inference-amber: #F5A623;
    --paper-white: #F0EDE8;
    --mist-gray: #8899AA;
    --gradient-start: #0D1B3E;
    --gradient-end: #0A2A2A;
    --alert-pulse: #FF5470;
    --section-hue: 220;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--deep-void);
    color: var(--paper-white);
    font-family: 'Albert Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.1vw, 1.15rem);
    line-height: 1.72;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---- Canvas & Overlays ---- */

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

#dot-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    background-image: radial-gradient(circle, #2A3B4D26 1px, transparent 1px);
    background-size: 40px 40px;
    will-change: transform;
}

#inference-lines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

/* ---- Navigation ---- */

#top-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 8px;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    background: linear-gradient(180deg, rgba(11, 17, 32, 0.85) 0%, rgba(11, 17, 32, 0) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    transition: opacity 0.4s ease, height 0.4s ease;
    overflow: hidden;
}

#top-nav.visible {
    height: 48px;
    opacity: 1;
}

.nav-label {
    font-size: 0.75rem;
    color: var(--signal-cyan);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-link {
    font-size: 0.75rem;
    color: var(--mist-gray);
    text-decoration: none;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--signal-cyan);
}

/* ---- Typography ---- */

.headline-primary {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: clamp(2.8rem, 7vw, 5.5rem);
    letter-spacing: -0.03em;
    line-height: 1.05;
    color: var(--paper-white);
}

.headline-secondary {
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--paper-white);
}

.body-text {
    font-family: 'Albert Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.1vw, 1.15rem);
    line-height: 1.72;
    color: var(--mist-gray);
}

.mono {
    font-family: 'Azeret Mono', monospace;
    font-weight: 400;
    letter-spacing: 0.04em;
}

/* ---- Hero Section ---- */

#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.hero-content {
    text-align: center;
    max-width: 900px;
    padding: 0 40px;
}

#hero-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    font-size: clamp(3rem, 8vw, 6rem);
    letter-spacing: -0.03em;
    color: var(--paper-white);
    margin-bottom: 24px;
    min-height: 1.2em;
}

#hero-title .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(8px);
}

#hero-title .char.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.tagline {
    font-size: 1.2rem;
    color: var(--mist-gray);
    opacity: 0;
    transition: opacity 1s ease;
}

.tagline.visible {
    opacity: 1;
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
}

.scroll-line {
    width: 1px;
    height: 60px;
    background: linear-gradient(180deg, var(--signal-cyan), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(0.6); }
    50% { opacity: 1; transform: scaleY(1); }
}

/* ---- Descent Section ---- */

#descent {
    position: relative;
    z-index: 10;
    min-height: 200vh;
    padding: 10vh 0;
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    gap: 0;
}

.content-stream {
    display: flex;
    flex-direction: column;
    gap: 80px;
    padding: 40px;
}

.stream-left {
    grid-column: 2 / 7;
}

.stream-right {
    grid-column: 10 / 15;
    margin-top: 30vh;
}

.content-panel {
    position: relative;
    background: rgba(11, 17, 32, 0.7);
    border: 1px solid var(--slate-steel);
    padding: 48px;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.3),
        0 4px 16px rgba(0, 0, 0, 0.2),
        0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.content-panel.in-view {
    opacity: 1;
    transform: translateY(0) rotate(var(--panel-rotate, 0deg));
}

.content-panel .headline-primary {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    margin-bottom: 16px;
}

.content-panel .body-text {
    margin-bottom: 24px;
}

/* Depth Markers */

.depth-marker {
    position: absolute;
    font-family: 'Azeret Mono', monospace;
    font-size: 9px;
    color: var(--slate-steel);
    line-height: 1;
    user-select: none;
}

.depth-marker.top-left { top: 8px; left: 8px; }
.depth-marker.top-right { top: 8px; right: 8px; }
.depth-marker.bottom-left { bottom: 8px; left: 8px; }
.depth-marker.bottom-right { bottom: 8px; right: 8px; }

/* Metric Display */

.metric-display {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--slate-steel);
}

.metric-value {
    font-size: 2.4rem;
    color: var(--inference-amber);
    font-variant-numeric: tabular-nums;
}

.metric-label {
    font-size: 0.75rem;
    color: var(--mist-gray);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Intersection Nodes */

.intersection-node {
    position: absolute;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 229, 204, 0.08) 0%, transparent 70%);
    border: 1px solid rgba(0, 229, 204, 0.15);
    pointer-events: none;
    z-index: 5;
}

.node-1 {
    top: 35%;
    left: 50%;
    transform: translateX(-50%);
}

.node-2 {
    top: 70%;
    left: 50%;
    transform: translateX(-50%);
}

/* ---- Intersection Zone ---- */

#intersection {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10vh 40px;
}

.intersection-content {
    max-width: 1000px;
    text-align: center;
}

.thesis-text {
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    font-size: clamp(2rem, 5vw, 4.5rem);
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: var(--paper-white);
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.thesis-text.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* ---- Depth Section ---- */

#depth {
    position: relative;
    z-index: 10;
    padding: 15vh 0 10vh;
}

.depth-grid {
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    gap: 24px;
    padding: 0 40px;
}

.depth-card {
    grid-column: span 5;
    position: relative;
    background: rgba(11, 17, 32, 0.5);
    border: 1px solid var(--slate-steel);
    padding: 40px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.depth-card:nth-child(1) { grid-column: 2 / 7; }
.depth-card:nth-child(2) { grid-column: 7 / 12; }
.depth-card:nth-child(3) { grid-column: 12 / 16; }
.depth-card:nth-child(4) { grid-column: 2 / 7; }
.depth-card:nth-child(5) { grid-column: 7 / 12; }
.depth-card:nth-child(6) { grid-column: 12 / 16; }

.depth-card.in-view {
    opacity: 1;
    transform: translateY(0);
}

.card-index {
    font-size: 0.7rem;
    color: var(--signal-cyan);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    display: block;
    margin-bottom: 16px;
}

.depth-card .headline-secondary {
    margin-bottom: 12px;
}

/* ---- Footer ---- */

#footer {
    position: relative;
    z-index: 10;
    padding: 80px 40px;
    transform: scale(0.97);
    filter: blur(0.5px);
    opacity: 0.7;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    border-top: 1px solid var(--slate-steel);
    padding-top: 24px;
}

.footer-domain {
    font-size: 0.8rem;
    color: var(--mist-gray);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.footer-year {
    font-size: 0.75rem;
    color: var(--slate-steel);
}

/* ---- Pulse Ring Effect ---- */

.pulse-ring {
    position: fixed;
    border-radius: 50%;
    border: 1px solid var(--signal-cyan);
    pointer-events: none;
    z-index: 9999;
    animation: pulseExpand 0.6s ease-out forwards;
}

@keyframes pulseExpand {
    0% {
        width: 0;
        height: 0;
        opacity: 0.4;
    }
    100% {
        width: 160px;
        height: 160px;
        opacity: 0;
    }
}

/* ---- Background Gradient Sections ---- */

#hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    opacity: 0.4;
    z-index: -1;
}

#intersection::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--deep-void);
    z-index: -1;
}

/* ---- Reduced Motion ---- */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .content-panel,
    .thesis-text,
    .depth-card {
        opacity: 1;
        transform: none;
    }
    #hero-title .char {
        opacity: 1;
        transform: none;
    }
    .tagline {
        opacity: 1;
    }
}

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

@media (max-width: 1024px) {
    #descent {
        display: flex;
        flex-direction: column;
        padding: 5vh 20px;
    }

    .stream-left,
    .stream-right {
        margin-top: 0;
        padding: 20px 0;
    }

    .depth-grid {
        display: flex;
        flex-direction: column;
        padding: 0 20px;
        gap: 20px;
    }

    .depth-card {
        grid-column: auto !important;
    }

    .intersection-node {
        display: none;
    }
}

@media (max-width: 600px) {
    .content-panel {
        padding: 28px;
    }

    .depth-card {
        padding: 28px;
    }

    .metric-value {
        font-size: 1.8rem;
    }

    #top-nav {
        padding: 0 20px;
    }
}
