:root {
    --bg-primary: #0a0812;
    --bg-card: #110e1c;
    --neon-primary: #00FFAA;
    --neon-secondary: #FF2D7B;
    --warm-ground: #8B5E3C;
    --warm-mid: #6B3F2A;
    --warm-deep: #4A2817;
    --text-primary: #b8bcc8;
    --text-display: #e8ecf4;
    --crystal-teal: #00D4AA;
    --font-display: 'Nunito Sans', sans-serif;
    --font-body: 'Varela Round', sans-serif;
    --font-mono: 'Azeret Mono', monospace;
    --hover-curve: cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: clamp(0.95rem, 1.8vw, 1.1rem);
    line-height: 1.7;
    overflow-x: hidden;
}

/* The Spine */
.spine {
    position: fixed;
    left: 24px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(0, 255, 170, 0.2);
    z-index: 100;
    pointer-events: none;
}

/* Particles Canvas */
#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* Monogram */
.monogram {
    position: fixed;
    top: 20px;
    left: 40px;
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-display);
    opacity: 0.6;
    z-index: 200;
    letter-spacing: 0.02em;
}

/* ========== Scene 1: Formation ========== */
.scene-formation {
    position: relative;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1;
    overflow: hidden;
}

.site-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(2.4rem, 6vw, 4.8rem);
    color: var(--text-display);
    letter-spacing: 0.01em;
    opacity: 0;
    animation: fadeInTitle 2s ease forwards 0.5s;
    position: relative;
    z-index: 2;
}

.site-tagline {
    font-family: var(--font-body);
    color: var(--text-primary);
    margin-top: 1.2rem;
    max-width: 520px;
    text-align: center;
    opacity: 0;
    animation: fadeInTitle 2s ease forwards 1.5s;
    position: relative;
    z-index: 2;
}

@keyframes fadeInTitle {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Crystal Cluster */
.crystal-cluster {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    height: 500px;
    z-index: 1;
}

.crystal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform-style: preserve-3d;
}

.crystal .face {
    position: absolute;
    border: 1px solid rgba(0, 255, 170, 0.3);
    background: rgba(0, 255, 170, 0.05);
}

.crystal-1 {
    width: 120px; height: 180px;
    margin-left: -60px; margin-top: -90px;
    animation: crystalRotate1 45s linear infinite;
    opacity: 0;
    animation: crystalFadeIn 2s ease forwards 0.2s, crystalRotate1 45s linear infinite 2.2s;
}
.crystal-1 .face-a {
    width: 120px; height: 180px;
    clip-path: polygon(50% 0%, 100% 30%, 100% 70%, 50% 100%, 0% 70%, 0% 30%);
    background: rgba(0, 255, 170, 0.06);
    border: none;
    box-shadow: inset 0 0 20px rgba(0, 255, 170, 0.05);
}
.crystal-1 .face-b {
    width: 100px; height: 160px;
    left: 10px; top: 10px;
    clip-path: polygon(50% 0%, 95% 25%, 95% 75%, 50% 100%, 5% 75%, 5% 25%);
    background: rgba(0, 212, 170, 0.04);
    border: none;
    border-right: 1px solid rgba(0, 255, 170, 0.2);
}
.crystal-1 .face-c {
    width: 80px; height: 140px;
    left: 20px; top: 20px;
    clip-path: polygon(50% 5%, 90% 28%, 90% 72%, 50% 95%, 10% 72%, 10% 28%);
    background: rgba(0, 255, 170, 0.08);
    border: none;
}

.crystal-2 {
    width: 80px; height: 130px;
    margin-left: 40px; margin-top: -100px;
    opacity: 0;
    animation: crystalFadeIn 2s ease forwards 0.4s, crystalRotate2 60s linear infinite 2.4s;
}
.crystal-2 .face-a {
    width: 80px; height: 130px;
    clip-path: polygon(50% 0%, 100% 35%, 80% 100%, 20% 100%, 0% 35%);
    background: rgba(0, 255, 170, 0.07);
}
.crystal-2 .face-b {
    width: 60px; height: 110px;
    left: 10px; top: 10px;
    clip-path: polygon(50% 0%, 100% 35%, 80% 100%, 20% 100%, 0% 35%);
    background: rgba(0, 212, 170, 0.05);
}
.crystal-2 .face-c {
    width: 40px; height: 90px;
    left: 20px; top: 20px;
    clip-path: polygon(50% 5%, 95% 38%, 75% 95%, 25% 95%, 5% 38%);
    background: rgba(0, 255, 170, 0.1);
}

