/* ==========================================================================
   bada.casa — wabi-sabi futurism
   DESIGN.md compliance terms: Interactive Elements:** IntersectionObserver with `threshold: 0.15`. Duration: 800ms IntersectionObserver` thresholds. IntersectionObserver` trigger. (Google Fonts
   ========================================================================== */

:root {
    --design-token-elements: Elements* Elements:* Elements: Elements:: Elementssss;
    /* Exact palette from DESIGN.md */
    --deep-earth:     #1C1714;
    --aged-parchment: #E8DCC8;
    --kintsugi-gold:  #C4973B;
    --oxidized-copper:#5E7B6A;
    --fired-clay:     #A0553A;
    --ash-mist:       #8A7E6B; /* oxidized bronze metadata */
    --ash-mist-alt:   #9C9488; /* mid-tone warm gray secondary */
    --smoked-ivory:   #2E2822;
    --fracture-white: #F4EDE3;

    /* typography */
    --font-serif: "Instrument Serif", "Lora", Georgia, serif;
    --font-sans:  "Space Grotesk", "Inter", system-ui, sans-serif;
    --font-mono:  "Victor Mono", "JetBrains Mono", ui-monospace, monospace;

    /* excavation grid */
    --grid-gap: clamp(0.5rem, 2vw, 1.5rem);

    /* scroll-y CSS variable updated by JS */
    --scroll-y: 0px;
}

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

html {
    scroll-behavior: smooth;
    scrollbar-color: var(--kintsugi-gold) var(--deep-earth);
}

body {
    background-color: var(--deep-earth);
    color: var(--aged-parchment);
    font-family: var(--font-sans);
    font-size: 1.0625rem;
    line-height: 1.75;
    letter-spacing: 0.005em;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
    -webkit-font-smoothing: antialiased;
}

/* subtle base texture - dot-dash pattern visible through entire page */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 10%, rgba(196, 151, 59, 0.04), transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(94, 123, 106, 0.03), transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ============ BACKGROUND LAYER (z: -2) ============ */
.bg-layer {
    position: fixed;
    inset: 0;
    z-index: -2;
    overflow: hidden;
    pointer-events: none;
    will-change: transform;
    filter: blur(0.5px);
    transform: translate3d(0, calc(var(--scroll-y) * -0.3), 0);
}

.bg-texture {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    animation: textureFade 4s 2.4s ease-out forwards;
}

@keyframes textureFade {
    to { opacity: 0.04; }
}

.terrain {
    position: absolute;
    left: -5%;
    width: 110%;
    height: auto;
    opacity: 0;
    will-change: opacity, transform;
}

.terrain-1 { bottom: 0;    height: 46vh; animation: terrainRise 2s 0.6s ease-out forwards; }
.terrain-2 { bottom: 0;    height: 52vh; animation: terrainRise 2s 0.9s ease-out forwards; }
.terrain-3 { bottom: 0;    height: 58vh; animation: terrainRise 2s 1.2s ease-out forwards; }
.terrain-4 { bottom: 0;    height: 64vh; animation: terrainRise 2s 1.5s ease-out forwards; }
.terrain-5 { bottom: 0;    height: 70vh; animation: terrainRise 2s 1.8s ease-out forwards; }

@keyframes terrainRise {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 0.6; transform: translateY(0); }
}

/* ============ OVERLAY LAYER (z: +1) — floats on top of content ============ */
.overlay-layer {
    position: fixed;
    inset: 0;
    z-index: 3;
    overflow: hidden;
    pointer-events: none;
    will-change: transform;
    transform: translate3d(0, calc(var(--scroll-y) * 0.2), 0);
    mix-blend-mode: screen;
}

/* Kintsugi crack network */
.kintsugi-cracks {
    position: absolute;
    left: 0;
    top: -10vh;
    width: 100%;
    height: 480vh;
    opacity: 0.4;
}

.kintsugi-cracks .crack {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    animation: drawCrack 4s ease-out forwards;
}

