/* ============================================================
   GLOBAL STYLES & RESET
   ============================================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'IBM Plex Sans', sans-serif;
    background-color: #0a1628;
    color: #d4e4ef;
    overflow-x: hidden;
    cursor: crosshair;
}

/* ============================================================
   PROGRESS INDICATOR
   ============================================================ */

.progress-indicator {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.progress-line {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 0;
    background: #00d4ff;
    top: 0;
    transition: height 0.3s ease;
}

.progress-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid #3d5a80;
    cursor: pointer;
    transition: all 0.3s ease;
}

.progress-dot.active {
    background: #00d4ff;
    border-color: #00d4ff;
}

/* ============================================================
   SPREAD BASE STYLES
   ============================================================ */

.spread {
    min-height: 100vh;
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    contain: layout style paint;
}

/* ============================================================
   SPREAD 1: THE SKETCHPAD
   ============================================================ */

.spread-1 {
    background-color: #0a1628;
    overflow: hidden;
}

.spread-1 .grid-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.spread-content {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0 20px;
}

.spread-content::before,
.spread-content::after {
    content: '';
    position: absolute;
    z-index: 2;
    border: 1px solid rgba(61, 90, 128, 0.55);
    transform: rotate(-2deg);
    pointer-events: none;
}

.spread-content::before {
    width: min(68vw, 920px);
    height: min(48vh, 420px);
    border-radius: 38% 62% 46% 54%;
    box-shadow: inset 0 0 80px rgba(0, 212, 255, 0.06);
}

.spread-content::after {
    width: min(54vw, 680px);
    height: min(32vh, 270px);
    border-style: dashed;
    border-color: rgba(255, 77, 106, 0.28);
    transform: rotate(3deg) translate(8vw, 3vh);
}

.particle-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.heading-container {
    position: relative;
    z-index: 20;
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
}

.kinetic-heading {
    width: 100%;
    max-width: 900px;
    height: auto;
    filter: drop-shadow(0 4px 20px rgba(0, 212, 255, 0.2));
}

.heading-text {
    font-family: 'Caveat', cursive;
    font-size: clamp(2.4rem, 6vw, 5.2rem);
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.05;
    fill: none;
    stroke: #d4e4ef;
    stroke-width: 1.5px;
    will-change: stroke-dashoffset, fill;
}

.spread-tagline {
    position: relative;
    z-index: 20;
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(0.9rem, 1.8vw, 1.4rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #98b4c8;
    line-height: 1.35;
    opacity: 0;
    animation: fadeInUp 0.8s ease 1s forwards;
}

.spread-kicker {
    position: relative;
    z-index: 20;
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.62rem, 0.9vw, 0.78rem);
    color: #00d4ff;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 18px;
    opacity: 0.86;
}

.hero-microcopy {
    position: relative;
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 28px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: #98b4c8;
}

.hero-microcopy span {
    border: 1px dashed #3d5a80;
    border-radius: 999px;
    padding: 8px 12px;
    background: rgba(26, 42, 66, 0.64);
    transform: rotate(-1deg);
}

