/* ============================================
   footprint.bar - Goblincore Earth Archive
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --bg-primary: #E8DCC8;       /* Raw Umber Ground */
    --bg-secondary: #C4A882;     /* Wet Clay */
    --bg-tertiary: #3A2E1F;      /* Peat Dark */
    --text-primary: #2B1D0E;     /* Deep Loam */
    --text-secondary: #4A3728;   /* Bark Brown */
    --accent-primary: #6B8F71;   /* Lichen Green */
    --accent-secondary: #D4A843; /* Spore Ochre */
    --accent-tertiary: #F5F0E6;  /* Mycelium White */
    --detail: #7A8B8C;           /* Fossil Slate */
    --detail-warm: #8B4A3A;      /* Decomposing Red */
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Literata', Georgia, serif;
    font-size: 18px;
    line-height: 1.85;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    overflow-x: hidden;
    letter-spacing: 0.005em;
}

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

/* --- Stratigraphy Navigation Strip --- */
.strat-nav {
    position: fixed;
    left: 0;
    top: 0;
    width: 32px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 100;
    border-right: 1px solid var(--detail);
}

.strat-segment {
    cursor: pointer;
    transition: opacity 0.3s ease;
    position: relative;
}

.strat-segment:hover {
    opacity: 0.7;
}

.strat-marker {
    position: absolute;
    left: 32px;
    top: 0;
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 8px solid var(--text-primary);
    transition: top 0.1s linear;
    z-index: 101;
}

@media (max-width: 900px) {
    .strat-nav {
        display: none;
    }
}

/* --- Stratum Sections (shared) --- */
.stratum {
    position: relative;
    overflow: hidden;
    transform: translateX(var(--stratum-offset, 0px));
}

