/* =========================================================
   recycle.studio — wabi-sabi material lifecycle
   Palette: Decomposed Earth
     #F5F0E8 Pulp White         #3D3629 Compost Dark
     #4A6741 Bottle Green       #8B7D6B Weathered Stone
     #C4A882 Raw Kraft          #6B4E3D Fired Clay
     #D4C5A9 Dried Straw        #2A3A2E Deep Mulch
   Type: DM Serif Display / Source Sans 3 / Space Mono
   ========================================================= */

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

html {
    scroll-behavior: smooth;
    background: #F5F0E8;
}

body {
    font-family: 'Source Sans 3', system-ui, sans-serif;
    font-size: 17px;
    line-height: 1.75;
    color: #3D3629;
    background-color: #F5F0E8;
    background-image:
        radial-gradient(circle at 8% 12%, rgba(196, 168, 130, 0.45) 0.8px, transparent 1.2px),
        radial-gradient(circle at 23% 47%, rgba(139, 125, 107, 0.32) 0.6px, transparent 1px),
        radial-gradient(circle at 41% 18%, rgba(196, 168, 130, 0.4) 1.2px, transparent 1.6px),
        radial-gradient(circle at 67% 73%, rgba(139, 125, 107, 0.28) 0.5px, transparent 0.9px),
        radial-gradient(circle at 84% 31%, rgba(196, 168, 130, 0.38) 0.9px, transparent 1.3px),
        radial-gradient(circle at 12% 88%, rgba(139, 125, 107, 0.34) 1px, transparent 1.4px),
        radial-gradient(circle at 92% 64%, rgba(196, 168, 130, 0.36) 0.7px, transparent 1.1px),
        radial-gradient(circle at 54% 92%, rgba(139, 125, 107, 0.3) 0.8px, transparent 1.2px);
    background-size: 280px 280px, 220px 220px, 320px 320px, 180px 180px,
                     260px 260px, 240px 240px, 300px 300px, 200px 200px;
    background-attachment: fixed;
    overflow-x: hidden;
    min-height: 100vh;
}

::selection {
    background: rgba(74, 103, 65, 0.25);
    color: #2A3A2E;
}

/* ---------- Grain Overlay (full page) ---------- */
.grain-defs {
    position: absolute;
    width: 0;
    height: 0;
    pointer-events: none;
}

.grain-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 100;
    opacity: 0.045;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='4' seed='7' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.24 0 0 0 0 0.21 0 0 0 0 0.16 0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
    mix-blend-mode: multiply;
}

/* ---------- Glass fragments scattered ---------- */
.glass-fragments {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.glass-fragment {
    position: absolute;
    background: linear-gradient(135deg, rgba(212, 197, 169, 0.35), rgba(245, 240, 232, 0.12));
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    filter: brightness(1.08);
    opacity: 0.6;
    animation: glass-shimmer 12s ease-in-out infinite;
}

.glass-1 {
    top: 12vh; left: 6vw;
    width: 32px; height: 24px;
    clip-path: polygon(20% 0, 100% 30%, 78% 100%, 0 70%);
    animation-delay: 0s;
}
.glass-2 {
    top: 38vh; right: 4vw;
    width: 38px; height: 30px;
    clip-path: polygon(0 20%, 80% 0, 100% 75%, 30% 100%);
    animation-delay: -2.4s;
}
.glass-3 {
    top: 64vh; left: 10vw;
    width: 26px; height: 36px;
    clip-path: polygon(40% 0, 100% 40%, 70% 100%, 0 60%);
    animation-delay: -4.8s;
}
.glass-4 {
    top: 110vh; right: 8vw;
    width: 30px; height: 22px;
    clip-path: polygon(0 0, 100% 25%, 85% 100%, 15% 80%);
    animation-delay: -7.2s;
}
.glass-5 {
    top: 152vh; left: 5vw;
    width: 36px; height: 28px;
    clip-path: polygon(25% 0, 100% 35%, 75% 100%, 0 75%);
    animation-delay: -3.1s;
}
.glass-6 {
    top: 198vh; right: 12vw;
    width: 24px; height: 32px;
    clip-path: polygon(50% 0, 100% 50%, 65% 100%, 0 50%);
    animation-delay: -5.6s;
}
.glass-7 {
    top: 246vh; left: 7vw;
    width: 28px; height: 26px;
    clip-path: polygon(0 30%, 70% 0, 100% 70%, 30% 100%);
    animation-delay: -1.4s;
}

@keyframes glass-shimmer {
    0%, 100% { opacity: 0.4; transform: translateY(0) rotate(0deg); }
    50%      { opacity: 0.7; transform: translateY(-4px) rotate(2deg); }
}

/* ---------- Vertical progress rail ---------- */
.progress-rail {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 40px;
    width: 1px;
    background: #8B7D6B;
    opacity: 0.55;
    z-index: 50;
}

.progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 0%;
    background: #4A6741;
    transform-origin: top center;
    transition: height 80ms linear;
}

