/* ═══════════════════════════════════════════════════════════
   {CONSCIENTIA} EXHIBITION — Styles
   A living digital exhibition in five acts
   ═══════════════════════════════════════════════════════════ */

:root {
    --eigengrau: #16161D;
    --ivory: #F4F1EC;
    --burgundy: #7A1F2B;
    --ikb: #002FA7;
    --gold: #e8a030;
    --font-primary: 'Avenir', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'Source Code Pro', monospace;
    --font-retro: 'VT323', monospace;
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-primary);
    background: var(--eigengrau);
    color: var(--ivory);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ─── Gallery Nameplate (fixed) ─── */

.nav-nameplate {
    position: fixed;
    top: 2rem;
    left: 2.5rem;
    z-index: 100;
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 400;
    line-height: 1;
    /* mix-blend-mode: difference inverts whatever's behind it,
       so it stays legible on both eigengrau and ivory backgrounds */
    color: rgba(255, 255, 255, 0.45);
    mix-blend-mode: difference;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    transition: color 0.6s ease;
    padding: 0.2rem 0;
    display: inline-flex;
    align-items: center;
}

.nav-nameplate:hover {
    color: rgba(255, 255, 255, 0.85);
}

/* ─── Language Toggle ─── */

.lang-toggle {
    position: fixed;
    top: 2rem;
    right: 2.5rem;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    /* Same trick as .nav-nameplate — auto-invert against any background */
    mix-blend-mode: difference;
    /* Same vertical box as the nameplate so they share a baseline */
    height: 0.78rem;
}

.lang-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.45);
    font-family: var(--font-mono);
    font-size: 0.62rem;
    line-height: 1;
    letter-spacing: 0.15em;
    cursor: pointer;
    transition: color 0.4s ease;
    padding: 0;
    display: inline-flex;
    align-items: center;
}

.lang-btn.active {
    color: rgba(255, 255, 255, 0.85);
}

.lang-btn:hover {
    color: rgba(255, 255, 255, 0.7);
}

.lang-sep {
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.62rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

/* ─── Exhibition Scroll Container ─── */

.exhibition-scroll {
    width: 100%;
    background: var(--eigengrau);
    overflow-x: hidden;
}

.act {
    position: relative;
    width: 100%;
}

/* ─── Act Labels ─── */

.act-label-container {
    position: relative;
    z-index: 10;
    padding: 8vh 0 4vh;
    text-align: center;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1.2s ease, transform 1.2s ease;
}

.act-label-container.revealed {
    opacity: 1;
    transform: translateY(0);
}

.act-number {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 300;
    letter-spacing: 0.5em;
    color: rgba(244, 241, 236, 0.2);
    margin-bottom: 1rem;
}

.act-label {
    font-family: var(--font-mono);
    font-size: clamp(1.2rem, 3vw, 2rem);
    font-weight: 200;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ivory);
    margin-bottom: 0.5rem;
}

.act-subtitle {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 300;
    letter-spacing: 0.25em;
    color: rgba(244, 241, 236, 0.25);
    text-transform: uppercase;
}

/* ─── Red Thread Transitions ─── */

.act-transition.thread {
    width: 1px;
    height: 120px;
    margin: 0 auto;
    background: linear-gradient(
        to bottom,
        transparent,
        var(--burgundy),
        transparent
    );
    opacity: 0.4;
}


/* ═══════════════════════════════════════════════════════════
   ENTRY (THRESHOLD) — The Void
   ═══════════════════════════════════════════════════════════ */

#act-i {
    height: 100vh;
    position: relative;
    z-index: 50;
}

.entry-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--eigengrau);
    z-index: 50;
}

/* ─── Light Field ─── */

.entry-light {
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0;
    background: radial-gradient(
        ellipse 80% 70% at 50% 48%,
        rgba(244, 241, 236, 0.06) 0%,
        transparent 70%
    );
    pointer-events: none;
    transition: opacity 3s cubic-bezier(0.25, 0, 0.3, 1);
}

.entry-screen.light-active .entry-light {
    opacity: 1;
}

.entry-screen.light-breathing .entry-light {
    animation: lightBreathe 4s ease-in-out infinite;
}

@keyframes lightBreathe {
    0%, 100% { opacity: 0.85; }
    50% { opacity: 1; }
}

/* ─── Text ─── */

.entry-text-container {
    text-align: center;
    max-width: 80vw;
    position: relative;
    z-index: 2;
}

.entry-text {
    font-family: var(--font-mono);
    font-size: clamp(1rem, 2.5vw, 1.6rem);
    font-weight: 200;
    letter-spacing: 0.08em;
    line-height: 2;
    color: var(--ivory);
}

/* Letter-by-letter reveal */
.entry-text-1 .letter {
    display: inline-block;
    opacity: 0;
    filter: blur(5px);
    transform: translateY(4px);
    transition: opacity 0.8s ease, filter 1s ease, transform 0.8s ease;
}

.entry-text-1 .letter.revealed {
    opacity: 0.85;
    filter: blur(0);
    transform: translateY(0);
}

.entry-text-1 .letter-space {
    display: inline-block;
    width: 0.35em;
}

/* Group letters into words so wraps happen between words, never mid-word */
.entry-text-1 .word {
    display: inline-block;
    white-space: nowrap;
}

/* Second line — whisper realization */
.entry-text-2 {
    margin-top: 0.8rem;
    font-style: italic;
    font-weight: 300;
    opacity: 0;
    filter: blur(5px);
    transform: translateY(4px);
    transition: opacity 3s ease, filter 3.5s ease, transform 2.5s ease;
}

