/* ============================================================
   rollup.report — Geological Observatory Design
   Jewel-tone mineral palette | Serif-revival typography
   ============================================================ */

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

:root {
    /* Palette */
    --bg-primary: #0E0B16;
    --bg-stratum-alt: #1A1225;
    --accent-sapphire: #1B4D3E;
    --accent-ruby: #8B2252;
    --accent-amethyst: #5B2C6F;
    --text-headline: #E8D5B5;
    --text-body: #C4B8A0;
    --text-data: #7B8D6E;
    --highlight-topaz: #D4A017;
    --divider: #2D1B3D;
    --deep-black: #080510;

    /* Typography */
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Lora', Georgia, serif;
    --font-mono: 'IBM Plex Mono', 'Courier New', monospace;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-body);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.1vw, 1.15rem);
    line-height: 1.75;
    overflow-x: hidden;
}

/* ============================================================
   Progress Bar — Left Edge
   ============================================================ */

#progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 3px;
    height: 0%;
    background: linear-gradient(to bottom, var(--accent-sapphire), var(--accent-amethyst), var(--accent-ruby));
    z-index: 100;
    transition: height 0.1s linear;
}

/* ============================================================
   Depth Indicator — Dot Navigation
   ============================================================ */

#depth-indicator {
    position: fixed;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 14px;
    z-index: 100;
}

.depth-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1.5px solid var(--divider);
    background: transparent;
    cursor: pointer;
    transition: background-color 0.4s ease, border-color 0.4s ease, transform 0.3s ease;
    padding: 0;
}

.depth-dot:hover {
    border-color: var(--highlight-topaz);
    transform: scale(1.3);
}

.depth-dot.active {
    background-color: var(--highlight-topaz);
    border-color: var(--highlight-topaz);
}

/* Dot color progression */
.depth-dot:nth-child(1).active { background-color: var(--accent-sapphire); border-color: var(--accent-sapphire); }
.depth-dot:nth-child(2).active { background-color: #2A5F4F; border-color: #2A5F4F; }
.depth-dot:nth-child(3).active { background-color: var(--accent-amethyst); border-color: var(--accent-amethyst); }
.depth-dot:nth-child(4).active { background-color: #6E3A5E; border-color: #6E3A5E; }
.depth-dot:nth-child(5).active { background-color: var(--accent-ruby); border-color: var(--accent-ruby); }
.depth-dot:nth-child(6).active { background-color: var(--highlight-topaz); border-color: var(--highlight-topaz); }

/* ============================================================
   Parallax Mountain Background
   ============================================================ */

#parallax-mountain {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    opacity: 0.3;
}

#parallax-mountain svg {
    width: 100%;
    height: 100%;
}

/* ============================================================
   Strata — Common
   ============================================================ */

.stratum {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

.stratum-content {
    max-width: 680px;
    width: 100%;
    padding: 80px 20px;
    margin: 0 auto;
    position: relative;
}

.stratum-heading {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    letter-spacing: 0.02em;
    color: var(--text-headline);
    margin-bottom: 1.5rem;
}

.stratum-intro {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 1.1rem;
    color: var(--text-body);
    margin-bottom: 2.5rem;
    opacity: 0.85;
}

.stratum-divider {
    width: 100%;
    height: 4px;
    position: absolute;
    bottom: 0;
    left: 0;
}

.stratum-divider svg {
    width: 100%;
    height: 4px;
}

/* ============================================================
   Stratum 1: Summit (Hero)
   ============================================================ */

.stratum-summit {
    background: linear-gradient(180deg, var(--deep-black) 0%, var(--bg-primary) 100%);
    min-height: 100vh;
    overflow: hidden;
}

.stratum-summit .stratum-content {
    max-width: 100%;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
}

.hero-mountain {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 60vh;
    opacity: 0.9;
}

.hero-text {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 0 40px;
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 6rem);
    letter-spacing: 0.02em;
    color: var(--text-headline);
    margin-bottom: 1rem;
    text-shadow: 0 4px 30px rgba(14, 11, 22, 0.8);
}

