:root {
    --cream: #F5EDE0;
    --charcoal: #3D3630;
    --olive: #8B7D6B;
    --terracotta: #C4876B;
    --slate: #7B8FA1;
    --ochre: #D4B896;
    --sepia: #5C4A3A;
    --blush: #E8D5C8;
    --progress: 0%;
}

/* Design vocabulary: Interaction Details:** Details: Details* IntersectionObserver when the illustration enters the viewport. IntersectionObserver with `threshold: [0.3 0.3 Interstitial | Soft Ochre | `#D4B896` | Chapter card backgrounds Interstitial Pauses:** Pauses: Pauses* Between major timeline sections Interstitials:** Interstitials: Interstitials* */

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

html { scroll-behavior: smooth; }

body {
    min-height: 100vh;
    overflow-x: hidden;
    background: var(--cream);
    color: var(--charcoal);
    font-family: "Nunito", Inter, system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.75;
    font-feature-settings: "kern" 1, "liga" 1;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(circle at 18% 12%, rgba(196, 135, 107, 0.18), transparent 28rem),
        radial-gradient(circle at 82% 38%, rgba(123, 143, 161, 0.16), transparent 30rem),
        linear-gradient(180deg, var(--cream), var(--blush) 48%, var(--cream));
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    opacity: 0.18;
    background-image:
        linear-gradient(90deg, rgba(92, 74, 58, 0.08) 1px, transparent 1px),
        linear-gradient(rgba(92, 74, 58, 0.07) 1px, transparent 1px);
    background-size: 42px 42px;
}

.letterbox-bar {
    position: fixed;
    left: 0;
    right: 0;
    height: 8vh;
    z-index: 1000;
    pointer-events: none;
    background: var(--charcoal);
    color: var(--olive);
    display: flex;
    align-items: center;
    padding: 0 clamp(1rem, 4vw, 4rem);
    font-family: "Caveat", cursive;
    font-size: 16px;
    letter-spacing: 0.04em;
}

.letterbox-top { top: 0; justify-content: flex-start; }
.letterbox-bottom { bottom: 0; justify-content: flex-end; }

main { position: relative; padding: 8vh 0; }

h1, h2 {
    font-family: "Fredoka", Inter, system-ui, sans-serif;
    font-weight: 600;
    color: var(--charcoal);
    letter-spacing: 0.01em;
}

h2 { font-size: clamp(1.6rem, 3.5vw, 2.8rem); line-height: 1.08; }
p { margin-top: 1rem; }
a {
    color: var(--charcoal);
    text-decoration: none;
    background-image: linear-gradient(var(--terracotta), var(--terracotta));
    background-position: 0 100%;
    background-repeat: no-repeat;
    background-size: 0 2px;
    transition: background-size 300ms ease;
}
a:hover { background-size: 100% 2px; }

.annotation { font-family: "Caveat", cursive; font-size: 22px; line-height: 1.8; color: var(--sepia); }
.frame-section { position: relative; }

.opening-frame {
    min-height: 100vh;
    display: grid;
    place-items: center;
    align-content: center;
    padding: 10vh 1.5rem;
    overflow: hidden;
}

.grain {
    position: absolute;
    inset: 8vh 0;
    opacity: 0.32;
    background:
        radial-gradient(circle at 20% 30%, rgba(92, 74, 58, 0.12) 0 1px, transparent 2px),
        radial-gradient(circle at 70% 70%, rgba(196, 135, 107, 0.13) 0 1px, transparent 2px);
    background-size: 32px 38px, 51px 47px;
}

.opening-kicker {
    position: relative;
    z-index: 2;
    margin-bottom: 0.4rem;
    opacity: 0;
    animation: fadeUp 700ms ease 300ms forwards;
}

.cinema-title {
    position: relative;
    z-index: 2;
    text-align: center;
    font-size: clamp(3.2rem, 6vw, 8rem);
    line-height: 0.95;
    color: var(--charcoal);
}

.title-char {
    display: inline-block;
    opacity: 0;
    transform: translateY(14px) scale(0.96);
    animation: titleChar 520ms cubic-bezier(.2,.7,.2,1) forwards;
}
.title-space { width: 0.28em; }