.entry-text-2.revealed {
    opacity: 0.7;
    filter: blur(0);
    transform: translateY(0);
}

/* ─── Scroll Hint ─── */

.entry-scroll-hint {
    position: absolute;
    bottom: 10vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    opacity: 0;
    transition: opacity 2s ease;
    z-index: 2;
}

.entry-scroll-hint.visible {
    opacity: 1;
}

.entry-hint-word {
    font-family: var(--font-retro);
    font-size: 1.1rem;
    letter-spacing: 0.4em;
    text-transform: lowercase;
    color: rgba(244, 241, 236, 0.3);
    animation: whisper 3s ease-in-out infinite;
}

@keyframes whisper {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.5; }
}

.entry-hint-line {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, transparent, rgba(244, 241, 236, 0.3));
    animation: hintPulse 2s ease-in-out infinite;
}

@keyframes hintPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(1); }
    50% { opacity: 0.8; transform: scaleY(1.2); }
}

/* ─── Notebook inside entry (hidden until illumination) ─── */

.entry-notebook {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Breathing room from the top bar (nameplate / lang toggle) */
    padding-top: 6vh;
    z-index: 1;
    opacity: 0;
    pointer-events: none;
}

.entry-notebook.visible {
    opacity: 1;
    pointer-events: auto;
    transition: opacity 2.5s cubic-bezier(0.25, 0, 0.3, 1);
}

.entry-notebook .open-notebook {
    opacity: 1;
    transform: scale(1);
    max-width: 75vw;
    max-height: 60vh;
    box-shadow:
        0 4px 20px rgba(22, 22, 29, 0.08),
        0 12px 50px rgba(22, 22, 29, 0.06),
        0 0 0 1px rgba(22, 22, 29, 0.04);
    border-radius: 4px;
    position: relative;
}

/* Soft vignette + grain — archival tactile quality */
.entry-notebook .open-notebook::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 4px;
    pointer-events: none;
    z-index: 3;
    background: radial-gradient(
        ellipse at 50% 50%,
        transparent 55%,
        rgba(22, 22, 29, 0.06) 85%,
        rgba(22, 22, 29, 0.12) 100%
    );
}

/* Morning pages — archival warm-neutral treatment.
   Not vintage, not B&W — quietly elevated, like a preserved artifact. */

.entry-notebook .morning-page {
    opacity: 1 !important;
    filter: blur(2px) brightness(0.96) contrast(1.06) saturate(0.7) sepia(0.12);
    transition: filter 2.5s cubic-bezier(0.25, 0, 0.3, 1);
}

.entry-notebook.visible .morning-page {
    filter: blur(0) brightness(0.98) contrast(1.08) saturate(0.7) sepia(0.12);
}

.entry-notebook .notebook-page {
    position: relative;
    -webkit-mask-image: linear-gradient(
        to right,
        transparent 0%,
        black 3%,
        black 97%,
        transparent 100%
    ),
    linear-gradient(
        to bottom,
        transparent 0%,
        black 3%,
        black 97%,
        transparent 100%
    );
    -webkit-mask-composite: destination-in;
    mask-image: linear-gradient(
        to right,
        transparent 0%,
        black 3%,
        black 97%,
        transparent 100%
    ),
    linear-gradient(
        to bottom,
        transparent 0%,
        black 3%,
        black 97%,
        transparent 100%
    );
    mask-composite: intersect;
}

.entry-notebook .notebook-left {
    border-radius: 8px 0 0 8px;
}

.entry-notebook .notebook-right {
    border-radius: 0 8px 8px 0;
}

.origin-plaque-inline {
    text-align: center;
    margin-top: 1.5rem;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 2s ease 1s, transform 2s ease 1s;
}

.entry-notebook.visible .origin-plaque-inline {
    opacity: 1;
    transform: translateY(0);
}

.origin-plaque-inline h2 {
    font-family: var(--font-mono);
    font-size: clamp(1rem, 2.5vw, 1.6rem);
    font-weight: 200;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--eigengrau);
    margin-bottom: 0.8rem;
}

.origin-plaque-inline p {
    font-family: var(--font-primary);
    font-size: clamp(0.75rem, 1.3vw, 0.95rem);
    font-weight: 300;
    font-style: italic;
    letter-spacing: 0.04em;
    color: rgba(22, 22, 29, 0.5);
    line-height: 1.6;
}

.origin-plaque-inline .plaque-date {
    font-style: normal;
    font-size: clamp(0.65rem, 1.1vw, 0.8rem);
    color: rgba(22, 22, 29, 0.35);
    letter-spacing: 0.1em;
    margin-top: 0.6rem;
}

/* ─── Continue-scrolling hint below the origin plaque ─── */
.origin-scroll-hint {
    margin-top: 6rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 2s ease 1.8s, transform 2s ease 1.8s;
}

.entry-notebook.visible .origin-scroll-hint {
    opacity: 1;
    transform: translateY(0);
}

.origin-hint-word {
    font-family: var(--font-retro);
    font-size: 0.95rem;
    letter-spacing: 0.4em;
    text-transform: lowercase;
    color: rgba(22, 22, 29, 0.35);
    animation: whisperDark 3s ease-in-out infinite;
}

@keyframes whisperDark {
    0%, 100% { opacity: 0.4; }
    50%      { opacity: 0.75; }
}

.origin-hint-line {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, rgba(22, 22, 29, 0.35), transparent);
    animation: hintPulse 2s ease-in-out infinite;
}

/* ─── Exit Transition ─── */

.entry-screen.phase-dissolve .entry-text-container,
.entry-screen.phase-dissolve .entry-scroll-hint {
    opacity: 0;
    filter: blur(4px);
    transition: opacity 1.5s ease, filter 1.5s ease;
}


