/* a6c.xyz — Goblincore Geological Strata */
/* Color Palette as CSS Custom Properties */
:root {
    --forest: #1B2A1E;
    --mineral: #7ED4A6;
    --stone: #F2EDE4;
    --amber: #D4A24E;
    --moss: #5C7A5E;
    --geode: #A8E06C;
    --specimen-white: #F0F5ED;
    --buried: #2C3A2E;
    --warm-stone: #EDE7D8;
    --cool-stone: #E8EDE4;

    --font-display: 'Josefin Sans', sans-serif;
    --font-body: 'DM Sans', sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;

    --fracture-1: polygon(0% 100%, 5% 96%, 10% 100%, 15% 97%, 20% 100%, 25% 95%, 30% 99%, 35% 96%, 40% 100%, 45% 97%, 50% 94%, 55% 98%, 60% 95%, 65% 100%, 70% 96%, 75% 99%, 80% 95%, 85% 100%, 90% 97%, 95% 94%, 100% 100%);
    --fracture-2: polygon(0% 100%, 4% 95%, 8% 98%, 14% 93%, 20% 97%, 26% 94%, 32% 100%, 38% 95%, 44% 98%, 50% 93%, 56% 97%, 62% 95%, 68% 100%, 74% 94%, 80% 98%, 86% 93%, 92% 97%, 96% 95%, 100% 100%);
    --fracture-3: polygon(0% 100%, 6% 97%, 12% 94%, 18% 99%, 24% 95%, 30% 98%, 36% 93%, 42% 97%, 48% 100%, 54% 94%, 60% 98%, 66% 93%, 72% 97%, 78% 95%, 84% 100%, 90% 94%, 96% 98%, 100% 100%);
    --fracture-4: polygon(0% 100%, 7% 96%, 13% 100%, 19% 94%, 25% 98%, 31% 95%, 37% 100%, 43% 96%, 49% 93%, 55% 98%, 61% 95%, 67% 100%, 73% 94%, 79% 97%, 85% 93%, 91% 98%, 97% 96%, 100% 100%);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    color: var(--buried);
    background: var(--forest);
    overflow-x: hidden;
    line-height: 1.75;
}

/* Hidden SVG filters */
.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* ===== STRATUM BASE ===== */
.stratum {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.stratum-dark {
    background-color: var(--forest);
    color: var(--specimen-white);
}

.stratum-light {
    background-color: var(--stone);
    color: var(--buried);
}

.stratum-warm {
    background-color: var(--warm-stone);
    color: var(--buried);
}

.stratum-cool {
    background-color: var(--cool-stone);
    color: var(--buried);
}

.stratum-content {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 calc(100% / 12);
}

/* ===== STRATUM 1: HERO ===== */
#stratum-1 {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.stratum-1-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
}

.hero-crystal {
    position: absolute;
    width: 50vmin;
    height: 50vmin;
    max-width: 400px;
    max-height: 400px;
    z-index: 1;
}

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

.hero-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 14vw;
    letter-spacing: -0.02em;
    color: var(--specimen-white);
    position: relative;
    z-index: 3;
    line-height: 1;
    mix-blend-mode: screen;
}

.hero-title .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    animation: crystal-grow 0.6s ease-out forwards;
}

.hero-title .char:nth-child(1) { animation-delay: 0.1s; }
.hero-title .char:nth-child(2) { animation-delay: 0.14s; }
.hero-title .char:nth-child(3) { animation-delay: 0.18s; }
.hero-title .char:nth-child(4) { animation-delay: 0.22s; }
.hero-title .char:nth-child(5) { animation-delay: 0.26s; }
.hero-title .char:nth-child(6) { animation-delay: 0.30s; }
.hero-title .char:nth-child(7) { animation-delay: 0.34s; }

@keyframes crystal-grow {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: 6vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 5;
}

.scroll-pulse {
    width: 2px;
    height: 40px;
    background: var(--mineral);
    border-radius: 1px;
    animation: pulse-down 2s ease-in-out infinite;
}

@keyframes pulse-down {
    0%, 100% { opacity: 0.3; transform: scaleY(0.6); }
    50% { opacity: 1; transform: scaleY(1); }
}

/* ===== STRATUM 2: F-PATTERN FIRST BAR ===== */
#stratum-2 {
    min-height: 80vh;
    padding: 12vh 0;
}

.stratum-2-grid {
    display: grid;
    grid-template-columns: 6fr 3fr;
    gap: 48px;
    align-items: center;
}