/* ---------- Bubble clusters (left margin) ---------- */
.bubble-cluster {
    position: absolute;
    left: 28px;
    width: 24px;
    z-index: 4;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.cluster-a { top: 38vh; }
.cluster-b { top: 168vh; }
.cluster-c { top: 320vh; }

.bubble {
    display: block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #8B7D6B;
    opacity: 0.5;
    animation: bubble-pulse 4.5s ease-in-out infinite;
}

.bubble:nth-child(1) { width: 4px; height: 4px; animation-delay: 0s; transform: translateX(-3px); }
.bubble:nth-child(2) { width: 6px; height: 6px; animation-delay: -0.6s; transform: translateX(2px); }
.bubble:nth-child(3) { width: 5px; height: 5px; animation-delay: -1.2s; transform: translateX(-1px); }
.bubble:nth-child(4) { width: 4px; height: 4px; animation-delay: -1.8s; transform: translateX(4px); }
.bubble:nth-child(5) { width: 5px; height: 5px; animation-delay: -2.4s; transform: translateX(-2px); }
.bubble:nth-child(6) { width: 6px; height: 6px; animation-delay: -3.0s; transform: translateX(1px); }
.bubble:nth-child(7) { width: 4px; height: 4px; animation-delay: -3.6s; transform: translateX(-3px); }

@keyframes bubble-pulse {
    0%, 100% { opacity: 0.3; }
    50%      { opacity: 0.7; }
}

/* ---------- Atmospheric arc loops ---------- */
.arc-loop {
    position: absolute;
    width: 120px;
    height: 120px;
    opacity: 0.22;
    animation: arc-rotate 60s linear infinite;
    z-index: 3;
    pointer-events: none;
}

.arc-loop-1 {
    top: 96vh;
    right: 7vw;
}

.arc-loop-2 {
    top: 248vh;
    left: 8vw;
    width: 90px;
    height: 90px;
    animation-direction: reverse;
    animation-duration: 80s;
}

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

/* ---------- Lifecycle column ---------- */
.lifecycle-column {
    position: relative;
    width: 100%;
    z-index: 10;
}

.stratum {
    position: relative;
    width: 100%;
    padding: 100px 24px 100px;
    display: flex;
    justify-content: center;
}

.stratum-inner {
    width: 100%;
    max-width: 680px;
    position: relative;
}

/* ---------- Reveal animation (blur to clear) ---------- */
.reveal {
    opacity: 0;
    filter: blur(4px);
    transform: translateY(8px);
    transition:
        opacity 600ms ease-out,
        filter 600ms ease-out,
        transform 600ms ease-out;
}

.reveal.is-visible {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
}

/* ---------- Common element typography ---------- */
.stratum-meta,
.reborn-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 36px;
}

.meta-label {
    font-family: 'Space Mono', ui-monospace, monospace;
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8B7D6B;
}

.meta-divider {
    width: 36px;
    height: 1px;
    background: #8B7D6B;
    opacity: 0.6;
}

.stratum-title {
    font-family: 'DM Serif Display', Georgia, serif;
    font-weight: 400;
    font-size: 64px;
    line-height: 1.05;
    letter-spacing: 0.02em;
    color: #3D3629;
    margin-bottom: 40px;
    text-shadow:
        0.5px 0.5px 0 rgba(61, 54, 41, 0.45),
        -0.5px 0.5px 0 rgba(61, 54, 41, 0.25);
}

.stratum-lede {
    font-size: 19px;
    line-height: 1.7;
    color: #3D3629;
    margin-bottom: 36px;
    max-width: 620px;
}

.stratum-detail p {
    margin-bottom: 24px;
    color: #3D3629;
}