.crystal-3 {
    width: 100px; height: 160px;
    margin-left: -120px; margin-top: -50px;
    opacity: 0;
    animation: crystalFadeIn 2s ease forwards 0.6s, crystalRotate3 75s linear infinite 2.6s;
}
.crystal-3 .face-a {
    width: 100px; height: 160px;
    clip-path: polygon(30% 0%, 70% 0%, 100% 50%, 70% 100%, 30% 100%, 0% 50%);
    background: rgba(0, 255, 170, 0.05);
    border: 1px solid rgba(0, 255, 170, 0.15);
}
.crystal-3 .face-b {
    width: 80px; height: 130px;
    left: 10px; top: 15px;
    clip-path: polygon(30% 0%, 70% 0%, 100% 50%, 70% 100%, 30% 100%, 0% 50%);
    background: rgba(0, 212, 170, 0.03);
}
.crystal-3 .face-c {
    width: 60px; height: 100px;
    left: 20px; top: 30px;
    clip-path: polygon(30% 5%, 70% 5%, 95% 50%, 70% 95%, 30% 95%, 5% 50%);
    background: rgba(0, 255, 170, 0.08);
}

.crystal-4 {
    width: 60px; height: 100px;
    margin-left: 80px; margin-top: 20px;
    opacity: 0;
    animation: crystalFadeIn 2s ease forwards 0.8s, crystalRotate1 55s linear infinite 2.8s;
}
.crystal-4 .face-a {
    width: 60px; height: 100px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: rgba(255, 45, 123, 0.04);
    border: 1px solid rgba(255, 45, 123, 0.15);
}
.crystal-4 .face-b {
    width: 45px; height: 80px;
    left: 8px; top: 10px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: rgba(255, 45, 123, 0.06);
}
.crystal-4 .face-c {
    width: 30px; height: 60px;
    left: 15px; top: 20px;
    clip-path: polygon(50% 5%, 95% 28%, 95% 72%, 50% 95%, 5% 72%, 5% 28%);
    background: rgba(255, 45, 123, 0.08);
}

.crystal-5 {
    width: 90px; height: 140px;
    margin-left: -80px; margin-top: 50px;
    opacity: 0;
    animation: crystalFadeIn 2s ease forwards 1s, crystalRotate2 40s linear infinite 3s;
}
.crystal-5 .face-a {
    width: 90px; height: 140px;
    clip-path: polygon(50% 0%, 100% 40%, 75% 100%, 25% 100%, 0% 40%);
    background: rgba(0, 255, 170, 0.06);
    border: 1px solid rgba(0, 255, 170, 0.2);
}
.crystal-5 .face-b {
    width: 70px; height: 110px;
    left: 10px; top: 15px;
    clip-path: polygon(50% 0%, 100% 40%, 75% 100%, 25% 100%, 0% 40%);
    background: rgba(0, 212, 170, 0.04);
}
.crystal-5 .face-c {
    width: 50px; height: 80px;
    left: 20px; top: 30px;
    clip-path: polygon(50% 5%, 95% 42%, 72% 95%, 28% 95%, 5% 42%);
    background: rgba(0, 255, 170, 0.09);
}

.crystal-6 {
    width: 70px; height: 110px;
    margin-left: 30px; margin-top: 80px;
    opacity: 0;
    animation: crystalFadeIn 2s ease forwards 1.2s, crystalRotate3 90s linear infinite 3.2s;
}
.crystal-6 .face-a {
    width: 70px; height: 110px;
    clip-path: polygon(40% 0%, 80% 15%, 100% 55%, 60% 100%, 20% 85%, 0% 45%);
    background: rgba(0, 255, 170, 0.05);
    border: 1px solid rgba(0, 255, 170, 0.18);
}
.crystal-6 .face-b {
    width: 55px; height: 85px;
    left: 8px; top: 13px;
    clip-path: polygon(40% 0%, 80% 15%, 100% 55%, 60% 100%, 20% 85%, 0% 45%);
    background: rgba(0, 212, 170, 0.03);
}
.crystal-6 .face-c {
    width: 40px; height: 60px;
    left: 15px; top: 25px;
    clip-path: polygon(40% 5%, 78% 18%, 95% 52%, 58% 95%, 22% 82%, 5% 48%);
    background: rgba(0, 255, 170, 0.07);
}
.crystal-6 .face-d {
    width: 25px; height: 40px;
    left: 22px; top: 35px;
    clip-path: polygon(50% 0%, 100% 30%, 80% 100%, 20% 100%, 0% 30%);
    background: rgba(0, 255, 170, 0.12);
}