.title-reflection {
    position: relative;
    z-index: 1;
    margin-top: 0.15rem;
    font-family: "Fredoka", Inter, system-ui, sans-serif;
    font-size: clamp(3.2rem, 6vw, 8rem);
    line-height: 0.72;
    color: var(--charcoal);
    transform: scaleY(-1) skewX(-4deg);
    opacity: 0.12;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,0.75), transparent 74%);
}

.illustration {
    stroke: var(--sepia);
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.illustration path, .illustration circle, .divider-trace {
    stroke-dasharray: var(--path-length, 1);
    stroke-dashoffset: var(--path-length, 1);
    transition: stroke-dashoffset 1.5s ease-in-out;
}

.illustration.visible path, .illustration.visible circle, .divider-trace.visible { stroke-dashoffset: 0; }

.opening-scale {
    position: relative;
    z-index: 2;
    width: min(58vw, 420px);
    margin-top: 1.5rem;
    filter: drop-shadow(0 18px 18px rgba(92, 74, 58, 0.08));
}

.scroll-indicator {
    position: absolute;
    left: 50%;
    bottom: 11vh;
    z-index: 5;
    width: 54px;
    height: 54px;
    border: 0;
    background: transparent;
    opacity: 0;
    transform: translateX(-50%);
    animation: revealIndicator 500ms ease 3300ms forwards, bob 1.55s cubic-bezier(.45,0,.55,1) 3800ms infinite;
    cursor: pointer;
}
.scroll-indicator svg { width: 100%; height: 100%; stroke: var(--sepia); stroke-width: 2; fill: none; stroke-linecap: round; }

.prologue { padding: 10rem 2rem 6rem; display: grid; place-items: center; }
.prologue-card {
    width: min(760px, 100%);
    padding: clamp(2rem, 5vw, 4rem);
    border: 1px solid rgba(139, 125, 107, 0.28);
    border-radius: 30px;
    background: rgba(232, 213, 200, 0.72);
    box-shadow: inset 0 0 0 1px rgba(245, 237, 224, 0.72);
}

.timeline-section {
    width: min(1180px, 92vw);
    margin: 0 auto;
    padding: 6rem 0 8rem;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    column-gap: clamp(1rem, 2.4vw, 2rem);
}

.timeline-spine, .timeline-wobble {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 40px;
    transform: translateX(-50%);
    pointer-events: none;
}
.timeline-spine {
    width: 2px;
    background: linear-gradient(to bottom, var(--terracotta) 0 var(--progress), var(--olive) var(--progress) 100%);
    opacity: 0.7;
}
.timeline-wobble { height: 100%; z-index: 0; }
.timeline-wobble path { stroke: rgba(139, 125, 107, 0.62); stroke-width: 2; fill: none; }

.timeline-node {
    position: relative;
    z-index: 2;
    grid-column: span 4;
    margin: 3rem 0 6rem;
    transform: scale(0.92);
    opacity: 0.54;
    transition: transform 500ms ease, opacity 500ms ease;
}
.timeline-node.is-centered { transform: scale(1); opacity: 1; }
.timeline-node:hover { transform: scale(1.03); }
.node-left { grid-column: 1 / 5; padding-right: clamp(2.4rem, 5vw, 5rem); }
.node-right { grid-column: 5 / 9; padding-left: clamp(2.4rem, 5vw, 5rem); margin-top: 10rem; }

.node-content {
    position: relative;
    overflow: hidden;
    min-height: 390px;
    padding: clamp(1.5rem, 3vw, 2.6rem);
    border-radius: 26px;
    background: rgba(232, 213, 200, 0.82);
    border: 2px solid var(--terracotta);
    transition: box-shadow 200ms ease-out, background 200ms ease-out;
}
.standard-b .node-content { border-color: var(--slate); }
.timeline-node:hover .node-content { box-shadow: 0 4px 24px rgba(92, 74, 58, 0.12); background: rgba(245, 237, 224, 0.94); }
.node-content::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.25;
    background:
        linear-gradient(90deg, transparent 22px, rgba(139, 125, 107, 0.28) 23px, transparent 24px),
        linear-gradient(transparent 22px, rgba(139, 125, 107, 0.18) 23px, transparent 24px);
    background-size: 54px 54px;
    pointer-events: none;
}
.node-content > * { position: relative; z-index: 1; }
.node-label { margin: 0 0 0.4rem; color: var(--sepia); }
.node-content h2 { color: var(--charcoal); }
.node-content p:not(.node-label) { max-width: 35rem; }
.node-content .illustration { width: min(100%, 330px); height: 180px; margin-top: 1.4rem; }
.node-content text { fill: var(--sepia); stroke: none; font-family: "Caveat", cursive; font-size: 18px; }

