/* ========================================
   simulai.tech — Fractured Opulence
   ======================================== */

:root {
    --bg-primary: #0d0b1e;
    --bg-secondary: #161234;
    --accent-magenta: #e03e7a;
    --accent-amber: #f0a030;
    --text-primary: #ede8e0;
    --text-secondary: #8a82b0;
    --glitch-cyan: #00e4f0;
    --glow-violet: #7b2ff0;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Libre Baskerville', Georgia, serif;
    overflow-x: hidden;
    perspective: 1200px;
    -webkit-font-smoothing: antialiased;
}

/* Scan Lines Overlay */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 2px,
        rgba(13, 11, 30, 0.03) 2px,
        rgba(13, 11, 30, 0.03) 4px
    );
    z-index: 20;
    pointer-events: none;
}

/* ========================================
   Background Plane
   ======================================== */

.background-plane {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    background: linear-gradient(170deg, var(--bg-primary) 0%, var(--bg-secondary) 40%, var(--bg-primary) 70%, var(--bg-secondary) 100%);
}

.glow-field {
    position: absolute;
    border-radius: 50%;
    mix-blend-mode: screen;
    will-change: transform;
    pointer-events: none;
}

.glow-field--1 {
    width: 50vw;
    height: 50vw;
    top: -10vh;
    left: -15vw;
    background: radial-gradient(ellipse at center, rgba(123, 47, 240, 0.15) 0%, rgba(123, 47, 240, 0.08) 40%, transparent 70%);
    animation: glowDrift1 35s cubic-bezier(0.37, 0, 0.63, 1) infinite alternate;
}

.glow-field--2 {
    width: 40vw;
    height: 40vw;
    top: 30vh;
    right: -10vw;
    background: radial-gradient(ellipse at center, rgba(224, 62, 122, 0.15) 0%, rgba(224, 62, 122, 0.08) 40%, transparent 70%);
    animation: glowDrift2 42s cubic-bezier(0.37, 0, 0.63, 1) infinite alternate;
}

.glow-field--3 {
    width: 35vw;
    height: 35vw;
    bottom: 10vh;
    left: 20vw;
    background: radial-gradient(ellipse at center, rgba(123, 47, 240, 0.12) 0%, rgba(123, 47, 240, 0.06) 40%, transparent 70%);
    animation: glowDrift3 38s cubic-bezier(0.37, 0, 0.63, 1) infinite alternate;
}

.glow-field--4 {
    width: 30vw;
    height: 30vw;
    top: 50vh;
    left: 50vw;
    background: radial-gradient(ellipse at center, rgba(224, 62, 122, 0.1) 0%, rgba(224, 62, 122, 0.05) 40%, transparent 70%);
    animation: glowDrift4 45s cubic-bezier(0.37, 0, 0.63, 1) infinite alternate;
}

.glow-field--5 {
    width: 25vw;
    height: 25vw;
    top: 80vh;
    left: 5vw;
    background: radial-gradient(ellipse at center, rgba(123, 47, 240, 0.1) 0%, rgba(123, 47, 240, 0.05) 40%, transparent 70%);
    animation: glowDrift5 30s cubic-bezier(0.37, 0, 0.63, 1) infinite alternate;
}

.glow-field--6 {
    width: 45vw;
    height: 45vw;
    top: -20vh;
    right: -20vw;
    background: radial-gradient(ellipse at center, rgba(240, 160, 48, 0.06) 0%, rgba(240, 160, 48, 0.03) 40%, transparent 70%);
    animation: glowDrift6 50s cubic-bezier(0.37, 0, 0.63, 1) infinite alternate;
}

@keyframes glowDrift1 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(15vw, 10vh) scale(1.15); }
}

@keyframes glowDrift2 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-12vw, 15vh) scale(1.1); }
}

@keyframes glowDrift3 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(10vw, -12vh) scale(1.2); }
}

@keyframes glowDrift4 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-8vw, 8vh) scale(1.05); }
}

@keyframes glowDrift5 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(12vw, -6vh) scale(1.1); }
}

@keyframes glowDrift6 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-10vw, 12vh) scale(0.95); }
}

/* ========================================
   Interference Plane
   ======================================== */

.interference-plane {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 15;
    pointer-events: none;
    overflow: hidden;
}

.typographic-debris {
    position: absolute;
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    opacity: 0.03;
    color: var(--text-primary);
    will-change: transform;
}

.debris--1 {
    font-size: 15vw;
    left: 5vw;
    top: 120vh;
    animation: debrisFloat 60s linear infinite;
}

.debris--2 {
    font-size: 10vw;
    left: 40vw;
    top: 140vh;
    animation: debrisFloat 75s linear infinite;
    animation-delay: -15s;
}

.debris--3 {
    font-size: 12vw;
    left: 70vw;
    top: 130vh;
    animation: debrisFloat 55s linear infinite;
    animation-delay: -25s;
}

