/* ===========================================
   SIM/AI — sim-ai.net
   Vaporwave Editorial Magazine Design
   =========================================== */

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

:root {
    --sunset-coral: #f4a683;
    --lavender-haze: #c28eda;
    --horizon-blue: #7eb4d8;
    --hot-pink: #e86b9e;
    --cream-static: #f0e8e0;
    --vhs-black: #1a1228;
    --pure-white: #ffffff;
    --glass-white: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-blur: 12px;
}

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

body {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: clamp(14px, 1.4vw, 17px);
    line-height: 1.75;
    color: var(--vhs-black);
    background: var(--vhs-black);
    overflow-x: hidden;
}

/* --- VHS Scanline Overlay --- */
.vhs-scanline {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.vhs-scanline::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(
        to bottom,
        transparent,
        rgba(255, 255, 255, 0.03),
        transparent
    );
    animation: vhsScan 8s linear infinite;
}

@keyframes vhsScan {
    0% { top: -2px; }
    100% { top: 100%; }
}

/* --- Grid Overlay --- */
.grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
    background-image: repeating-linear-gradient(
        to right,
        rgba(255, 255, 255, 0.04) 0px,
        rgba(255, 255, 255, 0.04) 1px,
        transparent 1px,
        transparent calc(100% / 12)
    );
    opacity: 0;
    transition: opacity 1s ease;
}

.grid-overlay.visible {
    opacity: 1;
}

/* --- Hero Section --- */
.hero-section {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        180deg,
        var(--sunset-coral) 0%,
        var(--lavender-haze) 50%,
        var(--horizon-blue) 100%
    );
    filter: saturate(0.3);
    transition: filter 0.8s ease;
}

.hero-gradient.saturated {
    filter: saturate(1);
}

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

.hero-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(64px, 15vw, 200px);
    color: var(--cream-static);
    letter-spacing: 0.05em;
    transform: skew(-2deg);
    text-shadow: 0 4px 30px rgba(26, 18, 40, 0.2);
    line-height: 1;
}

.hero-title .char {
    display: inline-block;
    opacity: 0;
    transition: opacity 0.1s ease;
}

.hero-title .char.visible {
    opacity: 1;
}