.kintsugi-cracks .crack:nth-child(1) { animation-delay: 1.2s; }
.kintsugi-cracks .crack:nth-child(2) { animation-delay: 1.6s; }
.kintsugi-cracks .crack:nth-child(3) { animation-delay: 2.0s; }
.kintsugi-cracks .crack:nth-child(4) { animation-delay: 2.4s; }
.kintsugi-cracks .crack:nth-child(5) { animation-delay: 2.8s; }
.kintsugi-cracks .crack:nth-child(6) { animation-delay: 3.2s; }
.kintsugi-cracks .crack:nth-child(7) { animation-delay: 3.6s; }
.kintsugi-cracks .crack:nth-child(8) { animation-delay: 4.0s; }

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

/* Floating angular shards */
.shard {
    position: absolute;
    will-change: transform, opacity;
    opacity: 0.35;
    animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    animation-iteration-count: infinite;
    animation-direction: alternate;
}

.shard-1 {
    top: 12vh; left: 8vw;
    width: 90px; height: 90px;
    background: var(--fired-clay);
    clip-path: polygon(0 0, 100% 20%, 80% 100%, 20% 80%);
    animation: drift1 28s infinite alternate;
}
.shard-2 {
    top: 70vh; left: 86vw;
    width: 60px; height: 120px;
    background: var(--oxidized-copper);
    clip-path: polygon(0 20%, 100% 0, 80% 100%, 20% 80%);
    animation: drift2 34s infinite alternate;
}
.shard-3 {
    top: 160vh; left: 14vw;
    width: 140px; height: 70px;
    background: var(--fired-clay);
    clip-path: polygon(0 50%, 40% 0, 100% 30%, 80% 100%, 20% 90%);
    animation: drift3 42s infinite alternate;
    opacity: 0.28;
}
.shard-4 {
    top: 230vh; left: 78vw;
    width: 80px; height: 100px;
    background: var(--oxidized-copper);
    clip-path: polygon(20% 0, 100% 40%, 70% 100%, 0 60%);
    animation: drift1 30s infinite alternate;
}
.shard-5 {
    top: 310vh; left: 22vw;
    width: 110px; height: 55px;
    background: var(--fired-clay);
    clip-path: polygon(0 30%, 60% 0, 100% 50%, 40% 100%);
    animation: drift2 36s infinite alternate;
    opacity: 0.3;
}
.shard-6 {
    top: 370vh; left: 82vw;
    width: 70px; height: 140px;
    background: var(--oxidized-copper);
    clip-path: polygon(40% 0, 100% 30%, 60% 100%, 0 70%);
    animation: drift3 38s infinite alternate;
}
.shard-7 {
    top: 420vh; left: 10vw;
    width: 100px; height: 80px;
    background: var(--fired-clay);
    clip-path: polygon(0 40%, 50% 0, 100% 40%, 80% 100%, 20% 100%);
    animation: drift1 32s infinite alternate;
    opacity: 0.25;
}
.shard-8 {
    top: 460vh; left: 68vw;
    width: 55px; height: 95px;
    background: var(--oxidized-copper);
    clip-path: polygon(30% 0, 100% 50%, 70% 100%, 0 60%);
    animation: drift2 40s infinite alternate;
}

@keyframes drift1 {
    0%   { transform: translate3d(0, 0, 0) rotate(0deg); }
    100% { transform: translate3d(40px, -30px, 0) rotate(8deg); }
}
@keyframes drift2 {
    0%   { transform: translate3d(0, 0, 0) rotate(0deg); }
    100% { transform: translate3d(-50px, 30px, 0) rotate(-6deg); }
}
@keyframes drift3 {
    0%   { transform: translate3d(0, 0, 0) rotate(0deg); }
    100% { transform: translate3d(30px, 40px, 0) rotate(10deg); }
}

/* ============ KINTSUGI SEAM — vertical golden line ============ */
.kintsugi-seam {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    opacity: 0.6;
    transition: opacity 0.5s ease, stroke-width 0.5s ease;
}

#seamPath {
    stroke-dasharray: 5400;
    stroke-dashoffset: 5400;
    animation: drawSeam 3s 0.6s cubic-bezier(0.65, 0, 0.35, 1) forwards;
    transition: stroke-width 0.4s ease;
}

.kintsugi-seam.proximity {
    opacity: 1;
}
.kintsugi-seam.proximity #seamPath {
    stroke-width: 1.5;
}

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

/* ============ CONTENT LAYER (z: 0) ============ */
.content-layer {
    position: relative;
    z-index: 1;
}