/* ═══════════════════════════════════════════════════════════
   ACT I — THE ORIGIN (post-reveal state applied via JS)
   ═══════════════════════════════════════════════════════════ */

/* Top gradient not needed — illumination transition handles the reveal */

#act-i::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 25vh;
    background: linear-gradient(to bottom, var(--ivory), var(--eigengrau));
    pointer-events: none;
    z-index: 0;
}

#act-i .act-number {
    color: rgba(22, 22, 29, 0.25);
}

#act-i .act-label {
    color: var(--eigengrau);
}

#act-i .act-subtitle {
    color: rgba(22, 22, 29, 0.35);
}

.morning-page-container {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* ─── Open Notebook (side by side pages) ─── */

.open-notebook {
    position: relative;
    display: flex;
    align-items: stretch;
    max-width: 85vw;
    max-height: 75vh;
    transform: scale(var(--zoom, 0.97));
    transition: transform 3s cubic-bezier(0.25, 0, 0.3, 1);
    will-change: transform, opacity;
    box-shadow:
        0 8px 40px rgba(0, 0, 0, 0.12),
        0 2px 10px rgba(0, 0, 0, 0.08);
    border-radius: 3px;
    opacity: 0;
    transition: transform 3s cubic-bezier(0.25, 0, 0.3, 1),
                opacity 2.5s cubic-bezier(0.25, 0, 0.3, 1);
}

.open-notebook.emerging {
    opacity: 1;
    transform: scale(1);
}

.notebook-page {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.notebook-left {
    border-radius: 3px 0 0 3px;
}

.notebook-right {
    border-radius: 0 3px 3px 0;
}

.notebook-spine {
    width: 3px;
    background: linear-gradient(
        to bottom,
        rgba(22, 22, 29, 0.15),
        rgba(22, 22, 29, 0.5),
        rgba(22, 22, 29, 0.5),
        rgba(22, 22, 29, 0.15)
    );
    flex-shrink: 0;
    box-shadow:
        -2px 0 8px rgba(0, 0, 0, 0.25),
         2px 0 8px rgba(0, 0, 0, 0.25);
}

.morning-page {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.98) contrast(1.08) saturate(0.7) sepia(0.12);
    opacity: 0;
    transition: opacity 2.5s cubic-bezier(0.25, 0, 0.3, 1);
    display: block;
}

.morning-page.loaded {
    /* Images wait — they reveal through illumination, not on load */
    opacity: 0;
}

.morning-page.illuminated {
    opacity: 1;
}

.breathing-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse at center,
        transparent 60%,
        rgba(244, 241, 236, 0.2) 100%
    );
    pointer-events: none;
    border-radius: 4px;
}

@keyframes breathe {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.75; }
}

/* ─── Museum Plaque ─── */

.origin-plaque {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 6vh 2rem 10vh;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.5s ease, transform 1.5s ease;
}

.origin-plaque.revealed {
    opacity: 1;
    transform: translateY(0);
}

.origin-plaque .act-label {
    font-family: var(--font-mono);
    font-size: clamp(1rem, 2.5vw, 1.6rem);
    font-weight: 200;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--eigengrau);
    margin-bottom: 1.2rem;
}

.plaque-inscription {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.plaque-line {
    font-family: var(--font-primary);
    font-size: clamp(0.75rem, 1.3vw, 0.95rem);
    font-weight: 300;
    font-style: italic;
    letter-spacing: 0.04em;
    color: rgba(22, 22, 29, 0.5);
    line-height: 1.6;
}

.plaque-line-secondary {
    font-style: normal;
    font-size: clamp(0.65rem, 1.1vw, 0.8rem);
    color: rgba(22, 22, 29, 0.35);
    letter-spacing: 0.08em;
}


/* ═══════════════════════════════════════════════════════════
   ACT II — THE BRUSH
   ═══════════════════════════════════════════════════════════ */

#act-ii {
    min-height: 200vh;
    padding-bottom: 10vh;
}

/* ─── Mind Map Graph ─── */

.mindmap-frame {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2vh 1.5vw;
}

.mindmap-frame-border {
    position: relative;
    width: 100%;
    max-width: none;
    height: 88vh;
    border: 1px solid rgba(42, 37, 32, 0.15);
    border-radius: 1px;
    overflow: hidden;
    box-shadow:
        0 2px 30px rgba(0, 0, 0, 0.12),
        inset 0 0 80px rgba(42, 37, 32, 0.04);
}

.mindmap-stage {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--ivory);
}

.mindmap-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* ─── Mind Map Controls ─── */

.mindmap-controls {
    position: absolute;
    bottom: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 10;
}

.mindmap-btn {
    width: 30px;
    height: 30px;
    background: rgba(244, 241, 236, 0.8);
    border: 1px solid rgba(42, 37, 32, 0.12);
    border-radius: 1px;
    color: rgba(42, 37, 32, 0.4);
    font-family: var(--font-mono);
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease, border-color 0.3s ease, background 0.3s ease;
    padding: 0;
}

.mindmap-btn:hover {
    color: rgba(42, 37, 32, 0.8);
    border-color: rgba(42, 37, 32, 0.25);
    background: rgba(244, 241, 236, 0.95);
}

.mindmap-btn-reset {
    margin-top: 4px;
    font-size: 14px;
}


.mindmap-caption {
    margin-top: 1.2rem;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 300;
    letter-spacing: 0.25em;
    color: rgba(244, 241, 236, 0.25);
    text-transform: lowercase;
}

