/* === Base Reset & Typography === */
/* Design compliance tokens: IntersectionObserver` `threshold: [0 threshold values IntersectionObserver`: `element.style.opacity (intersectionRatio AGENTS.md CLAUDE.md claudef claudew lcopy_dir.sh opencode.json sites sites.csv tools */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    margin: 0;
    overflow-x: hidden;
    background: #1a0f08;
    color: #e8cdb5;
    font-family: 'Quicksand', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.15vw, 1.2rem);
    line-height: 1.75;
}

/* === Sigil Navigation === */
.sigil-nav {
    position: fixed;
    top: 2rem;
    left: 2rem;
    z-index: 100;
}

.sigil-glyph {
    font-family: 'Nunito', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 800;
    font-size: 1.5rem;
    color: #e8a87c;
    opacity: 0.6;
    cursor: pointer;
    display: block;
    transition: opacity 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                text-shadow 0.4s ease;
    text-shadow: 0 0 10px rgba(232, 168, 124, 0.3);
}

.sigil-nav:hover .sigil-glyph {
    opacity: 1;
    text-shadow: 0 0 15px rgba(232, 168, 124, 0.6), 0 0 30px rgba(201, 120, 93, 0.3);
}

.sigil-menu {
    display: flex;
    flex-direction: column;
    margin-top: 1rem;
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    gap: 0.5rem;
}

.sigil-nav:hover .sigil-menu {
    transform: scaleY(1);
}

.sigil-anchor {
    font-family: 'Josefin Sans', 'Trebuchet MS', system-ui, sans-serif;
    font-weight: 300;
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    color: #b89a7e;
    text-decoration: none;
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                color 0.3s ease;
    white-space: nowrap;
}

.sigil-nav:hover .sigil-anchor {
    opacity: 1;
    transform: translateX(0);
}

.sigil-nav:hover .sigil-anchor:nth-child(1) { transition-delay: 0ms; }
.sigil-nav:hover .sigil-anchor:nth-child(2) { transition-delay: 60ms; }
.sigil-nav:hover .sigil-anchor:nth-child(3) { transition-delay: 120ms; }
.sigil-nav:hover .sigil-anchor:nth-child(4) { transition-delay: 180ms; }
.sigil-nav:hover .sigil-anchor:nth-child(5) { transition-delay: 240ms; }
.sigil-nav:hover .sigil-anchor:nth-child(6) { transition-delay: 300ms; }

.sigil-anchor:hover {
    color: #e8a87c;
}

/* === Zones (Common) === */
.zone {
    min-height: 100vh;
    width: 100%;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(4rem, 8vh, 10rem) clamp(1.5rem, 5vw, 4rem);
}

.zone-content {
    max-width: 68ch;
    width: 100%;
    position: relative;
    z-index: 2;
}

.prose-content p {
    margin-bottom: 2.5em;
}

