:root {
    --bg-primary: #0d1b2a;
    --bg-secondary: #1b2838;
    --rift-glow: #1a237e;
    --accent-gold: #d4af37;
    --accent-amber: #b8860b;
    --text-frost: #e8eaf6;
    --text-steel: #b0bec5;
    --blob-start: #0a1628;
    --blob-mid: #1a3a5c;
    --blob-end: #2c2a1a;
    --crimson: #c62828;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg-primary);
    background: radial-gradient(ellipse at 30% 20%, var(--bg-secondary) 0%, var(--bg-primary) 70%);
    color: var(--text-frost);
    font-family: 'Overpass Mono', monospace;
    font-weight: 300;
    font-size: clamp(0.9rem, 1.2vw, 1.1rem);
    line-height: 1.85;
    letter-spacing: 0.04em;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ============================
   BLOB LAYER - Background Plane
   ============================ */

.blob-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    opacity: 0;
    filter: blur(60px);
    animation: blobMorph1 25s ease-in-out infinite, blobFadeIn 2s ease-out 0.5s forwards;
}

.blob-1 {
    width: 500px;
    height: 500px;
    left: 10%;
    top: 20%;
    background: radial-gradient(circle at 40% 40%, var(--blob-mid), var(--blob-start));
    animation: blobMorph1 22s ease-in-out infinite, blobFadeIn 2s ease-out 0.5s forwards;
}

.blob-2 {
    width: 400px;
    height: 400px;
    left: 70%;
    top: 50%;
    background: radial-gradient(circle at 60% 30%, var(--blob-mid), var(--blob-end));
    animation: blobMorph2 28s ease-in-out infinite, blobFadeIn 2s ease-out 0.5s forwards;
}

.blob-3 {
    width: 350px;
    height: 350px;
    left: 40%;
    top: 80%;
    background: radial-gradient(circle at 50% 60%, var(--blob-end), var(--blob-start));
    animation: blobMorph3 30s ease-in-out infinite, blobFadeIn 2s ease-out 0.5s forwards;
}

@keyframes blobFadeIn {
    from { opacity: 0; }
    to { opacity: 0.4; }
}

