/* ============================================================
   mujun.works — y2k-futurism filtered through zen contemplation
   Palette: Sunset Warm
   Typography: Nunito (display), Source Serif 4 (body), IBM Plex Mono (data)
   Spacing: phi-scaled (8, 13, 21, 34, 55, 89, 144)
   ============================================================ */

:root {
    /* Colors — exact hex per DESIGN.md */
    --bg-deep:        #1E1433;   /* Twilight Indigo */
    --bg-warm:        #3A1F47;   /* Dusk Plum */
    --surface:        #E8956A;   /* Sunset Blush */
    --accent-1:       #F5C842;   /* Solar Gold */
    --accent-2:       #D4577A;   /* Rose Horizon */
    --text-1:         #FFF5E6;   /* Warm Cream */
    --text-2:         #B89AAF;   /* Faded Mauve */
    --chrome:         #F0E0D0;   /* Iridescent Pearl */
    --data-accent:    #FF7043;   /* Coral Ember */

    /* phi-scaled spacing */
    --s-1: 8px;
    --s-2: 13px;
    --s-3: 21px;
    --s-4: 34px;
    --s-5: 55px;
    --s-6: 89px;
    --s-7: 144px;

    /* easing */
    --ease-in:  cubic-bezier(0.23, 1, 0.32, 1);
    --ease-out: cubic-bezier(0.4, 0, 0.2, 1);

    /* gradients */
    --grad-sunset: linear-gradient(135deg, #F5C842 0%, #E8956A 35%, #D4577A 65%, #3A1F47 100%);
    --grad-chrome: linear-gradient(180deg, #F0E0D0 0%, #E8956A 40%, #B89AAF 70%, #3A1F47 100%);
    --grad-glow:   radial-gradient(circle at center, #F5C842 0%, #FF7043 50%, transparent 80%);
    --grad-chrome-soft: linear-gradient(180deg, rgba(240,224,208,0.85) 0%, rgba(232,149,106,0.55) 40%, rgba(184,154,175,0.45) 70%, rgba(58,31,71,0.35) 100%);
}

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

html, body {
    width: 100%;
    height: 100%;
    background: var(--bg-deep);
    color: var(--text-1);
    font-family: 'Source Serif 4', 'Lora', Georgia, serif;
    font-size: 18px;
    line-height: 1.7;
    letter-spacing: 0.005em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

body {
    background: var(--grad-sunset);
    background-attachment: fixed;
}

/* ============================================================
   Reader / scroll-snap container
   ============================================================ */

.reader {
    width: 100%;
    height: 100vh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
}

.reader::-webkit-scrollbar { width: 0; height: 0; }
.reader { scrollbar-width: none; }

.spread {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 100vh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    overflow: hidden;
    isolation: isolate;
}

/* per-spread backgrounds — variations on the sunset gradient */
.spread-1 {
    background:
        radial-gradient(ellipse 80% 60% at 30% 70%, rgba(245, 200, 66, 0.18), transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 20%, rgba(212, 87, 122, 0.18), transparent 60%),
        linear-gradient(160deg, #1E1433 0%, #3A1F47 70%, #1E1433 100%);
}
.spread-2 {
    background:
        radial-gradient(ellipse 70% 60% at 75% 60%, rgba(232, 149, 106, 0.22), transparent 65%),
        linear-gradient(135deg, #3A1F47 0%, #1E1433 60%, #3A1F47 100%);
}
.spread-3 {
    background:
        radial-gradient(ellipse 100% 70% at 50% 50%, rgba(245, 200, 66, 0.16), transparent 70%),
        var(--grad-sunset);
}
.spread-4 {
    background:
        radial-gradient(ellipse 60% 80% at 20% 50%, rgba(212, 87, 122, 0.18), transparent 65%),
        linear-gradient(200deg, #3A1F47 0%, #1E1433 60%, #1E1433 100%);
}
.spread-5 {
    background:
        radial-gradient(ellipse 70% 70% at 50% 50%, rgba(245, 200, 66, 0.20), transparent 70%),
        linear-gradient(180deg, #1E1433 0%, #3A1F47 50%, #1E1433 100%);
}

/* chrome rule between spreads */
.spread + .toolbar-fragment::before,
.spread + .toolbar-fragment::after {
    content: "";
}

/* ============================================================
   Floating Navigation
   ============================================================ */

.floating-nav {
    position: fixed;
    top: var(--s-3);
    left: 50%;
    transform: translateX(-50%) translateY(-200%);
    z-index: 50;
    width: min(820px, calc(100% - var(--s-4)));
    transition: transform 900ms var(--ease-in), opacity 900ms var(--ease-in);
    opacity: 0;
    pointer-events: none;
}

.floating-nav.is-visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-3);
    padding: var(--s-2) var(--s-3);
    background: rgba(30, 20, 51, 0.55);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border: 1px solid rgba(240, 224, 208, 0.28);
    border-radius: 999px;
    box-shadow:
        inset 0 1px 0 rgba(240, 224, 208, 0.30),
        0 4px 20px rgba(30, 20, 51, 0.4);
}

.nav-mark {
    font-family: 'Nunito', 'Inter', sans-serif;
    font-weight: 700;
    color: var(--accent-1);
    font-size: 1rem;
    letter-spacing: 0.04em;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: var(--s-3);
}

.nav-list a {
    font-family: 'Nunito', 'Inter', sans-serif;
    font-weight: 300;
    font-size: 0.8125rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-2);
    text-decoration: none;
    transition: color 600ms var(--ease-in);
}

.nav-list a.is-active,
.nav-list a:hover {
    color: var(--text-1);
}

.nav-status {
    display: flex;
    align-items: center;
    gap: var(--s-1);
    font-family: 'IBM Plex Mono', 'Space Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-2);
    letter-spacing: 0.04em;
}

.nav-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, var(--chrome), var(--accent-1) 50%, var(--accent-2) 100%);
    box-shadow: 0 0 8px rgba(245, 200, 66, 0.6);
    animation: dot-breath 4s var(--ease-in) infinite;
}

@keyframes dot-breath {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50%      { opacity: 1.0; transform: scale(1.15); }
}

/* ============================================================
   Spread grids
   ============================================================ */

.spread-grid {
    display: grid;
    width: 100%;
    height: 100%;
    column-gap: var(--s-5);
    padding: var(--s-5) var(--s-6);
    align-items: center;
}

.grid-62-38 { grid-template-columns: 62fr 38fr; }
.grid-45-55 { grid-template-columns: 45fr 55fr; }
.grid-38-62 { grid-template-columns: 38fr 62fr; }

.panel {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ============================================================
   Spread 1 — Opening
   ============================================================ */

.panel-viz {
    position: relative;
    align-items: center;
    justify-content: center;
}

.data-glow {
    position: absolute;
    inset: 10%;
    background: var(--grad-glow);
    opacity: 0.55;
    filter: blur(8px);
    z-index: 0;
    animation: glow-breath 7s var(--ease-in) infinite;
}

@keyframes glow-breath {
    0%, 100% { opacity: 0.45; transform: scale(1); }
    50%      { opacity: 0.7;  transform: scale(1.04); }
}

.viz {
    position: relative;
    width: 100%;
    max-width: min(100%, 540px);
    height: auto;
    z-index: 1;
}

.viz-chord {
    aspect-ratio: 1 / 1;
}

.panel-title {
    position: relative;
    padding-left: var(--s-4);
}

.vertical-rule {
    position: absolute;
    left: 0;
    top: 12%;
    bottom: 12%;
    width: 2px;
    background: linear-gradient(180deg, transparent 0%, var(--chrome) 20%, var(--accent-1) 50%, var(--accent-2) 80%, transparent 100%);
    opacity: 0.6;
}

.title-stack {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
}

.display-title {
    font-family: 'Nunito', 'Inter', sans-serif;
    font-weight: 700;
    font-size: 4.5rem;
    line-height: 1.05;
    letter-spacing: -0.03em;
    color: var(--text-1);
    display: flex;
    flex-direction: column;
}

.title-line {
    background: linear-gradient(180deg, #F0E0D0 0%, #FFF5E6 40%, #E8956A 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.title-line-alt {
    font-weight: 300;
    background: linear-gradient(180deg, #F5C842 0%, #D4577A 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-left: var(--s-3);
}

.title-sub {
    font-family: 'Source Serif 4', 'Lora', serif;
    font-weight: 300;
    font-style: italic;
    font-size: 1.25rem;
    line-height: 1.5;
    color: var(--text-1);
    max-width: 24ch;
    opacity: 0.92;
}
.title-sub em {
    font-style: italic;
    color: var(--accent-1);
}

.title-meta {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    margin-top: var(--s-3);
    font-family: 'IBM Plex Mono', 'Space Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-2);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.meta-key {
    color: var(--accent-1);
    font-size: 1rem;
}
.meta-sep {
    width: 21px;
    height: 1px;
    background: var(--text-2);
    opacity: 0.4;
}

.caption {
    font-family: 'Source Serif 4', 'Lora', serif;
    font-weight: 600;
    font-size: 0.8125rem;
    line-height: 1.5;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-2);
}
.caption-eyebrow {
    color: var(--accent-2);
    margin-bottom: var(--s-3);
}
.caption-center { display: block; text-align: center; }
.caption-quiet  { opacity: 0.7; }

/* ============================================================
   Chrome orbs — pure CSS metallic spheres
   ============================================================ */

.chrome-orb {
    position: absolute;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 28% 28%, rgba(255, 255, 255, 0.85) 0%, rgba(240, 224, 208, 0.6) 12%, transparent 22%),
        linear-gradient(180deg, #F0E0D0 0%, #E8956A 40%, #B89AAF 70%, #3A1F47 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -2px 4px rgba(30, 20, 51, 0.4),
        0 4px 14px rgba(30, 20, 51, 0.45);
    pointer-events: none;
}
.chrome-orb::after {
    content: "";
    position: absolute;
    top: 18%;
    left: 22%;
    width: 18%;
    height: 18%;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    filter: blur(0.6px);
}

.orb-corner-tl { top: var(--s-3);  left: var(--s-3);  width: 36px; height: 36px; }
.orb-corner-bl { bottom: var(--s-3); left: var(--s-3); width: 24px; height: 24px; }
.orb-tiny      { width: 16px; height: 16px; position: relative; align-self: flex-start; }
.orb-inline    { width: 20px; height: 20px; position: relative; align-self: flex-start; margin-top: var(--s-3); }
.orb-small     { width: 22px; height: 22px; }
.orb-card      { top: var(--s-2); right: var(--s-2); }
.orb-card-tr   { top: var(--s-3); right: var(--s-3); }
.orb-card-bl   { bottom: var(--s-3); left: var(--s-3); width: 18px; height: 18px; }

/* ============================================================
   Halo rings
   ============================================================ */

.halo-rings {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 0;
}

.ring {
    position: absolute;
    border: 1px solid var(--accent-1);
    border-radius: 50%;
    opacity: 0.15;
}
.ring-outer  { width: 110vh; height: 110vh; opacity: 0.10; animation: ring-spin 60s linear infinite; }
.ring-middle { width: 68vh;  height: 68vh;  opacity: 0.15; animation: ring-spin-rev 90s linear infinite; }
.ring-inner  { width: 42vh;  height: 42vh;  opacity: 0.20; }

.halo-rings-small .ring-outer  { width: 460px; height: 460px; }
.halo-rings-small .ring-middle { width: 320px; height: 320px; }
.halo-rings-small .ring-inner  { width: 220px; height: 220px; }

.halo-rings-large .ring-outer  { width: 90vmin; height: 90vmin; }
.halo-rings-large .ring-middle { width: 56vmin; height: 56vmin; }
.halo-rings-large .ring-inner  { width: 35vmin; height: 35vmin; }

@keyframes ring-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
@keyframes ring-spin-rev {
    from { transform: rotate(0deg); }
    to   { transform: rotate(-360deg); }
}

.spread-grid,
.spread-bleed,
.spread-center {
    position: relative;
    z-index: 1;
}

/* ============================================================
   Toolbar fragments (between spreads)
   ============================================================ */

.toolbar-fragment {
    position: relative;
    width: 100%;
    height: 40px;
    display: flex;
    align-items: center;
    gap: var(--s-2);
    padding: 0 var(--s-5);
    background: rgba(30, 20, 51, 0.4);
    backdrop-filter: blur(8px) saturate(130%);
    -webkit-backdrop-filter: blur(8px) saturate(130%);
    border-top: 1px solid rgba(240, 224, 208, 0.30);
    border-bottom: 1px solid rgba(240, 224, 208, 0.18);
    overflow: hidden;
    isolation: isolate;
    /* break out of scroll-snap: NOT a section, sits between */
    flex-shrink: 0;
}

.toolbar-fragment::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(245, 200, 66, 0.10) 50%, transparent 100%);
    z-index: -1;
}

.toolbar-fragment-alt {
    background: rgba(58, 31, 71, 0.45);
}

.tb-pill {
    width: 28px;
    height: 14px;
    border-radius: 999px;
    background: var(--grad-chrome-soft);
    box-shadow:
        inset 0 1px 0 rgba(240, 224, 208, 0.5),
        inset 0 -1px 2px rgba(30, 20, 51, 0.3);
}
.tb-pill-wide { width: 56px; }

.tb-divider {
    width: 1px;
    height: 18px;
    background: rgba(240, 224, 208, 0.3);
}

.tb-text {
    font-family: 'IBM Plex Mono', 'Space Mono', monospace;
    font-size: 0.6875rem;
    letter-spacing: 0.10em;
    color: var(--text-2);
    text-transform: uppercase;
}

/* ============================================================
   Section headings & prose
   ============================================================ */

.section-heading {
    font-family: 'Nunito', 'Inter', sans-serif;
    font-weight: 300;
    font-size: 2.75rem;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: var(--text-1);
    margin-bottom: var(--s-4);
}
.section-heading-center { text-align: center; }

.prose {
    font-family: 'Source Serif 4', 'Lora', serif;
    font-weight: 400;
    font-size: 1.125rem;
    line-height: 1.7;
    letter-spacing: 0.005em;
    color: var(--text-1);
    max-width: 28ch;
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
}
.prose em { color: var(--accent-1); font-style: italic; }
.prose-wide { max-width: 52ch; gap: var(--s-3); }

.pull-quote {
    position: relative;
    margin: var(--s-3) 0;
    padding: var(--s-3) var(--s-4);
    font-family: 'Source Serif 4', 'Lora', serif;
    font-weight: 300;
    font-style: italic;
    font-size: 1.75rem;
    line-height: 1.45;
    letter-spacing: -0.005em;
    color: var(--text-1);
    background:
        linear-gradient(135deg, rgba(212, 87, 122, 0.20) 0%, rgba(245, 200, 66, 0.12) 50%, rgba(232, 149, 106, 0.18) 100%);
    border: 1px solid rgba(240, 224, 208, 0.22);
    border-radius: 12px;
    box-shadow:
        inset 0 1px 0 rgba(240, 224, 208, 0.3),
        0 4px 20px rgba(30, 20, 51, 0.4);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.pull-quote-alt {
    background:
        linear-gradient(135deg, rgba(245, 200, 66, 0.18) 0%, rgba(212, 87, 122, 0.20) 100%);
}
.quote-mark {
    font-family: 'Nunito', 'Inter', sans-serif;
    font-weight: 700;
    color: var(--accent-1);
    font-size: 2.5rem;
    line-height: 0;
    margin-right: var(--s-1);
    vertical-align: -0.4em;
}

/* ============================================================
   Card-flip
   ============================================================ */

.card-flip {
    position: relative;
    width: 100%;
    max-width: 420px;
    aspect-ratio: 4 / 3;
    margin: 0 auto;
    perspective: 1400px;
    z-index: 2;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transform: rotateY(0deg);
    transition: transform 900ms cubic-bezier(0.23, 1, 0.32, 1),
                box-shadow 900ms cubic-bezier(0.23, 1, 0.32, 1);
}

.card-flip.is-flipped .card-inner {
    transform: rotateY(180deg);
}

/* golden glow at moment of flip */
.card-flip.is-flipping .card-inner {
    box-shadow: 0 0 60px 20px rgba(245, 200, 66, 0.15);
}

.card-face {
    position: absolute;
    inset: 0;
    border-radius: 12px;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    overflow: hidden;
    padding: var(--s-4);
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow:
        inset 0 1px 0 rgba(240, 224, 208, 0.3),
        0 4px 20px rgba(30, 20, 51, 0.4);
}

/* chrome bevel border using border-image */
.card-front {
    background: var(--bg-deep);
    border: 2px solid transparent;
    background-clip: padding-box;
    position: relative;
}
.card-front::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 12px;
    padding: 2px;
    background: var(--grad-chrome);
    -webkit-mask:
        linear-gradient(#000, #000) content-box,
        linear-gradient(#000, #000);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    pointer-events: none;
}

.card-back {
    background: var(--bg-warm);
    transform: rotateY(180deg);
    border: 2px solid transparent;
    position: relative;
    align-items: center;
    justify-content: center;
}
.card-back::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 12px;
    padding: 2px;
    background: var(--grad-chrome);
    -webkit-mask:
        linear-gradient(#000, #000) content-box,
        linear-gradient(#000, #000);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    pointer-events: none;
}

.card-system-label {
    font-family: 'IBM Plex Mono', 'Space Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.10em;
    color: var(--accent-1);
    text-transform: uppercase;
    margin-bottom: var(--s-3);
}

.card-heading {
    font-family: 'Nunito', 'Inter', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    line-height: 1.25;
    letter-spacing: 0.01em;
    color: var(--text-1);
    margin-bottom: var(--s-3);
}
.card-heading-tile {
    font-size: 1.35rem;
    line-height: 1.15;
}

.card-meta {
    font-family: 'Source Serif 4', 'Lora', serif;
    font-style: italic;
    font-size: 0.95rem;
    color: var(--text-2);
    line-height: 1.5;
}
.card-meta-tile {
    font-family: 'Source Serif 4', 'Lora', serif;
    font-style: italic;
    font-size: 0.85rem;
    color: var(--text-2);
}

.card-back-label {
    position: absolute;
    bottom: var(--s-2);
    right: var(--s-3);
    font-family: 'IBM Plex Mono', 'Space Mono', monospace;
    font-size: 0.6875rem;
    letter-spacing: 0.08em;
    color: var(--text-2);
    text-transform: uppercase;
}

/* ============================================================
   Spread 3 — Gallery (full-bleed)
   ============================================================ */

.spread-bleed {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: var(--s-5) var(--s-5);
}

.bleed-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
    align-items: center;
}

.card-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--s-4);
    align-items: center;
    justify-items: center;
    padding: 0 var(--s-3);
}

.card-flip-tile {
    max-width: 320px;
    aspect-ratio: 3 / 4;
}
.card-flip-tile .card-front {
    align-items: flex-start;
    text-align: left;
}

.bleed-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--s-2);
}
.bleed-rule {
    width: min(640px, 70%);
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, var(--chrome) 30%, var(--accent-1) 50%, var(--accent-2) 70%, transparent 100%);
    opacity: 0.6;
    border-radius: 2px;
}

