/* ============================================================
   PPEBBL.com - Lithic Minimalism
   Geological strata design system
   ============================================================ */

/* --- CSS Custom Properties --- */
:root {
    --limestone-wash: #f0ece4;
    --basalt-night: #1a1d23;
    --slate-ink: #2d3142;
    --granite-mist: #6b7280;
    --sandstone-ochre: #c4956a;
    --serpentine-deep: #3a6b5e;
    --quartz-vein: #d4c5a9;
    --river-teal: #4a8b7f;

    --font-display: 'DM Serif Display', serif;
    --font-body: 'Libre Franklin', sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;

    --space-xs: 12px;
    --space-sm: 24px;
    --space-md: 48px;
    --space-lg: 80px;
    --space-xl: 120px;
}

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

html {
    scroll-snap-type: y proximity;
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    font-weight: 300;
    color: var(--slate-ink);
    background: var(--limestone-wash);
    line-height: 1.85;
    letter-spacing: 0.01em;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Sediment Texture Overlay (subtle striations) --- */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 3px,
        rgba(45, 49, 66, 0.015) 3px,
        rgba(45, 49, 66, 0.015) 4px
    );
}

/* --- Stratum (Section) Base --- */
.stratum {
    min-height: 100vh;
    scroll-snap-align: start;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stratum-inner {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-lg) 0;
    position: relative;
    z-index: 2;
}

/* --- Stratum Labels --- */
.stratum-label {
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    font-weight: 400;
    letter-spacing: 0.08em;
    color: var(--granite-mist);
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.stratum-label-light {
    color: var(--granite-mist);
}

.label-mono {
    font-family: var(--font-mono);
    font-weight: 300;
    font-size: 0.8rem;
    color: var(--sandstone-ochre);
    opacity: 0.7;
}

/* ============================================================
   STRATUM 0: Surface / Hero
   ============================================================ */
.stratum-surface {
    background: var(--limestone-wash);
    flex-direction: column;
}

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

.hero-pebble-container {
    position: relative;
    width: clamp(280px, 50vw, 520px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-pebble {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 8px 40px rgba(45, 49, 66, 0.08));
}

.hero-title {
    position: absolute;
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 5vw, 4.8rem);
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--slate-ink);
    user-select: none;
}

.hero-tagline {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    color: var(--granite-mist);
    margin-top: var(--space-md);
    max-width: 480px;
}

.scroll-hint {
    margin-top: var(--space-xl);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    opacity: 0.5;
    animation: scrollHintPulse 3s ease-in-out infinite;
}

.scroll-hint-text {
    font-family: var(--font-mono);
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--granite-mist);
}

.scroll-hint-line {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, var(--granite-mist), transparent);
}

@keyframes scrollHintPulse {
    0%, 100% { opacity: 0.5; transform: translateY(0); }
    50% { opacity: 0.3; transform: translateY(6px); }
}

/* ============================================================
   STRATUM 1: Alluvial - Horizontal Pebble Gallery
   ============================================================ */