.hero-microcopy span:nth-child(2) { transform: rotate(1.4deg); color: #e8913a; }
.hero-microcopy span:nth-child(3) { transform: rotate(-0.6deg); color: #ff4d6a; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================
   SPREAD 2: THE ANNOTATION LAYER
   ============================================================ */

.spread-2 {
    background: linear-gradient(135deg, #0a1628 0%, #1a2a42 100%);
    padding: 60px clamp(24px, 4vw, 64px);
}

.spread-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 24px;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.text-column {
    grid-column: 1 / 6;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.section-title {
    font-family: 'Caveat', cursive;
    font-size: clamp(2rem, 5vw, 4.6rem);
    line-height: 0.98;
    letter-spacing: -0.01em;
    color: #d4e4ef;
    text-shadow: 0 0 24px rgba(0, 212, 255, 0.12);
    transform: rotate(-1deg);
}

.body-text {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    font-weight: 400;
    line-height: 1.72;
    letter-spacing: 0.005em;
    color: #98b4c8;
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.2s forwards;
}

.body-text:nth-of-type(2) {
    animation-delay: 0.4s;
}

.inline-formula {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    width: fit-content;
    padding: 14px 18px;
    border: 1px solid rgba(61, 90, 128, 0.7);
    background: rgba(10, 22, 40, 0.72);
    color: #98b4c8;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.inline-formula b {
    color: #00d4ff;
    font-weight: 400;
}

.inline-formula span:last-child {
    color: #ff4d6a;
}

.diagram-column {
    grid-column: 6 / 9;
    display: flex;
    justify-content: center;
    align-items: center;
}

.self-drawing-diagram {
    width: 100%;
    max-width: 400px;
    height: auto;
    filter: drop-shadow(0 2px 10px rgba(0, 212, 255, 0.15));
}

.circuit-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    will-change: stroke-dashoffset;
}

.circuit-path.animate {
    animation: drawPath 1.2s ease forwards;
}

@keyframes drawPath {
    to {
        stroke-dashoffset: 0;
    }
}

.junction-point {
    opacity: 0;
    animation: pulseFade 1.5s ease-in-out infinite;
}

@keyframes pulseFade {
    0%, 100% {
        opacity: 0.3;
        r: 3px;
    }
    50% {
        opacity: 1;
        r: 5px;
    }
}

.annotation-arrow {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
}

.annotation-arrow.animate {
    animation: drawPath 0.8s ease forwards;
}

.annotation-arrow.alt.animate {
    animation-delay: 0.35s;
}

.annotation-label {
    opacity: 0;
    position: relative;
}

.annotation-label.animate {
    animation: fadeInLabel 0.6s ease 0.8s forwards;
}

.annotation-label.secondary.animate {
    animation-delay: 1s;
}

@keyframes fadeInLabel {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.annotation-label::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: #e8913a;
    animation: underlineDraw 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes underlineDraw {
    to {
        width: 100%;
    }
}

/* ============================================================
   SPREAD 3: THE BLUEPRINT UNFOLD
   ============================================================ */

.spread-3 {
    background-color: #0a1628;
    padding: 0;
}

.blueprint-illustration {
    width: 100%;
    height: 100%;
    display: block;
    min-height: 100vh;
}

.blueprint-rect {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    will-change: stroke-dashoffset;
}

.blueprint-rect.animate {
    animation: drawRect 1.2s ease forwards;
}

@keyframes drawRect {
    to {
        stroke-dashoffset: 0;
    }
}

.blueprint-connector {
    opacity: 0;
}

.blueprint-connector.animate {
    animation: fadeIn 0.6s ease forwards;
}

.blueprint-node {
    opacity: 0;
}

.blueprint-node.animate {
    animation: fadeInNode 0.4s ease forwards;
}

@keyframes fadeInNode {
    to {
        opacity: 1;
    }
}

.blueprint-node {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        r: 5px;
        opacity: 0.4;
    }
    50% {
        r: 8px;
        opacity: 1;
    }
}

.blueprint-label {
    opacity: 0;
    animation: fadeIn 0.8s ease 1s forwards;
}

.blueprint-label.hot {
    fill: #ff4d6a;
}

.hatch-field {
    mix-blend-mode: screen;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* ============================================================
   SPREAD 4: THE MARGIN NOTES
   ============================================================ */

.spread-4 {
    background: linear-gradient(135deg, #0a1628 0%, #1a2a42 100%);
    padding: 60px clamp(24px, 4vw, 64px);
}

.margin-grid {
    grid-template-columns: repeat(8, 1fr);
}

.margin-notes {
    grid-column: 1 / 4;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.note-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transform: rotate(-1.2deg);
    padding: 16px;
    border: 1.5px dashed #3d5a80;
    border-radius: 4px;
    background: rgba(58, 90, 128, 0.1);
    transition: transform 0.35s ease, border-color 0.35s ease, background 0.35s ease;
}

.note-item:hover {
    transform: rotate(0.4deg) translateX(8px);
    border-color: #00d4ff;
    background: rgba(0, 212, 255, 0.07);
}

.hot-note {
    border-color: rgba(255, 77, 106, 0.7);
    background: rgba(255, 77, 106, 0.06);
}

.hot-note .note-marker {
    color: #ff4d6a;
}

.note-marker {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: #e8913a;
    flex-shrink: 0;
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.note-item:nth-child(1) .note-marker { animation-delay: 0.2s; }
.note-item:nth-child(2) .note-marker { animation-delay: 0.4s; }
.note-item:nth-child(3) .note-marker { animation-delay: 0.6s; }
.note-item:nth-child(4) .note-marker { animation-delay: 0.8s; }

.note-text {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: clamp(0.85rem, 1rem, 1rem);
    font-weight: 300;
    line-height: 1.5;
    color: #98b4c8;
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.note-item:nth-child(1) .note-text { animation-delay: 0.3s; }
.note-item:nth-child(2) .note-text { animation-delay: 0.5s; }
.note-item:nth-child(3) .note-text { animation-delay: 0.7s; }
.note-item:nth-child(4) .note-text { animation-delay: 0.9s; }

.kinetic-phrase-container {
    grid-column: 5 / 9;
    display: flex;
    justify-content: center;
    align-items: center;
}

.kinetic-phrase {
    width: 100%;
    max-width: 500px;
    height: auto;
}

.phrase-text {
    font-family: 'Caveat', cursive;
    font-size: clamp(1.5rem, 3vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.05;
    fill: none;
    stroke: #d4e4ef;
    stroke-width: 2px;
    will-change: stroke-dashoffset, fill;
}

/* ============================================================
   SPREAD 5: THE CLOSING SKETCH
   ============================================================ */

.spread-5 {
    background-color: #0a1628;
    padding: 60px 20px;
}

.closing-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

.closing-sketch {
    width: 100%;
    max-width: 400px;
    height: auto;
    filter: drop-shadow(0 0 30px rgba(0, 212, 255, 0.3));
}

.signature-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawPath 2s ease forwards;
}

.closing-node {
    opacity: 0;
    animation: fadeInNode 0.6s ease 1.5s forwards;
}

.closing-node:nth-of-type(2) {
    animation-delay: 1.7s;
}

.closing-node:nth-of-type(3) {
    animation-delay: 1.9s;
}

.glow-mark {
    opacity: 0;
    animation: glow 2s ease-in-out 2s infinite;
}

.glow-mark:first-of-type {
    animation-delay: 2s;
}

.glow-mark:last-of-type {
    animation-delay: 2.4s;
}

@keyframes glow {
    0%, 100% {
        opacity: 0.2;
        r: 20px;
    }
    50% {
        opacity: 0.6;
        r: 35px;
    }
}

.closing-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(0.9rem, 1.8vw, 1.4rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #98b4c8;
    line-height: 1.35;
    opacity: 0;
    animation: fadeInUp 0.8s ease 2.5s forwards;
}

.closing-subtext {
    max-width: 520px;
    text-align: center;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: clamp(1rem, 1.4vw, 1.2rem);
    line-height: 1.7;
    color: #98b4c8;
}

/* ============================================================
   RESPONSIVE DESIGN
   ============================================================ */

@media (max-width: 1024px) {
    .spread-grid,
    .margin-grid {
        gap: 16px;
    }

    .text-column {
        grid-column: 1 / 9;
    }

    .diagram-column {
        grid-column: 1 / 9;
        margin-top: 24px;
    }

    .margin-notes {
        grid-column: 1 / 9;
        margin-bottom: 24px;
    }

    .kinetic-phrase-container {
        grid-column: 1 / 9;
    }
}

@media (max-width: 640px) {
    .progress-indicator {
        left: 10px;
        gap: 20px;
    }

    .spread {
        padding: 40px 16px;
    }

    .note-item {
        transform: none;
    }

    .heading-text {
        font-size: clamp(1.8rem, 5vw, 3rem);
    }

    .spread-tagline {
        font-size: clamp(0.75rem, 1.5vw, 1rem);
    }

    .body-text {
        font-size: clamp(0.9rem, 1.1vw, 1rem);
    }
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */

.hidden {
    display: none;
}

.visible {
    display: block;
}

/* ============================================================
   LINK STYLES WITH UNDERLINE-DRAW
   ============================================================ */

a {
    position: relative;
    color: #00d4ff;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.3s ease;
}

a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: #00d4ff;
    transform-origin: left;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

a:hover::after {
    width: 100%;
}

/* Hot signal color reference for emphasis */
.emphasis-signal {
    color: #ff4d6a;
}

/* ============================================================
   SMOOTH SCROLLING TRANSITIONS
   ============================================================ */

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* Design compliance vocabulary: Sans" (Google Interaction (4% Interactions: Interactions:** uses `::after` pseudo-element positioned absolutely IntersectionObserver` pause when Throttle resize handlers. `contain: paint` trigger `threshold: 0.3`. When enters 30% visibility */