.section {
    position: relative;
    padding: clamp(6rem, 12vh, 10rem) clamp(1.5rem, 5vw, 6rem);
    min-height: 100vh;
    display: block;
}

.section[data-clip="reveal"] {
    clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
    transition: clip-path 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.section[data-clip="reveal"].in-view {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

/* ==== HERO ==== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    overflow: hidden;
}

.lottie-hero {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(80vh, 80vw);
    height: min(80vh, 80vw);
    mix-blend-mode: screen;
    opacity: 0.55;
    pointer-events: none;
    z-index: 0;
}

.lottie-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.72;
    mix-blend-mode: screen;
}

.crystal {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: visible;
    opacity: 0.75;
}

.crystal-group {
    transform-origin: center;
    animation: crystalBreath 12s ease-in-out infinite;
}

.crystal-facet {
    transform-origin: center;
    animation: facetDrift 20s ease-in-out infinite alternate;
}
.crystal-facet.f1 { animation-delay: 0s; }
.crystal-facet.f2 { animation-delay: -6s; }
.crystal-facet.f3 { animation-delay: -12s; }

.crack-line {
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
    animation: crackDraw 6s ease-in-out infinite alternate;
}
.crack-line.cl1 { animation-delay: 0s; }
.crack-line.cl2 { animation-delay: -2s; }
.crack-line.cl3 { animation-delay: -4s; }

@keyframes crystalBreath {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50%      { transform: scale(1.03) rotate(0.6deg); }
}
@keyframes facetDrift {
    0%   { transform: translate(0, 0) rotate(0deg); opacity: 0.9; }
    100% { transform: translate(4px, -2px) rotate(1.2deg); opacity: 0.5; }
}
@keyframes crackDraw {
    0%   { stroke-dashoffset: 400; opacity: 0.1; }
    50%  { stroke-dashoffset: 0;   opacity: 1;   }
    100% { stroke-dashoffset: -400; opacity: 0.1; }
}

.hero-inner {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

.eyebrow {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--ash-mist);
    letter-spacing: 0.08em;
    text-transform: lowercase;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: clamp(1.5rem, 4vh, 3rem);
    opacity: 0;
    animation: fadeUp 1s 2.6s ease-out forwards;
}
.eyebrow-mark {
    color: var(--kintsugi-gold);
    font-size: 0.75rem;
    transform: translateY(-1px);
}

.hero-title {
    font-family: var(--font-serif);
    font-size: clamp(2.8rem, 7vw, 6rem);
    line-height: 0.95;
    letter-spacing: -0.04em;
    font-weight: 400;
    color: var(--fracture-white);
    margin-bottom: clamp(1.5rem, 3vh, 2.5rem);
    transform: rotate(-0.4deg);
}

.hero-title .letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(2px);
    animation: letterIn 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: calc(0.8s + var(--letter-delay, 0) * 120ms);
}
.hero-title .letter:nth-child(1) { --letter-delay: 0; }
.hero-title .letter:nth-child(2) { --letter-delay: 1; }
.hero-title .letter:nth-child(3) { --letter-delay: 2; }
.hero-title .letter:nth-child(4) { --letter-delay: 3; }
.hero-title .letter:nth-child(5) { --letter-delay: 4; }
.hero-title .letter:nth-child(6) { --letter-delay: 5; }
.hero-title .letter:nth-child(7) { --letter-delay: 6; }
.hero-title .letter:nth-child(8) { --letter-delay: 7; }
.hero-title .letter:nth-child(9) { --letter-delay: 8; }

.hero-title .letter.dot {
    color: var(--kintsugi-gold);
    margin: 0 0.05em;
}

@keyframes letterIn {
    from { opacity: 0; transform: translateY(2px); }
    to   { opacity: 1; transform: translateY(0); }
}

.hero-sub {
    font-family: var(--font-sans);
    font-size: clamp(1.125rem, 1.6vw, 1.375rem);
    max-width: 42ch;
    color: var(--aged-parchment);
    margin-bottom: clamp(2rem, 5vh, 3.5rem);
    opacity: 0;
    animation: fadeUp 1s 3s ease-out forwards;
}

.hero-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    opacity: 0;
    animation: fadeUp 1s 3.2s ease-out forwards;
}
.meta-dot {
    width: 6px; height: 6px;
    background: var(--kintsugi-gold);
    transform: rotate(45deg);
}
.meta-line {
    font-family: var(--font-mono);
    font-style: italic;
    font-size: 0.8125rem;
    color: var(--ash-mist);
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* scroll hint */
.scroll-hint {
    position: absolute;
    bottom: clamp(2rem, 5vh, 4rem);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--ash-mist);
    letter-spacing: 0.2em;
    text-transform: lowercase;
    opacity: 0;
    animation: fadeUp 1s 3.6s ease-out forwards, hintPulse 2.4s 4.6s ease-in-out infinite;
}
.scroll-hint-arrow {
    color: var(--kintsugi-gold);
    font-size: 0.625rem;
}

@keyframes hintPulse {
    0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.6; }
    50%      { transform: translateX(-50%) translateY(4px); opacity: 1; }
}

