/* ===== ROOT VARIABLES ===== */
:root {
    --abyssal-black: #0A0E14;
    --trench-teal: #004D40;
    --bioluminescent-violet: #4A148C;
    --abyssal-magenta: #880E4F;
    --phosphor-white: #E8F5E9;
    --reef-gray: #CFD8DC;
    --ice-cyan: #B2EBF2;
    --neon-teal: #1DE9B6;
    --jellyfish-pink: #F48FB1;
    --deep-reef: #1A3A3A;
    --medium-teal: #80CBC4;
}

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

html {
    scroll-behavior: smooth;
}

/* ===== BODY + AURORA BACKGROUND ===== */
body {
    font-family: 'Lora', serif;
    color: var(--reef-gray);
    background: linear-gradient(135deg, #004D40 0%, #4A148C 45%, #880E4F 100%);
    background-size: 400% 400%;
    animation: auroraShift 30s ease-in-out infinite;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

@keyframes auroraShift {
    0% { background-position: 0% 0%; }
    25% { background-position: 100% 50%; }
    50% { background-position: 50% 100%; }
    75% { background-position: 0% 50%; }
    100% { background-position: 0% 0%; }
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3 {
    font-family: 'Playfair Display', serif;
    color: var(--phosphor-white);
    letter-spacing: -0.02em;
}

/* ===== PARTICLE FIELD ===== */
#particle-field {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    will-change: transform, opacity;
}

@keyframes particleDriftA {
    0% { transform: translate(0, 0); opacity: 0.2; }
    25% { transform: translate(30px, -60px); opacity: 0.7; }
    50% { transform: translate(-20px, -120px); opacity: 0.3; }
    75% { transform: translate(40px, -180px); opacity: 0.6; }
    100% { transform: translate(0, -240px); opacity: 0.2; }
}

@keyframes particleDriftB {
    0% { transform: translate(0, 0); opacity: 0.3; }
    25% { transform: translate(-40px, -50px); opacity: 0.5; }
    50% { transform: translate(20px, -110px); opacity: 0.8; }
    75% { transform: translate(-30px, -170px); opacity: 0.4; }
    100% { transform: translate(10px, -230px); opacity: 0.2; }
}

@keyframes particleDriftC {
    0% { transform: translate(0, 0); opacity: 0.4; }
    33% { transform: translate(25px, -80px); opacity: 0.6; }
    66% { transform: translate(-35px, -160px); opacity: 0.3; }
    100% { transform: translate(15px, -250px); opacity: 0.15; }
}

.particle.bright {
    filter: brightness(2.5);
    transition: filter 0.4s ease;
}

/* ===== CURRENT LINES ===== */
#current-lines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.current-line {
    position: absolute;
    width: 200%;
    height: 1px;
    background: var(--deep-reef);
    opacity: 0.4;
}

.current-line-1 {
    top: 20%;
    animation: currentFlow 25s linear infinite;
}

.current-line-2 {
    top: 45%;
    animation: currentFlow 35s linear infinite reverse;
}

.current-line-3 {
    top: 65%;
    animation: currentFlow 20s linear infinite;
}

.current-line-4 {
    top: 85%;
    animation: currentFlow 40s linear infinite reverse;
}

@keyframes currentFlow {
    0% { transform: translateX(-50%); }
    100% { transform: translateX(0%); }
}

/* ===== MAIN LAYOUT ===== */
main {
    position: relative;
    z-index: 2;
}

.zone {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6rem 2rem;
}

/* ===== HERO SECTION ===== */
#hero {
    min-height: 100vh;
    position: relative;
}