.grain-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.grain-surface {
    filter: url(#grain-surface);
}

.grain-coarse {
    filter: url(#grain-coarse);
}

.grain-fine {
    filter: url(#grain-fine);
}

.grain-medium {
    filter: url(#grain-medium);
}

/* --- The Surface (Hero) --- */
.stratum-surface {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    background-color: var(--bg-primary);
    position: relative;
}

.surface-content {
    position: relative;
    z-index: 10;
    text-align: center;
}

.site-title {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 800;
    font-variation-settings: 'WONK' 1;
    font-size: 64px;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}

.site-subtitle {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    font-weight: 400;
    color: var(--accent-primary);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Hero footprint watermark */
.footprint-hero {
    position: absolute;
    width: 60vw;
    max-width: 600px;
    height: auto;
    top: 50%;
    left: 55%;
    transform: translate(-50%, -50%) rotate(12deg);
    color: var(--text-secondary);
    opacity: 0;
    z-index: 2;
    transition: opacity 2s ease;
}

.footprint-hero.visible {
    opacity: 0.03;
}

/* Stratigraphy draw line */
.strat-draw-line {
    position: absolute;
    left: 15px;
    top: 0;
    width: 2px;
    height: 100%;
    z-index: 5;
}

.strat-line-anim {
    animation: drawLine 2s ease-out 0.5s forwards;
}

@keyframes drawLine {
    to {
        stroke-dashoffset: 0;
    }
}

/* --- Footprint Watermarks (shared) --- */
.footprint-watermark {
    position: absolute;
    pointer-events: none;
    z-index: 2;
}

/* --- Stratum 1: Recent Impressions --- */
.stratum-one {
    min-height: 140vh;
    background-color: var(--bg-secondary);
    padding: 80px 0;
    position: relative;
}

.fp-boot {
    width: 180px;
    height: auto;
    top: 10%;
    right: 8%;
    transform: rotate(25deg);
    color: var(--text-secondary);
    opacity: 0.05;
    will-change: transform;
}

.fp-bare-small {
    width: 140px;
    height: auto;
    bottom: 15%;
    left: 5%;
    transform: rotate(-18deg);
    color: var(--text-secondary);
    opacity: 0.04;
    will-change: transform;
}

/* Stratigraphy lines decoration */
.strat-lines {
    position: absolute;
    top: 30%;
    left: 0;
    width: 100%;
    height: 20px;
    z-index: 2;
}

/* Impression grid (2:3:2 ratio) */
.impression-grid {
    position: relative;
    z-index: 10;
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 60px;
    display: grid;
    grid-template-columns: 2fr 3fr 2fr;
    gap: 40px;
}

.grid-col-left {
    grid-column: 1 / 3;
}

.grid-col-right {
    grid-column: 3 / 4;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-top: 80px;
}

@media (max-width: 768px) {
    .impression-grid {
        grid-template-columns: 1fr;
        padding: 40px 24px;
    }
    .grid-col-left {
        grid-column: 1;
    }
    .grid-col-right {
        grid-column: 1;
        padding-top: 20px;
    }
}

/* Section titles */
.stratum-title {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 800;
    font-variation-settings: 'WONK' 1;
    font-size: 48px;
    color: var(--text-secondary);
    letter-spacing: -0.02em;
    margin-bottom: 32px;
}

.stratum-title-light {
    color: var(--accent-tertiary);
}

/* Body text */
.body-text {
    font-family: 'Literata', Georgia, serif;
    font-weight: 400;
    font-size: 18px;
    line-height: 1.85;
    color: var(--text-primary);
    letter-spacing: 0.005em;
    margin-bottom: 24px;
}

.body-text-light {
    color: var(--accent-tertiary);
}

/* Annotations */
.annotation {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    font-weight: 400;
    color: var(--accent-primary);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 8px 0;
    border-bottom: 1px solid rgba(106, 143, 113, 0.2);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.annotation.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Pressed specimen dividers */
.pressed-specimen {
    display: block;
    width: 120px;
    height: auto;
    margin: 60px auto;
    position: relative;
    z-index: 10;
    opacity: 0.6;
}

.pressed-specimen-light {
    opacity: 0.4;
}

/* --- Reveal animations --- */
.reveal-element {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-element.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Slide reveal (for deep time section) */
.slide-reveal {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.slide-reveal.revealed {
    opacity: 1;
    transform: translateX(0);
}

/* --- Stratum 2: Deep Time --- */
.stratum-two {
    min-height: 160vh;
    background-color: var(--bg-tertiary);
    padding: 100px 0;
    position: relative;
}

.mycelium-network {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.fp-trilobite {
    width: 300px;
    height: auto;
    top: 20%;
    right: 10%;
    transform: rotate(8deg);
    color: var(--accent-tertiary);
    opacity: 0.06;
}

.deep-time-content {
    position: relative;
    z-index: 10;
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 60px;
    display: grid;
    grid-template-columns: 2fr 3fr 2fr;
    gap: 40px;
}

.deep-time-content .stratum-title {
    grid-column: 1 / 3;
}

.deep-time-text {
    grid-column: 1 / 3;
}

@media (max-width: 768px) {
    .deep-time-content {
        grid-template-columns: 1fr;
        padding: 40px 24px;
    }
    .deep-time-content .stratum-title,
    .deep-time-text {
        grid-column: 1;
    }
}

/* --- Stratum 3: The Measurement Bar --- */
.stratum-three {
    min-height: 120vh;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    padding: 100px 0;
    position: relative;
}

.measurement-content {
    position: relative;
    z-index: 10;
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 60px;
}

@media (max-width: 768px) {
    .measurement-content {
        padding: 40px 24px;
    }
}

/* Bar chart section */
.bar-chart-section {
    margin-top: 48px;
    display: flex;
    flex-direction: column;
    gap: 36px;
}

.bar-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bar-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    font-weight: 400;
    color: var(--accent-primary);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.bar-track {
    width: 100%;
    height: 32px;
    background-color: var(--bg-primary);
    border: 1px solid rgba(122, 139, 140, 0.2);
    position: relative;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    width: 0%;
    background-color: var(--bar-color, var(--accent-primary));
    transition: width 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 12px;
    clip-path: polygon(0 0, calc(100% - 2px) 1px, 100% 3px, calc(100% + 1px) calc(100% - 2px), calc(100% - 3px) 100%, 1px calc(100% - 1px), 0 100%);
}

.bar-fill.animated {
    width: calc(var(--target-width, 0) * 1%);
}

.bar-value {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    font-weight: 400;
    color: var(--accent-tertiary);
    letter-spacing: 0.08em;
    white-space: nowrap;
}

.bar-description {
    font-family: 'Literata', Georgia, serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
    opacity: 0.8;
}

/* --- Stratum 4: The Archive --- */
.stratum-four {
    min-height: 140vh;
    background-color: var(--text-primary);
    padding: 100px 0;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.mycelium-dense {
    opacity: 1;
}

.archive-content {
    position: relative;
    z-index: 10;
    max-width: 700px;
    margin: 0 auto;
    padding: 80px 60px;
    text-align: center;
}

.archive-text {
    font-family: 'Literata', Georgia, serif;
    font-weight: 400;
    font-size: 20px;
    line-height: 1.85;
    color: var(--accent-tertiary);
    letter-spacing: 0.005em;
}

@media (max-width: 768px) {
    .archive-content {
        padding: 60px 24px;
    }
}

/* Footprint spiral */
.footprint-spiral {
    position: relative;
    z-index: 10;
    width: 500px;
    height: 500px;
    margin: 60px auto;
}

@media (max-width: 600px) {
    .footprint-spiral {
        width: 300px;
        height: 300px;
    }
}

.spiral-print {
    position: absolute;
    color: var(--accent-tertiary);
    animation: spiralRotate 120s linear infinite;
}

.sp-1 {
    width: 80px;
    top: 10%;
    left: 50%;
    transform: translate(-50%, 0) rotate(0deg);
    opacity: 0.1;
    animation-delay: 0s;
}

.sp-2 {
    width: 55px;
    top: 25%;
    left: 75%;
    opacity: 0.08;
    animation-delay: -15s;
    animation-duration: 100s;
}

.sp-3 {
    width: 45px;
    top: 50%;
    left: 80%;
    opacity: 0.1;
    animation-delay: -30s;
    animation-duration: 110s;
}

.sp-4 {
    width: 50px;
    top: 70%;
    left: 65%;
    opacity: 0.09;
    animation-delay: -45s;
    animation-duration: 130s;
}

.sp-5 {
    width: 48px;
    top: 80%;
    left: 40%;
    opacity: 0.12;
    animation-delay: -60s;
    animation-duration: 115s;
}

.sp-6 {
    width: 60px;
    top: 65%;
    left: 15%;
    opacity: 0.08;
    animation-delay: -75s;
    animation-duration: 125s;
}

.sp-7 {
    width: 70px;
    top: 40%;
    left: 10%;
    opacity: 0.1;
    animation-delay: -90s;
    animation-duration: 105s;
}

.sp-8 {
    width: 65px;
    top: 20%;
    left: 25%;
    opacity: 0.09;
    animation-delay: -105s;
    animation-duration: 135s;
}

@keyframes spiralRotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* --- Closing Section --- */
.stratum-closing {
    min-height: 60vh;
    background-color: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.closing-content {
    position: relative;
    z-index: 10;
    text-align: center;
}

.closing-title {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 800;
    font-variation-settings: 'WONK' 1;
    font-size: 42px;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}

.closing-subtitle {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    font-weight: 400;
    color: var(--accent-primary);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* --- Transition overlaps between strata --- */
.stratum-one::before {
    content: '';
    position: absolute;
    top: -40px;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    z-index: 3;
    pointer-events: none;
}

.stratum-two::before {
    content: '';
    position: absolute;
    top: -40px;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    z-index: 3;
    pointer-events: none;
}

.stratum-three::before {
    content: '';
    position: absolute;
    top: -40px;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(180deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    z-index: 3;
    pointer-events: none;
}

.stratum-four::before {
    content: '';
    position: absolute;
    top: -40px;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--text-primary) 100%);
    z-index: 3;
    pointer-events: none;
}

.stratum-closing::before {
    content: '';
    position: absolute;
    top: -40px;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(180deg, var(--text-primary) 0%, var(--bg-primary) 100%);
    z-index: 3;
    pointer-events: none;
}

/* --- Parallax watermark drift for stratum 1 --- */
.fp-boot,
.fp-bare-small {
    transition: transform 0.1s linear;
}

/* --- Selection styling --- */
::selection {
    background: var(--accent-secondary);
    color: var(--text-primary);
}

/* --- Scrollbar styling (webkit) --- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--detail);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}