.hero-tagline {
    font-family: var(--font-body);
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1rem, 2vw, 1.4rem);
    color: var(--text-body);
    opacity: 0.8;
    max-width: 600px;
    margin: 0 auto;
    text-shadow: 0 2px 20px rgba(14, 11, 22, 0.9);
}

/* ============================================================
   Stratum 2: Ridge Line (Overview) — Card-Flip
   ============================================================ */

.stratum-ridge {
    background-color: var(--bg-stratum-alt);
}

.card-arc {
    display: flex;
    gap: 24px;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: wrap;
}

.flip-card {
    width: 200px;
    height: 280px;
    perspective: 1000px;
    cursor: pointer;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.flip-card.flipped .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 8px;
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.flip-card-front {
    justify-content: center;
    align-items: center;
    text-align: center;
}

.flip-card-back {
    transform: rotateY(180deg);
    background-color: var(--bg-primary);
    border: 1px solid var(--divider);
    padding: 20px 16px;
    justify-content: center;
    position: relative;
}

.flip-card-back::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 40 Q60 30 100 42 T180 38' fill='none' stroke='%237B8D6E' stroke-width='0.5' opacity='0.15'/%3E%3Cpath d='M10 80 Q70 70 130 85 T190 75' fill='none' stroke='%237B8D6E' stroke-width='0.5' opacity='0.12'/%3E%3Cpath d='M15 120 Q55 115 100 125 T185 118' fill='none' stroke='%237B8D6E' stroke-width='0.5' opacity='0.1'/%3E%3Cpath d='M20 160 Q80 150 140 162 T180 155' fill='none' stroke='%237B8D6E' stroke-width='0.5' opacity='0.08'/%3E%3C/svg%3E") center/cover no-repeat;
    opacity: 0.08;
    pointer-events: none;
}

.flip-card-back p {
    font-family: var(--font-body);
    font-size: 0.88rem;
    line-height: 1.65;
    color: var(--text-body);
    position: relative;
    z-index: 1;
}

/* Card front styles per jewel */
.card-sapphire {
    background: linear-gradient(135deg, var(--accent-sapphire), var(--accent-amethyst));
}

.card-amethyst {
    background: linear-gradient(135deg, var(--accent-amethyst), #3D1F4F);
}

.card-ruby {
    background: linear-gradient(135deg, var(--accent-ruby), var(--highlight-topaz));
}

.card-gem {
    margin-bottom: 16px;
    opacity: 0.9;
}

.flip-card-front h3 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-headline);
    margin-bottom: 12px;
    letter-spacing: 0.02em;
}

.card-metric {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 2.2rem;
    color: #FFFFFF;
    line-height: 1;
    margin-bottom: 6px;
}

.card-metric small {
    font-size: 0.9rem;
    opacity: 0.7;
    margin-left: 2px;
}

.card-label {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-data);
    margin-top: 4px;
}

/* ============================================================
   Stratum 3: Exposed Strata (Data Layer)
   ============================================================ */

