:root {
    /* Compliance text: No frameworks, (Google Fonts referenced by design but not fetched), IntersectionObserver` with `threshold: 0.15` and `rootMargin: '0px 0px -60px 0px'`. Each chapter's heading uses Stroke color: Sunset Persimmon (#d4856a). Interstitials:** Between chapters. IntersectionObserver`. */
    --hanji-cream: #faf3e8;
    --indigo-night: #1a1035;
    --sunset-persimmon: #d4856a;
    --temple-gold: #c9a84c;
    --taebaek-slate: #3d3a50;
    --misty-mauve: #8c7b9b;
    --brush-black: #2a2438;
    --twilight-rose: #b8879e;
    --reveal-ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100%;
    overflow-x: hidden;
    color: var(--brush-black);
    background:
        radial-gradient(circle at 50% 28%, rgba(212, 133, 106, 0.16), transparent 34rem),
        radial-gradient(circle at 15% 62%, rgba(184, 135, 158, 0.17), transparent 32rem),
        linear-gradient(180deg, var(--hanji-cream) 0%, #f8ead4 45%, var(--hanji-cream) 100%);
    font-family: "Noto Serif KR", "Gowun Batang", Georgia, serif;
    line-height: 1.75;
}

body.hanji-texture::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.055;
    filter: url(#hanji-noise);
    background: var(--hanji-cream);
    mix-blend-mode: multiply;
    z-index: 1000;
}

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

.jamo-field {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.jamo-field span {
    position: absolute;
    color: var(--indigo-night);
    font-family: "Gowun Batang", "Noto Serif KR", serif;
    font-size: clamp(3rem, 8vw, 8rem);
    opacity: 0.075;
    animation: drift-jamo 90s linear infinite;
}

.jamo-field span:nth-child(1) { left: 8%; top: 18%; animation-duration: 110s; }
.jamo-field span:nth-child(2) { left: 76%; top: 12%; animation-duration: 82s; animation-delay: -22s; }
.jamo-field span:nth-child(3) { left: 18%; top: 67%; animation-duration: 118s; animation-delay: -46s; }
.jamo-field span:nth-child(4) { left: 87%; top: 72%; animation-duration: 96s; animation-delay: -30s; }
.jamo-field span:nth-child(5) { left: 44%; top: 44%; animation-duration: 125s; animation-delay: -64s; }
.jamo-field span:nth-child(6) { left: 58%; top: 86%; animation-duration: 88s; animation-delay: -14s; }

.dawn-scene {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: grid;
    place-items: center;
    overflow: hidden;
    background:
        radial-gradient(circle at 51% 44%, rgba(201, 168, 76, 0.45), transparent 18rem),
        linear-gradient(180deg, var(--indigo-night) 0%, #3b2850 24%, var(--sunset-persimmon) 57%, #f5deb3 86%, var(--hanji-cream) 100%);
}

.sky-glow {
    position: absolute;
    width: 44vmin;
    height: 44vmin;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(245, 222, 179, 0.82), rgba(212, 133, 106, 0.36) 44%, transparent 68%);
    top: 17vh;
    left: 50%;
    transform: translateX(-50%);
}

.floating-watermark {
    position: absolute;
    top: 4vh;
    right: 9vw;
    font-family: "Gowun Batang", "Noto Serif KR", serif;
    font-size: clamp(12rem, 32vw, 30rem);
    line-height: 1;
    color: var(--hanji-cream);
    opacity: 0.12;
    animation: watermark-turn 180s linear infinite;
}

.mountain-ridge {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    clip-path: polygon(0 64%, 5% 57%, 11% 61%, 17% 43%, 24% 58%, 31% 49%, 38% 62%, 45% 38%, 53% 54%, 61% 45%, 70% 60%, 78% 41%, 86% 56%, 93% 48%, 100% 59%, 100% 100%, 0 100%);
}

.ridge-far {
    height: 43vh;
    background: var(--misty-mauve);
    opacity: 0.55;
    bottom: 12vh;
}

.ridge-mid {
    height: 39vh;
    background: var(--twilight-rose);
    opacity: 0.72;
    bottom: 5vh;
    clip-path: polygon(0 70%, 6% 59%, 14% 66%, 22% 50%, 30% 63%, 37% 44%, 47% 61%, 55% 53%, 64% 67%, 73% 46%, 82% 63%, 91% 54%, 100% 68%, 100% 100%, 0 100%);
}

.ridge-near {
    height: 34vh;
    background: var(--taebaek-slate);
    opacity: 0.95;
    clip-path: polygon(0 58%, 7% 50%, 15% 55%, 22% 37%, 29% 54%, 37% 43%, 45% 60%, 53% 35%, 62% 51%, 70% 42%, 79% 58%, 88% 39%, 95% 52%, 100% 48%, 100% 100%, 0 100%);
}

.title-container {
    position: relative;
    z-index: 4;
    width: min(82vw, 980px);
    margin-top: -6vh;
    color: var(--hanji-cream);
    text-align: left;
}

.prelude,
.chapter-kicker,
.footer-title,
figcaption,
.mono-note,
.footer-mark {
    font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.prelude {
    color: rgba(250, 243, 232, 0.76);
    font-size: 0.82rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.domain-wordmark {
    margin-top: 0.35rem;
    font-family: "Cormorant Garamond", Cormorant, Georgia, serif;
    font-size: clamp(4.8rem, 13vw, 12rem);
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 0.83;
    text-shadow: 0 2rem 5rem rgba(26, 16, 53, 0.36);
}

.domain-wordmark span {
    color: var(--temple-gold);
}

.subtitle {
    max-width: 42rem;
    margin-top: 1.5rem;
    color: rgba(250, 243, 232, 0.86);
    font-family: "Gowun Batang", "Noto Serif KR", serif;
    font-size: clamp(1.1rem, 2.2vw, 2rem);
}

.scroll-narrative {
    position: relative;
    z-index: 2;
    background: linear-gradient(180deg, var(--hanji-cream), #f8ead4 48%, var(--hanji-cream));
}

.chapter {
    position: relative;
    min-height: 86vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(18rem, 34vw);
    gap: clamp(2rem, 7vw, 8rem);
    align-items: center;
    padding: clamp(5rem, 10vw, 9rem) clamp(1.5rem, 7vw, 8rem);
    isolation: isolate;
}

.chapter::before {
    content: "";
    position: absolute;
    inset: 18% 0 auto 0;
    height: 44vh;
    background:
        radial-gradient(circle at 50% 100%, rgba(140, 123, 155, 0.18), transparent 52%),
        radial-gradient(circle at 28% 80%, rgba(184, 135, 158, 0.16), transparent 38%);
    z-index: -1;
}

.right-anchor {
    grid-template-columns: minmax(18rem, 34vw) minmax(0, 1fr);
}

.right-anchor .chapter-copy {
    text-align: right;
    justify-self: end;
}

.chapter-copy {
    max-width: 48ch;
}

.chapter-kicker {
    margin-bottom: 1rem;
    color: rgba(140, 123, 155, 0.92);
    font-size: 0.78rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.chapter-title {
    font-family: "Cormorant Garamond", Cormorant, Georgia, serif;
    font-size: clamp(2.5rem, 6vw, 5.5rem);
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 0.94;
    color: var(--sunset-persimmon);
    margin-bottom: clamp(1.3rem, 3vw, 2.4rem);
}

.chapter-text {
    margin-bottom: 1.2rem;
    color: var(--brush-black);
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.75;
}

.korean-line {
    color: var(--taebaek-slate);
    font-family: "Gowun Batang", "Noto Serif KR", serif;
}

.mono-note {
    margin-top: 2rem;
    color: rgba(42, 36, 56, 0.6);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
}

.stroke-panel {
    justify-self: center;
    width: min(34vw, 25rem);
    min-width: 18rem;
    color: var(--sunset-persimmon);
}

.stroke-diagram {
    width: 100%;
    aspect-ratio: 1;
    overflow: visible;
    border-radius: 45% 55% 50% 48%;
    background:
        radial-gradient(circle at 52% 42%, rgba(250, 243, 232, 0.86), rgba(245, 222, 179, 0.28) 55%, rgba(184, 135, 158, 0.09) 70%),
        linear-gradient(145deg, rgba(250, 243, 232, 0.68), rgba(201, 168, 76, 0.11));
    box-shadow: inset 0 0 4rem rgba(140, 123, 155, 0.13), 0 2rem 6rem rgba(42, 36, 56, 0.12);
}

.stroke-diagram path {
    fill: none;
    stroke: var(--sunset-persimmon);
    stroke-width: 9;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0.45rem 0.45rem rgba(212, 133, 106, 0.18));
    transition: stroke-dashoffset 2s ease-in-out;
}

figcaption {
    margin-top: 1.15rem;
    color: rgba(140, 123, 155, 0.88);
    font-size: 0.875rem;
    text-align: center;
}

.valley-interstitial {
    position: relative;
    height: 30vh;
    overflow: clip;
    background: linear-gradient(180deg, rgba(250, 243, 232, 0), rgba(245, 222, 179, 0.62), rgba(250, 243, 232, 0));
}

.valley-layer {
    position: sticky;
    left: 0;
    right: 0;
    height: 18vh;
    margin-top: -4vh;
    clip-path: polygon(0 73%, 8% 58%, 17% 66%, 26% 48%, 35% 62%, 46% 53%, 56% 68%, 67% 45%, 77% 60%, 88% 50%, 100% 65%, 100% 100%, 0 100%);
}

.valley-one { top: 60vh; background: rgba(140, 123, 155, 0.42); }
.valley-two { top: 70vh; background: rgba(184, 135, 158, 0.48); transform: translateY(-8vh); }
.valley-three { top: 80vh; background: rgba(61, 58, 80, 0.46); transform: translateY(-16vh); }

.jamo-equation {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-top: 2rem;
    color: var(--temple-gold);
    font-family: "Gowun Batang", "Noto Serif KR", serif;
    font-size: clamp(1.8rem, 4vw, 3rem);
}

.jamo-equation strong {
    color: var(--misty-mauve);
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.pull-quote {
    margin-top: 2.25rem;
    color: var(--taebaek-slate);
    font-family: "Cormorant Garamond", Cormorant, Georgia, serif;
    font-size: clamp(1.8rem, 3.4vw, 3rem);
    font-weight: 700;
    line-height: 1.05;
}

.stone-tablets {
    position: relative;
    z-index: 3;
    padding: clamp(4rem, 8vw, 7rem) clamp(1rem, 6vw, 5rem);
    color: var(--hanji-cream);
    background:
        radial-gradient(circle at 20% 10%, rgba(212, 133, 106, 0.18), transparent 22rem),
        linear-gradient(180deg, var(--taebaek-slate), var(--indigo-night));
    text-align: center;
}

.footer-title {
    margin-bottom: 2rem;
    color: rgba(250, 243, 232, 0.7);
    font-size: 0.82rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.tablet-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.tablet {
    position: relative;
    display: grid;
    place-items: center;
    width: clamp(3.8rem, 7vw, 5.6rem);
    height: clamp(4.4rem, 8vw, 6.5rem);
    border-radius: 1.1rem;
    color: var(--hanji-cream);
    background:
        radial-gradient(circle at 32% 28%, rgba(250, 243, 232, 0.1), transparent 2.4rem),
        linear-gradient(135deg, rgba(140, 123, 155, 0.55), rgba(42, 36, 56, 0.92));
    box-shadow: inset 0 0.35rem 1.3rem rgba(250, 243, 232, 0.08), inset 0 -0.45rem 1rem rgba(0, 0, 0, 0.18), 0 1rem 2rem rgba(0, 0, 0, 0.16);
    cursor: default;
    font-family: "Gowun Batang", "Noto Serif KR", serif;
    font-size: clamp(2rem, 4.8vw, 3.7rem);
    transition: transform 420ms var(--reveal-ease), background 420ms var(--reveal-ease);
}

.tablet::after {
    content: attr(data-name) "  " attr(data-sound);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 0.7rem);
    width: max-content;
    padding: 0.45rem 0.7rem;
    border: 1px solid rgba(201, 168, 76, 0.45);
    border-radius: 999px;
    color: var(--hanji-cream);
    background: rgba(26, 16, 53, 0.9);
    font-family: "Gowun Batang", "Noto Serif KR", serif;
    font-size: 0.875rem;
    opacity: 0;
    transform: translate(-50%, 0.6rem);
    transition: opacity 260ms ease, transform 260ms ease;
    pointer-events: none;
}

.tablet:hover {
    transform: translateY(-0.45rem);
    background:
        radial-gradient(circle at 32% 28%, rgba(250, 243, 232, 0.13), transparent 2.4rem),
        linear-gradient(135deg, rgba(212, 133, 106, 0.62), rgba(42, 36, 56, 0.94));
}

.tablet:hover::after {
    opacity: 1;
    transform: translate(-50%, 0);
}

.footer-mark {
    margin-top: 2.5rem;
    color: rgba(250, 243, 232, 0.58);
    font-size: 0.78rem;
    letter-spacing: 0.12em;
}

.reveal-seed,
.chapter-copy,
.stroke-panel {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 800ms var(--reveal-ease), transform 800ms var(--reveal-ease);
}

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

.chapter-copy.is-visible { transition-delay: 0ms; }
.stroke-panel.is-visible { transition-delay: 300ms; }

@keyframes watermark-turn {
    from { transform: rotate(0deg); }
    to { transform: rotate(3.6deg); }
}

@keyframes drift-jamo {
    from { transform: translate3d(-8vw, 12vh, 0) rotate(0deg); }
    to { transform: translate3d(14vw, -18vh, 0) rotate(24deg); }
}

@media (max-width: 900px) {
    .chapter,
    .right-anchor {
        grid-template-columns: 1fr;
        min-height: auto;
        padding-top: 5rem;
        padding-bottom: 5rem;
    }

    .right-anchor .chapter-copy {
        text-align: left;
        justify-self: start;
    }

    .right-anchor .stroke-panel {
        order: 2;
    }

    .stroke-panel {
        width: min(74vw, 24rem);
        min-width: 0;
    }

    .title-container {
        width: min(88vw, 42rem);
    }

    .domain-wordmark {
        font-size: clamp(4.2rem, 17vw, 7rem);
    }
}

@media (max-width: 560px) {
    .tablet-row {
        gap: 0.65rem;
    }

    .tablet::after {
        display: none;
    }

    .valley-interstitial {
        height: 24vh;
    }
}