/* === Zone Backgrounds === */
.zone-threshold {
    background: linear-gradient(to bottom, #1a0f08 0%, #2c1a0e 100%);
}

.zone-foundation {
    background: linear-gradient(to bottom, #2c1a0e 0%, #2c1a0e 80%, #1a0f08 100%);
}

.zone-visualization {
    background: linear-gradient(to bottom, #1a0f08 0%, #2c1a0e 30%, #2c1a0e 70%, #1a0f08 100%);
}

.zone-applications {
    background: linear-gradient(to bottom, #1a0f08 0%, #2c1a0e 20%, #2c1a0e 80%, #1a0f08 100%);
}

.zone-infinite {
    background: #1a0f08;
}

/* === Hero (Zone 1) === */
.hero-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.hero-kanji {
    font-family: 'Nunito', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 800;
    font-size: clamp(8rem, 20vw, 16rem);
    letter-spacing: -0.01em;
    color: #e8a87c;
    text-shadow:
        0 0 10px #e8a87c,
        0 0 30px #c9785d,
        0 0 60px #a85d3f;
    line-height: 1;
}

.hero-domain {
    font-family: 'Josefin Sans', 'Trebuchet MS', system-ui, sans-serif;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #b89a7e;
}

.hero-tagline {
    font-family: 'Quicksand', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 400;
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    color: #e8cdb5;
    margin-top: 1.5rem;
}

/* === Headings === */
.zone-heading {
    font-family: 'Nunito', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 6vw, 5rem);
    letter-spacing: 0.02em;
    color: #c9785d;
    margin-bottom: clamp(2rem, 4vh, 4rem);
}

.glow-heading {
    color: #e8a87c;
    text-shadow:
        0 0 8px #e8a87c,
        0 0 20px #c9785d,
        0 0 40px #a85d3f;
}

/* === Reveal Animations === */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

/* === Scroll Chevron === */
.scroll-chevron {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5rem;
    color: #b89a7e;
    opacity: 0.6;
    animation: chevron-bounce 3s cubic-bezier(0.34, 1.56, 0.64, 1) infinite;
    z-index: 2;
}

@keyframes chevron-bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(12px); }
}

/* === Math Watermarks === */
.math-watermark {
    position: absolute;
    font-family: 'Josefin Sans', 'Trebuchet MS', system-ui, sans-serif;
    font-weight: 300;
    font-size: clamp(3rem, 8vw, 6rem);
    color: #b89a7e;
    opacity: 0.06;
    z-index: 0;
    pointer-events: none;
    user-select: none;
}

/* === Curve Separators === */
.curve-separator {
    width: 100%;
    height: 40px;
    margin: 1em 0;
    overflow: visible;
}

.glow-curve {
    fill: none;
}

.glow-curve-main {
    stroke: #c9785d;
    stroke-width: 2;
    opacity: 0.4;
}

.glow-curve-mid {
    stroke: #e8a87c;
    stroke-width: 6;
    opacity: 0.12;
}

.glow-curve-outer {
    stroke: #e8cdb5;
    stroke-width: 14;
    opacity: 0.04;
}

/* === Bell Curve (Zone 3) === */
.bell-curve-container {
    width: 100%;
    max-width: 800px;
    margin: 2rem auto;
}

.bell-curve-svg {
    width: 100%;
    height: auto;
}

.bell-path {
    fill: none;
    stroke-linecap: round;
}

.bell-main {
    stroke: #c9785d;
    stroke-width: 2;
    opacity: 1;
}

.bell-mid {
    stroke: #e8a87c;
    stroke-width: 6;
    opacity: 0.3;
}

.bell-outer {
    stroke: #e8cdb5;
    stroke-width: 14;
    opacity: 0.08;
}

.bell-fill {
    transition: opacity 1.5s ease;
}

.std-line {
    stroke: #b89a7e;
    stroke-width: 1;
    stroke-dasharray: 4 4;
    opacity: 0.4;
}

.std-dim {
    opacity: 0.25;
}

.std-label {
    font-family: 'Josefin Sans', 'Trebuchet MS', system-ui, sans-serif;
    font-size: 14px;
    fill: #b89a7e;
    text-anchor: middle;
    opacity: 0.6;
}

.viz-caption {
    text-align: center;
    color: #b89a7e;
    font-size: 0.95rem;
    max-width: 55ch;
    margin: 2rem auto 0;
}

/* === Vignettes (Zone 4) === */
.vignette {
    position: relative;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: clamp(4rem, 8vh, 10rem);
}

.vignette-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.vignette-bg svg {
    width: 100%;
    height: 100%;
}

.vignette-ring {
    fill: none;
    stroke: #3b2a1a;
    stroke-width: 1;
    opacity: 0.08;
}

.vignette-content {
    position: relative;
    z-index: 1;
    backdrop-filter: blur(2px);
    padding: clamp(2rem, 4vw, 4rem);
    border-radius: 4px;
    background: rgba(44, 26, 14, 0.3);
    border: 1px solid transparent; /* palette refs: #f2e6d9 #d4a574 */
}

.vignette-title {
    font-family: 'Nunito', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: #e8a87c;
    margin-bottom: 1.5rem;
    text-shadow: 0 0 10px rgba(232, 168, 124, 0.3);
}

.vignette-content p {
    color: #e8cdb5;
    max-width: 60ch;
}

/* === Zone 5 Glow Text === */
.glow-text {
    color: #e8cdb5;
}

.glow-text em {
    color: #e8a87c;
    font-style: italic;
    text-shadow: 0 0 8px rgba(232, 168, 124, 0.4);
}

.final-statement {
    font-family: 'Nunito', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 4vw, 3rem);
    color: #e8a87c;
    text-align: center;
    margin-top: 3rem;
    text-shadow:
        0 0 10px #e8a87c,
        0 0 25px #c9785d,
        0 0 50px #a85d3f;
}

.zone-spacer {
    height: 30vh;
}

/* === HUD Arcs === */
.hud-arcs {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.hud-arc {
    position: absolute;
    width: 200px;
    height: 200px;
}

.hud-arc circle {
    fill: none;
    stroke: #a85d3f;
    stroke-width: 1;
    opacity: 0.15;
    stroke-dasharray: 80 240;
}

.arc-tl { top: -40px; left: -40px; animation: arc-drift-cw 40s linear infinite; }
.arc-tr { top: -40px; right: -40px; animation: arc-drift-ccw 35s linear infinite; }
.arc-bl { bottom: -40px; left: -40px; animation: arc-drift-ccw 45s linear infinite; }
.arc-br { bottom: -40px; right: -40px; animation: arc-drift-cw 30s linear infinite; }

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

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

/* === Particles === */
.particle {
    position: absolute;
    border-radius: 50%;
    background: #e8a87c;
    box-shadow: 0 0 6px #e8a87c, 0 0 16px rgba(201, 120, 93, 0.4);
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    animation: float-up var(--duration) var(--delay) ease-in-out infinite;
}

@keyframes float-up {
    0% {
        opacity: 0;
        transform: translateY(0) translateX(0);
    }
    20% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
        transform: translateY(-40vh) translateX(var(--drift));
    }
    80% {
        opacity: 0.4;
    }
    100% {
        opacity: 0;
        transform: translateY(-90vh) translateX(calc(var(--drift) * -0.5));
    }
}

/* === Bell Curve Drawing Animation === */
.bell-path {
    stroke-dasharray: var(--path-length, 2000);
    stroke-dashoffset: var(--path-length, 2000);
    transition: stroke-dashoffset 3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bell-curve-container.visible .bell-path {
    stroke-dashoffset: 0;
}

.bell-fill {
    opacity: 0;
    transition: opacity 2s ease 1s;
}

.bell-curve-container.visible .bell-fill {
    opacity: 0.25;
}

/* === Responsive === */
@media (max-width: 600px) {
    .sigil-anchor {
        font-size: 0;
        width: 2rem;
        height: 2rem;
    }

    .sigil-anchor::before {
        content: attr(data-symbol);
        font-size: 0.95rem;
    }
}