.mindmap-tooltip {
    position: fixed;
    z-index: 50;
    max-width: 280px;
    padding: 14px 18px;
    background: rgba(244, 241, 236, 0.95);
    border: 1px solid rgba(42, 37, 32, 0.12);
    border-radius: 1px;
    color: #2a2520;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 300;
    line-height: 1.8;
    letter-spacing: 0.02em;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Keep old classes for backward compat in case other code references them */
.translation-stage {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
}

.fragment-layer {
    position: absolute;
    inset: 0;
}

.ai-brush-area {
    position: absolute;
    inset: 0;
    z-index: 5;
}

/* ─── Fragments ─── */

.fragment {
    position: absolute;
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    transition: opacity 0.8s ease, transform 0.8s ease;
    pointer-events: none;
    white-space: nowrap;
}

.fragment.visible {
    opacity: var(--fragment-opacity, 0.8);
    transform: translateY(0) scale(1);
}

.fragment.fading {
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
}

/* Layer 1: Origin text */
.fragment-origin {
    font-family: var(--font-primary);
    font-size: clamp(1.5rem, 4vw, 3rem);
    font-weight: 200;
    letter-spacing: 0.15em;
    color: var(--ivory);
    text-transform: uppercase;
}

/* Layer 2: Questions */
.fragment-question {
    font-family: var(--font-mono);
    font-size: clamp(0.7rem, 1.5vw, 1rem);
    font-weight: 300;
    color: rgba(244, 241, 236, 0.55);
    font-style: italic;
    white-space: normal;
    max-width: 30vw;
}

/* Layer 3: Artist names */
.fragment-artist {
    font-family: var(--font-primary);
    font-size: clamp(0.8rem, 1.8vw, 1.2rem);
    font-weight: 200;
    color: rgba(0, 47, 167, 0.5);
    letter-spacing: 0.1em;
}

/* Layer 4: Keywords */
.fragment-keyword {
    font-family: var(--font-mono);
    font-size: clamp(0.65rem, 1.2vw, 0.85rem);
    font-weight: 400;
    color: rgba(244, 241, 236, 0.35);
    letter-spacing: 0.08em;
    text-transform: lowercase;
}

/* Layer 5: Parameters */
.fragment-param {
    font-family: var(--font-retro);
    font-size: clamp(0.8rem, 1.5vw, 1.1rem);
    color: var(--gold);
    opacity: 0;
}

.fragment-param.visible {
    opacity: 0.6;
}

/* Layer 6: Revelation */
.fragment-revelation {
    font-family: var(--font-mono);
    font-size: clamp(0.8rem, 1.8vw, 1.1rem);
    font-weight: 300;
    color: var(--ivory);
    text-align: center;
    white-space: normal;
    max-width: 50vw;
    transform: translateX(-50%);
}

.fragment-revelation-key {
    font-size: clamp(1.2rem, 3vw, 2rem);
    font-weight: 200;
    letter-spacing: 0.15em;
    color: var(--burgundy);
}

.fragment-date {
    font-family: var(--font-retro);
    font-size: 0.85rem;
    color: var(--gold);
    letter-spacing: 0.12em;
}

/* ─── Act II Final Message ─── */

.act-ii-message {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 6;
    opacity: 0;
    transition: opacity 2s ease;
    pointer-events: none;
}

.act-ii-message.visible {
    opacity: 1;
}

.translation-truth {
    font-family: var(--font-mono);
    font-size: clamp(1rem, 2.5vw, 1.6rem);
    font-weight: 200;
    letter-spacing: 0.15em;
    color: rgba(244, 241, 236, 0.6);
    margin-bottom: 0.5rem;
}

.translation-truth-emphasis {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    color: var(--ivory);
    font-weight: 300;
    font-style: italic;
}


/* ═══════════════════════════════════════════════════════════
   ACT III — THE EVOLUTION
   ═══════════════════════════════════════════════════════════ */

#act-iii {
    /* Height determined by timeline-scroll-spacer set in JS */
}

.act-description {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 300;
    letter-spacing: 0.12em;
    color: rgba(244, 241, 236, 0.2);
    font-style: italic;
    margin-top: 0.6rem;
}

.timeline-scroll-spacer {
    height: 1px; /* JS sets this */
}

/* ─── Scrubber Stage ─── */

.scrubber-stage {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    background: var(--eigengrau);
    cursor: default;
}

.scrubber-canvas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 80vw;
    max-height: 75vh;
    object-fit: contain;
    transition: opacity 0.8s ease;
    will-change: opacity;
}

.scrubber-canvas.behind {
    z-index: 1;
}

.scrubber-canvas.front {
    z-index: 2;
}

/* Subtle breathing motion on the active image */
@keyframes scrubberBreathe {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.008); }
}

.scrubber-canvas.alive {
    animation: scrubberBreathe 6s ease-in-out infinite;
}

/* ─── Data Overlay ─── */