.stratum-alluvial {
    background: var(--limestone-wash);
    background-image: linear-gradient(180deg, var(--limestone-wash) 0%, #ebe5d8 100%);
    clip-path: polygon(0 0, 100% 4%, 100% 100%, 0 96%);
    padding: var(--space-lg) 0;
}

.pebble-gallery-wrapper {
    position: relative;
    overflow: hidden;
}

.gallery-fade {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 80px;
    z-index: 3;
    pointer-events: none;
}

.gallery-fade-left {
    left: 0;
    background: linear-gradient(to right, #ebe5d8, transparent);
}

.gallery-fade-right {
    right: 0;
    background: linear-gradient(to left, #ebe5d8, transparent);
}

.pebble-gallery {
    display: flex;
    gap: var(--space-md);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: var(--space-md) var(--space-md);
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.pebble-gallery::-webkit-scrollbar {
    display: none;
}

.pebble-card {
    flex: 0 0 280px;
    scroll-snap-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: default;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1),
                box-shadow 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.pebble-card:hover {
    transform: scale(1.03);
}

.pebble-card:hover .pebble-svg {
    filter: drop-shadow(0 4px 20px rgba(58, 107, 94, 0.15));
}

.pebble-svg {
    width: 100%;
    height: auto;
    transition: filter 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.pebble-text {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(0.9rem, 1vw, 1rem);
    color: var(--slate-ink);
    line-height: 1.7;
    margin-top: var(--space-sm);
    max-width: 240px;
}

.gallery-arrows {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
    opacity: 1;
    transition: opacity 1s ease;
}

.gallery-arrows.faded {
    opacity: 0;
}

.gallery-arrow {
    background: none;
    border: 1px solid var(--granite-mist);
    color: var(--granite-mist);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-body);
}

.gallery-arrow:hover {
    border-color: var(--sandstone-ochre);
    color: var(--sandstone-ochre);
}

/* ============================================================
   STRATUM 2: Metamorphic - Bento Grid
   ============================================================ */
.stratum-metamorphic {
    background: var(--limestone-wash);
    background-image: linear-gradient(180deg, #ebe5d8 0%, #e2dcd0 100%);
    clip-path: polygon(0 4%, 100% 0, 100% 96%, 0 100%);
    padding: var(--space-xl) 0;
}

.bento-grid {
    display: grid;
    grid-template-columns: 1fr 1.4fr 0.8fr;
    grid-template-rows: auto auto auto;
    gap: var(--space-sm);
}

.bento-cell {
    background: rgba(240, 236, 228, 0.6);
    backdrop-filter: blur(8px);
    padding: var(--space-md);
    overflow: hidden;
    position: relative;
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bento-cell.visible {
    opacity: 1;
    transform: scale(1);
}

.bento-cell-1 {
    border-radius: 36px;
    grid-column: 1 / 2;
    grid-row: 1 / 2;
}

.bento-cell-2 {
    border-radius: 28px;
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bento-cell-3 {
    border-radius: 40px;
    grid-column: 3 / 4;
    grid-row: 1 / 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.bento-cell-4 {
    border-radius: 32px;
    grid-column: 1 / 3;
    grid-row: 2 / 3;
}

.bento-cell-5 {
    border-radius: 24px;
    grid-column: 3 / 4;
    grid-row: 2 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bento-cell-6 {
    border-radius: 44px;
    grid-column: 1 / 2;
    grid-row: 3 / 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.bento-cell-7 {
    border-radius: 30px;
    grid-column: 2 / 4;
    grid-row: 3 / 4;
}

.bento-heading {
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    font-weight: 400;
    letter-spacing: 0.04em;
    color: var(--slate-ink);
    margin-bottom: var(--space-sm);
}

.bento-body {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(0.95rem, 1.1vw, 1.1rem);
    color: var(--granite-mist);
    line-height: 1.85;
}

.bento-color-field {
    width: 100%;
    height: 120px;
    border-radius: 20px;
    margin-bottom: var(--space-xs);
}

.bento-label {
    font-family: var(--font-mono);
    font-weight: 300;
    font-size: 0.8rem;
    color: var(--granite-mist);
    letter-spacing: 0.05em;
}

.mineral-pattern {
    width: 100%;
    max-width: 200px;
    height: auto;
}

/* ============================================================
   STRATUM 3: Igneous Core - Monolith Text
   ============================================================ */
.stratum-igneous {
    background: var(--basalt-night);
    clip-path: polygon(0 0, 100% 4%, 100% 100%, 0 96%);
    padding: var(--space-xl) 0;
}

.stratum-igneous .stratum-label {
    color: var(--granite-mist);
    opacity: 0.6;
}

.stratum-igneous .label-mono {
    color: var(--sandstone-ochre);
    opacity: 0.5;
}

.monolith-column {
    max-width: 520px;
    margin: 0 auto;
    text-align: left;
}

.monolith-text {
    font-family: var(--font-display);
    font-size: clamp(1.1rem, 1.4vw, 1.3rem);
    font-weight: 400;
    color: var(--limestone-wash);
    line-height: 1.85;
    margin-bottom: var(--space-md);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.monolith-text.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Erosion reveal mask effect */
.monolith-text {
    -webkit-mask-image: linear-gradient(to top, transparent 0%, black 100%);
    mask-image: linear-gradient(to top, transparent 0%, black 100%);
    -webkit-mask-size: 100% 200%;
    mask-size: 100% 200%;
    -webkit-mask-position: 0 100%;
    mask-position: 0 100%;
}

.monolith-text.revealed {
    -webkit-mask-position: 0 0;
    mask-position: 0 0;
    transition: opacity 0.8s ease, transform 0.8s ease, -webkit-mask-position 1.2s ease, mask-position 1.2s ease;
}

/* ============================================================
   STRATUM 4: Fossil Layer - Timeline
   ============================================================ */
.stratum-fossil {
    background: #e2dcd0;
    background-image: linear-gradient(180deg, #ddd6c8 0%, var(--limestone-wash) 100%);
    clip-path: polygon(0 4%, 100% 0, 100% 96%, 0 100%);
    padding: var(--space-xl) 0;
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: var(--space-lg) 0;
}

.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--granite-mist);
    opacity: 0.3;
    transform: translateX(-50%);
}

.timeline-node {
    display: flex;
    align-items: flex-start;
    position: relative;
    margin-bottom: var(--space-lg);
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.timeline-node.visible {
    opacity: 1;
    transform: translateY(0);
}

.timeline-node:nth-child(odd) {
    flex-direction: row;
    padding-right: calc(50% + 50px);
    text-align: right;
}

.timeline-node:nth-child(even) {
    flex-direction: row-reverse;
    padding-left: calc(50% + 50px);
    text-align: left;
}

.timeline-marker {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

.cross-section {
    width: 64px;
    height: 64px;
    cursor: default;
}

.cross-section:hover circle:last-child {
    animation: morphPebble 2s ease-in-out infinite;
}

@keyframes morphPebble {
    0%, 100% { rx: 6; ry: 6; }
    25% { rx: 5.5; ry: 6.5; }
    50% { rx: 6.2; ry: 5.8; }
    75% { rx: 5.8; ry: 6.2; }
}

.timeline-content {
    flex: 1;
}

.timeline-heading {
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    font-weight: 400;
    letter-spacing: 0.06em;
    color: var(--slate-ink);
    margin-bottom: var(--space-xs);
}

.timeline-body {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    color: var(--granite-mist);
    line-height: 1.85;
}

/* ============================================================
   STRATUM 5: Tidal - Footer
   ============================================================ */
.stratum-tidal {
    background: var(--limestone-wash);
    clip-path: polygon(0 6%, 100% 0, 100% 100%, 0 100%);
    padding: var(--space-xl) 0 var(--space-lg);
    min-height: 80vh;
}

.stratum-tidal .stratum-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    position: relative;
}

.tidal-pebbles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.tidal-pebble {
    position: absolute;
    animation: tidalFloat linear infinite;
}

.tp-1 { width: 40px; top: 15%; left: 10%; animation-duration: 10s; animation-delay: 0s; }
.tp-2 { width: 28px; top: 60%; left: 20%; animation-duration: 8s; animation-delay: 1.5s; }
.tp-3 { width: 36px; top: 30%; left: 75%; animation-duration: 11s; animation-delay: 3s; }
.tp-4 { width: 22px; top: 70%; left: 85%; animation-duration: 9s; animation-delay: 0.8s; }
.tp-5 { width: 34px; top: 45%; left: 50%; animation-duration: 12s; animation-delay: 2.2s; }
.tp-6 { width: 20px; top: 80%; left: 40%; animation-duration: 8.5s; animation-delay: 4s; }
.tp-7 { width: 30px; top: 20%; left: 60%; animation-duration: 10.5s; animation-delay: 1s; }
.tp-8 { width: 24px; top: 55%; left: 30%; animation-duration: 9.5s; animation-delay: 5s; }

@keyframes tidalFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

/* Water ripple pseudo-elements */
.tidal-pebble::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid var(--granite-mist);
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    animation: waterRipple 5s ease-out infinite;
}

.tp-1::after { animation-delay: 2s; }
.tp-2::after { animation-delay: 4.5s; }
.tp-3::after { animation-delay: 3s; }
.tp-4::after { animation-delay: 6s; }
.tp-5::after { animation-delay: 1.5s; }
.tp-6::after { animation-delay: 7s; }
.tp-7::after { animation-delay: 3.5s; }
.tp-8::after { animation-delay: 5.5s; }

@keyframes waterRipple {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0.3;
    }
    100% {
        transform: translate(-50%, -50%) scale(3);
        opacity: 0;
    }
}

.tidal-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.tidal-message {
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 3vw, 2.4rem);
    font-weight: 400;
    letter-spacing: 0.06em;
    color: var(--slate-ink);
    margin-bottom: var(--space-md);
}

.tidal-contact {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(0.85rem, 1vw, 1rem);
    color: var(--granite-mist);
    letter-spacing: 0.04em;
}

.tidal-year {
    font-family: var(--font-mono);
    font-weight: 300;
    font-size: 0.8rem;
    color: var(--granite-mist);
    opacity: 0.5;
    margin-top: var(--space-sm);
    letter-spacing: 0.15em;
}

/* ============================================================
   Mineral Vein Dividers
   ============================================================ */
.vein-divider {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 20px;
    z-index: -1;
    pointer-events: none;
    display: none;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
    .bento-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .bento-cell-1,
    .bento-cell-2,
    .bento-cell-3,
    .bento-cell-4,
    .bento-cell-5,
    .bento-cell-6,
    .bento-cell-7 {
        grid-column: 1 / -1;
        grid-row: auto;
    }

    .timeline-node:nth-child(odd),
    .timeline-node:nth-child(even) {
        flex-direction: column;
        padding-left: 80px;
        padding-right: 0;
        text-align: left;
    }

    .timeline-marker {
        left: 0;
        transform: translateX(0);
    }

    .timeline-line {
        left: 30px;
    }

    .pebble-card {
        flex: 0 0 240px;
    }

    .hero-pebble-container {
        width: clamp(220px, 70vw, 360px);
    }

    .stratum-alluvial,
    .stratum-metamorphic,
    .stratum-igneous,
    .stratum-fossil,
    .stratum-tidal {
        clip-path: polygon(0 0, 100% 2%, 100% 100%, 0 98%);
    }
}

@media (max-width: 480px) {
    :root {
        --space-lg: 60px;
        --space-xl: 80px;
    }

    .hero-title {
        font-size: clamp(1.8rem, 8vw, 2.6rem);
    }
}
