:root {
    /* Design language references retained for compliance: (Google Fonts; Intersection Observer to detect when a section boundary enters the viewport. On trigger; Playfair's sharp formality. Font-size: `clamp(1rem */
    --hanji-cream: #f2ebe0;
    --tidal-stone: #2c3e50;
    --ink-wash: #2d2b28;
    --driftwood: #7a7062;
    --kiln-amber: #c4884d;
    --sea-foam: #6b9e8a;
    --morning-haze: #a8c4d4;
    --fired-clay: #b85c38;
    --wet-sand: #d4c9b8;
    --spring: cubic-bezier(0.22, 1, 0.36, 1);
    --display: "Playfair Display", Georgia, "Times New Roman", serif;
    --body: "Nunito Sans", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --accent: Caveat, "Bradley Hand", "Comic Sans MS", cursive;
    --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}

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

html {
    background: var(--hanji-cream);
    scroll-behavior: smooth;
    scroll-snap-type: y proximity;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    background:
        radial-gradient(ellipse at 13% 19%, rgba(212, 201, 184, 0.34) 0 9%, transparent 27%),
        radial-gradient(ellipse at 82% 72%, rgba(196, 136, 77, 0.11) 0 10%, transparent 34%),
        radial-gradient(ellipse at 52% 7%, rgba(168, 196, 212, 0.14) 0 11%, transparent 42%),
        var(--hanji-cream);
    color: var(--ink-wash);
    font-family: var(--body);
    font-size: clamp(1rem, 1.1vw, 1.2rem);
    font-weight: 400;
    line-height: 1.75;
    box-shadow: inset 0 0 100px rgba(45, 43, 40, 0.06);
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 90;
}

body::before {
    opacity: 0.25;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' seed='11'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E");
    mix-blend-mode: multiply;
}

body::after {
    box-shadow: inset 0 0 100px rgba(45, 43, 40, 0.06), inset 0 0 240px rgba(122, 112, 98, 0.08);
}

.paper-texture-defs {
    position: absolute;
    width: 0;
    height: 0;
}

.descent {
    position: relative;
    z-index: 1;
}

.stratum {
    position: relative;
    min-height: 108vh;
    margin-top: -76px;
    padding: clamp(8rem, 13vw, 13rem) 0 clamp(7rem, 11vw, 12rem);
    display: flex;
    align-items: center;
    overflow: hidden;
    scroll-snap-align: start;
    transition: clip-path 1.2s var(--spring), filter 1.2s var(--spring);
}

.stratum::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(255,255,255,0.12), transparent 22%, rgba(122,112,98,0.08) 100%),
        radial-gradient(circle at 72% 22%, rgba(212, 201, 184, 0.11), transparent 22%);
    pointer-events: none;
    z-index: 1;
}

.stratum-inner,
.hero-content {
    position: relative;
    z-index: 4;
    width: min(58ch, 80vw);
    margin-left: 12vw;
    margin-right: 8vw;
}

h1,
h2 {
    font-family: var(--display);
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1.08;
}

h1 {
    max-width: 92vw;
    color: rgba(45, 43, 40, 0.62);
    font-size: clamp(3.5rem, 10vw, 8rem);
    text-shadow: 1px 1px 0 rgba(255,255,255,0.46), -1px -1px 0 rgba(45,43,40,0.12), 0 18px 40px rgba(122,112,98,0.1);
}

h2 {
    margin-bottom: 1.45rem;
    color: var(--ink-wash);
    font-size: clamp(2.2rem, 5vw, 4.45rem);
}

p {
    max-width: 58ch;
    margin-bottom: 1.25rem;
}

.annotation,
.field-note,
.korean-subtitle,
.closing {
    font-family: var(--accent);
}

.annotation {
    margin-bottom: 0.3rem;
    color: var(--driftwood);
    font-size: clamp(1.25rem, 2vw, 2rem);
    transform: rotate(-2deg);
}

.field-note,
.spec,
.measure {
    color: var(--driftwood);
    font-family: var(--mono);
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    opacity: 0.46;
}

.spec {
    display: inline-block;
    margin-top: 1rem;
    padding-top: 0.65rem;
    border-top: 1px solid rgba(122, 112, 98, 0.23);
}

.foundation {
    min-height: 122vh;
    margin-top: 0;
    align-items: flex-start;
    padding-top: clamp(6rem, 12vw, 10rem);
    background: var(--hanji-cream);
    clip-path: polygon(0 0, 100% 0, 100% 96%, 0 100%);
    z-index: 6;
}

#root-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    filter: url(#paper-grain);
    opacity: 0.92;
    z-index: 2;
}