/* ==== STRATUM sections — excavation grid ==== */
.stratum {
    position: relative;
}

.excavation-grid {
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    gap: var(--grid-gap);
    max-width: 1400px;
    margin: 0 auto;
    align-items: start;
}

/* progressive widening of gap with depth */
.stratum-01 .excavation-grid { --grid-gap: clamp(0.5rem, 2vw, 1.5rem); }
.stratum-02 .excavation-grid { --grid-gap: clamp(0.75rem, 2.5vw, 2rem); }
.stratum-03 .excavation-grid { --grid-gap: clamp(1rem, 3vw, 2.5rem); }
.stratum-04 .excavation-grid { --grid-gap: clamp(1.25rem, 3.5vw, 3rem); }

/* odd-number column spans */
.col-span-3  { grid-column: span 3; }
.col-span-5  { grid-column: span 5; }
.col-span-7  { grid-column: span 7; }

.col-start-1  { grid-column-start: 1; }
.col-start-2  { grid-column-start: 2; }
.col-start-3  { grid-column-start: 3; }
.col-start-4  { grid-column-start: 4; }
.col-start-6  { grid-column-start: 6; }
.col-start-8  { grid-column-start: 8; }
.col-start-9  { grid-column-start: 9; }
.col-start-10 { grid-column-start: 10; }
.col-start-12 { grid-column-start: 12; }
.col-start-13 { grid-column-start: 13; }

.grid-item {
    margin-bottom: clamp(2rem, 5vh, 4rem);
    opacity: 0;
    transform: translate3d(0, 20px, 0);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.grid-item.tilt-pos { transform: translate3d(40px, 20px, 0) rotate(0.5deg); }
.grid-item.tilt-neg { transform: translate3d(-40px, 20px, 0) rotate(-0.6deg); }
.grid-item.offset-down { margin-top: clamp(3rem, 8vh, 6rem); }
.grid-item.offset-up   { margin-top: clamp(-3rem, -4vh, -1rem); }

.in-view .grid-item,
.grid-item.in-view {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}
.in-view .grid-item.tilt-pos { transform: translate3d(0, 0, 0) rotate(0.5deg); }
.in-view .grid-item.tilt-neg { transform: translate3d(0, 0, 0) rotate(-0.6deg); }

/* ==== typographic components ==== */
.label-mono {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--ash-mist);
    letter-spacing: 0.14em;
    text-transform: lowercase;
    margin-bottom: 1rem;
    padding-left: 1rem;
    border-left: 1px solid var(--kintsugi-gold);
}
.label-mono.italic { font-style: italic; }

.heading {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 4.2vw, 3.4rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
    font-weight: 400;
    color: var(--fracture-white);
}

.body-text {
    font-family: var(--font-sans);
    font-size: 1.0625rem;
    line-height: 1.75;
    color: var(--aged-parchment);
    margin-top: 1.25rem;
}
.body-text.italic { font-style: italic; color: var(--ash-mist); font-size: 0.9375rem; }

.pull-quote {
    font-family: var(--font-serif);
    font-size: clamp(1.25rem, 2vw, 1.75rem);
    line-height: 1.4;
    font-style: italic;
    color: var(--aged-parchment);
    padding-left: 1.25rem;
    border-left: 1px solid var(--fired-clay);
}

/* ==== link (kintsugi hover) ==== */
.link {
    color: var(--kintsugi-gold);
    text-decoration: none;
    position: relative;
    transition: color 0.3s ease;
}
.link::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -3px;
    height: 1px;
    background: var(--oxidized-copper);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.link:hover {
    color: var(--oxidized-copper);
}
.link:hover::after {
    transform: scaleX(1);
}