.debris--4 {
    font-size: 8vw;
    left: 25vw;
    top: 150vh;
    animation: debrisFloat 80s linear infinite;
    animation-delay: -40s;
}

.debris--5 {
    font-size: 14vw;
    left: 85vw;
    top: 110vh;
    animation: debrisFloat 65s linear infinite;
    animation-delay: -10s;
}

.debris--6 {
    font-size: 11vw;
    left: 55vw;
    top: 160vh;
    animation: debrisFloat 70s linear infinite;
    animation-delay: -35s;
}

.debris--7 {
    font-size: 9vw;
    left: 15vw;
    top: 145vh;
    animation: debrisFloat 85s linear infinite;
    animation-delay: -50s;
}

@keyframes debrisFloat {
    0% { transform: translateY(0); }
    100% { transform: translateY(-300vh); }
}

/* ========================================
   Content Plane
   ======================================== */

.content-plane {
    position: relative;
    z-index: 10;
}

/* ========================================
   Glitch Seam
   ======================================== */

.glitch-seam {
    position: absolute;
    top: 38vh;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-magenta);
    z-index: 5;
    animation: glitchSeam 5s steps(6, end) infinite;
}

@keyframes glitchSeam {
    0%, 88% { transform: translateX(0); opacity: 0.6; }
    89% { transform: translateX(8px); opacity: 0.9; }
    90% { transform: translateX(-4px); opacity: 0.7; }
    91% { transform: translateX(12px); opacity: 1; }
    92% { transform: translateX(-6px); opacity: 0.8; }
    93% { transform: translateX(3px); opacity: 0.6; }
    94%, 100% { transform: translateX(0); opacity: 0.6; }
}

/* ========================================
   Section: The Void
   ======================================== */

.section-void {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.void-content {
    text-align: center;
    opacity: 0;
    animation: voidFadeIn 2s ease-out 1.2s forwards;
}

.logo-text {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 700;
    font-size: clamp(3rem, 10vw, 10rem);
    letter-spacing: -0.03em;
    line-height: 0.92;
    color: var(--text-primary);
    position: relative;
}

.logo-text::before,
.logo-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.logo-text::before {
    color: var(--glitch-cyan);
    animation: rgbSplitLeft 6s steps(6, end) infinite;
    mix-blend-mode: screen;
}

.logo-text::after {
    color: var(--accent-magenta);
    animation: rgbSplitRight 6s steps(6, end) infinite;
    mix-blend-mode: screen;
}

@keyframes rgbSplitLeft {
    0%, 87% { transform: translate(0, 0); opacity: 0; }
    88% { transform: translate(-3px, 1px); opacity: 0.7; }
    89% { transform: translate(2px, -1px); opacity: 0.5; }
    90% { transform: translate(-4px, 0); opacity: 0.8; }
    91% { transform: translate(1px, 2px); opacity: 0.4; }
    92%, 100% { transform: translate(0, 0); opacity: 0; }
}

@keyframes rgbSplitRight {
    0%, 87% { transform: translate(0, 0); opacity: 0; }
    88% { transform: translate(3px, -1px); opacity: 0.7; }
    89% { transform: translate(-2px, 1px); opacity: 0.5; }
    90% { transform: translate(4px, 0); opacity: 0.8; }
    91% { transform: translate(-1px, -2px); opacity: 0.4; }
    92%, 100% { transform: translate(0, 0); opacity: 0; }
}

.logo-text.logo-entering {
    animation: logoRGBConverge 2s ease-out forwards;
}

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

@keyframes voidFadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

.tagline {
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-secondary);
    opacity: 0;
    margin-top: 2rem;
    animation: taglineFadeIn 1.5s ease-out 2.5s forwards;
}

@keyframes taglineFadeIn {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 0.3; transform: translateY(0); }
}

/* ========================================
   Section: The Thesis
   ======================================== */

.section-thesis {
    position: relative;
    min-height: 120vh;
    padding: 15vh 0 20vh;
}

.thesis-block {
    max-width: 38ch;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1.2s ease-out, transform 1.2s ease-out;
}

.thesis-block.visible {
    opacity: 1;
    transform: translateY(0);
}

.thesis-block--left {
    margin-left: 8vw;
    margin-bottom: 5vh;
}

.thesis-block--right {
    margin-left: 62vw;
    margin-top: 10vh;
}

.body-text {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
    line-height: 1.72;
    letter-spacing: 0.005em;
    color: var(--text-primary);
}

.glow-field-inline {
    position: absolute;
    width: 30vw;
    height: 30vw;
    left: 35vw;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(123, 47, 240, 0.12) 0%, rgba(123, 47, 240, 0.06) 40%, transparent 70%);
    mix-blend-mode: screen;
    animation: glowPulse 8s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes glowPulse {
    0% { opacity: 0.6; transform: translateY(-50%) scale(1); }
    100% { opacity: 1; transform: translateY(-50%) scale(1.08); }
}