.data-overlay {
    position: absolute;
    bottom: 6rem;
    left: 3rem;
    z-index: 20;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.data-overlay.visible {
    opacity: 1;
}

.data-date {
    font-family: var(--font-retro);
    font-size: 1.2rem;
    color: var(--gold);
    letter-spacing: 0.12em;
}

.data-mood {
    font-family: var(--font-retro);
    font-size: 0.9rem;
    color: rgba(232, 160, 48, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.data-lunar {
    font-family: var(--font-retro);
    font-size: 0.8rem;
    color: rgba(244, 241, 236, 0.3);
    letter-spacing: 0.1em;
}

/* ─── Milestone Flash ─── */

.milestone-text {
    position: absolute;
    top: 50%;
    right: 3rem;
    transform: translateY(-50%);
    z-index: 25;
    font-family: var(--font-mono);
    font-size: clamp(0.7rem, 1.2vw, 0.9rem);
    font-weight: 300;
    letter-spacing: 0.15em;
    color: rgba(244, 241, 236, 0);
    text-align: right;
    max-width: 30vw;
    transition: color 0.6s ease;
    pointer-events: none;
}

.milestone-text.visible {
    color: rgba(244, 241, 236, 0.55);
}

/* ─── Scrubber Bar ─── */

.scrubber-bar {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    width: min(80vw, 700px);
    z-index: 30;
    opacity: 0;
    transition: opacity 1s ease;
    user-select: none;
    -webkit-user-select: none;
}

.scrubber-bar.visible {
    opacity: 1;
}

.scrubber-track {
    position: relative;
    width: 100%;
    height: 2px;
    background: rgba(244, 241, 236, 0.12);
    border-radius: 1px;
    cursor: pointer;
}

.scrubber-filled {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(244, 241, 236, 0.3);
    border-radius: 1px;
    pointer-events: none;
    transition: width 0.05s linear;
}

.scrubber-handle {
    position: absolute;
    top: 50%;
    width: 12px;
    height: 12px;
    background: var(--ivory);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: grab;
    box-shadow: 0 0 10px rgba(244, 241, 236, 0.2);
    transition: transform 0.15s ease, box-shadow 0.3s ease;
    z-index: 2;
}

.scrubber-handle:hover {
    transform: translate(-50%, -50%) scale(1.3);
    box-shadow: 0 0 16px rgba(244, 241, 236, 0.35);
}

.scrubber-handle.dragging {
    cursor: grabbing;
    transform: translate(-50%, -50%) scale(1.4);
}

.scrubber-handle.pulse {
    box-shadow: 0 0 20px rgba(122, 31, 43, 0.6);
    background: var(--burgundy);
}

/* ─── Milestone Markers on Track ─── */

.scrubber-milestone {
    position: absolute;
    top: 50%;
    width: 4px;
    height: 4px;
    background: var(--burgundy);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.5;
    pointer-events: none;
    z-index: 1;
}

/* ─── Scrubber Dates ─── */

.scrubber-dates {
    display: flex;
    justify-content: space-between;
    margin-top: 0.6rem;
}

.scrubber-dates span {
    font-family: var(--font-retro);
    font-size: 0.7rem;
    color: rgba(244, 241, 236, 0.2);
    letter-spacing: 0.1em;
}


/* ═══════════════════════════════════════════════════════════
   TRANSITION
   ═══════════════════════════════════════════════════════════ */

#transition {
    height: 100vh;
}

.transition-stillness {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.transition-image {
    width: 50vw;
    height: 60vh;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 3s ease;
}

.transition-image.visible {
    opacity: 0.6;
    animation: fadeToStill 4s ease-out forwards;
}

@keyframes fadeToStill {
    0% { opacity: 0.6; filter: blur(0); }
    100% { opacity: 0.3; filter: blur(2px); }
}

.transition-fade {
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse at center,
        transparent 30%,
        var(--eigengrau) 80%
    );
    pointer-events: none;
}


/* ═══════════════════════════════════════════════════════════
   ACT IV — FULL CIRCLE
   ═══════════════════════════════════════════════════════════ */

#act-iv {
    min-height: 100vh;
}

.canvas-workspace {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    gap: 1.5rem;
}

.canvas-prompt {
    font-family: var(--font-mono);
    font-size: clamp(1rem, 2.5vw, 1.6rem);
    font-weight: 200;
    letter-spacing: 0.12em;
    color: rgba(244, 241, 236, 0.6);
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.5s ease, transform 1.5s ease;
}

.canvas-prompt.revealed {
    opacity: 1;
    transform: translateY(0);
}

.canvas-container {
    position: relative;
    max-width: 90vw;
    max-height: 55vh;
    border: 1px solid rgba(244, 241, 236, 0.08);
    background: rgba(22, 22, 29, 0.5);
}

.canvas-container canvas {
    display: block;
    max-width: 90vw;
    max-height: 55vh;
}

#interactionCanvas {
    position: absolute;
    top: 0;
    left: 0;
    cursor: crosshair;
}

.selection-rect {
    position: absolute;
    border: 1px dashed rgba(244, 241, 236, 0.5);
    background: rgba(0, 47, 167, 0.08);
    pointer-events: none;
    display: none;
}

.selection-rect.active {
    display: block;
}

/* ─── Toolbar ─── */