.hero-porthole {
    position: relative;
    width: 80vw;
    max-width: 800px;
    height: 80vw;
    max-height: 800px;
    border-radius: 50%;
    border: 2px solid var(--deep-reef);
    background: rgba(10, 14, 20, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 0 30px rgba(29, 233, 182, 0.08),
        0 0 60px rgba(29, 233, 182, 0.04),
        inset 0 0 40px rgba(29, 233, 182, 0.03);
    animation: portholeBreath 4s ease-in-out infinite;
}

@keyframes portholeBreath {
    0%, 100% { transform: scale(1); box-shadow: 0 0 30px rgba(29, 233, 182, 0.08), 0 0 60px rgba(29, 233, 182, 0.04), inset 0 0 40px rgba(29, 233, 182, 0.03); }
    50% { transform: scale(1.01); box-shadow: 0 0 40px rgba(29, 233, 182, 0.12), 0 0 80px rgba(29, 233, 182, 0.06), inset 0 0 50px rgba(29, 233, 182, 0.05); }
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(3.5rem, 12vw, 9rem);
    color: var(--phosphor-white);
    text-align: center;
    line-height: 1;
    text-shadow:
        0 0 10px #1DE9B6,
        0 0 30px rgba(29, 233, 182, 0.5),
        0 0 60px rgba(29, 233, 182, 0.25);
    letter-spacing: -0.02em;
}

.hero-dot {
    color: var(--neon-teal);
}

.hero-chevron {
    position: absolute;
    bottom: 12%;
    animation: chevronPulse 2.5s ease-in-out infinite;
    cursor: pointer;
}

@keyframes chevronPulse {
    0%, 100% { opacity: 0.4; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(6px); }
}

/* ===== JELLYFISH PULSE RINGS ===== */
.jellyfish-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.jellyfish-ring-1 {
    border: 1px solid rgba(29, 233, 182, 0.2);
    animation: jellyPulse 3s ease-out infinite;
}

.jellyfish-ring-2 {
    border: 1px solid rgba(29, 233, 182, 0.15);
    animation: jellyPulse 3s ease-out infinite 1s;
}

.jellyfish-ring-3 {
    border: 1px solid rgba(29, 233, 182, 0.1);
    animation: jellyPulse 3s ease-out infinite 2s;
}

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

/* ===== ORBITAL NAV ===== */
.orbital-nav {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 90vw;
    max-width: 900px;
    height: 90vw;
    max-height: 900px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    animation: orbitalSpin 60s linear infinite;
}

.orbital-link {
    position: absolute;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: clamp(0.75rem, 1.2vw, 0.95rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--medium-teal);
    text-decoration: none;
    pointer-events: auto;
    transition: color 0.3s ease, text-shadow 0.3s ease;
    animation: orbitalCounterSpin 60s linear infinite;
}

.orbital-link:hover {
    color: var(--neon-teal);
    text-shadow: 0 0 10px #1DE9B6, 0 0 20px rgba(29, 233, 182, 0.4);
}

.orbital-link-0 {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.orbital-link-1 {
    top: 50%;
    right: 0;
    transform: translateY(-50%);
}

.orbital-link-2 {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

@keyframes orbitalSpin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes orbitalCounterSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(-360deg); }
}

/* ===== CORAL DIVIDERS ===== */
.coral-divider {
    position: relative;
    width: 100%;
    padding: 2rem 0;
    z-index: 2;
}

.coral-svg {
    width: 100%;
    height: 80px;
    display: block;
}

.coral-node {
    opacity: 0;
    transition: opacity 0.8s ease;
}

.coral-divider.in-view .coral-node {
    opacity: 0.8;
}

/* ===== PHILOSOPHY SECTION ===== */
#philosophy {
    min-height: 100vh;
}

.philosophy-panel {
    position: relative;
    width: 70vw;
    max-width: 700px;
    padding: clamp(2rem, 4vw, 4rem);
    border-radius: 40px;
    background: rgba(10, 14, 20, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(29, 233, 182, 0.3);
    box-shadow: 0 0 20px rgba(29, 233, 182, 0.1);
    opacity: 0;
    transform: scale(0.97);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out, box-shadow 0.6s ease-out;
}

.philosophy-panel.visible {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 30px rgba(29, 233, 182, 0.15);
    animation: panelBreath 4s ease-in-out infinite 0.6s;
}

@keyframes panelBreath {
    0%, 100% { box-shadow: 0 0 20px rgba(29, 233, 182, 0.1); }
    50% { box-shadow: 0 0 40px rgba(29, 233, 182, 0.25); }
}

.philosophy-heading {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4rem);
    color: var(--phosphor-white);
    margin-bottom: 2rem;
    text-shadow: 0 0 10px rgba(29, 233, 182, 0.3);
}