.crystal-7 {
    width: 50px; height: 80px;
    margin-left: -150px; margin-top: -120px;
    opacity: 0;
    animation: crystalFadeIn 2s ease forwards 1.4s, crystalRotate1 35s linear infinite 3.4s;
}
.crystal-7 .face-a {
    width: 50px; height: 80px;
    clip-path: polygon(50% 0%, 100% 30%, 100% 70%, 50% 100%, 0% 70%, 0% 30%);
    background: rgba(0, 212, 170, 0.07);
    border: 1px solid rgba(0, 212, 170, 0.2);
}
.crystal-7 .face-b {
    width: 35px; height: 60px;
    left: 8px; top: 10px;
    clip-path: polygon(50% 0%, 100% 30%, 100% 70%, 50% 100%, 0% 70%, 0% 30%);
    background: rgba(0, 255, 170, 0.04);
}
.crystal-7 .face-c {
    width: 20px; height: 40px;
    left: 15px; top: 20px;
    clip-path: polygon(50% 5%, 95% 32%, 95% 68%, 50% 95%, 5% 68%, 5% 32%);
    background: rgba(0, 255, 170, 0.1);
}

@keyframes crystalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes crystalRotate1 {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes crystalRotate2 {
    from { transform: translate(-50%, -50%) rotate(0deg) scale(1); }
    to { transform: translate(-50%, -50%) rotate(-360deg) scale(1); }
}

@keyframes crystalRotate3 {
    from { transform: translate(-50%, -50%) rotate(15deg); }
    to { transform: translate(-50%, -50%) rotate(375deg); }
}

/* ========== Specimen Grid ========== */
.scene-grid {
    position: relative;
    z-index: 1;
    padding: 40px 60px 40px 60px;
}

.specimen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2px;
    max-width: 1400px;
    margin: 0 auto;
}

.specimen-card {
    background: rgba(17, 14, 28, 0.85);
    padding: 32px 28px;
    border-radius: 0;
    position: relative;
    box-shadow: inset 0 0 30px rgba(0, 255, 170, 0.03);
    transition: transform 400ms var(--hover-curve), box-shadow 400ms ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.specimen-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(0, 255, 170, 0.03) 10px,
        rgba(0, 255, 170, 0.03) 11px
    ),
    repeating-linear-gradient(
        -30deg,
        transparent,
        transparent 10px,
        rgba(0, 255, 170, 0.02) 10px,
        rgba(0, 255, 170, 0.02) 11px
    );
    opacity: 0;
    transition: opacity 400ms ease;
    pointer-events: none;
}

.specimen-card:hover::before {
    opacity: 1;
}

.specimen-card:hover {
    transform: translateY(-4px);
    box-shadow:
        inset 0 0 30px rgba(0, 255, 170, 0.08),
        0 0 20px rgba(0, 255, 170, 0.1),
        0 0 60px rgba(0, 255, 170, 0.03);
}

/* Card entering animation */
.specimen-card.observe-me {
    opacity: 0;
    transform: translateY(20px);
}

.specimen-card.observe-me.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 600ms ease, transform 600ms var(--hover-curve);
}

.specimen-card.observe-me.visible:hover {
    transform: translateY(-4px);
}

.card-span-2col {
    grid-column: span 2;
}

.card-span-2row {
    grid-row: span 2;
}

.card-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(0, 255, 170, 0.6);
}

.card-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    color: var(--text-display);
    letter-spacing: 0.01em;
    line-height: 1.3;
}

.card-body {
    font-family: var(--font-body);
    color: var(--text-primary);
    font-size: clamp(0.9rem, 1.5vw, 1rem);
    line-height: 1.7;
    flex: 1;
}

.card-meta {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(0, 255, 170, 0.4);
    margin-top: auto;
    padding-top: 8px;
}

/* Card inline crystal decoration */
.card-crystal-inline {
    position: relative;
    height: 80px;
    margin: 12px 0;
}