.toolbar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tool-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid rgba(244, 241, 236, 0.15);
    border-radius: 4px;
    color: rgba(244, 241, 236, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.tool-btn:hover {
    border-color: rgba(244, 241, 236, 0.3);
    color: var(--ivory);
}

.tool-btn.active {
    border-color: var(--ikb);
    color: var(--ikb);
    background: rgba(0, 47, 167, 0.1);
}

.effect-btn {
    background: transparent;
    border: 1px solid rgba(244, 241, 236, 0.1);
    border-radius: 3px;
    color: rgba(244, 241, 236, 0.4);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.4rem 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.effect-btn:hover {
    border-color: rgba(244, 241, 236, 0.3);
    color: var(--ivory);
}

.effect-btn.active {
    border-color: var(--burgundy);
    color: var(--burgundy);
    background: rgba(122, 31, 43, 0.1);
}

.effect-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.size-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.size-label {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    color: rgba(244, 241, 236, 0.3);
    text-transform: uppercase;
}

input[type="range"] {
    -webkit-appearance: none;
    width: 80px;
    height: 2px;
    background: rgba(244, 241, 236, 0.15);
    border-radius: 1px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 10px;
    height: 10px;
    background: var(--ivory);
    border-radius: 50%;
    cursor: pointer;
}

.action-btn {
    background: transparent;
    border: 1px solid rgba(244, 241, 236, 0.15);
    border-radius: 3px;
    color: rgba(244, 241, 236, 0.5);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.4rem 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn:hover {
    border-color: var(--ivory);
    color: var(--ivory);
}

.action-btn-primary {
    border-color: var(--ikb);
    color: var(--ikb);
}

.action-btn-primary:hover {
    background: rgba(0, 47, 167, 0.15);
}

/* ─── Canvas Signature ─── */

.canvas-signature {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    color: rgba(244, 241, 236, 0.2);
    text-transform: uppercase;
    display: flex;
    gap: 0.5rem;
}

.signature-sep {
    color: rgba(244, 241, 236, 0.1);
}


/* ═══════════════════════════════════════════════════════════
   CUSTOM CURSOR (ACT II)
   ═══════════════════════════════════════════════════════════ */

.ai-cursor {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 1000;
    display: none;
}

.ai-cursor.active {
    display: block;
}

.ai-cursor-dot {
    width: 8px;
    height: 8px;
    background: var(--ikb);
    border-radius: 50%;
    opacity: 0.7;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 12px rgba(0, 47, 167, 0.4);
}

.ai-cursor-trail {
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 6px;
    background: var(--ikb);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.15s ease;
}

.ai-cursor-trail[data-i="0"] { opacity: 0.35; width: 6px; height: 6px; }
.ai-cursor-trail[data-i="1"] { opacity: 0.25; width: 5px; height: 5px; }
.ai-cursor-trail[data-i="2"] { opacity: 0.15; width: 4px; height: 4px; }
.ai-cursor-trail[data-i="3"] { opacity: 0.08; width: 3px; height: 3px; }
.ai-cursor-trail[data-i="4"] { opacity: 0.04; width: 2px; height: 2px; }


/* ═══════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════ */

.exhibition-footer {
    padding: 6rem 2rem 3rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.footer-nameplate {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    color: rgba(244, 241, 236, 0.25);
    text-transform: uppercase;
    display: flex;
    gap: 0.6rem;
}

.footer-meta {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    letter-spacing: 0.15em;
    color: rgba(244, 241, 236, 0.15);
    display: flex;
    gap: 0.4rem;
}

.footer-sep {
    opacity: 0.4;
}


/* ═══════════════════════════════════════════════════════════
   NOTEBOOK LIGHTBOX
   Click a notebook page → fullscreen view for reading handwriting
   ═══════════════════════════════════════════════════════════ */

.page-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(244, 241, 236, 0);
    backdrop-filter: blur(0);
    -webkit-backdrop-filter: blur(0);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    /* Slow, ceremonial fade — like the gallery dimming around you */
    transition:
        opacity 1.8s cubic-bezier(0.25, 0, 0.3, 1),
        background 1.8s cubic-bezier(0.25, 0, 0.3, 1),
        backdrop-filter 1.8s cubic-bezier(0.25, 0, 0.3, 1),
        -webkit-backdrop-filter 1.8s cubic-bezier(0.25, 0, 0.3, 1);
}

.page-lightbox.open {
    pointer-events: auto;
    opacity: 1;
    background: rgba(244, 241, 236, 0.97);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.page-lightbox-stage {
    max-width: 92vw;
    max-height: 92vh;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 2400px;
    /* Begin smaller and slightly lifted — the page rises into the room */
    transform: scale(0.88) translateY(20px);
    filter: blur(6px);
    opacity: 0;
    transition:
        transform 2.2s cubic-bezier(0.22, 0, 0.18, 1) 0.15s,
        filter   2s cubic-bezier(0.22, 0, 0.18, 1) 0.25s,
        opacity  1.6s cubic-bezier(0.25, 0, 0.3, 1) 0.2s;
}

.page-lightbox.open .page-lightbox-stage {
    transform: scale(1) translateY(0);
    filter: blur(0);
    opacity: 1;
}

/* ─── Two-faced page flipper (front + back like a real notebook page) ─── */
.page-lightbox-flipper {
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.95s cubic-bezier(0.45, 0, 0.25, 1);
    /* Both faces share an explicit box so they can't disagree on size.
       object-fit: contain on each image letterboxes within this box. */
    width: 92vw;
    height: 92vh;
}

.page-lightbox-front,
.page-lightbox-back {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Override the existing max-width/max-height from .page-lightbox-img */
    max-width: 100%;
    max-height: 100%;
    /* Re-apply the soft-edge dissolve mask (lost when we moved to
       absolute positioning) so the page edges fade into the backdrop */
    -webkit-mask-image:
        linear-gradient(to right,  transparent 0%, black 3%, black 97%, transparent 100%),
        linear-gradient(to bottom, transparent 0%, black 3%, black 97%, transparent 100%);
    -webkit-mask-composite: source-in;
            mask-image:
        linear-gradient(to right,  transparent 0%, black 3%, black 97%, transparent 100%),
        linear-gradient(to bottom, transparent 0%, black 3%, black 97%, transparent 100%);
            mask-composite: intersect;
}

.page-lightbox-face {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.page-lightbox-front {
    position: relative;
    z-index: 2;
}

.page-lightbox-back {
    position: absolute;
    inset: 0;
    /* Mirror so the "back" reads the right way around once flipped */
    transform: rotateY(180deg);
}

/* Flip directions — JS adds these classes to trigger the rotation */
.page-lightbox-flipper.flipping-next {
    transform: rotateY(-180deg);
}
.page-lightbox-flipper.flipping-prev {
    transform: rotateY(180deg);
}

.page-lightbox-img {
    max-width: 92vw;
    max-height: 92vh;
    object-fit: contain;
    border-radius: 4px;
    cursor: default;
    /* Same soft edge fade as the notebook spread on the entry */
    -webkit-mask-image:
        linear-gradient(to right,  transparent 0%, black 3%, black 97%, transparent 100%),
        linear-gradient(to bottom, transparent 0%, black 3%, black 97%, transparent 100%);
    -webkit-mask-composite: source-in;
            mask-image:
        linear-gradient(to right,  transparent 0%, black 3%, black 97%, transparent 100%),
        linear-gradient(to bottom, transparent 0%, black 3%, black 97%, transparent 100%);
            mask-composite: intersect;
    /* Archival treatment — same as notebook */
    filter:
        brightness(0.98) contrast(1.08) saturate(0.7) sepia(0.12)
        drop-shadow(0 20px 60px rgba(22, 22, 29, 0.16))
        drop-shadow(0 4px 18px rgba(22, 22, 29, 0.08));
}

/* Color overlay elements hidden — single-layer archival treatment */
.page-lightbox-color {
    display: none;
}

/* A slow breathing aura around the page — the morning page is alive */
.page-lightbox-stage::before {
    content: '';
    position: absolute;
    inset: -8%;
    background: radial-gradient(ellipse at center,
        rgba(244, 241, 236, 0.6) 0%,
        rgba(244, 241, 236, 0) 70%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 2.4s ease 0.4s;
    animation: lightbox-breathe 6s ease-in-out infinite 2s;
}

.page-lightbox.open .page-lightbox-stage::before {
    opacity: 1;
}

@keyframes lightbox-breathe {
    0%, 100% { transform: scale(1); opacity: 0.55; }
    50%      { transform: scale(1.04); opacity: 0.85; }
}

.page-lightbox-close {
    position: absolute;
    top: 1.6rem;
    right: 2rem;
    z-index: 10;
    background: none;
    border: none;
    color: rgba(22, 22, 29, 0);
    font-size: 2.4rem;
    font-weight: 200;
    cursor: pointer;
    line-height: 1;
    padding: 0.4rem 0.8rem;
    /* Close button arrives last, almost as an afterthought */
    transition: color 1.4s ease 1.4s, transform 0.6s ease;
}

.page-lightbox.open .page-lightbox-close {
    color: rgba(22, 22, 29, 0.4);
}

.page-lightbox-close:hover {
    color: rgba(22, 22, 29, 0.85) !important;
    transform: rotate(90deg);
    transition: color 0.3s ease, transform 0.6s ease;
}

/* ─── Prev/Next page navigation ─── */
.page-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(22, 22, 29, 0);
    font-size: 3rem;
    font-weight: 200;
    line-height: 1;
    cursor: pointer;
    padding: 1rem 1.4rem;
    z-index: 2;
    transition: color 1.4s ease 1.4s, transform 0.5s ease, opacity 0.4s ease;
}

.page-lightbox.open .page-lightbox-nav {
    color: rgba(22, 22, 29, 0.35);
}

.page-lightbox-nav:hover {
    color: rgba(22, 22, 29, 0.85) !important;
    transition: color 0.3s ease, transform 0.5s ease;
}

.page-lightbox-prev {
    left: 1.5rem;
}

.page-lightbox-prev:hover {
    transform: translateY(-50%) translateX(-4px);
}

.page-lightbox-next {
    right: 1.5rem;
}

.page-lightbox-next:hover {
    transform: translateY(-50%) translateX(4px);
}

.page-lightbox-nav.disabled {
    opacity: 0.15;
    pointer-events: none;
}

/* ─── Page indicator dots ─── */
.page-lightbox-dots {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.6rem;
    opacity: 0;
    transition: opacity 1.4s ease 1.4s;
}

.page-lightbox.open .page-lightbox-dots {
    opacity: 1;
}

.page-lightbox-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(22, 22, 29, 0.2);
    transition: background 0.4s ease, transform 0.4s ease;
    cursor: pointer;
    border: none;
    padding: 0;
}

.page-lightbox-dot.active {
    background: var(--ikb, #002FA7);
    transform: scale(1.3);
}

/* On mobile, scale the nav controls down a touch and pull them in */
@media (max-width: 768px) {
    .page-lightbox-nav {
        font-size: 2.4rem;
        padding: 0.6rem 0.8rem;
    }
    .page-lightbox-prev { left: 0.4rem; }
    .page-lightbox-next { right: 0.4rem; }
    .page-lightbox-dots { bottom: 1.4rem; }
}

/* Make the notebook pages feel clickable on desktop */
@media (min-width: 769px) {
    .entry-notebook .notebook-page {
        cursor: zoom-in;
    }
}


/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {

    .nav-nameplate {
        top: 1.2rem;
        left: 1.2rem;
        font-size: 0.55rem;
    }

    .lang-toggle {
        top: 1.2rem;
        right: 1.2rem;
    }

    /* ─── Act I — Mobile page-flip notebook ───
       The two morning-page photos can't fit side-by-side at phone width
       (handwriting becomes unreadable). Instead, show one page at a time
       with a swipe-to-flip interaction. */
    /* More breathing room from the top bar on mobile */
    .entry-notebook {
        padding-top: 9vh;
        justify-content: flex-start;
    }

    /* Continue hint is unnecessary on mobile — wastes vertical space */
    .origin-scroll-hint { display: none !important; }

    /* Tighten the inline plaque so the whole act fits the viewport */
    .origin-plaque-inline {
        margin-top: 1rem;
    }

    .entry-notebook .open-notebook,
    #act-i .open-notebook {
        /* One page at a time — contain the full page, never crop */
        width: 88vw;
        height: min(68vh, calc(88vw * 4 / 3));
        max-width: 88vw;
        max-height: 68vh;
        flex-direction: row;
        position: relative;
        background: transparent;
        border-radius: 4px;
        overflow: hidden;
        box-shadow:
            0 4px 20px rgba(22, 22, 29, 0.08),
            0 12px 50px rgba(22, 22, 29, 0.06),
            0 0 0 1px rgba(22, 22, 29, 0.04);
    }

    .open-notebook .notebook-page {
        position: absolute;
        inset: 0;
        flex: none;
        border-radius: 4px;
        transition:
            transform 0.45s cubic-bezier(0.4, 0, 0.2, 1),
            opacity   0.45s cubic-bezier(0.4, 0, 0.2, 1);
        will-change: transform, opacity;
    }

    /* Show the whole page on mobile and force visibility — !important
       overrides the desktop opacity:0 starting state on .morning-page */
    .open-notebook .notebook-page .morning-page {
        opacity: 1 !important;
        filter: brightness(0.98) contrast(1.08) saturate(0.7) sepia(0.12) !important;
        object-fit: contain !important;
        object-position: center;
        background: transparent;
    }

    /* Active page sits flat in front, fully visible */
    .open-notebook .notebook-page.flip-active {
        opacity: 1;
        transform: translateX(0);
        z-index: 2;
        pointer-events: auto;
        visibility: visible;
    }

    /* Next page waits offscreen-right */
    .open-notebook .notebook-page.flip-next {
        opacity: 0;
        transform: translateX(8%);
        z-index: 1;
        pointer-events: none;
    }

    /* Previous page is offscreen-left */
    .open-notebook .notebook-page.flip-prev {
        opacity: 0;
        transform: translateX(-8%);
        z-index: 1;
        pointer-events: none;
    }

    /* Cursor hint that the page is tappable to zoom */
    .open-notebook .notebook-page {
        cursor: zoom-in;
    }

    /* Spine and lens don't make sense in single-page mode */
    .notebook-spine { display: none; }

    /* Hide custom AI cursor on touch devices */
    .ai-cursor { display: none !important; }

    /* ─── Page-flip indicator (dots) ─── */
    .notebook-flip-dots {
        display: flex;
        gap: 0.6rem;
        justify-content: center;
        margin-top: 1rem;
    }

    .notebook-flip-dot {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: rgba(22, 22, 29, 0.2);
        transition: background 0.4s ease, transform 0.4s ease;
    }

    .notebook-flip-dot.active {
        background: var(--ikb, #002FA7);
        transform: scale(1.3);
    }

    /* ─── Swipe hint (one-time) ─── */
    .notebook-flip-hint {
        font-family: var(--font-retro);
        font-size: 0.75rem;
        letter-spacing: 0.18em;
        color: rgba(22, 22, 29, 0.4);
        text-align: center;
        margin-top: 0.6rem;
        opacity: 0;
        transition: opacity 1.2s ease;
        pointer-events: none;
    }

    .notebook-flip-hint.visible { opacity: 1; }
    .notebook-flip-hint.dismissed { opacity: 0; }

    /* Act II: Mind Map — touch-friendly on mobile */
    .mindmap-stage {
        touch-action: none; /* we handle touch ourselves */
    }

    /* Act II: fragments (legacy) — let everything wrap, shrink, and fit the viewport */
    .fragment {
        white-space: normal;
        max-width: 78vw;
    }

    .fragment-origin {
        font-size: clamp(1.1rem, 5.5vw, 1.8rem);
        letter-spacing: 0.08em;
        max-width: 75vw;
    }

    .fragment-question {
        max-width: 70vw;
        font-size: 0.78rem;
    }

    .fragment-keyword {
        font-size: 0.72rem;
    }

    .fragment-artist {
        font-size: 0.85rem;
        max-width: 70vw;
    }

    .fragment-param {
        font-size: 0.75rem;
        max-width: 80vw;
    }

    .fragment-revelation {
        max-width: 85vw;
    }

    .fragment-revelation-key {
        font-size: clamp(1.1rem, 5vw, 1.8rem);
    }

    /* Hide custom AI cursor on touch devices — no mouse to follow */
    .ai-cursor {
        display: none !important;
    }

    /* Slightly shorter so the sticky stage doesn't feel endless on phones */
    #act-ii {
        min-height: 380vh;
    }

    /* Act III */
    .data-overlay {
        bottom: 6rem;
        left: 1.5rem;
    }

    .scrubber-bar {
        width: 90vw;
        bottom: 1.2rem;
    }

    .milestone-text {
        right: 1.5rem;
        max-width: 40vw;
    }

    /* Act IV */
    .canvas-workspace {
        padding: 1rem;
        gap: 1rem;
    }

    .canvas-container {
        max-height: 45vh;
    }

    .toolbar {
        gap: 0.8rem;
    }

    .toolbar-effects {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 480px) {

    .entry-text {
        font-size: 0.9rem;
    }

    .act-label {
        font-size: 1rem;
    }

    .toolbar-group {
        width: 100%;
        justify-content: center;
    }
}


/* ═══════════════════════════════════════════════════════════
   REDUCED MOTION
   ═══════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {

    * {
        animation-duration: 0.01s !important;
        transition-duration: 0.01s !important;
    }

    .entry-text {
        opacity: 0.85;
        transform: none;
    }

    .breathing-overlay {
        animation: none;
    }

    .fragment {
        transition: opacity 0.01s;
    }

    .open-notebook {
        transform: none !important;
    }
}