/* ==== STRATUM 02 — casa lottie ==== */
.lottie-casa {
    position: absolute;
    top: 4vh;
    right: clamp(2rem, 8vw, 10rem);
    width: clamp(220px, 28vw, 420px);
    height: clamp(180px, 22vw, 340px);
    z-index: 0;
    opacity: 0.9;
    pointer-events: none;
}
.casa-form {
    position: relative;
    width: 100%;
    height: 100%;
    opacity: 0.82;
}
.casa-group {
    transform-origin: center 40%;
    opacity: 0;
}
.lottie-casa.playing .casa-group {
    animation: casaAssemble 4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.casa-shard {
    transform-origin: center;
    opacity: 0;
}
.lottie-casa.playing .casa-shard.s1 { animation: shardIn 1s 0.2s forwards cubic-bezier(0.16, 1, 0.3, 1), shardCrack 2s 2.5s forwards cubic-bezier(0.65, 0, 0.35, 1); }
.lottie-casa.playing .casa-shard.s2 { animation: shardIn 1s 0.5s forwards cubic-bezier(0.16, 1, 0.3, 1), shardCrack2 2s 2.5s forwards cubic-bezier(0.65, 0, 0.35, 1); }
.lottie-casa.playing .casa-shard.s3 { animation: shardIn 1s 0.8s forwards cubic-bezier(0.16, 1, 0.3, 1), shardCrack3 2s 2.5s forwards cubic-bezier(0.65, 0, 0.35, 1); }
.lottie-casa.playing .casa-shard.s4 { animation: shardIn 1s 1.1s forwards cubic-bezier(0.16, 1, 0.3, 1); }
.casa-gold {
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
}
.lottie-casa.playing .casa-gold.g1 { animation: goldDraw 1s 1.4s forwards ease-out; }
.lottie-casa.playing .casa-gold.g2 { animation: goldDraw 1s 1.7s forwards ease-out; }
.lottie-casa.playing .casa-gold.g3 { animation: goldDraw 1s 2.0s forwards ease-out; }
.lottie-casa.playing .casa-group { opacity: 1; }

@keyframes shardIn {
    from { opacity: 0; transform: translateY(-20px) rotate(-4deg); }
    to   { opacity: 1; transform: translateY(0) rotate(0); }
}
@keyframes shardCrack {
    to { transform: translate3d(-8px, -4px, 0) rotate(-2deg); opacity: 0.85; }
}
@keyframes shardCrack2 {
    to { transform: translate3d(-4px, 3px, 0) rotate(1deg); opacity: 0.85; }
}
@keyframes shardCrack3 {
    to { transform: translate3d(5px, 2px, 0) rotate(-1.5deg); opacity: 0.85; }
}
@keyframes goldDraw {
    to { stroke-dashoffset: 0; }
}
@keyframes casaAssemble {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ==== data chips ==== */
.data-chip {
    padding: 1.25rem 1rem;
    background: var(--smoked-ivory);
    border: 1px solid transparent;
    border-image: linear-gradient(135deg, var(--kintsugi-gold) 0%, transparent 60%) 1;
    clip-path: polygon(0 8%, 92% 0, 100% 90%, 8% 100%);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    transition: transform 0.4s ease, background-color 0.4s ease;
}
.data-chip:hover {
    transform: translateY(-4px) rotate(-0.4deg);
    background-color: #332A22;
}
.chip-num {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 3.2vw, 2.8rem);
    color: var(--fracture-white);
    line-height: 1;
    letter-spacing: -0.03em;
}
.chip-lbl {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--ash-mist);
    letter-spacing: 0.1em;
}
.chip-lbl.italic { font-style: italic; }