.text-block {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.crystal-cluster-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.crystal-icon {
    width: 120px;
    height: 120px;
    transition: transform 0.3s ease;
}

.crystal-icon-2 {
    width: 100px;
    height: 100px;
    margin-left: 30px;
}

.crystal-icon-3 {
    width: 140px;
    height: 140px;
    margin-right: 20px;
}

/* ===== STRATUM 3: SPECIMEN CARDS ===== */
#stratum-3 {
    min-height: 70vh;
    padding: 12vh 0;
}

.stratum-3-content {
    display: flex;
    flex-direction: column;
    gap: 48px;
}

.specimen-row {
    display: flex;
    gap: 32px;
    align-items: flex-start;
    width: 80%;
}

.specimen-card {
    padding: 32px 28px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: rgba(255, 255, 255, 0.4);
    clip-path: polygon(8% 0%, 100% 0%, 100% 85%, 92% 100%, 0% 100%, 0% 15%);
    transition: box-shadow 0.3s ease;
}

.specimen-card-1 { min-height: 280px; }
.specimen-card-2 { min-height: 320px; margin-top: 24px; }
.specimen-card-3 { min-height: 260px; margin-top: 48px; }

.specimen-card::before {
    content: '';
    position: absolute;
    inset: 1px;
    background: rgba(255, 255, 255, 0.6);
    clip-path: polygon(8% 0%, 100% 0%, 100% 85%, 92% 100%, 0% 100%, 0% 15%);
    z-index: -1;
}

.card-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 24px;
    color: var(--forest);
    letter-spacing: -0.01em;
}

.card-body {
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.75;
    color: var(--buried);
}

.card-crystal {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.diamond-bullet {
    width: 8px;
    height: 8px;
    background: var(--mineral);
    transform: rotate(45deg);
}

/* ===== STRATUM 4: DESCENT ===== */
#stratum-4 {
    min-height: 90vh;
    padding: 12vh 0;
}

.stratum-4-content {
    display: flex;
    flex-direction: column;
    gap: 8vh;
    align-items: flex-start;
}

.descent-block {
    display: flex;
    flex-direction: column;
    gap: 16px;
    border-left: 2px solid var(--mineral);
    padding-left: 24px;
}

.descent-wide { width: 70%; }
.descent-medium { width: 60%; margin-left: 5%; }
.descent-narrow { width: 50%; margin-left: 10%; }

.descent-text-sm { font-size: 16px; }
.descent-text-xs { font-size: 15px; }

/* ===== STRATUM 5: CLOSING ===== */
#stratum-5 {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stratum-5-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    gap: 48px;
}

.closing-phrase {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(32px, 6vw, 64px);
    color: var(--mineral);
    letter-spacing: -0.02em;
}

.closing-phrase .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
}

.closing-phrase.revealed .char {
    animation: crystal-grow 0.5s ease-out forwards;
}

.closing-phrase .char:nth-child(1) { animation-delay: 0.03s; }
.closing-phrase .char:nth-child(2) { animation-delay: 0.06s; }
.closing-phrase .char:nth-child(3) { animation-delay: 0.09s; }
.closing-phrase .char:nth-child(4) { animation-delay: 0.12s; }
.closing-phrase .char:nth-child(5) { animation-delay: 0.15s; }
.closing-phrase .char:nth-child(6) { animation-delay: 0.18s; }
.closing-phrase .char:nth-child(7) { animation-delay: 0.21s; }
.closing-phrase .char:nth-child(8) { animation-delay: 0.24s; }
.closing-phrase .char:nth-child(9) { animation-delay: 0.27s; }
.closing-phrase .char:nth-child(10) { animation-delay: 0.30s; }
.closing-phrase .char:nth-child(11) { animation-delay: 0.33s; }
.closing-phrase .char:nth-child(12) { animation-delay: 0.36s; }
.closing-phrase .char:nth-child(13) { animation-delay: 0.39s; }
.closing-phrase .char:nth-child(14) { animation-delay: 0.42s; }
.closing-phrase .char:nth-child(15) { animation-delay: 0.45s; }
.closing-phrase .char:nth-child(16) { animation-delay: 0.48s; }
.closing-phrase .char:nth-child(17) { animation-delay: 0.51s; }

/* Shattered crystal */
.shattered-crystal {
    position: relative;
    width: 300px;
    height: 300px;
}

.shard-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: transform 30s ease-out, opacity 30s ease-out;
}

.shattered-crystal.shattered .shard-frag-1 { transform: translate(-30px, -40px) rotate(-8deg); opacity: 0.7; }
.shattered-crystal.shattered .shard-frag-2 { transform: translate(40px, -20px) rotate(5deg); opacity: 0.6; }
.shattered-crystal.shattered .shard-frag-3 { transform: translate(-50px, -10px) rotate(-12deg); opacity: 0.7; }
.shattered-crystal.shattered .shard-frag-4 { transform: translate(-40px, 30px) rotate(8deg); opacity: 0.5; }
.shattered-crystal.shattered .shard-frag-5 { transform: translate(0px, 50px) rotate(3deg); opacity: 0.8; }
.shattered-crystal.shattered .shard-frag-6 { transform: translate(50px, 40px) rotate(-6deg); opacity: 0.4; }
.shattered-crystal.shattered .shard-frag-7 { transform: translate(-60px, 50px) rotate(10deg); opacity: 0.4; }

