:root {
    /* Compliance references from DESIGN.md: #000000 #ffffff (Google Fonts Interpretation:** IntersectionObserver` (threshold array: `[0 */
    --deep-canvas: #0c1524;
    --surface-layer: #142035;
    --cedar-dusk: #0f1a28;
    --amber-flame: #c9873a;
    --molten-gold: #daa24e;
    --warm-parchment: #e8e0d4;
    --blue-silver: #a8b4c2;
    --muted-steel: #6b7d94;
    --charcoal-line: #1e2d42;
    --elastic: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --glow-x: 72%;
    --glow-y: 30%;
    --glow-strength: 0.08;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    min-height: 100vh;
    overflow-x: hidden;
    background: #0c1524;
    color: #a8b4c2;
    font-family: "Nunito Sans", Inter, system-ui, sans-serif;
    font-size: clamp(1rem, 1.15vw, 1.125rem);
    line-height: 1.75;
}

::selection { background: rgba(201, 135, 58, 0.3); color: #e8e0d4; }

.grain-layer,
.candle-field,
.seal-watermark {
    position: fixed;
    inset: 0;
    pointer-events: none;
}

.grain-layer {
    z-index: 0;
    opacity: 0.15;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140'%3E%3Cg stroke='%231e2d42' stroke-width='.3' opacity='1'%3E%3Cline x1='12' y1='-20' x2='14' y2='160'/%3E%3Cline x1='33' y1='-10' x2='31' y2='150'/%3E%3Cline x1='58' y1='-25' x2='61' y2='145'/%3E%3Cline x1='82' y1='-15' x2='79' y2='155'/%3E%3Cline x1='110' y1='-20' x2='113' y2='160'/%3E%3Cline x1='0' y1='22' x2='140' y2='19'/%3E%3Cline x1='0' y1='95' x2='140' y2='101'/%3E%3C/g%3E%3C/svg%3E");
}

.candle-field {
    z-index: 1;
    opacity: 1;
    transition: background-position 1500ms var(--elastic), opacity 1500ms var(--elastic);
    background:
        radial-gradient(ellipse at var(--glow-x) var(--glow-y), rgba(201, 135, 58, var(--glow-strength)) 0%, rgba(218, 162, 78, 0.04) 18%, transparent 58%),
        radial-gradient(ellipse at calc(var(--glow-x) - 8%) calc(var(--glow-y) + 18%), rgba(218, 162, 78, 0.045) 0%, transparent 44%);
    animation: flicker 8s ease-in-out infinite alternate;
}

.seal-watermark {
    z-index: 1;
    display: grid;
    place-items: center;
    opacity: 0.05;
}
.seal-watermark::before {
    content: "";
    width: min(42vw, 420px);
    aspect-ratio: 1;
    border: 3px solid #1e2d42;
    clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
}
.seal-watermark span {
    position: absolute;
    width: min(25vw, 250px);
    aspect-ratio: 1;
    border: 2px solid #1e2d42;
    border-radius: 50%;
}

main { position: relative; z-index: 2; }
a { color: inherit; text-decoration: none; }
h1, h2 {
    max-width: 10.5ch;
    color: #e8e0d4;
    font-family: "Nunito Sans", Inter, system-ui, sans-serif;
    font-size: clamp(2.2rem, 5.5vw, 4.8rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
}
h3 {
    color: #c9873a;
    font-family: Nunito, "Nunito Sans", system-ui, sans-serif;
    font-size: clamp(1.1rem, 2.2vw, 1.5rem);
    font-weight: 600;
    letter-spacing: 0.06em;
    line-height: 1.4;
    text-transform: uppercase;
}
p { max-width: 62ch; }

.site-chrome {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: clamp(1.1rem, 2.5vw, 2rem) clamp(1.25rem, 3.6vw, 3.4rem);
    background: linear-gradient(to bottom, rgba(12, 21, 36, 0.78), transparent);
}
.wordmark {
    color: #e8e0d4;
    font-family: "Nunito Sans", Inter, system-ui, sans-serif;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}
.incense-trigger {
    position: relative;
    display: grid;
    gap: 7px;
    width: 42px;
    border: 0;
    background: transparent;
    cursor: pointer;
}
.incense-trigger span {
    display: block;
    height: 1px;
    margin-left: auto;
    background: #e8e0d4;
    box-shadow: 0 0 10px rgba(201, 135, 58, 0.25);
    transition: transform 600ms var(--elastic), width 600ms var(--elastic), opacity 400ms var(--elastic), background 400ms var(--elastic);
}
.incense-trigger span:nth-child(1) { width: 34px; }
.incense-trigger span:nth-child(2) { width: 24px; }
.incense-trigger span:nth-child(3) { width: 14px; }
.incense-trigger.open span { width: 34px; background: #daa24e; }
.incense-trigger.open span:nth-child(1) { transform: translateY(8px) rotate(40deg); }
.incense-trigger.open span:nth-child(2) { opacity: 0; transform: translateX(14px); }
.incense-trigger.open span:nth-child(3) { transform: translateY(-8px) rotate(-40deg); }

.nav-panel {
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 15;
    width: min(40vw, 520px);
    transform: translateX(105%);
    border-left: 1px solid #1e2d42;
    background: rgba(15, 26, 40, 0.88);
    box-shadow: -20px 0 80px rgba(201, 135, 58, 0.1);
    backdrop-filter: blur(18px);
    transition: transform 700ms var(--elastic);
}
.nav-panel.open { transform: translateX(0); }
.panel-inner {
    display: flex;
    min-height: 100%;
    flex-direction: column;
    justify-content: center;
    gap: 2rem;
    padding: 7rem 3rem;
}
.panel-inner a {
    color: #a8b4c2;
    font-family: Nunito, "Nunito Sans", system-ui, sans-serif;
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: color 400ms var(--elastic), transform 400ms var(--elastic);
}
.panel-inner a:hover { color: #daa24e; transform: translateX(-8px) scale(1.03); }
.panel-inner em { color: #6b7d94; font-family: "Fira Code", monospace; font-size: 0.8rem; font-style: normal; margin-right: 1rem; }

.wick-rail {
    position: fixed;
    top: 0;
    bottom: 0;
    left: calc(50% + 344px);
    z-index: 12;
    width: 3px;
    background: rgba(201, 135, 58, 0.12);
}
.wick-progress {
    width: 100%;
    height: 0%;
    background: linear-gradient(to bottom, #c9873a, #daa24e 65%, transparent);
    box-shadow: 0 0 12px rgba(201, 135, 58, 0.3);
    transition: height 120ms linear, box-shadow 600ms var(--elastic);
}
.wick-progress.hot { box-shadow: 0 0 24px rgba(201, 135, 58, 0.62); }

.chapter {
    position: relative;
    min-height: 85vh;
    display: flex;
    align-items: center;
    padding: clamp(6rem, 11vh, 9rem) 0;
    background: linear-gradient(to bottom, #0c1524 0%, #142035 50%, #0c1524 100%);
    overflow: hidden;
}
.chapter:nth-of-type(4n) { background: linear-gradient(to bottom, #142035 0%, #0c1524 70%, #0f1a28 100%); }
.chapter-grid {
    width: min(1240px, calc(100% - 3rem));
    margin: 0 auto;
    transform: translateX(-4%);
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 2.4rem;
}
.reading-zone { grid-column: 1 / span 8; position: relative; }
.atmospheric-margin { grid-column: 9 / span 4; position: relative; min-height: 48vh; background: linear-gradient(90deg, transparent, rgba(15, 26, 40, 0.28)); }
.eyebrow {
    margin-bottom: 1.3rem;
    color: #c9873a;
    font-family: Nunito, "Nunito Sans", system-ui, sans-serif;
    font-size: clamp(1.1rem, 2.2vw, 1.5rem);
    font-weight: 600;
    letter-spacing: 0.06em;
    line-height: 1.4;
    text-transform: uppercase;
}
.lead { margin-top: 1.6rem; color: #a8b4c2; font-size: clamp(1.05rem, 1.35vw, 1.32rem); }
.microcopy { color: #6b7d94; font-family: "Fira Code", monospace; font-size: 0.8rem; letter-spacing: 0.04em; }
.horizon { height: 1px; width: min(680px, 100%); margin: 3rem 0 1.2rem; background: linear-gradient(to right, transparent 0%, #1e2d42 20%, #1e2d42 80%, transparent 100%); }

.overlap {
    position: relative;
    z-index: 3;
    height: 120px;
    margin: -60px 0;
    display: flex;
    justify-content: center;
    gap: 3.8rem;
    background: linear-gradient(to bottom, transparent, rgba(20, 32, 53, 0.4), transparent);
    overflow: hidden;
}
.overlap span {
    width: 1px;
    height: 140px;
    background: linear-gradient(to bottom, #1e2d42, #c9873a, #1e2d42);
    opacity: 0.55;
    transform: rotate(1deg);
    animation: rise 12s ease-in-out infinite;
}
.overlap span:nth-child(2) { animation-delay: 2s; transform: rotate(-1deg); }
.overlap span:nth-child(3) { animation-delay: 4s; }

.brand-reveal { font-size: clamp(4rem, 11vw, 8.8rem); text-transform: lowercase; }
.wordmark-stage .lead { max-width: 58ch; }
.seal-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    width: min(640px, 100%);
    margin-top: 3rem;
    padding: 1.4rem;
    border: 1px solid #1e2d42;
    background: rgba(20, 32, 53, 0.48);
    box-shadow: 0 20px 80px rgba(201, 135, 58, 0.06);
}
.mini-seal { flex: 0 0 54px; aspect-ratio: 1; border: 1px solid #c9873a; clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%); opacity: 0.65; }

.f-band,
.principle-card {
    position: relative;
    border: 1px solid #1e2d42;
    background: rgba(20, 32, 53, 0.56);
    box-shadow: 0 18px 70px rgba(201, 135, 58, 0.055);
    transition: transform 500ms var(--elastic), border-color 500ms var(--elastic), box-shadow 500ms var(--elastic), opacity 600ms var(--elastic);
}
.f-band::before,
.principle-card::before {
    content: "";
    position: absolute;
    inset: -1px;
    background: radial-gradient(ellipse at 85% 20%, rgba(201, 135, 58, 0.08), transparent 48%);
    pointer-events: none;
}
.f-band { padding: clamp(1.4rem, 3vw, 2.3rem); margin-top: 2rem; }
.primary-band { width: 100%; }
.secondary-band { width: 72%; }
.f-band p, .principle-card p { margin-top: 0.65rem; color: #a8b4c2; }
.f-band:hover,
.principle-card:hover { transform: scale(1.03); border-color: rgba(201, 135, 58, 0.55); box-shadow: 0 28px 90px rgba(201, 135, 58, 0.12); }
.vertical-descent { margin-top: 2rem; display: grid; gap: 0.7rem; color: #a8b4c2; }
.vertical-descent strong { margin-right: 1rem; color: #daa24e; font-family: "Fira Code", monospace; font-size: 0.8rem; font-weight: 400; letter-spacing: 0.04em; }
.principle-stack { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.4rem; margin-top: 2.5rem; }
.principle-card { padding: clamp(1.4rem, 3vw, 2rem); min-height: 220px; }
.principle-card span { display: block; margin-bottom: 1rem; color: #daa24e; font-family: "Fira Code", monospace; font-size: 0.8rem; letter-spacing: 0.04em; }
.closing { background: linear-gradient(to bottom, #0c1524 0%, #0f1a28 100%); }
.closing-zone { align-self: center; min-height: 40vh; display: flex; flex-direction: column; justify-content: center; }
.closing-zone h2 { max-width: 13ch; }

.ember {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #c9873a;
    box-shadow: 0 0 8px rgba(201, 135, 58, 0.4);
    animation: ember 6s ease-in-out infinite;
}
.e1 { top: 18%; right: 28%; }
.e2 { top: 55%; right: 10%; animation-delay: 1.4s; }
.e3 { top: 32%; right: 54%; animation-delay: 2.2s; }
.e4 { top: 72%; right: 34%; animation-delay: 3.1s; }
.e5 { top: 12%; right: 7%; animation-delay: 4.5s; }
.floating-caption {
    position: absolute;
    top: 44%;
    right: -1.8rem;
    transform: rotate(-90deg);
    transform-origin: right center;
    color: #6b7d94;
    font-family: "Fira Code", monospace;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    opacity: 0.72;
    white-space: nowrap;
    transition: transform 800ms var(--elastic);
}

.reveal-char {
    display: inline-block;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 600ms var(--elastic), transform 600ms var(--elastic);
}
.reveal-char.visible { opacity: 1; transform: translateY(0); }
.enterable { opacity: 0; transform: translateY(20px); }
.enterable.in-view { opacity: 1; transform: translateY(0); }

@keyframes flicker {
    0% { opacity: 0.82; transform: scale(0.985); }
    45% { opacity: 1; transform: scale(1.018); }
    100% { opacity: 0.9; transform: scale(1.04); }
}
@keyframes ember { 0%, 100% { opacity: 0.3; transform: scale(0.8); } 50% { opacity: 0.8; transform: scale(1.18); } }
@keyframes rise { 0%, 100% { transform: translateY(18px); opacity: 0.38; } 50% { transform: translateY(-20px); opacity: 0.7; } }

@media (max-width: 980px) {
    .chapter-grid { transform: none; grid-template-columns: 1fr; }
    .reading-zone, .atmospheric-margin { grid-column: 1; }
    .atmospheric-margin { min-height: 120px; }
    .wick-rail { right: 1rem; left: auto; }
    .nav-panel { width: 100vw; }
    .secondary-band { width: 100%; }
    .principle-stack { grid-template-columns: 1fr; }
}