.stratum-data {
    background-color: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

.mineral-texture {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(27, 77, 62, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 60%, rgba(91, 44, 111, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(139, 34, 82, 0.04) 0%, transparent 50%);
    pointer-events: none;
}

.data-points {
    display: flex;
    flex-direction: column;
    gap: 60px;
}

.data-point {
    text-align: center;
    position: relative;
}

.data-number {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: clamp(3rem, 8vw, 6rem);
    color: var(--text-headline);
    line-height: 1;
    display: inline;
}

.data-unit {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: clamp(1.2rem, 3vw, 2rem);
    color: var(--highlight-topaz);
    margin-left: 8px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.data-caption {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text-body);
    margin-top: 12px;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0.8;
}

.contour-line {
    display: block;
    width: 100%;
    max-width: 500px;
    height: 40px;
    margin: 16px auto 0;
}

.contour-line path {
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    transition: stroke-dashoffset 1.5s ease-out;
}

.stratum-data.visible .contour-line path {
    stroke-dashoffset: 0;
}

/* ============================================================
   Stratum 4: Core Sample (Deep Narrative)
   ============================================================ */

.stratum-core {
    background-color: var(--bg-stratum-alt);
}

.narrative-body {
    position: relative;
}

.narrative-body p {
    margin-bottom: 1.8rem;
    color: var(--text-body);
}

.pull-quote {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.4rem, 3vw, 2rem);
    color: var(--highlight-topaz);
    border-left: 3px solid var(--highlight-topaz);
    padding-left: 24px;
    margin: 2.5rem 0;
    line-height: 1.45;
    letter-spacing: 0.01em;
}

/* ============================================================
   Stratum 5: Mineral Gallery (Visual Evidence)
   ============================================================ */

.stratum-gallery {
    background-color: var(--bg-primary);
}

.gallery-plates {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
    margin-top: 1rem;
}

.gallery-card {
    width: 100%;
    height: 320px;
    transform: rotate(var(--rotation, 0deg));
    transition: transform 0.4s ease;
}

.gallery-card:hover {
    transform: rotate(0deg) scale(1.02);
    z-index: 2;
}

.gallery-front {
    background-color: var(--bg-stratum-alt);
    border: 1px solid var(--divider);
    text-align: center;
    justify-content: flex-start;
    align-items: center;
}

.gallery-back {
    background-color: var(--bg-stratum-alt);
}

.specimen-visual {
    width: 100%;
    height: 160px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 14px;
}

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

.gallery-front h4 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-headline);
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}

.specimen-label {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-data);
}

/* ============================================================
   Stratum 6: Bedrock (Conclusion)
   ============================================================ */

.stratum-bedrock {
    background: linear-gradient(180deg, var(--bg-stratum-alt) 0%, var(--bg-primary) 40%, var(--deep-black) 100%);
    min-height: 100vh;
    position: relative;
}

.stratum-bedrock .stratum-content {
    max-width: 100%;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.inverted-mountain {
    width: 100%;
    max-height: 25vh;
    display: block;
}

.bedrock-text {
    max-width: 680px;
    width: 100%;
    padding: 60px 20px 120px;
    text-align: center;
}

.bedrock-text p {
    margin-bottom: 1.5rem;
    color: var(--text-body);
}

.bedrock-signature {
    margin-top: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.signature-label {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-data);
}

.signature-value {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    color: var(--text-headline);
    letter-spacing: 0.02em;
}

.signature-timestamp {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--highlight-topaz);
    opacity: 0.7;
}

#core-sample-line {
    position: absolute;
    left: 50%;
    top: 0;
    width: 2px;
    height: 0%;
    background: linear-gradient(to bottom, transparent, var(--highlight-topaz));
    transform: translateX(-50%);
    transition: height 1.5s ease-out;
    pointer-events: none;
    opacity: 0.5;
}

.stratum-bedrock.visible #core-sample-line {
    height: 100%;
}

/* ============================================================
   Mobile Responsive
   ============================================================ */

@media (max-width: 768px) {
    .stratum {
        min-height: 70vh;
    }

    .stratum-content {
        padding: 60px 20px;
    }

    #depth-indicator {
        left: 8px;
        gap: 10px;
    }

    .depth-dot {
        width: 6px;
        height: 6px;
    }

    .card-arc {
        flex-direction: column;
        align-items: center;
    }

    .flip-card {
        width: 100%;
        max-width: 280px;
        height: 260px;
    }

    .gallery-plates {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .gallery-card {
        transform: rotate(0deg) !important;
        height: 300px;
    }

    .hero-title {
        font-size: clamp(2.4rem, 10vw, 4rem);
    }

    .data-number {
        font-size: clamp(2.5rem, 12vw, 4rem);
    }

    .pull-quote {
        font-size: clamp(1.2rem, 4vw, 1.6rem);
        padding-left: 16px;
    }

    .bedrock-text {
        padding: 40px 20px 80px;
    }
}

@media (max-width: 480px) {
    .stratum {
        min-height: 60vh;
    }

    .flip-card {
        height: 240px;
    }

    .gallery-card {
        height: 280px;
    }

    .card-metric {
        font-size: 1.8rem;
    }
}