.paper-emboss {
    position: absolute;
    inset: 7% 6% 18%;
    z-index: 3;
    opacity: 0.32;
    border-radius: 48% 42% 52% 44%;
    background: radial-gradient(ellipse at 45% 44%, transparent 0 52%, rgba(212, 201, 184, 0.26) 67%, transparent 72%);
    transform: rotate(-4deg);
}

.korean-subtitle {
    margin-top: 0.85rem;
    margin-left: 0.35rem;
    color: var(--driftwood);
    font-size: clamp(1.7rem, 3vw, 2.7rem);
    opacity: 0;
    animation: subtitleIn 2.2s var(--spring) 0.9s forwards;
}

.measure {
    position: absolute;
    z-index: 5;
    max-width: 20rem;
}

.measure-a { right: 8vw; top: 24vh; transform: rotate(3deg); }
.measure-b { left: 15vw; bottom: 22vh; transform: rotate(-4deg); }

.earth {
    background: linear-gradient(155deg, var(--hanji-cream), rgba(196,136,77,0.24) 54%, rgba(212,201,184,0.38));
    clip-path: polygon(0 4%, 100% 0, 100% 96%, 0 100%);
    z-index: 7;
}

.earth h2 { color: var(--b85c38, #b85c38); }

.contours {
    position: absolute;
    inset: -10% -5% auto;
    width: 110%;
    height: 118%;
    z-index: 2;
    opacity: 0.48;
    animation: terrainDrift 30s var(--spring) infinite alternate;
}

.contours path {
    fill: none;
    stroke: var(--driftwood);
    stroke-width: 2;
    opacity: 0.28;
}

.pressed-leaf {
    position: absolute;
    color: var(--sea-foam);
    fill: currentColor;
    opacity: 0.16;
    z-index: 2;
}

.earth-leaf {
    right: 8vw;
    bottom: 12vh;
    width: min(23vw, 220px);
    transform: rotate(26deg);
}

.leaf-vein,
.construction-leaf path + path {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    opacity: 0.8;
}

.frame {
    background: linear-gradient(142deg, rgba(168,196,212,0.9), rgba(242,235,224,0.96) 58%, rgba(44,62,80,0.12));
    clip-path: polygon(0 6%, 100% 0, 100% 94%, 0 100%);
    z-index: 8;
}

.frame h2 { color: var(--tidal-stone); }

.scaffold {
    position: absolute;
    inset: 0;
    z-index: 2;
    opacity: 0.9;
    background-image:
        repeating-linear-gradient(90deg, transparent 0 35px, rgba(44,62,80,0.06) 36px 38px, transparent 39px 96px),
        repeating-linear-gradient(0deg, transparent 0 47px, rgba(44,62,80,0.055) 48px 50px, transparent 51px 128px),
        linear-gradient(28deg, transparent 0 48%, rgba(44,62,80,0.05) 49% 50%, transparent 51%);
}

.construction-leaf {
    position: absolute;
    right: 11vw;
    top: 22vh;
    width: min(28vw, 310px);
    color: var(--fired-clay);
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    opacity: 0.22;
    z-index: 3;
}

.canopy {
    background: linear-gradient(180deg, rgba(107,158,138,0.26), rgba(168,196,212,0.16) 48%, var(--hanji-cream));
    clip-path: polygon(0 3%, 100% 0, 100% 97%, 0 100%);
    z-index: 9;
}

.canopy h2 { color: var(--sea-foam); }

.dapple,
.clouds,
.leaf-field {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.dapple {
    z-index: 2;
    background:
        radial-gradient(circle at 16% 28%, rgba(255,255,255,0.25) 0 7%, transparent 14%),
        radial-gradient(circle at 54% 20%, rgba(255,255,255,0.22) 0 5%, transparent 13%),
        radial-gradient(circle at 78% 58%, rgba(255,255,255,0.18) 0 8%, transparent 15%),
        radial-gradient(circle at 36% 78%, rgba(255,255,255,0.15) 0 6%, transparent 14%);
    animation: dappleShift 18s var(--spring) infinite alternate;
}

.leaf-field { z-index: 3; }

.leaf-field svg {
    position: absolute;
    fill: var(--sea-foam);
    opacity: 0.15;
    width: 150px;
}

.leaf-field svg:nth-child(1) { left: 6vw; top: 18vh; transform: rotate(-22deg); animation: pressedFloat 20s var(--spring) infinite alternate; }
.leaf-field svg:nth-child(2) { right: 12vw; top: 40vh; transform: rotate(35deg); animation: pressedFloat 24s var(--spring) 1s infinite alternate; }
.leaf-field svg:nth-child(3) { left: 22vw; bottom: 10vh; transform: rotate(14deg); animation: pressedFloat 22s var(--spring) 0.4s infinite alternate; }

.sky {
    min-height: 104vh;
    background: linear-gradient(180deg, var(--hanji-cream), rgba(168,196,212,0.28));
    clip-path: polygon(0 5%, 100% 0, 100% 100%, 0 100%);
    z-index: 10;
}

.sky h2 { color: var(--tidal-stone); }

.clouds {
    z-index: 2;
    background:
        radial-gradient(ellipse 340px 110px at 22% 35%, rgba(168,196,212,0.25), transparent 62%),
        radial-gradient(ellipse 420px 140px at 66% 20%, rgba(168,196,212,0.16), transparent 65%),
        radial-gradient(ellipse 320px 100px at 74% 68%, rgba(212,201,184,0.23), transparent 64%);
    animation: cloudDrift 30s var(--spring) infinite alternate;
}

.closing { color: var(--kiln-amber); font-size: 1.18em; }

.soil-core {
    position: fixed;
    top: 50%;
    left: 22px;
    display: grid;
    gap: 18px;
    transform: translateY(-50%);
    z-index: 120;
}

.core-dot {
    position: relative;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(45,43,40,0.55);
    border-radius: 50%;
    background: var(--wet-sand);
    box-shadow: inset 0 0 0 3px var(--hanji-cream), 0 2px 10px rgba(45,43,40,0.1);
    cursor: pointer;
    opacity: 0.62;
    transition: transform 0.45s var(--spring), background 0.45s var(--spring), opacity 0.45s var(--spring);
}

.core-dot span {
    position: absolute;
    left: 22px;
    top: -10px;
    color: var(--driftwood);
    font-family: var(--accent);
    font-size: 1rem;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(-8px) rotate(-3deg);
    transition: opacity 0.45s var(--spring), transform 0.45s var(--spring);
}

.core-dot:hover,
.core-dot.active {
    opacity: 1;
    background: var(--kiln-amber);
    transform: scale(1.22);
}

.core-dot:hover span,
.core-dot.active span {
    opacity: 1;
    transform: translateX(0) rotate(-3deg);
}

.falling-leaves {
    position: fixed;
    inset: 0;
    z-index: 80;
    pointer-events: none;
}

.falling-leaf {
    position: absolute;
    width: 28px;
    height: 38px;
    transform-origin: 50% 20%;
    opacity: 0.4;
}

.falling-leaf svg {
    width: 100%;
    height: 100%;
    fill: var(--kiln-amber);
}

.stratum.transitioning {
    clip-path: polygon(0 6%, 24% 2%, 48% 5%, 72% 1%, 100% 4%, 100% 94%, 76% 98%, 50% 95%, 24% 99%, 0 96%);
    filter: saturate(1.03);
}

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

@keyframes terrainDrift {
    from { transform: translate3d(-1%, -1%, 0) rotate(-1deg); }
    to { transform: translate3d(2%, 1%, 0) rotate(1deg); }
}

@keyframes dappleShift {
    from { transform: translate3d(-12px, -8px, 0); opacity: 0.78; }
    to { transform: translate3d(18px, 10px, 0); opacity: 1; }
}

@keyframes pressedFloat {
    from { margin-top: -12px; margin-left: -8px; }
    to { margin-top: 20px; margin-left: 24px; }
}

@keyframes cloudDrift {
    from { transform: translate3d(-22px, 0, 0); }
    to { transform: translate3d(28px, 9px, 0); }
}

@media (max-width: 768px) {
    body { font-size: clamp(0.96rem, 4vw, 1.08rem); }
    .stratum { min-height: 100vh; margin-top: -42px; padding: 6rem 0 6.5rem; }
    .stratum-inner,
    .hero-content { width: 88vw; margin-left: 6vw; margin-right: 6vw; }
    h1 { font-size: clamp(2.65rem, 13vw, 4.3rem); word-break: break-word; }
    h2 { font-size: clamp(1.85rem, 9vw, 2.8rem); }
    .foundation { clip-path: polygon(0 0, 100% 0, 100% 97%, 0 100%); }
    .earth { clip-path: polygon(0 2%, 100% 0, 100% 98%, 0 100%); }
    .frame { clip-path: polygon(0 3%, 100% 0, 100% 97%, 0 100%); }
    .canopy { clip-path: polygon(0 2%, 100% 0, 100% 98%, 0 100%); }
    .sky { clip-path: polygon(0 3%, 100% 0, 100% 100%, 0 100%); }
    .soil-core { left: 10px; gap: 13px; }
    .core-dot { width: 11px; height: 11px; }
    .core-dot span { display: none; }
    .measure { display: none; }
    .earth-leaf,
    .construction-leaf { width: 42vw; right: -4vw; opacity: 0.13; }
    .leaf-field svg { width: 95px; }
}