.organic-divider {
    width: 100%;
    height: 80px;
    margin-top: 10vh;
    display: block;
}

/* ========================================
   Section: The Rupture
   ======================================== */

.section-rupture {
    position: relative;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.section-rupture .glitch-seam--multi-1 { top: 15vh; animation-delay: 0s; }
.section-rupture .glitch-seam--multi-2 { top: 32vh; animation-delay: 0.3s; }
.section-rupture .glitch-seam--multi-3 { top: 48vh; animation-delay: 0.7s; }
.section-rupture .glitch-seam--multi-4 { top: 65vh; animation-delay: 1.1s; }

.section-rupture.active {
    animation: ruptureFlash 0.3s ease-in-out;
}

.section-rupture.active body::after {
    opacity: 0.08;
}

@keyframes ruptureFlash {
    0%, 100% { background: transparent; }
    50% { background: rgba(22, 18, 52, 0.5); }
}

.rupture-content {
    text-align: center;
    padding: 0 10vw;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1.5s ease-out, transform 1.5s ease-out;
}

.rupture-content.visible {
    opacity: 1;
    transform: translateY(0);
}

.rupture-headline {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(2rem, 5vw, 5rem);
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--text-primary);
    position: relative;
}

.rupture-headline::before,
.rupture-headline::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    font-style: italic;
}

.rupture-headline::before {
    color: var(--glitch-cyan);
    animation: rgbSplitLeft 4s steps(6, end) infinite;
    mix-blend-mode: screen;
}

.rupture-headline::after {
    color: var(--accent-magenta);
    animation: rgbSplitRight 4s steps(6, end) infinite;
    mix-blend-mode: screen;
}

/* ========================================
   Section: The Evidence
   ======================================== */

.section-evidence {
    position: relative;
    min-height: 160vh;
    padding: 15vh 0 20vh;
}

.evidence-cluster {
    max-width: 42ch;
    padding: 2rem;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1.2s ease-out, transform 1.2s ease-out;
}

.evidence-cluster.visible {
    opacity: 1;
    transform: translateY(0);
}

.evidence-cluster--1 {
    margin-left: 12vw;
    transform: perspective(800px) rotateY(2deg) rotateX(1deg) translateY(40px);
}

.evidence-cluster--1.visible {
    transform: perspective(800px) rotateY(2deg) rotateX(1deg) translateY(0);
}

.evidence-cluster--2 {
    margin-left: 50vw;
    margin-top: 8vh;
    transform: perspective(800px) rotateY(-1.5deg) rotateX(0.8deg) translateY(40px);
}

.evidence-cluster--2.visible {
    transform: perspective(800px) rotateY(-1.5deg) rotateX(0.8deg) translateY(0);
}

.evidence-cluster--3 {
    margin-left: 22vw;
    margin-top: 8vh;
    transform: perspective(800px) rotateY(1deg) rotateX(1.5deg) translateY(40px);
}

.evidence-cluster--3.visible {
    transform: perspective(800px) rotateY(1deg) rotateX(1.5deg) translateY(0);
}

.cluster-headline {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 3.5vw, 3rem);
    letter-spacing: -0.03em;
    line-height: 0.92;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.cluster-visual {
    margin-top: 2rem;
    width: 180px;
    height: 180px;
}

.cluster-visual svg {
    width: 100%;
    height: 100%;
}

.morph-path {
    animation: morphPulse 8s ease-in-out infinite alternate;
}

.morph-path--offset {
    animation: morphPulseOffset 10s ease-in-out infinite alternate;
}

@keyframes morphPulse {
    0% { d: path('M100,20 C140,20 180,60 180,100 C180,140 140,180 100,180 C60,180 20,140 20,100 C20,60 60,20 100,20 Z'); }
    50% { d: path('M100,30 C150,10 190,50 185,100 C180,150 130,190 100,175 C70,190 20,150 15,100 C10,50 50,10 100,30 Z'); }
    100% { d: path('M100,25 C130,25 170,70 175,105 C180,140 150,175 100,180 C50,175 25,135 20,100 C15,65 70,25 100,25 Z'); }
}

@keyframes morphPulseOffset {
    0% { d: path('M100,30 C135,30 170,65 170,100 C170,135 135,170 100,170 C65,170 30,135 30,100 C30,65 65,30 100,30 Z'); }
    50% { d: path('M100,40 C145,25 175,55 170,100 C165,145 125,180 100,165 C75,180 35,145 30,100 C25,55 55,25 100,40 Z'); }
    100% { d: path('M100,35 C140,35 165,70 165,105 C165,140 140,165 100,170 C60,165 40,130 35,100 C30,70 60,35 100,35 Z'); }
}

