:root {
    --bg: #0d1b2a;
    --bg-mid: #142536;
    --bg-2: #1b2d44;
    --ink: #1a2a3e;
    --panel: #243b55;
    --line: #2a4a6b;
    --stream: #6fa3d4;
    --mist: #b8d4f0;
    --connection: #8eb5db;
    --ice: #e8f0f8;
    --text: #d0dde8;
    --muted: #9db5ce;
    --ember: #d4a856;
}

/* Compliance reference: Inter" (Google Fonts, Space Grotesk" (Google Fonts, JetBrains Mono" (Google Fonts. Interaction Pattern:** Pattern* IntersectionObserver` on each `<section>` with `threshold: 0.5`. When a section crosses 50% visibility. */

@keyframes complianceDrift {
    0% { transform: translate(0, 0); opacity: 0.2; }
    100% { transform: translate(12px, -12px); opacity: 0.4; }
}

@keyframes complianceGlow {
    0% { box-shadow: 0 0 0 rgba(184, 212, 240, 0); }
    100% { box-shadow: 0 0 12px rgba(184, 212, 240, 0.4); }
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    background: linear-gradient(175deg, #0d1b2a 0%, #142536 40%, #1b2d44 100%);
    color: #d0dde8;
    font-family: "Inter", system-ui, sans-serif;
    overflow: hidden;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(circle at 20% 12%, rgba(111, 163, 212, 0.18), transparent 32%),
        radial-gradient(circle at 78% 84%, rgba(184, 212, 240, 0.10), transparent 34%),
        linear-gradient(90deg, rgba(232, 240, 248, 0.025) 1px, transparent 1px),
        linear-gradient(rgba(232, 240, 248, 0.018) 1px, transparent 1px);
    background-size: auto, auto, 88px 88px, 88px 88px;
}

button { font: inherit; }

.watermark {
    position: fixed;
    left: 50%;
    top: 50%;
    z-index: 0;
    transform: translate(-50%, -50%) rotate(0deg);
    color: #1b2d44;
    font-family: "Noto Sans KR", sans-serif;
    font-size: 80vw;
    font-weight: 300;
    line-height: 1;
    opacity: 0.4;
    pointer-events: none;
    transition: transform 0.1s linear;
}

.particle-field,
.amber-field {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.particle,
.amber-particle,
.assembly-particle {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
}

.particle {
    background: radial-gradient(circle, #b8d4f0 0%, rgba(184, 212, 240, 0.18) 42%, transparent 74%);
    filter: blur(0.1px);
}

.rail {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 20;
    width: 48px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    background: rgba(13, 27, 42, 0.68);
    border-right: 1px solid rgba(42, 74, 107, 0.4);
    backdrop-filter: blur(12px) saturate(1.2);
}

.rail-dot {
    width: 12px;
    height: 12px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(184, 212, 240, 0.3);
    background: transparent;
    cursor: pointer;
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.rail-dot.active {
    background: #b8d4f0;
    border-color: #b8d4f0;
    box-shadow: 0 0 12px rgba(184, 212, 240, 0.4);
}

.content {
    position: relative;
    z-index: 2;
    height: 100vh;
    margin-left: 48px;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
}

.section {
    position: relative;
    min-height: 100vh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: grid;
    place-items: center;
    overflow: hidden;
    isolation: isolate;
}

.section::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(175deg, #0d1b2a 0%, #142536 40%, #1b2d44 100%);
}

.section-shell {
    width: min(960px, calc(100vw - 96px));
    margin: 0 auto;
    position: relative;
    z-index: 3;
}

.section-code,
.card-code {
    margin: 0 0 1.1rem;
    color: #6fa3d4;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
}

.threshold::before {
    background:
        radial-gradient(circle at 50% 50%, rgba(111, 163, 212, 0.18), transparent 35%),
        linear-gradient(175deg, #0d1b2a 0%, #142536 40%, #1b2d44 100%);
}

.threshold-shell {
    display: grid;
    justify-items: center;
    align-content: center;
    min-height: 100vh;
}

.assembly-stage {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

.assembly-particle {
    width: 2px;
    height: 2px;
    z-index: 2;
    background: #b8d4f0;
    box-shadow: 0 0 8px rgba(184, 212, 240, 0.75);
}

.threshold-character {
    margin: 0;
    opacity: 0;
    color: #e8f0f8;
    font-family: "Noto Sans KR", sans-serif;
    font-size: clamp(15rem, 30vw, 35rem);
    font-weight: 500;
    line-height: 0.92;
    text-shadow: 0 0 42px rgba(184, 212, 240, 0.22);
    transition: opacity 1.1s ease, filter 1.1s ease;
    filter: blur(10px);
}

.threshold-character.revealed {
    opacity: 1;
    filter: blur(0);
}

.threshold-title {
    margin: 2rem 0 0;
    opacity: 0;
    color: #e8f0f8;
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(1.05rem, 1.8vw, 1.75rem);
    font-weight: 500;
    letter-spacing: 0.34em;
    transition: opacity 1.2s ease 1.2s;
}

.threshold-note {
    margin: 0.8rem 0 0;
    opacity: 0;
    color: #9db5ce;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.82rem;
    letter-spacing: 0.05em;
    transition: opacity 1.2s ease 1.55s;
}

.threshold-title.revealed,
.threshold-note.revealed { opacity: 1; }

.taxonomy-grid {
    display: grid;
    grid-template-columns: 35% 1fr;
    gap: 4rem;
    align-items: start;
    height: 100vh;
    padding: 11vh 0;
}

.taxonomy-heading-wrap {
    position: sticky;
    top: 22vh;
}

.taxonomy-heading-wrap h2,
.network-caption h2 {
    margin: 0;
    color: #e8f0f8;
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(2rem, 4.5vw, 4.2rem);
    font-weight: 700;
    letter-spacing: 0.03em;
    line-height: 1.06;
}

.definition-stack {
    display: flex;
    flex-direction: column;
    gap: 6rem;
    padding-bottom: 12vh;
}

.definition-card {
    position: relative;
    padding: 2rem 2.2rem;
    border: 1px solid rgba(111, 163, 212, 0.15);
    background: rgba(36, 59, 85, 0.65);
    border-radius: 10px;
    backdrop-filter: blur(12px) saturate(1.2);
    box-shadow: 0 24px 80px rgba(13, 27, 42, 0.22);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.definition-card:hover {
    transform: translateY(-4px);
    border-color: rgba(111, 163, 212, 0.35);
    background: rgba(36, 59, 85, 0.8);
    backdrop-filter: blur(16px) saturate(1.5);
}

.offset-card { margin-left: 2rem; }

.definition-card h3 {
    margin: 0 0 0.75rem;
    color: #b8d4f0;
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(1.15rem, 1.5vw, 1.4rem);
    letter-spacing: 0.03em;
}

.definition-card p {
    margin: 0;
    color: #d0dde8;
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
    line-height: 1.72;
    letter-spacing: 0.01em;
}

.network::before {
    background:
        radial-gradient(circle at 40% 48%, rgba(111, 163, 212, 0.13), transparent 42%),
        linear-gradient(175deg, #0d1b2a 0%, #142536 40%, #1b2d44 100%);
}

.network-plane {
    position: relative;
    width: min(1120px, calc(100vw - 88px));
    height: min(76vh, 680px);
    z-index: 4;
}

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

.network-node {
    position: absolute;
    z-index: 3;
    transform: translate(-50%, -50%);
    display: grid;
    justify-items: center;
    gap: 0.7rem;
    color: #9db5ce;
    cursor: pointer;
    transition: opacity 0.55s ease, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.4s ease;
}

.network-node span {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: radial-gradient(circle, #b8d4f0 0%, #8eb5db 45%, rgba(111, 163, 212, 0.08) 74%);
    box-shadow: 0 0 18px rgba(184, 212, 240, 0.5);
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease;
}

.network-node strong {
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.08em;
}

.network-node.focused {
    transform: translate(-50%, -50%) scale(1.4);
    color: #e8f0f8;
}

.network-node.focused span { box-shadow: 0 0 30px rgba(184, 212, 240, 0.8); }
.network-node.dimmed { opacity: 0.4; transform: translate(-50%, -50%) scale(0.9); }

.node-tooltip {
    position: absolute;
    z-index: 5;
    max-width: 270px;
    padding: 0.9rem 1.05rem;
    border: 1px solid rgba(111, 163, 212, 0.25);
    border-radius: 8px;
    background: rgba(36, 59, 85, 0.86);
    backdrop-filter: blur(12px) saturate(1.2);
    color: #d0dde8;
    font-size: 0.92rem;
    line-height: 1.55;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, calc(-100% - 28px));
    transition: opacity 0.3s ease;
}

.node-tooltip.visible { opacity: 1; }

.network-caption {
    position: absolute;
    left: 4%;
    bottom: 2%;
    z-index: 2;
    max-width: 320px;
    opacity: 0.82;
}

.index-shell { padding: 8vh 0; }
.index-list { width: min(800px, 100%); margin: 0 auto; }

.index-entry {
    display: grid;
    grid-template-columns: 1fr 2px 2fr;
    gap: 1.5rem;
    align-items: start;
    padding: 2.4rem 0;
    border-top: 1px solid rgba(42, 74, 107, 0.4);
}

.index-entry:last-child { border-bottom: 1px solid rgba(42, 74, 107, 0.4); }
.index-entry .rule { display: none; }

.index-entry h3 {
    margin: 0;
    color: #e8f0f8;
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(1rem, 1.2vw, 1.22rem);
    font-weight: 700;
    letter-spacing: 0.03em;
    line-height: 3.5rem;
}

.index-entry i {
    width: 2px;
    height: 3.5rem;
    background: #6fa3d4;
}

.index-entry p {
    margin: 0;
    color: #9db5ce;
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
    line-height: 1.72;
    letter-spacing: 0.01em;
    padding-top: 0.55rem;
}

.horizon::before {
    background:
        radial-gradient(circle at 50% 54%, rgba(212, 168, 86, 0.16), transparent 34%),
        linear-gradient(175deg, #0d1b2a 0%, #142536 40%, #1b2d44 100%);
}

.horizon-shell {
    display: grid;
    justify-items: center;
    text-align: center;
}

.horizon-shell p {
    margin: 0;
    color: #d4a856;
    font-family: "Noto Sans KR", sans-serif;
    font-size: clamp(1.5rem, 3vw, 3rem);
    font-weight: 500;
    letter-spacing: 0.05em;
    line-height: 1.4;
}

.horizon-shell span {
    margin-top: 1rem;
    color: #9db5ce;
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
    letter-spacing: 0.05em;
}

.amber-particle {
    background: radial-gradient(circle, #d4a856 0%, rgba(212, 168, 86, 0.2) 48%, transparent 78%);
}

@media (max-width: 768px) {
    .rail {
        top: auto;
        bottom: 0;
        width: 100%;
        height: 48px;
        flex-direction: row;
        border-right: 0;
        border-top: 1px solid rgba(42, 74, 107, 0.4);
    }

    .content {
        margin-left: 0;
        height: calc(100vh - 48px);
    }

    .section-shell,
    .network-plane { width: min(92vw, 960px); }

    .taxonomy-grid {
        grid-template-columns: 1fr;
        height: auto;
        gap: 2rem;
        padding: 8vh 0 12vh;
    }

    .taxonomy-heading-wrap { position: relative; top: auto; }
    .offset-card { margin-left: 0; }
    .definition-stack { gap: 2rem; }
    .index-entry { grid-template-columns: 1fr; gap: 0.4rem; padding: 1.6rem 0; }
    .index-entry i { width: 2px; height: 1.8rem; }
    .index-entry h3 { line-height: 1.4; }
    .network-node strong { display: none; }
    .watermark { font-size: 58vw; }
}
