/* scriptswirl.com — Ocean Deep Marble Design */
/* Palette */
:root {
    --surface: #0a3d62;
    --thermocline: #08304e;
    --mesopelagic: #061e38;
    --bathypelagic: #041428;
    --abyss: #020c18;
    --marble-vein: #1a6b8a;
    --marble-warm: #2d8fa8;
    --foam: #c8e6f0;
    --pearl: #e8f4f8;
    --bioluminescence: #4af0c8;
    --ink-swirl: #8b6f47;
    --depth-shadow: #010810;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--abyss);
    color: var(--foam);
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    overflow-x: hidden;
}

/* Descent Thread */
.descent-thread {
    position: fixed;
    left: 18vw;
    top: 0;
    width: 1px;
    height: 100vh;
    background: repeating-linear-gradient(
        to bottom,
        rgba(26, 107, 138, 0.25) 0px,
        rgba(26, 107, 138, 0.25) 8px,
        transparent 8px,
        transparent 16px
    );
    background-size: 1px 16px;
    animation: thread-flow 4s linear infinite;
    z-index: 10;
    pointer-events: none;
}

@keyframes thread-flow {
    0% { background-position: 0 0; }
    100% { background-position: 0 16px; }
}

/* Zones */
.zone {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.zone-0 {
    background: var(--surface);
    min-height: 100vh;
    justify-content: center;
}

.zone-1 {
    background: linear-gradient(to bottom, var(--surface), var(--thermocline));
    min-height: 100vh;
}

.zone-2 {
    background: linear-gradient(to bottom, var(--thermocline), var(--mesopelagic));
    min-height: 150vh;
}

.zone-3 {
    background: linear-gradient(to bottom, var(--mesopelagic), var(--bathypelagic));
    min-height: 150vh;
    flex-direction: column;
    justify-content: center;
}

.zone-4 {
    background: linear-gradient(to bottom, var(--bathypelagic), var(--abyss));
    min-height: 150vh;
    justify-content: center;
}

/* Marble Surfaces */
.marble-surface {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.marble-0 {
    background:
        radial-gradient(ellipse at 20% 50%, rgba(26, 107, 138, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 30%, rgba(139, 111, 71, 0.15) 0%, transparent 40%),
        radial-gradient(ellipse at 45% 80%, rgba(45, 143, 168, 0.2) 0%, transparent 60%),
        radial-gradient(ellipse at 85% 60%, rgba(26, 107, 138, 0.1) 0%, transparent 35%);
    animation: marble-drift 60s ease-in-out infinite alternate;
}

.marble-1 {
    background:
        radial-gradient(ellipse at 30% 40%, rgba(26, 107, 138, 0.25) 0%, transparent 45%),
        radial-gradient(ellipse at 80% 60%, rgba(139, 111, 71, 0.12) 0%, transparent 35%),
        radial-gradient(ellipse at 55% 20%, rgba(45, 143, 168, 0.15) 0%, transparent 55%),
        radial-gradient(ellipse at 15% 75%, rgba(26, 107, 138, 0.2) 0%, transparent 40%);
    animation: marble-drift 60s ease-in-out infinite alternate-reverse;
}

.marble-2 {
    background:
        radial-gradient(ellipse at 40% 60%, rgba(26, 107, 138, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse at 75% 25%, rgba(139, 111, 71, 0.1) 0%, transparent 40%),
        radial-gradient(ellipse at 25% 35%, rgba(45, 143, 168, 0.18) 0%, transparent 55%),
        radial-gradient(ellipse at 90% 80%, rgba(26, 107, 138, 0.15) 0%, transparent 35%),
        radial-gradient(ellipse at 60% 50%, rgba(139, 111, 71, 0.08) 0%, transparent 60%);
    animation: marble-drift 60s ease-in-out infinite alternate;
}

.marble-3 {
    background:
        radial-gradient(ellipse at 50% 30%, rgba(26, 107, 138, 0.15) 0%, transparent 45%),
        radial-gradient(ellipse at 20% 70%, rgba(139, 111, 71, 0.1) 0%, transparent 35%),
        radial-gradient(ellipse at 80% 50%, rgba(45, 143, 168, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 35% 85%, rgba(26, 107, 138, 0.18) 0%, transparent 40%);
    animation: marble-drift 60s ease-in-out infinite alternate-reverse;
}

.marble-4 {
    background:
        radial-gradient(ellipse at 50% 50%, rgba(26, 107, 138, 0.1) 0%, transparent 40%),
        radial-gradient(ellipse at 30% 30%, rgba(139, 111, 71, 0.06) 0%, transparent 35%),
        radial-gradient(ellipse at 70% 70%, rgba(45, 143, 168, 0.08) 0%, transparent 50%);
    animation: marble-drift 60s ease-in-out infinite alternate;
}

@keyframes marble-drift {
    0% { background-position: 0% 0%; }
    25% { background-position: 5% 3%; }
    50% { background-position: -3% 5%; }
    75% { background-position: 4% -2%; }
    100% { background-position: -2% 4%; }
}

/* Content Drift */
.zone-content {
    position: relative;
    z-index: 5;
    max-width: 720px;
    width: 100%;
    padding: 4rem 2rem;
    transition: margin-left 1.2s cubic-bezier(0.23, 1, 0.32, 1);
}

.content-drift[data-zone='0'] {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.content-drift[data-zone='1'] {
    margin-left: 35vw;
}

.content-drift[data-zone='2'] {
    margin-left: 8vw;
    max-width: 85vw;
}

.content-drift[data-zone='3'] {
    margin-left: 15vw;
}

.content-drift[data-zone='4'] {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Logotype */
.logotype {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: 0.15em;
    text-transform: lowercase;
    color: var(--pearl);
    display: inline-block;
    position: relative;
}

.logo-char {
    display: inline-block;
    transform: translateY(var(--char-offset, 0));
    text-shadow:
        0 2px 0 #0a3d62,
        0 4px 2px rgba(10, 61, 98, 0.8),
        0 6px 4px rgba(8, 48, 78, 0.6),
        0 8px 8px rgba(6, 30, 56, 0.5),
        0 12px 16px rgba(4, 20, 40, 0.4),
        0 16px 32px rgba(2, 12, 24, 0.3);
}

/* Narrative Text */
.narrative-text {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    line-height: 2.2;
    letter-spacing: 0.08em;
    color: var(--foam);
    max-width: 55ch;
    text-indent: 3ch;
    white-space: pre-line;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s ease-out, transform 1s ease-out;
}

.narrative-text.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Annotation */
.annotation {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-style: italic;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
    color: #4a8fa8;
    display: block;
    margin-top: 2rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.2s ease-out 0.3s, transform 1.2s ease-out 0.3s;
}

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

/* Marble Ornaments */
.marble-ornament {
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    z-index: 2;
    pointer-events: none;
}

.ornament-left {
    left: 5vw;
    top: 20%;
    background:
        repeating-conic-gradient(
            from 0deg at 50% 50%,
            rgba(26, 107, 138, 0.15) 0deg,
            transparent 20deg,
            rgba(139, 111, 71, 0.08) 40deg,
            transparent 60deg
        );
    opacity: 0.6;
}

.ornament-right {
    right: 8vw;
    bottom: 15%;
    width: 150px;
    height: 150px;
    background:
        repeating-conic-gradient(
            from 45deg at 50% 50%,
            rgba(45, 143, 168, 0.12) 0deg,
            transparent 15deg,
            rgba(26, 107, 138, 0.1) 30deg,
            transparent 50deg
        );
    opacity: 0.5;
}

/* Concept Cards */
.concept-cards {
    display: flex;
    flex-direction: column;
    gap: 6rem;
    padding: 4rem 0;
}

.inflated-card {
    border-radius: 24px;
    padding: 3rem 2.5rem;
    max-width: 420px;
    position: relative;
    box-shadow:
        0 2px 4px rgba(2, 12, 24, 0.3),
        0 8px 16px rgba(2, 12, 24, 0.25),
        0 16px 32px rgba(2, 12, 24, 0.2),
        inset 0 1px 0 rgba(200, 230, 240, 0.08),
        inset 0 -2px 0 rgba(2, 12, 24, 0.15);
    background: linear-gradient(145deg,
        rgba(26, 107, 138, 0.12) 0%,
        rgba(6, 30, 56, 0.95) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.inflated-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.card-left {
    align-self: flex-start;
    margin-left: 5%;
}

.card-center {
    align-self: center;
}

.card-right {
    align-self: flex-end;
    margin-right: 5%;
}

.card-heading {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: 0.15em;
    text-transform: lowercase;
    color: var(--pearl);
    margin-bottom: 1.5rem;
}

.underline-draw {
    position: relative;
    display: inline-block;
}

.underline-draw::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--bioluminescence);
    box-shadow: 0 0 6px rgba(74, 240, 200, 0.4);
    transition: width 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.inflated-card:hover .underline-draw::after {
    width: 100%;
}

.card-text {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.9rem;
    line-height: 2;
    letter-spacing: 0.06em;
    color: var(--foam);
    white-space: pre-line;
}

/* Wave Container */
.wave-container {
    position: relative;
    width: 100%;
    height: 300px;
    z-index: 3;
    overflow: hidden;
    margin-bottom: 2rem;
}

.wave-svg {
    width: 200%;
    height: 100%;
    position: absolute;
    left: -50%;
}

.wave-path {
    stroke-dasharray: 800 400;
}

.wave-1 { animation: wave-flow 20s linear infinite; }
.wave-2 { animation: wave-flow 25s linear infinite; }
.wave-3 { animation: wave-flow 18s linear infinite; }
.wave-4 { animation: wave-flow 30s linear infinite; }
.wave-5 { animation: wave-flow 22s linear infinite; }
.wave-6 { animation: wave-flow 35s linear infinite; }

@keyframes wave-flow {
    0% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: -1200; }
}

/* Abyss Watermark */
.abyss-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: clamp(4rem, 10vw, 8rem);
    letter-spacing: 0.1em;
    text-transform: lowercase;
    color: var(--foam);
    opacity: 0.06;
    white-space: nowrap;
    z-index: 2;
    pointer-events: none;
}

/* Pearl */
.pearl {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    position: relative;
    margin-bottom: 3rem;
    background:
        radial-gradient(circle at 35% 35%, rgba(232, 244, 248, 0.9) 0%, rgba(200, 230, 240, 0.4) 30%, transparent 60%),
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.6) 0%, transparent 20%),
        radial-gradient(ellipse at 60% 55%, rgba(26, 107, 138, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 45% 65%, rgba(139, 111, 71, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(45, 143, 168, 0.4) 0%, rgba(10, 61, 98, 0.8) 60%, rgba(4, 20, 40, 1) 100%);
    box-shadow:
        0 4px 12px rgba(2, 12, 24, 0.5),
        0 8px 24px rgba(2, 12, 24, 0.3),
        inset 0 -4px 8px rgba(2, 12, 24, 0.4);
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 1.5s ease-out, transform 1.5s ease-out;
}

.pearl.visible {
    opacity: 1;
    transform: scale(1);
}

/* Final Text */
.final-text {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    line-height: 2.2;
    letter-spacing: 0.08em;
    color: var(--pearl);
    text-align: center;
    max-width: 50ch;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.5s ease-out 0.5s, transform 1.5s ease-out 0.5s;
}

.final-text.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    .content-drift[data-zone='1'] {
        margin-left: 8vw;
    }

    .content-drift[data-zone='2'] {
        margin-left: 4vw;
    }

    .content-drift[data-zone='3'] {
        margin-left: 6vw;
    }

    .concept-cards {
        gap: 3rem;
    }

    .inflated-card {
        max-width: 90vw;
    }

    .card-left,
    .card-center,
    .card-right {
        margin-left: 0;
        margin-right: 0;
        align-self: center;
    }

    .descent-thread {
        left: 8vw;
    }

    .marble-ornament {
        display: none;
    }

    .abyss-watermark {
        font-size: clamp(2rem, 12vw, 5rem);
    }
}