.philosophy-text {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.text-line {
    display: block;
    font-family: 'Lora', serif;
    font-weight: 400;
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    line-height: 1.85;
    color: var(--reef-gray);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
    position: relative;
}

.text-line::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--neon-teal);
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

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

.text-line.line-visible::after {
    animation: lineFlash 0.6s ease-out forwards;
}

@keyframes lineFlash {
    0% { opacity: 0.15; }
    100% { opacity: 0; }
}

/* ===== WORK SECTION ===== */
.work-zone {
    min-height: auto;
    padding: 10vh 2rem;
    gap: 20vh;
}

.specimen {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    opacity: 0;
    transform: scale(0.97);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

.specimen-container {
    position: relative;
    width: clamp(280px, 50vw, 400px);
    height: clamp(280px, 50vw, 400px);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
}

.specimen-1 .specimen-container {
    clip-path: polygon(25% 0%, 75% 0%, 100% 25%, 100% 75%, 75% 100%, 25% 100%, 0% 75%, 0% 25%);
}

.specimen-2 .specimen-container {
    clip-path: ellipse(48% 45% at 50% 50%);
}

.specimen-3 .specimen-container {
    clip-path: polygon(50% 0%, 95% 25%, 95% 75%, 50% 100%, 5% 75%, 5% 25%);
}

.specimen-4 .specimen-container {
    clip-path: circle(48% at 50% 50%);
}

.specimen-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(29, 233, 182, 0.08) 0%, transparent 70%);
}

.specimen-inner {
    position: relative;
    width: 100%;
    height: 100%;
    background: rgba(10, 14, 20, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.specimen-label {
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: clamp(0.75rem, 1.2vw, 0.95rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--medium-teal);
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
}

.specimen-visual {
    width: 70%;
    height: 70%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.specimen-svg {
    width: 100%;
    height: 100%;
}

.specimen-title {
    font-family: 'Playfair Display', serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(2rem, 5vw, 4rem);
    color: var(--phosphor-white);
    margin-bottom: 0.5rem;
    text-shadow: 0 0 8px rgba(29, 233, 182, 0.2);
}

.specimen-desc {
    font-family: 'Lora', serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.5vw, 1.15rem);
    line-height: 1.7;
    color: var(--reef-gray);
    max-width: 38em;
}

/* Specimen Drift Animations */
.specimen-1.visible .specimen-container {
    animation: specimenDrift1 8s ease-in-out infinite;
}
.specimen-2.visible .specimen-container {
    animation: specimenDrift2 8s ease-in-out infinite;
}
.specimen-3.visible .specimen-container {
    animation: specimenDrift3 8s ease-in-out infinite;
}
.specimen-4.visible .specimen-container {
    animation: specimenDrift4 8s ease-in-out infinite;
}

@keyframes specimenDrift1 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(3px, -2px); }
}

@keyframes specimenDrift2 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-2px, 3px); }
}

@keyframes specimenDrift3 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(2px, 2px); }
}

@keyframes specimenDrift4 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-3px, -2px); }
}

/* Specimen visible breathing */
.specimen.visible {
    animation: specimenBreath 4s ease-in-out infinite 0.6s;
}

@keyframes specimenBreath {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.01); }
}

/* Anemone Hover Tendrils */
.specimen-container::before,
.specimen-container::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 2px;
    background: rgba(29, 233, 182, 0.5);
    border-radius: 1px;
    transition: transform 0.6s ease, opacity 0.6s ease;
    opacity: 0;
    z-index: 5;
}

.specimen-container::before {
    top: 20%;
    right: -5px;
    transform: scaleX(0);
    transform-origin: left center;
}