.stratum-coda {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 22px;
    line-height: 1.5;
    text-align: center;
    color: #4A6741;
    margin-top: 56px;
    font-style: italic;
    letter-spacing: 0.01em;
}

/* =========================================================
   STRATUM 1 — RAW
   Dense fiber + cross-section bands at top
   ========================================================= */
.stratum-raw {
    min-height: 100vh;
    padding-top: 18vh;
    padding-bottom: 12vh;
    background:
        /* cross-section layered bands at top */
        linear-gradient(
            to bottom,
            rgba(212, 197, 169, 0.0)   0%,
            rgba(212, 197, 169, 0.22)  1%,
            rgba(196, 168, 130, 0.0)   2%,
            rgba(139, 125, 107, 0.18)  3%,
            rgba(212, 197, 169, 0.0)   4%,
            rgba(196, 168, 130, 0.20)  5.5%,
            rgba(139, 125, 107, 0.0)   7%,
            rgba(212, 197, 169, 0.16)  8%,
            transparent 12%
        ),
        /* dense fiber */
        radial-gradient(circle at 14% 22%, rgba(196, 168, 130, 0.55) 1.4px, transparent 2px),
        radial-gradient(circle at 38% 41%, rgba(139, 125, 107, 0.42) 1px, transparent 1.5px),
        radial-gradient(circle at 62% 18%, rgba(196, 168, 130, 0.5) 1.6px, transparent 2.2px),
        radial-gradient(circle at 81% 56%, rgba(139, 125, 107, 0.4) 0.9px, transparent 1.4px),
        radial-gradient(circle at 27% 78%, rgba(196, 168, 130, 0.48) 1.2px, transparent 1.8px),
        radial-gradient(circle at 71% 87%, rgba(139, 125, 107, 0.36) 1.3px, transparent 1.7px),
        /* rust bloom at bottom */
        radial-gradient(circle at 50% 100%, rgba(107, 78, 61, 0.18), transparent 50%);
    background-size:
        100% 100%,
        160px 160px, 140px 140px, 180px 180px, 120px 120px, 200px 200px, 150px 150px,
        100% 100%;
    background-attachment: fixed, scroll, scroll, scroll, scroll, scroll, scroll, scroll;
}

.raw-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 48px;
}

.raw-tag {
    font-family: 'Space Mono', ui-monospace, monospace;
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 8px 14px;
    border: 1px solid #8B7D6B;
    color: #6B4E3D;
    background: rgba(245, 240, 232, 0.45);
    transition: all 240ms ease;
}

.raw-tag:hover {
    color: #F5F0E8;
    background: #6B4E3D;
    border-color: #6B4E3D;
}

/* =========================================================
   STRATUM 2 — DISSOLVE
   Scattered, rotated, generous whitespace
   ========================================================= */
.stratum-dissolve {
    min-height: 130vh;
    padding-top: 14vh;
    padding-bottom: 14vh;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(196, 168, 130, 0.10), transparent 55%),
        radial-gradient(ellipse at 80% 70%, rgba(139, 125, 107, 0.10), transparent 55%);
}

.scatter-field {
    margin-top: 48px;
    position: relative;
    min-height: 880px;
}

.scatter-block {
    position: relative;
    background: rgba(245, 240, 232, 0.55);
    padding: 22px 26px;
    border-left: 1px solid #C4A882;
    color: #3D3629;
    font-size: 17px;
    line-height: 1.7;
    margin-bottom: 96px;
    max-width: 460px;
    box-shadow: 0 1px 0 rgba(139, 125, 107, 0.08);
}

.scatter-1 {
    transform: rotate(-2.5deg) translateX(-10px);
    opacity: 0.95;
    margin-left: 0;
}
.scatter-2 {
    transform: rotate(3deg) translateX(80px);
    opacity: 0.82;
    margin-left: auto;
    margin-right: 0;
}
.scatter-3 {
    transform: rotate(-4deg) translateX(40px);
    opacity: 0.74;
    margin-left: 60px;
}
.scatter-4 {
    transform: rotate(2deg) translateX(-30px);
    opacity: 0.88;
    margin-left: auto;
    margin-right: 30px;
}
.scatter-5 {
    transform: rotate(-1.5deg) translateX(20px);
    opacity: 0.92;
    margin-left: 20px;
}

.scatter-block.reveal.is-visible {
    /* keep the rotation when revealed */
}