.closing-label {
    color: var(--moss);
}

/* ===== FRACTURE EDGES ===== */
.fracture-edge {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    z-index: 3;
}

.fracture-1 {
    background: var(--stone);
    clip-path: var(--fracture-1);
}

.fracture-2 {
    background: var(--warm-stone);
    clip-path: var(--fracture-2);
}

.fracture-3 {
    background: var(--cool-stone);
    clip-path: var(--fracture-3);
}

.fracture-4 {
    background: var(--forest);
    clip-path: var(--fracture-4);
}

/* ===== TYPOGRAPHY ===== */
.section-heading {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(36px, 5vw, 64px);
    letter-spacing: -0.02em;
    color: var(--forest);
    line-height: 1.1;
}

.section-heading .char-wrap {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.section-heading.revealed .char-wrap {
    opacity: 1;
    transform: translateY(0);
}

.body-text {
    font-family: var(--font-body);
    font-size: 18px;
    font-weight: 400;
    line-height: 1.75;
    color: var(--buried);
}

.specimen-label {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--moss);
}

.stratum-dark .section-heading {
    color: var(--specimen-white);
}

.stratum-dark .body-text {
    color: var(--specimen-white);
    opacity: 0.85;
}

.stratum-dark .specimen-label {
    color: var(--mineral);
    opacity: 0.6;
}

/* ===== CRYSTAL DECORATIONS ===== */
.crystal-cluster-decor {
    position: absolute;
    z-index: 1;
}

.cluster-tl {
    top: 40px;
    left: 20px;
}

.cluster-br {
    bottom: 60px;
    right: 40px;
}

.crystal-shard {
    position: absolute;
    width: 3px;
    background: var(--moss);
    opacity: 0.4;
}

.shard-1 {
    height: 60px;
    transform: rotate(15deg);
    top: 0;
    left: 0;
}

.shard-2 {
    height: 45px;
    transform: rotate(-20deg);
    top: 10px;
    left: 15px;
}

.shard-3 {
    height: 35px;
    transform: rotate(35deg);
    top: 5px;
    left: 30px;
}

.shard-4 {
    height: 50px;
    transform: rotate(-10deg);
    top: 0;
    left: 0;
    background: var(--mineral);
}

.shard-5 {
    height: 70px;
    transform: rotate(25deg);
    top: -10px;
    left: 20px;
    background: var(--amber);
    opacity: 0.3;
}

/* ===== SEISMIC TREMOR ANIMATION ===== */
@keyframes seismic-tremor {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    20% { transform: translate(-2px, 1px) rotate(-0.5deg); }
    40% { transform: translate(2px, -1px) rotate(0.5deg); }
    60% { transform: translate(-1px, 2px) rotate(-0.3deg); }
    80% { transform: translate(1px, -2px) rotate(0.3deg); }
}

.crystal-element:hover {
    animation: seismic-tremor 0.15s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

/* ===== CRYSTAL ROTATION ===== */
@keyframes slow-rotate {
    from { transform: rotateY(0deg); }
    to { transform: rotateY(360deg); }
}

.hero-crystal {
    perspective: 800px;
}

.crystal-svg {
    animation: slow-rotate 30s linear infinite;
    transform-style: preserve-3d;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .stratum-2-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .crystal-cluster-right {
        flex-direction: row;
        justify-content: center;
    }

    .crystal-icon,
    .crystal-icon-2,
    .crystal-icon-3 {
        width: 80px;
        height: 80px;
        margin: 0;
    }

    .specimen-row {
        flex-direction: column;
        width: 100%;
    }

    .specimen-card-2 { margin-top: 0; }
    .specimen-card-3 { margin-top: 0; }

    .descent-wide,
    .descent-medium,
    .descent-narrow {
        width: 100%;
        margin-left: 0;
    }

    .hero-title {
        font-size: 20vw;
    }

    .shattered-crystal {
        width: 200px;
        height: 200px;
    }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    .crystal-svg {
        animation: none;
    }

    .crystal-element:hover {
        animation: none;
    }

    .hero-title .char,
    .closing-phrase .char {
        animation: none;
        opacity: 1;
        transform: none;
    }

    .scroll-pulse {
        animation: none;
        opacity: 0.6;
    }

    .shard-svg {
        transition: none;
    }
}