/* ============================================================
   Spread 4 — Details
   ============================================================ */

.panel-monitors {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--s-3);
}

.monitor-stack {
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
}

.monitor {
    position: relative;
}

.monitor-frame {
    position: relative;
    background: rgba(30, 20, 51, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 12px;
    padding: var(--s-2) var(--s-3);
    display: flex;
    flex-direction: column;
    gap: var(--s-1);
    box-shadow:
        inset 0 1px 0 rgba(240, 224, 208, 0.30),
        0 4px 20px rgba(30, 20, 51, 0.40);
    border: 2px solid transparent;
}
.monitor-frame::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 12px;
    padding: 2px;
    background: var(--grad-chrome);
    -webkit-mask:
        linear-gradient(#000, #000) content-box,
        linear-gradient(#000, #000);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    pointer-events: none;
    opacity: 0.6;
}

.monitor-label {
    font-family: 'IBM Plex Mono', 'Space Mono', monospace;
    font-size: 0.6875rem;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: var(--accent-1);
}

.monitor-meta {
    font-family: 'IBM Plex Mono', 'Space Mono', monospace;
    font-size: 0.6875rem;
    letter-spacing: 0.06em;
    color: var(--text-2);
}

.monitor-readout {
    display: flex;
    gap: 6px;
    align-items: center;
    height: 28px;
}
.swatch {
    flex: 1;
    height: 100%;
    border-radius: 4px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.s-1 { background: #F5C842; }
.s-2 { background: #E8956A; }
.s-3 { background: #D4577A; }
.s-4 { background: #3A1F47; }
.s-5 { background: #FFF5E6; }

.monitor-graph {
    width: 100%;
    height: 36px;
    overflow: visible;
}
#cadencePath {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    animation: cadence-draw 6s var(--ease-in) infinite;
}
@keyframes cadence-draw {
    0%   { stroke-dashoffset: 600; opacity: 0.4; }
    50%  { stroke-dashoffset: 0;   opacity: 1.0; }
    100% { stroke-dashoffset: -600; opacity: 0.4; }
}

.monitor-bars {
    display: flex;
    gap: 6px;
    align-items: flex-end;
    height: 60px;
}
.bar {
    flex: 1;
    height: var(--h, 20px);
    background: linear-gradient(180deg, var(--accent-1) 0%, var(--accent-2) 100%);
    border-radius: 2px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
    opacity: 0.85;
}

.monitor-big {
    font-family: 'Nunito', 'Inter', sans-serif;
    font-weight: 700;
    font-size: 2.25rem;
    color: var(--text-1);
    line-height: 1;
    letter-spacing: -0.02em;
}
.monitor-unit {
    font-size: 1rem;
    font-weight: 300;
    color: var(--text-2);
    margin-left: 4px;
}

.panel-prose {
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-y: auto;
    max-height: 100%;
    padding-right: var(--s-3);
    scrollbar-width: thin;
    scrollbar-color: rgba(240, 224, 208, 0.2) transparent;
}
.panel-prose::-webkit-scrollbar { width: 6px; }
.panel-prose::-webkit-scrollbar-thumb { background: rgba(240, 224, 208, 0.2); border-radius: 3px; }

/* ============================================================
   Spread 5 — Close
   ============================================================ */

.spread-center {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--s-3);
    padding: var(--s-5) var(--s-5);
}

.card-flip-large {
    max-width: 720px;
    aspect-ratio: 5 / 3;
}
.card-flip-large .card-front {
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--s-5);
}

.closing-heading {
    font-family: 'Nunito', 'Inter', sans-serif;
    font-weight: 300;
    font-size: 2.5rem;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--text-1);
    margin-bottom: var(--s-3);
}
.closing-body {
    font-family: 'Source Serif 4', 'Lora', serif;
    font-weight: 400;
    font-style: italic;
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--text-1);
    max-width: 36ch;
    margin: 0 auto var(--s-3);
    opacity: 0.9;
}
.closing-sig {
    font-family: 'IBM Plex Mono', 'Space Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.10em;
    color: var(--accent-1);
    text-transform: uppercase;
}

.closing-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--s-2);
    margin-top: var(--s-3);
}

/* ============================================================
   Circuit traces (decorative)
   ============================================================ */

.circuit-trace {
    position: absolute;
    width: 200px;
    height: 120px;
    pointer-events: none;
    opacity: 0.6;
}
.circuit-trace svg { width: 100%; height: 100%; }
.trace-tl { top: 8%; left: -2%; }

/* ============================================================
   Data viz primitive animations (CSS-driven)
   ============================================================ */

.chord-arcs path {
    fill: none;
    stroke-linecap: round;
    animation: arc-breath 4s var(--ease-in) infinite;
}
.chord-arcs path:nth-child(8n+1) { animation-delay: 0ms; }
.chord-arcs path:nth-child(8n+2) { animation-delay: 200ms; }
.chord-arcs path:nth-child(8n+3) { animation-delay: 400ms; }
.chord-arcs path:nth-child(8n+4) { animation-delay: 600ms; }
.chord-arcs path:nth-child(8n+5) { animation-delay: 800ms; }
.chord-arcs path:nth-child(8n+6) { animation-delay: 1000ms; }
.chord-arcs path:nth-child(8n+7) { animation-delay: 1200ms; }
.chord-arcs path:nth-child(8n+0) { animation-delay: 1400ms; }

@keyframes arc-breath {
    0%, 100% { opacity: 0.40; }
    50%      { opacity: 1.00; }
}

.chord-points circle {
    fill: var(--accent-1);
    opacity: 0.7;
    animation: point-pulse 6s var(--ease-in) infinite;
}
@keyframes point-pulse {
    0%, 100% { opacity: 0.5; }
    50%      { opacity: 1.0; }
}

.ribbon {
    transform-origin: center;
    animation: ribbon-drift 8s ease-in-out infinite;
}
.ribbon-a { animation-delay: 0s; }
.ribbon-b { animation-delay: -2s; }
.ribbon-c { animation-delay: -4s; }
@keyframes ribbon-drift {
    0%, 100% { transform: translateY(0px); }
    50%      { transform: translateY(3px); }
}

/* ============================================================
   Reveal states — observed via IntersectionObserver
   ============================================================ */

.spread-1 .panel-title,
.spread-1 .panel-viz,
.spread-2 .panel-text,
.spread-2 .panel-card,
.spread-3 .bleed-header,
.spread-3 .card-strip,
.spread-3 .bleed-footer,
.spread-4 .panel-monitors,
.spread-4 .panel-prose,
.spread-5 .spread-center {
    opacity: 0;
    transform: translateY(34px);
    transition:
        opacity 1200ms var(--ease-in),
        transform 1200ms var(--ease-in);
}
.spread.is-visible .panel-title,
.spread.is-visible .panel-viz,
.spread.is-visible .panel-text,
.spread.is-visible .panel-card,
.spread.is-visible .bleed-header,
.spread.is-visible .card-strip,
.spread.is-visible .bleed-footer,
.spread.is-visible .panel-monitors,
.spread.is-visible .panel-prose,
.spread.is-visible .spread-center {
    opacity: 1;
    transform: translateY(0);
}

/* stagger via transition-delay */
.spread.is-visible .panel-title  { transition-delay: 250ms; }
.spread.is-visible .panel-card   { transition-delay: 250ms; }
.spread.is-visible .panel-prose  { transition-delay: 250ms; }
.spread.is-visible .card-strip   { transition-delay: 200ms; }
.spread.is-visible .bleed-footer { transition-delay: 600ms; }

/* dot-matrix scatter wave reveal */
.spread-3.is-visible #scatterDots circle {
    animation: scatter-wave 2000ms var(--ease-in) forwards;
}
@keyframes scatter-wave {
    0%   { opacity: 0; }
    100% { opacity: var(--target-opacity, 0.85); }
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1100px) {
    .spread-grid { padding: var(--s-4) var(--s-5); column-gap: var(--s-4); }
    .display-title { font-size: 3.6rem; }
    .section-heading { font-size: 2.25rem; }
    .closing-heading { font-size: 2rem; }
}