@keyframes blobMorph1 {
    0%   { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
    20%  { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
    40%  { border-radius: 50% 50% 20% 80% / 40% 70% 50% 30%; }
    60%  { border-radius: 40% 60% 60% 40% / 70% 30% 40% 60%; }
    80%  { border-radius: 70% 30% 50% 50% / 30% 50% 60% 70%; }
    100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
}

@keyframes blobMorph2 {
    0%   { border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; }
    25%  { border-radius: 70% 30% 30% 70% / 60% 40% 60% 40%; }
    50%  { border-radius: 30% 70% 50% 50% / 50% 60% 30% 70%; }
    75%  { border-radius: 60% 40% 60% 40% / 30% 70% 50% 50%; }
    100% { border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; }
}

@keyframes blobMorph3 {
    0%   { border-radius: 50% 50% 40% 60% / 50% 40% 60% 50%; }
    20%  { border-radius: 30% 70% 60% 40% / 60% 30% 50% 70%; }
    40%  { border-radius: 70% 30% 30% 70% / 40% 60% 70% 30%; }
    60%  { border-radius: 40% 60% 50% 50% / 70% 50% 30% 60%; }
    80%  { border-radius: 60% 40% 70% 30% / 30% 70% 40% 60%; }
    100% { border-radius: 50% 50% 40% 60% / 50% 40% 60% 50%; }
}

/* ============================
   PARTICLE FIELD - Foreground Plane
   ============================ */

.particle-field {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 3;
    pointer-events: none;
    opacity: 0;
    animation: particleFadeIn 1s ease-out 2s forwards;
}

@keyframes particleFadeIn {
    to { opacity: 1; }
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: var(--accent-gold);
    animation: particleFloat 10s ease-in-out infinite;
}

@keyframes particleFloat {
    0%, 100% { transform: translateY(0); opacity: 0.2; }
    50%      { transform: translateY(-30px); opacity: 0.7; }
}

/* ============================
   ACT I - Hero / Diagonal Split
   ============================ */

.act {
    position: relative;
    z-index: 1;
}

.act-1 {
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-split {
    display: flex;
    width: 100%;
    min-height: 100vh;
    position: relative;
}

.hero-left {
    width: 58%;
    display: flex;
    align-items: center;
    justify-content: center;
    clip-path: polygon(0 0, 100% 0, 78% 100%, 0 100%);
    background: radial-gradient(ellipse at 40% 40%, rgba(27, 40, 56, 0.6), rgba(13, 27, 42, 0.9));
    padding: 2rem;
    animation: diagonalReveal 1.5s cubic-bezier(0.4, 0, 0.2, 1) 0.3s both;
}

@keyframes diagonalReveal {
    from { clip-path: polygon(0 0, 50% 0, 50% 100%, 0 100%); }
    to   { clip-path: polygon(0 0, 100% 0, 78% 100%, 0 100%); }
}

.hero-right {
    width: 42%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.domain-title {
    font-family: 'Bungee Shade', cursive;
    font-size: clamp(4rem, 12vw, 9rem);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-frost);
    text-shadow:
        2px 2px 0 var(--bg-primary),
        4px 4px 0 rgba(26, 35, 126, 0.6),
        0 0 40px rgba(212, 175, 55, 0.4);
    line-height: 1;
}

.letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(-30px);
    animation: letterReveal 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes letterReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-blob {
    width: 300px;
    height: 300px;
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    background: radial-gradient(circle at 40% 40%, var(--blob-mid), var(--bg-primary));
    opacity: 0;
    filter: blur(40px);
    animation: blobMorph1 20s ease-in-out infinite, heroFadeIn 2s ease-out 0.5s forwards;
}

@keyframes heroFadeIn {
    to { opacity: 0.6; }
}

/* ============================
   RIFT FISSURES
   ============================ */

.rift {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 80px;
    margin: -20px 0;
}

.rift svg {
    width: 100%;
    height: 100%;
}

.rift-outer {
    stroke: var(--rift-glow);
    stroke-width: 2;
    fill: none;
    filter: drop-shadow(0 0 12px var(--rift-glow)) drop-shadow(0 0 24px rgba(26, 35, 126, 0.5));
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 1.5s ease-out;
}

.rift-inner {
    stroke: var(--accent-gold);
    stroke-width: 0.5;
    fill: none;
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 2s ease-out 0.3s;
}

.rift.visible .rift-outer,
.rift.visible .rift-inner {
    stroke-dashoffset: 0;
}

/* Rift glow pulse */
.rift.visible .rift-outer {
    animation: riftPulse 4s ease-in-out infinite;
}

@keyframes riftPulse {
    0%, 100% { filter: drop-shadow(0 0 12px var(--rift-glow)) drop-shadow(0 0 24px rgba(26, 35, 126, 0.5)); }
    50%      { filter: drop-shadow(0 0 20px var(--rift-glow)) drop-shadow(0 0 40px rgba(26, 35, 126, 0.7)); }
}

/* ============================
   GILDED CIRCUIT SIGILS
   ============================ */

.sigil {
    width: 200px;
    height: 200px;
    position: relative;
    z-index: 2;
    margin: 2rem auto;
    animation: sigilRotate 60s linear infinite;
}

.sigil-1 { margin-left: 10%; }
.sigil-2 { margin-right: 10%; margin-left: auto; }

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

.sigil-path {
    stroke: var(--accent-gold);
    stroke-width: 1.5;
    fill: none;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 2s ease-out;
}

.sigil.visible .sigil-path {
    stroke-dashoffset: 0;
}

.sigil-node {
    fill: var(--accent-gold);
    opacity: 0;
    transition: opacity 0.5s ease-out 1.5s;
}

.sigil.visible .sigil-node {
    opacity: 1;
}

/* ============================
   CONTENT CARDS - Act II/III
   ============================ */

.act-2, .act-3, .act-4 {
    padding: 6vh 5vw;
    position: relative;
    z-index: 1;
}

.content-card {
    background: rgba(27, 40, 56, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(212, 175, 55, 0.3);
    padding: clamp(2rem, 4vw, 4rem);
    margin: 4vh 0;
    max-width: 700px;
    position: relative;
    opacity: 0;
    transform-origin: center center;
    transition: opacity 0.8s ease-out, border-radius 12s ease-in-out;
    animation: cardBorderMorph 12s ease-in-out infinite;
}

.content-card.visible {
    opacity: 1;
}

/* Broken grid offsets */
.card-1 {
    margin-left: 5%;
    margin-right: auto;
    margin-top: -20px;
}

.card-2 {
    margin-left: auto;
    margin-right: -5%;
    margin-top: -30px;
}

.card-3 {
    margin-left: 15%;
    margin-right: auto;
    margin-top: -25px;
}

.card-4 {
    margin-left: auto;
    margin-right: 3%;
    margin-top: -40px;
}

.card-5 {
    margin: 0 auto;
    max-width: 800px;
}

@keyframes cardBorderMorph {
    0%, 100% { border-radius: 5% 15% 10% 20% / 15% 5% 20% 10%; }
    25%      { border-radius: 20% 5% 25% 10% / 10% 20% 5% 25%; }
    50%      { border-radius: 10% 25% 5% 15% / 20% 10% 25% 5%; }
    75%      { border-radius: 15% 10% 20% 5% / 5% 25% 10% 20%; }
}

/* Card morph entrance */
.content-card.morph-enter {
    animation: cardMorphIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards, cardBorderMorph 12s ease-in-out infinite;
}

@keyframes cardMorphIn {
    from {
        border-radius: 50%;
        transform: scale(0.85) rotate(0deg);
        opacity: 0;
    }
    to {
        border-radius: 5% 15% 10% 20% / 15% 5% 20% 10%;
        transform: scale(1);
        opacity: 1;
    }
}

.section-heading {
    font-family: 'Cinzel Decorative', cursive;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: var(--text-frost);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.section-heading.gold {
    color: var(--accent-gold);
}

.section-subheading {
    font-family: 'Cinzel Decorative', cursive;
    font-weight: 400;
    font-size: clamp(1.4rem, 3vw, 2rem);
    color: var(--accent-gold);
    margin-bottom: 1.2rem;
    line-height: 1.3;
}

.whisper-text {
    font-family: 'Overpass Mono', monospace;
    font-weight: 300;
    font-size: clamp(0.9rem, 1.2vw, 1.1rem);
    line-height: 1.85;
    letter-spacing: 0.04em;
    color: var(--text-steel);
    text-shadow: 0 0 8px rgba(176, 190, 197, 0.15);
}

/* ============================
   ACT III - INNER SANCTUM
   ============================ */

.sanctum {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    padding: 10vh 5vw;
    gap: 2rem;
}

.sanctum-sigil-left,
.sanctum-sigil-right {
    width: 150px;
    height: 150px;
    flex-shrink: 0;
}

.sanctum-sigil-left {
    animation: sigilRotate 60s linear infinite;
}

.sanctum-sigil-right {
    animation: sigilRotate 60s linear infinite reverse;
}

.sanctum-sigil-left .sigil-path,
.sanctum-sigil-right .sigil-path {
    stroke: var(--accent-gold);
    stroke-width: 1.5;
    fill: none;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 2s ease-out;
}

.sanctum-sigil-left.visible .sigil-path,
.sanctum-sigil-right.visible .sigil-path {
    stroke-dashoffset: 0;
}

.sanctum-sigil-left .sigil-node,
.sanctum-sigil-right .sigil-node {
    fill: var(--accent-gold);
    opacity: 0;
    transition: opacity 0.5s ease-out 1.5s;
}

.sanctum-sigil-left.visible .sigil-node,
.sanctum-sigil-right.visible .sigil-node {
    opacity: 1;
}

.sanctum-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    max-width: 700px;
}

.sanctum-blob {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle at 45% 45%, #2c3e6b, var(--blob-mid), var(--blob-start));
    filter: blur(80px);
    opacity: 0.5;
    animation: blobMorph1 25s ease-in-out infinite, sanctumPulse 6s ease-in-out infinite;
    z-index: -1;
}

@keyframes sanctumPulse {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50%      { opacity: 0.55; transform: scale(1.05); }
}

.proclamation {
    font-family: 'Cinzel Decorative', cursive;
    font-weight: 400;
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    color: var(--text-frost);
    text-align: center;
    line-height: 1.4;
    text-shadow: 0 0 30px rgba(212, 175, 55, 0.3);
    position: relative;
    z-index: 1;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.2s ease-out, transform 1.2s ease-out;
}

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

/* ============================
   VOID - Closing Section
   ============================ */

.void {
    min-height: 40vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.void-glyph {
    font-size: 3rem;
    color: var(--accent-gold);
    opacity: 0;
    transition: opacity 2s ease-out;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
}

.void-text.visible .void-glyph {
    opacity: 0.6;
}

/* ============================
   RESPONSIVE
   ============================ */

@media (max-width: 768px) {
    .hero-split {
        flex-direction: column;
    }

    .hero-left {
        width: 100%;
        min-height: 60vh;
        clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
    }

    @keyframes diagonalReveal {
        from { clip-path: polygon(0 0, 100% 0, 100% 50%, 0 50%); }
        to   { clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%); }
    }

    .hero-right {
        width: 100%;
        min-height: 40vh;
    }

    .domain-title {
        font-size: clamp(2.5rem, 10vw, 5rem);
    }

    .content-card {
        max-width: 95%;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .card-2, .card-4 {
        margin-right: auto !important;
    }

    .sanctum {
        flex-direction: column;
        gap: 3rem;
    }

    .sanctum-sigil-left,
    .sanctum-sigil-right {
        width: 100px;
        height: 100px;
    }

    .sanctum-blob {
        width: 350px;
        height: 350px;
    }

    .blob-1 { width: 300px; height: 300px; }
    .blob-2 { width: 250px; height: 250px; }
    .blob-3 { width: 200px; height: 200px; }
}