.specimen-container::after {
    bottom: 30%;
    left: -5px;
    transform: scaleX(0);
    transform-origin: right center;
}

.specimen:hover .specimen-container::before {
    transform: scaleX(1) translateX(10px);
    opacity: 1;
}

.specimen:hover .specimen-container::after {
    transform: scaleX(1) translateX(-10px);
    opacity: 1;
}

/* ===== SIGNAL SECTION ===== */
#signal {
    min-height: 100vh;
}

.signal-porthole {
    position: relative;
    width: clamp(300px, 50vw, 500px);
    height: clamp(300px, 50vw, 500px);
    border-radius: 50%;
    border: 2px solid var(--deep-reef);
    background: rgba(10, 14, 20, 0.5);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(2rem, 4vw, 3.5rem);
    text-align: center;
    box-shadow:
        0 0 30px rgba(29, 233, 182, 0.08),
        inset 0 0 30px rgba(29, 233, 182, 0.03);
    opacity: 0;
    transform: scale(0.97);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.signal-porthole.visible {
    opacity: 1;
    transform: scale(1);
    animation: signalBreath 4s ease-in-out infinite 0.6s;
}

@keyframes signalBreath {
    0%, 100% { transform: scale(1); box-shadow: 0 0 30px rgba(29, 233, 182, 0.08), inset 0 0 30px rgba(29, 233, 182, 0.03); }
    50% { transform: scale(1.02); box-shadow: 0 0 50px rgba(29, 233, 182, 0.14), inset 0 0 40px rgba(29, 233, 182, 0.06); }
}

.signal-heading {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4rem);
    color: var(--phosphor-white);
    margin-bottom: 1rem;
    text-shadow: 0 0 10px rgba(29, 233, 182, 0.3);
}

.signal-statement {
    font-family: 'Lora', serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.5vw, 1.15rem);
    line-height: 1.85;
    color: var(--reef-gray);
    margin-bottom: 1.5rem;
}

.signal-contact {
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: clamp(0.85rem, 1.3vw, 1rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--neon-teal);
    text-shadow: 0 0 10px #1DE9B6, 0 0 30px rgba(29, 233, 182, 0.5);
    animation: contactPulse 3s ease-in-out infinite;
}

@keyframes contactPulse {
    0%, 100% { text-shadow: 0 0 10px #1DE9B6, 0 0 30px rgba(29, 233, 182, 0.3); }
    50% { text-shadow: 0 0 15px #1DE9B6, 0 0 40px rgba(29, 233, 182, 0.5), 0 0 60px rgba(29, 233, 182, 0.2); }
}

/* ===== FOOTER ===== */
.site-footer {
    position: relative;
    z-index: 2;
    padding: 4rem 2rem;
    text-align: center;
}

.footer-text {
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: clamp(0.75rem, 1vw, 0.85rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ice-cyan);
    opacity: 0;
    transition: opacity 1s ease;
}

.footer-text.visible {
    opacity: 0.6;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .zone {
        padding: 4rem 1.5rem;
    }

    .hero-porthole {
        width: 90vw;
        height: 90vw;
    }

    .orbital-nav {
        width: 95vw;
        height: 95vw;
    }

    .philosophy-panel {
        width: 90vw;
        padding: 2rem;
    }

    .work-zone {
        gap: 12vh;
    }

    .specimen-container {
        width: 260px;
        height: 260px;
    }

    .signal-porthole {
        width: 85vw;
        height: 85vw;
        max-width: 400px;
        max-height: 400px;
    }
}

@media (max-width: 480px) {
    .hero-porthole {
        width: 95vw;
        height: 95vw;
    }

    .orbital-nav {
        display: none;
    }

    .philosophy-panel {
        width: 95vw;
        border-radius: 24px;
    }

    .specimen-container {
        width: 240px;
        height: 240px;
    }

    .signal-porthole {
        width: 90vw;
        height: 90vw;
        max-width: 340px;
        max-height: 340px;
        padding: 1.5rem;
    }
}