.scatter-1.is-visible { transform: rotate(-2.5deg) translateX(-10px); }
.scatter-2.is-visible { transform: rotate(3deg)    translateX(80px); }
.scatter-3.is-visible { transform: rotate(-4deg)   translateX(40px); }
.scatter-4.is-visible { transform: rotate(2deg)    translateX(-30px); }
.scatter-5.is-visible { transform: rotate(-1.5deg) translateX(20px); }

/* =========================================================
   STRATUM 3 — TRANSFORM
   Two columns merging
   ========================================================= */
.stratum-transform {
    min-height: 120vh;
    padding-top: 12vh;
    padding-bottom: 12vh;
    background:
        linear-gradient(
            to bottom,
            transparent 0%,
            rgba(212, 197, 169, 0.18) 30%,
            rgba(212, 197, 169, 0.18) 70%,
            transparent 100%
        );
}

.split-columns {
    display: grid;
    grid-template-columns: 45% 45%;
    column-gap: 10%;
    margin-top: 32px;
    margin-bottom: 24px;
    position: relative;
}

.split-columns::before {
    content: "";
    position: absolute;
    top: 6%;
    bottom: 6%;
    left: 50%;
    width: 1px;
    background: linear-gradient(to bottom, transparent, #8B7D6B 50%, transparent);
    opacity: 0.45;
    transform: translateX(-0.5px);
}

.split-col p {
    margin-bottom: 22px;
    color: #3D3629;
    font-size: 16px;
    line-height: 1.75;
}

.split-left p {
    text-align: right;
}
.split-right p {
    text-align: left;
}

.merge-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 56px 0 28px;
}

.merge-line {
    height: 1px;
    width: 120px;
    background: linear-gradient(to right, transparent, #4A6741, transparent);
}

.merge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4A6741;
    box-shadow: 0 0 0 4px rgba(74, 103, 65, 0.18);
}

/* =========================================================
   STRATUM 4 — RECONSTITUTE
   Bento-box grid, dense and ordered
   ========================================================= */
.stratum-reconstitute {
    min-height: 120vh;
    padding-top: 14vh;
    padding-bottom: 16vh;
    background:
        linear-gradient(to bottom, rgba(212, 197, 169, 0.16), rgba(245, 240, 232, 0));
}

.bento-grid {
    margin-top: 48px;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    grid-template-rows: auto auto auto;
    grid-template-areas:
        "large large tall"
        "wide  wide  tall"
        "small medium narrow";
    gap: 14px;
}

.bento-cell {
    position: relative;
    padding: 22px 22px 24px;
    background: #F5F0E8;
    border: 1px solid rgba(139, 125, 107, 0.35);
    overflow: hidden;
    transition: transform 320ms ease, border-color 320ms ease, box-shadow 320ms ease;
}

.bento-cell::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.7;
    z-index: 0;
}

.bento-cell > * {
    position: relative;
    z-index: 1;
}

.bento-large  { grid-area: large; }
.bento-tall   { grid-area: tall; }
.bento-wide   { grid-area: wide; }
.bento-small  { grid-area: small; }
.bento-medium { grid-area: medium; }
.bento-narrow { grid-area: narrow; }

.bento-large::before {
    background:
        radial-gradient(circle at 22% 30%, rgba(196, 168, 130, 0.45) 1.2px, transparent 1.6px),
        radial-gradient(circle at 65% 60%, rgba(139, 125, 107, 0.32) 1px, transparent 1.4px),
        linear-gradient(135deg, rgba(212, 197, 169, 0.25), transparent 60%);
    background-size: 100px 100px, 80px 80px, 100% 100%;
}

.bento-tall::before {
    background:
        repeating-linear-gradient(
            to bottom,
            rgba(212, 197, 169, 0.18) 0 3px,
            rgba(196, 168, 130, 0.10) 3px 6px,
            rgba(139, 125, 107, 0.08) 6px 9px
        );
}

.bento-wide::before {
    background:
        radial-gradient(circle at 50% 50%, rgba(107, 78, 61, 0.18), transparent 55%),
        radial-gradient(circle at 18% 80%, rgba(196, 168, 130, 0.35) 1.4px, transparent 2px);
    background-size: 100% 100%, 90px 90px;
}

.bento-small::before {
    background:
        linear-gradient(45deg, rgba(212, 197, 169, 0.30), rgba(245, 240, 232, 0));
}