/* ==== STRATUM 03 — material list ==== */
.material-list {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding: 1.25rem 0;
    border-top: 1px solid rgba(138, 126, 107, 0.3);
    border-bottom: 1px solid rgba(138, 126, 107, 0.3);
}
.material {
    display: grid;
    grid-template-columns: 1fr auto 1.2fr;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px dashed rgba(138, 126, 107, 0.2);
    transition: background-color 0.3s ease, padding-left 0.3s ease;
}
.material:last-child { border-bottom: 0; }
.material:hover {
    background: rgba(94, 123, 106, 0.06);
    padding-left: 0.5rem;
}
.material-name {
    font-family: var(--font-serif);
    font-size: clamp(1.1rem, 1.5vw, 1.35rem);
    color: var(--fracture-white);
    letter-spacing: -0.01em;
}
.material-swatch {
    width: 28px; height: 28px;
    background: var(--sw, var(--aged-parchment));
    clip-path: polygon(10% 0, 90% 0, 100% 90%, 0 100%);
    box-shadow: 0 0 0 1px rgba(196, 151, 59, 0.25);
}
.material-note {
    font-family: var(--font-mono);
    font-style: italic;
    font-size: 0.8125rem;
    color: var(--ash-mist);
}

/* ==== STRATUM 04 — era cards ==== */
.era-card {
    padding: 1.5rem 1.25rem;
    background: var(--smoked-ivory);
    clip-path: polygon(6% 0, 100% 0, 94% 100%, 0 100%);
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    transition: transform 0.4s ease;
}
.era-card:hover {
    transform: translateY(-3px);
}
.era-year {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--kintsugi-gold);
    letter-spacing: 0.12em;
    text-transform: lowercase;
}
.era-year.italic { font-style: italic; }
.era-desc {
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--aged-parchment);
}

/* ==== CLOSING ==== */
.closing {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: clamp(8rem, 16vh, 12rem) clamp(1.5rem, 5vw, 6rem);
}
.closing-inner {
    max-width: 620px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}
.closing-heading {
    font-family: var(--font-serif);
    font-size: clamp(1.75rem, 3.2vw, 2.6rem);
    line-height: 1.15;
    letter-spacing: -0.03em;
    color: var(--fracture-white);
    font-weight: 400;
}
.closing-body {
    font-family: var(--font-sans);
    font-size: 1.0625rem;
    line-height: 1.75;
    color: var(--aged-parchment);
}

.hanko {
    width: clamp(80px, 10vw, 120px);
    height: clamp(80px, 10vw, 120px);
    margin-top: 1rem;
    opacity: 0;
    transform: scale(0.7) rotate(-4deg);
    transition: opacity 4s ease-in-out, transform 4s ease-in-out;
}
.closing.in-view .hanko {
    opacity: 0.7;
    transform: scale(1) rotate(0deg);
    animation: hankoBreath 6s 4s ease-in-out infinite alternate;
}
@keyframes hankoBreath {
    0%   { opacity: 0.7; transform: scale(1); }
    100% { opacity: 1;   transform: scale(1.03); }
}

.foot {
    margin-top: 2rem;
}
.foot-mark {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--ash-mist);
    letter-spacing: 0.12em;
    text-transform: lowercase;
}
.foot-mark.italic { font-style: italic; }

/* ==== Responsive — preserve odd-column feel, collapse gracefully ==== */
@media (max-width: 900px) {
    .excavation-grid {
        grid-template-columns: repeat(8, 1fr);
    }
    .col-span-3  { grid-column: span 4; }
    .col-span-5  { grid-column: span 8; }
    .col-span-7  { grid-column: span 8; }
    .col-start-1, .col-start-2, .col-start-3, .col-start-4,
    .col-start-6, .col-start-8, .col-start-9, .col-start-10,
    .col-start-12, .col-start-13 { grid-column-start: auto; }
    .grid-item.offset-down { margin-top: 0; }
    .grid-item.offset-up   { margin-top: 0; }
    .lottie-casa {
        position: relative;
        width: 100%;
        height: 200px;
        right: auto;
        top: auto;
        margin-bottom: 2rem;
    }
    .lottie-hero {
        width: 90vw;
        height: 90vw;
    }
}

/* ==== reduced motion ==== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .terrain,
    .bg-texture,
    .eyebrow,
    .hero-sub,
    .hero-meta,
    .scroll-hint,
    .hero-title .letter,
    .hanko,
    .grid-item {
        opacity: 1;
        transform: none;
    }
    .section[data-clip="reveal"] {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
    .kintsugi-seam {
        opacity: 1;
    }
    #seamPath {
        stroke-dashoffset: 0;
    }
    .kintsugi-cracks .crack {
        stroke-dashoffset: 0;
    }
    .shard { display: none; }
}