.mini-crystal {
    position: absolute;
    border: 1px solid rgba(0, 255, 170, 0.2);
    background: rgba(0, 255, 170, 0.04);
}

.mc-1 {
    width: 40px; height: 60px; left: 20%;
    clip-path: polygon(50% 0%, 100% 30%, 100% 70%, 50% 100%, 0% 70%, 0% 30%);
    animation: crystalRotate1 30s linear infinite;
}

.mc-2 {
    width: 30px; height: 50px; left: 45%; top: 10px;
    clip-path: polygon(50% 0%, 100% 35%, 80% 100%, 20% 100%, 0% 35%);
    background: rgba(255, 45, 123, 0.04);
    border-color: rgba(255, 45, 123, 0.2);
    animation: crystalRotate2 40s linear infinite;
}

.mc-3 {
    width: 35px; height: 55px; left: 65%; top: 5px;
    clip-path: polygon(30% 0%, 70% 0%, 100% 50%, 70% 100%, 30% 100%, 0% 50%);
    animation: crystalRotate3 50s linear infinite;
}

/* ========== Stratum Dividers ========== */
.stratum {
    position: relative;
    z-index: 1;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(180deg,
            var(--bg-primary) 0%,
            #4A2817 8%,
            #6B3F2A 15%,
            #8B5E3C 22%,
            #6B3F2A 30%,
            var(--bg-primary) 38%,
            rgba(0, 255, 170, 0.05) 40%,
            var(--bg-primary) 42%,
            #4A2817 55%,
            #8B5E3C 62%,
            #6B3F2A 70%,
            var(--bg-primary) 78%,
            rgba(0, 255, 170, 0.03) 82%,
            var(--bg-primary) 85%,
            #4A2817 92%,
            var(--bg-primary) 100%
        );
    overflow: hidden;
}

.stratum::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(0, 255, 170, 0.05) 30%,
        transparent 50%,
        rgba(0, 255, 170, 0.03) 70%,
        transparent 100%
    );
    animation: glowPulse 4s ease-in-out infinite;
}

.stratum-text {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(0, 255, 170, 0.4);
    position: relative;
    z-index: 2;
}

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

/* ========== Scene 5: The Deep ========== */
.scene-deep {
    position: relative;
    z-index: 1;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
}

.deep-crystal {
    position: relative;
    width: 200px;
    height: 300px;
    animation: crystalRotate1 60s linear infinite;
}

.deep-crystal .face {
    position: absolute;
    border: 1px solid rgba(0, 255, 170, 0.25);
    background: rgba(0, 255, 170, 0.04);
}

.deep-crystal .face-a {
    width: 200px; height: 300px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: rgba(0, 255, 170, 0.05);
}

.deep-crystal .face-b {
    width: 160px; height: 250px;
    left: 20px; top: 25px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: rgba(0, 212, 170, 0.03);
    border-color: rgba(0, 255, 170, 0.15);
}

.deep-crystal .face-c {
    width: 120px; height: 200px;
    left: 40px; top: 50px;
    clip-path: polygon(50% 3%, 97% 27%, 97% 73%, 50% 97%, 3% 73%, 3% 27%);
    background: rgba(0, 255, 170, 0.07);
    border-color: rgba(0, 255, 170, 0.1);
}

.deep-crystal .face-d {
    width: 80px; height: 140px;
    left: 60px; top: 80px;
    clip-path: polygon(50% 5%, 95% 28%, 95% 72%, 50% 95%, 5% 72%, 5% 28%);
    background: rgba(0, 255, 170, 0.1);
    border-color: rgba(0, 255, 170, 0.2);
}

.deep-signature {
    font-family: var(--font-mono);
    font-size: 12px;
    color: rgba(0, 255, 170, 0.3);
    letter-spacing: 0.08em;
    text-transform: lowercase;
    margin-top: 60px;
}

/* ========== Mobile ========== */
@media (max-width: 768px) {
    .spine { display: none; }
    .monogram { left: 16px; top: 12px; }

    .scene-grid {
        padding: 20px 16px;
    }

    .specimen-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .specimen-card {
        border-bottom: 1px solid rgba(0, 255, 170, 0.15);
    }

    .card-span-2col,
    .card-span-2row {
        grid-column: span 1;
        grid-row: span 1;
    }

    .crystal-cluster {
        width: 300px;
        height: 300px;
    }
}