.radial-dot--1 { animation: dotPulse 4s ease-in-out infinite alternate; }
.radial-dot--2 { animation: dotPulse 5s ease-in-out infinite alternate; animation-delay: 1s; }
.radial-dot--3 { animation: dotPulse 3.5s ease-in-out infinite alternate; animation-delay: 0.5s; }
.radial-dot--4 { animation: dotPulse 4.5s ease-in-out infinite alternate; animation-delay: 1.5s; }

@keyframes dotPulse {
    0% { r: 2; opacity: 0.4; }
    100% { r: 4; opacity: 0.9; }
}

.gen-line--1 { animation: lineWave 6s ease-in-out infinite alternate; }
.gen-line--2 { animation: lineWave 7s ease-in-out infinite alternate; animation-delay: 0.5s; }
.gen-line--3 { animation: lineWave 8s ease-in-out infinite alternate; animation-delay: 1s; }
.gen-line--4 { animation: lineWave 5s ease-in-out infinite alternate; animation-delay: 1.5s; }
.gen-line--5 { animation: lineWave 9s ease-in-out infinite alternate; animation-delay: 2s; }

@keyframes lineWave {
    0% { stroke-dashoffset: 0; opacity: 0.3; }
    100% { stroke-dashoffset: 20; opacity: 0.7; }
}

.gen-line {
    stroke-dasharray: 5 3;
}

.organic-divider--2,
.organic-divider--3 {
    margin-top: 6vh;
    margin-bottom: 2vh;
}

/* ========================================
   Section: The Signal
   ======================================== */

.section-signal {
    position: relative;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.signal-content {
    position: relative;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.5s ease-out, transform 1.5s ease-out;
}

.signal-content.visible {
    opacity: 1;
    transform: translateY(0);
}

.signal-text {
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-primary);
    position: relative;
    z-index: 2;
}

.signal-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(123, 47, 240, 0.2) 0%, rgba(123, 47, 240, 0.08) 30%, rgba(224, 62, 122, 0.04) 50%, transparent 70%);
    mix-blend-mode: screen;
    z-index: 1;
    animation: signalGlowPulse 6s ease-in-out infinite alternate;
}

@keyframes signalGlowPulse {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
    100% { transform: translate(-50%, -50%) scale(1.3); opacity: 1; }
}

/* ========================================
   Radial Navigation
   ======================================== */

.nav-trigger {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 100;
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.nav-trigger:hover {
    opacity: 1;
}

.radial-nav {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 99;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.radial-nav.active {
    pointer-events: auto;
    opacity: 1;
}

.radial-nav__item {
    position: absolute;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-primary);
    text-decoration: none;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s ease;
    white-space: nowrap;
}

.radial-nav.active .radial-nav__item {
    opacity: 0.7;
}

.radial-nav__item:hover {
    opacity: 1;
    color: var(--accent-amber);
}

.radial-nav__item--1 {
    transform: translate(-80px, -10px) perspective(400px) rotateY(-5deg);
}

.radial-nav.active .radial-nav__item--1 {
    transform: translate(-80px, -10px) perspective(400px) rotateY(0deg);
    transition-delay: 0.05s;
}

.radial-nav__item--2 {
    transform: translate(-100px, 25px) perspective(400px) rotateY(-5deg);
}

.radial-nav.active .radial-nav__item--2 {
    transform: translate(-100px, 25px) perspective(400px) rotateY(0deg);
    transition-delay: 0.1s;
}

.radial-nav__item--3 {
    transform: translate(-90px, 60px) perspective(400px) rotateY(-5deg);
}

.radial-nav.active .radial-nav__item--3 {
    transform: translate(-90px, 60px) perspective(400px) rotateY(0deg);
    transition-delay: 0.15s;
}

.radial-nav__item--4 {
    transform: translate(-70px, 95px) perspective(400px) rotateY(-5deg);
}

.radial-nav.active .radial-nav__item--4 {
    transform: translate(-70px, 95px) perspective(400px) rotateY(0deg);
    transition-delay: 0.2s;
}

.radial-nav__item--5 {
    transform: translate(-50px, 130px) perspective(400px) rotateY(-5deg);
}

.radial-nav.active .radial-nav__item--5 {
    transform: translate(-50px, 130px) perspective(400px) rotateY(0deg);
    transition-delay: 0.25s;
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 768px) {
    .thesis-block--left {
        margin-left: 6vw;
        max-width: 85vw;
    }

    .thesis-block--right {
        margin-left: 12vw;
        max-width: 80vw;
    }

    .evidence-cluster--1 {
        margin-left: 6vw;
    }

    .evidence-cluster--2 {
        margin-left: 10vw;
    }

    .evidence-cluster--3 {
        margin-left: 8vw;
    }

    .evidence-cluster {
        max-width: 85vw;
    }
}