.connector {
    position: absolute;
    top: 2.4rem;
    width: clamp(2.4rem, 5vw, 5rem);
    height: 2px;
    border-top: 2px dashed rgba(139, 125, 107, 0.58);
}
.node-left .connector { right: 0; }
.node-right .connector { left: 0; }
.node-dot {
    position: absolute;
    top: calc(2.4rem - 8px);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--cream);
    border: 1px solid var(--olive);
    box-shadow: inset 0 0 0 4px var(--olive), 0 0 0 6px rgba(245, 237, 224, 0.82);
}
.node-left .node-dot { right: -8px; }
.node-right .node-dot { left: -8px; }

.chapter-card {
    grid-column: 1 / 9;
    margin: 2rem 0 8rem;
    padding: 8rem 2rem;
    display: grid;
    place-items: center;
    text-align: center;
    border-radius: 34px;
    background:
        linear-gradient(90deg, rgba(139,125,107,0.2) 1px, transparent 1px),
        linear-gradient(rgba(139,125,107,0.18) 1px, transparent 1px),
        var(--ochre);
    background-size: 58px 58px;
}
.chapter-card .illustration { width: min(40vw, 430px); min-width: 260px; }
.chapter-card blockquote {
    max-width: 720px;
    margin-top: 1.8rem;
    color: var(--charcoal);
    font-size: clamp(1.7rem, 3vw, 2.3rem);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 600ms ease 400ms, transform 600ms ease 400ms;
}
.chapter-card.visible blockquote { opacity: 1; transform: translateY(0); }

.closing-frame {
    min-height: 76vh;
    padding: 8rem 2rem 12rem;
    display: grid;
    place-items: center;
    text-align: center;
    background: linear-gradient(180deg, transparent, rgba(61, 54, 48, 0.12));
}
.closing-frame h2, .closing-frame p { max-width: 760px; }
.closing-frame p { font-size: 1.12rem; }
.circuit-divider { width: min(720px, 80vw); height: 42px; position: relative; margin-bottom: 2rem; }
.circuit-divider::before { content: ""; position: absolute; left: 0; right: 0; top: 20px; border-top: 2px solid rgba(139,125,107,0.55); }
.circuit-divider span { position: absolute; top: 14px; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--olive); background: var(--cream); }
.circuit-divider span:nth-child(1) { left: 18%; } .circuit-divider span:nth-child(2) { left: 50%; } .circuit-divider span:nth-child(3) { left: 78%; }

@keyframes titleChar { to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }
@keyframes revealIndicator { to { opacity: 1; } }
@keyframes bob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 10px); } }

@media (max-width: 760px) {
    .letterbox-bar { height: 6vh; }
    main { padding: 6vh 0; }
    .timeline-section { width: min(100% - 2rem, 680px); display: block; padding-left: 2rem; }
    .timeline-spine, .timeline-wobble { left: 1rem; }
    .timeline-node, .node-right { margin: 2rem 0 4rem; padding: 0 0 0 2rem; transform: scale(0.96); }
    .node-left { padding: 0 0 0 2rem; }
    .node-left .connector, .node-right .connector { left: 0; right: auto; width: 2rem; }
    .node-left .node-dot, .node-right .node-dot { left: -8px; right: auto; }
    .node-content { min-height: auto; }
    .chapter-card { margin: 2rem 0 5rem; padding: 5rem 1rem; }
    .title-reflection { font-size: clamp(2.6rem, 14vw, 4rem); }
}