.hero-subtitle {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: clamp(12px, 1.5vw, 18px);
    color: var(--cream-static);
    letter-spacing: 0.3em;
    text-transform: lowercase;
    margin-top: 1.5rem;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.hero-subtitle.visible {
    opacity: 1;
}

/* Hero Geometric Accents */
.hero-geometric {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.geo-triangle,
.geo-diamond {
    position: absolute;
}

.geo-tri-1 {
    width: 300px;
    height: 300px;
    top: 10%;
    left: -5%;
    transform: rotate(15deg);
    opacity: 0;
    transition: opacity 1s ease 2s;
}

.geo-dia-1 {
    width: 150px;
    height: 150px;
    top: 20%;
    right: 8%;
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity 1s ease 2.3s;
}

.geo-tri-2 {
    width: 200px;
    height: 200px;
    bottom: 15%;
    right: -3%;
    transform: rotate(-20deg);
    opacity: 0;
    transition: opacity 1s ease 2.6s;
}

.hero-geometric.visible .geo-tri-1,
.hero-geometric.visible .geo-dia-1,
.hero-geometric.visible .geo-tri-2 {
    opacity: 1;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.scroll-indicator.visible {
    opacity: 1;
}

.scroll-text {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.2em;
    color: var(--cream-static);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.scroll-line {
    width: 1px;
    height: 40px;
    background: var(--cream-static);
    animation: scrollPulse 2s ease-in-out infinite;
}

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

/* --- Magazine Spread Sections --- */
.magazine-spread {
    position: relative;
    min-height: 100vh;
    padding: 6rem 3rem;
    overflow: hidden;
}

.spread-1 {
    background: linear-gradient(
        160deg,
        #d4a0c8 0%,
        var(--lavender-haze) 30%,
        var(--horizon-blue) 70%,
        #6a9fc4 100%
    );
}

.spread-2 {
    background: linear-gradient(
        200deg,
        var(--sunset-coral) 0%,
        #d99a7a 30%,
        var(--lavender-haze) 70%,
        var(--hot-pink) 100%
    );
}

.spread-3 {
    background: linear-gradient(
        140deg,
        var(--horizon-blue) 0%,
        var(--lavender-haze) 40%,
        var(--sunset-coral) 80%,
        #e0947a 100%
    );
}

.spread-4 {
    background: linear-gradient(
        180deg,
        var(--lavender-haze) 0%,
        var(--vhs-black) 100%
    );
    padding-bottom: 8rem;
}

/* --- Spread Grid (12-column) --- */
.spread-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 5;
}

/* --- Glassmorphic Cards --- */
.glass-card {
    background: var(--glass-white);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.glass-card.revealed {
    opacity: 1;
    transform: translateY(0) translateX(0);
}

.glass-card[data-reveal="left"] {
    transform: translateX(-60px);
}

.glass-card[data-reveal="right"] {
    transform: translateX(60px);
}

.glass-card[data-reveal="bottom"] {
    transform: translateY(60px);
}

.glass-card.revealed[data-reveal="left"],
.glass-card.revealed[data-reveal="right"],
.glass-card.revealed[data-reveal="bottom"] {
    transform: translateX(0) translateY(0);
}

/* Card Variations */
.card-feature {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.card-sidebar {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.card-accent {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: rgba(232, 107, 158, 0.1);
    border-color: rgba(232, 107, 158, 0.2);
}

.card-terminal {
    background: rgba(26, 18, 40, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-color: rgba(194, 142, 218, 0.3);
}

.card-closing {
    background: rgba(26, 18, 40, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-color: rgba(244, 166, 131, 0.2);
    text-align: center;
    padding: 3rem 2rem;
}

/* --- Typography in Cards --- */
.card-label {
    display: block;
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.15em;
    color: var(--hot-pink);
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.card-headline {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(24px, 3vw, 42px);
    color: var(--cream-static);
    line-height: 1.2;
    margin-bottom: 1.2rem;
}

.card-subhead {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(18px, 2vw, 28px);
    color: var(--cream-static);
    line-height: 1.3;
    margin-bottom: 1rem;
}

.card-body {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: clamp(14px, 1.4vw, 17px);
    line-height: 1.75;
    color: var(--cream-static);
    margin-bottom: 1rem;
}

.card-body:last-child {
    margin-bottom: 0;
}

.pull-quote {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-style: italic;
    font-size: clamp(20px, 2.5vw, 36px);
    color: var(--cream-static);
    line-height: 1.4;
    text-align: center;
}

.full-width-quote {
    padding: 1rem 2rem;
}

/* --- Status Block --- */
.status-block {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.status-key {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    color: rgba(240, 232, 224, 0.7);
    letter-spacing: 0.05em;
}

.status-value {
    font-family: 'Space Mono', monospace;
    font-size: 13px;
    color: var(--hot-pink);
    font-weight: 700;
}

/* --- Simulation Params --- */
.sim-params {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.param {
    display: flex;
    justify-content: space-between;
    padding: 0.3rem 0;
}

.param-key {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    color: rgba(240, 232, 224, 0.6);
}

.param-val {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    color: var(--sunset-coral);
    font-weight: 700;
}

/* --- Version Info --- */
.version-info {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.mono-text {
    font-family: 'Space Mono', monospace;
    font-size: 13px;
    color: var(--cream-static);
    opacity: 0.8;
}

/* --- Pipeline List --- */
.pipeline-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 0.5rem;
}

.pipeline-step {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.step-num {
    font-family: 'Space Mono', monospace;
    font-size: 14px;
    font-weight: 700;
    color: var(--hot-pink);
    flex-shrink: 0;
    width: 2rem;
}

.step-text {
    font-family: 'Nunito', sans-serif;
    font-size: clamp(13px, 1.3vw, 16px);
    color: var(--cream-static);
    line-height: 1.5;
}

/* --- Terminal --- */
.terminal-output {
    font-family: 'Space Mono', monospace;
    font-size: clamp(12px, 1.2vw, 15px);
    line-height: 2;
}

.term-line {
    color: var(--cream-static);
    opacity: 0.9;
}

.term-prompt {
    color: var(--hot-pink);
    margin-right: 0.5rem;
}

.term-response {
    color: var(--lavender-haze);
    padding-left: 1.5rem;
    opacity: 0.8;
}

.term-cursor {
    margin-top: 0.5rem;
}

.cursor-blink {
    animation: cursorBlink 1s step-end infinite;
    color: var(--hot-pink);
}

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

/* --- Closing --- */
.closing-text {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(28px, 4vw, 48px);
    color: var(--cream-static);
    margin-bottom: 0.5rem;
}

.closing-sub {
    font-family: 'Space Mono', monospace;
    font-size: clamp(11px, 1.2vw, 14px);
    color: var(--sunset-coral);
    letter-spacing: 0.15em;
    margin-bottom: 1rem;
}

.closing-mono {
    font-family: 'Nunito', sans-serif;
    font-size: clamp(13px, 1.3vw, 16px);
    font-style: italic;
    color: rgba(240, 232, 224, 0.6);
}

/* --- Spread Geometric Accents --- */
.spread-geo {
    position: absolute;
    pointer-events: none;
    z-index: 1;
}

.spread-geo-1 {
    width: 400px;
    height: 400px;
    bottom: -50px;
    right: -50px;
    transform: rotate(25deg);
}

.spread-geo-2 {
    width: 300px;
    height: 300px;
    top: -30px;
    left: -40px;
    transform: rotate(15deg);
}

.spread-geo-3 {
    width: 350px;
    height: 350px;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%) rotate(-10deg);
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .magazine-spread {
        padding: 4rem 2rem;
    }

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

    .glass-card {
        grid-column: 1 / -1 !important;
        grid-row: auto !important;
    }

    .hero-title {
        font-size: clamp(48px, 12vw, 120px);
    }
}

@media (max-width: 640px) {
    .magazine-spread {
        padding: 3rem 1rem;
    }

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

    .glass-card {
        padding: 1.5rem;
    }

    .hero-title {
        font-size: clamp(40px, 15vw, 80px);
    }

    .hero-subtitle {
        letter-spacing: 0.15em;
        font-size: clamp(10px, 3vw, 14px);
    }

    .pull-quote {
        font-size: clamp(18px, 5vw, 24px);
    }

    .full-width-quote {
        padding: 0.5rem;
    }

    .spread-geo {
        display: none;
    }
}