@media (max-width: 768px) {
    html, body { font-size: 16px; }
    .floating-nav { width: calc(100% - var(--s-3)); }
    .nav-list { display: none; }
    .nav-inner { padding: var(--s-1) var(--s-3); }

    .spread-grid {
        grid-template-columns: 1fr;
        grid-template-rows: 50% 50%;
        gap: var(--s-3);
        padding: var(--s-3) var(--s-3);
        column-gap: 0;
    }
    .grid-62-38, .grid-45-55, .grid-38-62 {
        grid-template-columns: 1fr;
    }

    .panel-title { padding-left: var(--s-3); }
    .vertical-rule { left: 0; width: 1px; }

    .display-title { font-size: 2.75rem; }
    .section-heading { font-size: 1.85rem; }
    .closing-heading { font-size: 1.6rem; }

    .prose, .prose-wide { max-width: 100%; }

    .pull-quote { padding: var(--s-3); font-size: 1.25rem; }

    .card-flip { max-width: calc(100vw - 32px); }
    .card-flip-large { aspect-ratio: 4 / 5; max-width: calc(100vw - 32px); }

    .card-strip {
        grid-template-columns: 1fr;
        gap: var(--s-3);
        max-height: 70vh;
        overflow-y: auto;
    }
    .card-flip-tile {
        aspect-ratio: 5 / 3;
        max-width: 100%;
    }

    .spread-bleed { padding: var(--s-3); }
    .spread-center { padding: var(--s-3); }

    .toolbar-fragment { padding: 0 var(--s-3); }

    .chrome-orb { width: 24px; height: 24px; }
    .orb-corner-tl { width: 24px; height: 24px; }
    .orb-tiny { width: 14px; height: 14px; }

    .monitor-frame { padding: var(--s-1) var(--s-2); }
    .monitor-big { font-size: 1.75rem; }

    .panel-prose {
        max-height: none;
        overflow-y: visible;
        padding-right: 0;
    }
}

@media (max-width: 480px) {
    .display-title { font-size: 2.25rem; }
    .title-line-alt { margin-left: var(--s-2); }
    .pull-quote { font-size: 1.1rem; }
}