.bento-medium::before {
    background:
        radial-gradient(circle at 70% 30%, rgba(74, 103, 65, 0.10), transparent 60%),
        radial-gradient(circle at 30% 75%, rgba(196, 168, 130, 0.32) 1px, transparent 1.5px);
    background-size: 100% 100%, 70px 70px;
}

.bento-narrow::before {
    background:
        repeating-linear-gradient(
            45deg,
            rgba(139, 125, 107, 0.14) 0 4px,
            transparent 4px 8px
        );
}

.bento-cell:hover {
    transform: translateY(-2px);
    border-color: #6B4E3D;
    box-shadow: 0 6px 18px -10px rgba(61, 54, 41, 0.35);
}

.bento-label {
    display: block;
    font-family: 'Space Mono', ui-monospace, monospace;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #8B7D6B;
    margin-bottom: 14px;
}

.bento-title {
    font-family: 'DM Serif Display', Georgia, serif;
    font-weight: 400;
    font-size: 26px;
    line-height: 1.15;
    color: #3D3629;
    margin-bottom: 12px;
    letter-spacing: 0.01em;
}

.bento-text {
    font-size: 14.5px;
    line-height: 1.65;
    color: #3D3629;
    margin-bottom: 14px;
}

.bento-meta {
    display: block;
    font-family: 'Space Mono', ui-monospace, monospace;
    font-size: 11px;
    letter-spacing: 0.06em;
    color: #6B4E3D;
}

/* =========================================================
   STRATUM 5 — REBORN
   Full-bleed Deep Mulch, silence
   ========================================================= */
.stratum-reborn {
    min-height: 110vh;
    padding-top: 24vh;
    padding-bottom: 18vh;
    background-color: #2A3A2E;
    background-image: none;
    color: #F5F0E8;
    text-align: center;
    /* override page texture */
    background-attachment: scroll;
}

.stratum-reborn .meta-label {
    color: #C4A882;
}

.reborn-meta {
    justify-content: center;
    margin-bottom: 56px;
}

.reborn-title {
    font-family: 'DM Serif Display', Georgia, serif;
    font-weight: 400;
    font-size: 72px;
    line-height: 1.05;
    letter-spacing: 0.02em;
    color: #F5F0E8;
    margin-bottom: 80px;
    text-shadow:
        0.5px 0.5px 0 rgba(245, 240, 232, 0.35),
        -0.5px 0.5px 0 rgba(245, 240, 232, 0.18);
}

.reborn-coda {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 30px;
    color: #C4A882;
    letter-spacing: 0.04em;
    margin-bottom: 24px;
}

.reborn-coda .dot {
    color: #4A6741;
    font-weight: 700;
}

.reborn-fineprint {
    font-family: 'Space Mono', ui-monospace, monospace;
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #8B7D6B;
}

/* =========================================================
   Stratum body texture overrides driven by JS scroll-state
   class on <body>: stratum-state-1 ... stratum-state-5
   Subtly evolves overall texture density.
   ========================================================= */
body.stratum-state-1 .grain-overlay { opacity: 0.06; }
body.stratum-state-2 .grain-overlay { opacity: 0.045; }
body.stratum-state-3 .grain-overlay { opacity: 0.03; }
body.stratum-state-4 .grain-overlay { opacity: 0.02; }
body.stratum-state-5 .grain-overlay { opacity: 0; }

.grain-overlay {
    transition: opacity 800ms ease;
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 720px) {
    .stratum {
        padding: 80px 22px 80px;
    }
    .progress-rail { left: 22px; }
    .bubble-cluster { left: 12px; }
    .arc-loop-1, .arc-loop-2 { width: 70px; height: 70px; }

    .stratum-title { font-size: 44px; }
    .reborn-title { font-size: 48px; }

    .scatter-block {
        max-width: 100%;
        margin-bottom: 64px;
    }
    .scatter-2.is-visible,
    .scatter-3.is-visible,
    .scatter-4.is-visible,
    .scatter-5.is-visible {
        transform: rotate(0deg) translateX(0);
    }
    .scatter-1.is-visible {
        transform: rotate(-1deg) translateX(0);
    }

    .split-columns {
        grid-template-columns: 1fr;
        column-gap: 0;
        row-gap: 12px;
    }
    .split-columns::before { display: none; }
    .split-left p, .split-right p { text-align: left; }

    .bento-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "large large"
            "tall  wide"
            "tall  small"
            "medium narrow";
    }
}
