/* ============================================================
   Nook Nook Mats Biography — Page CSS
   Scoped to .nook-story-page (applied via body_class filter)
   Source: About Me/Nook Nook Mats Biography/nook-nook-desktop-index.html
   ============================================================ */

/* ============================================
   RESET & BASE STYLES
   ============================================ */
.nook-story-page {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    overflow-x: hidden;
    background: #FFFEF9;
}
body.nook-story-page #content {
    padding-top: 0;
}
.nook-story-page *,
.nook-story-page *::before,
.nook-story-page *::after {
    box-sizing: border-box;
}

/* ============================================
   CSS CUSTOM PROPERTIES
   ============================================ */
:root {
    /* Font Families */
    --nook-font-serif: Georgia, serif;
    --nook-font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --nook-font-mono: 'Courier Prime', 'Courier New', Courier, monospace;

    /* Desktop Font Sizes */
    --nook-text-hero: 48px;
    --nook-text-body: 18px;

    /* Line Heights */
    --nook-lh-relaxed: 1.6;
    --nook-lh-loose: 1.8;

    /* Colors */
    --nook-white: #FFFFFF;
    --nook-cream-warm: #FFFEF9;
    --nook-text-charcoal: #2B2B2B;
    --nook-text-light: #6B6B6B;

    /* Chapter 2 / Descent colors */
    --nook-terracotta:  #d4664a;
    --nook-tan:         #c8a882;
    --nook-ghost:       #DDD4C8;
    --nook-caption:     #9B8B7E;
    --nook-warm-dark:   #3D3935;
    --nook-cream-paper: #FBF8F3;
    --nook-gold:        #C9A86A;
    --nook-cool-gray:   #B8B4AE;

    /* Chapter 5 terminal colors */
    --terminal-green: rgba(76, 175, 80, 0.9);
    --amber-warm: rgba(201, 168, 106, 1);
}

/* Mobile Typography Adjustments */
@media (max-width: 768px) {
    :root {
        --nook-text-hero: 32px;
        --nook-text-body: 16px;
    }
}

/* ============================================
   CHAPTER TRANSITION HEADER
   ============================================ */
.nook-chapter-transition {
    position: relative;
    width: 100%;
    height: 300px;
    background: linear-gradient(to bottom,
        #ebebeb 0%,
        #f0ebe5 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 80px;
    overflow: hidden;
}

/* LEFT: Wavy Textile Lines - Sequential weaving animation */
.nook-textile-pattern {
    width: 180px;
    height: 100%;
    display: flex;
    align-items: center;
}

.nook-textile-pattern svg {
    width: 100%;
    height: 200px;
}

.nook-textile-pattern path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 0.4s ease-out;
}

.nook-textile-pattern.animate path:nth-child(1) {
    animation: nook-draw-line 0.4s ease-out 0.0s forwards;
}

.nook-textile-pattern.animate path:nth-child(2) {
    animation: nook-draw-line 0.4s ease-out 0.1s forwards;
}

.nook-textile-pattern.animate path:nth-child(3) {
    animation: nook-draw-line 0.4s ease-out 0.2s forwards;
}

.nook-textile-pattern.animate path:nth-child(4) {
    animation: nook-draw-line 0.4s ease-out 0.3s forwards;
}

.nook-textile-pattern.animate path:nth-child(5) {
    animation: nook-draw-line 0.4s ease-out 0.4s forwards;
}

.nook-textile-pattern.animate path:nth-child(6) {
    animation: nook-draw-line 0.4s ease-out 0.5s forwards;
}

.nook-textile-pattern.animate path:nth-child(7) {
    animation: nook-draw-line 0.4s ease-out 0.6s forwards;
}

.nook-textile-pattern.animate path:nth-child(8) {
    animation: nook-draw-line 0.4s ease-out 0.7s forwards;
}

@keyframes nook-draw-line {
    to {
        stroke-dashoffset: 0;
    }
}

/* CENTER: Brand Typography - Character by character fade */
.nook-brand-logo {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0;
    flex-direction: column;
}

.nook-brand-logo__main {
    display: flex;
    align-items: center;
    gap: 0;
    line-height: 1;
}

.nook-brand-logo__nook {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 84px;
    font-weight: 900;
    color: #000000;
    letter-spacing: -0.02em;
    line-height: 0.9;
}

.nook-brand-logo__nook span {
    display: inline-block;
    opacity: 0;
    transform: translateY(10px);
}

.nook-brand-logo__dot {
    width: 16px;
    height: 16px;
    background: #d4664a;
    border-radius: 50%;
    margin: 0 8px;
    align-self: center;
    position: relative;
    top: -8px;
    opacity: 0;
    transform: scale(0.5);
}

.nook-brand-logo__mats {
    font-family: 'Dancing Script', 'Brush Script MT', cursive, sans-serif;
    font-size: 52px;
    font-weight: 400;
    color: #000000;
    /* NOTE: font-style:italic intentionally omitted — Dancing Script italic breaks on iOS Safari */
    position: relative;
    top: -15px;
    left: -10px;
    letter-spacing: 0.02em;
    opacity: 0;
    transform: translateY(10px);
}

/* RIGHT: Organic Blob Shape - Spinning/expanding */
.nook-organic-shape {
    width: 280px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    opacity: 0;
    transform: scale(0.3) rotate(-90deg);
    transition: opacity 1.2s ease, transform 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nook-organic-shape.animate {
    opacity: 1;
    transform: scale(1.0) rotate(0deg);
}

.nook-organic-shape svg {
    width: 220px;
    height: 220px;
}

/* ============================================
   DOT SEPARATOR ROW
   ============================================ */
.nook-dot-separator {
    width: 100%;
    background: #FFFEF9;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 80px 0;
}

.nook-dot-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.nook-journey-dot {
    width: 7px;
    height: 7px;
    background: #c8a882;
    border-radius: 50%;
    flex-shrink: 0;

    /* Initial state — invisible and collapsed */
    opacity: 0;
    transform: scale(0);

    /* Same spring bounce easing as the blob */
    transition:
        transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
        opacity   0.2s ease;
}

/* Visible state — triggered by JS */
.nook-journey-dot.visible {
    opacity: 1;
    transform: scale(1);
}

/* ============================================
   SECTION 1: THE OPENING DUALITY
   ============================================ */

.nook-section-1 {
    position: relative;
    width: 100%;
}

/* Opening Text Stage — full viewport, pinned during fill animation */
.nook-product-reveal {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    background-color: var(--nook-cream-warm);
    padding: 0 80px 10vh;
    position: relative;
    z-index: 3;
}

/* Opening paragraph text */
.nook-opening-text {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 36px;
    font-weight: 500;
    line-height: 1.65;
    letter-spacing: 0.005em;
    width: 100%;
}
@media (min-width: 1920px) {
    .nook-opening-text {
        max-width: 1200px;
    }
}

/* Individual word spans — start as ghost, fill on scroll */
.nook-opening-word {
    display: inline;
    color: #DDD4C8;
}

/* ============================================
   THRESHOLD IMAGE — end of Section 1
   ============================================ */
.nook-threshold-section {
    width: 100%;
    background: var(--nook-cream-warm);
}

.nook-threshold-container {
    width: 100%;
    height: 82vh;
    overflow: hidden;
    position: relative;
}

.nook-threshold-img {
    width: 100%;
    height: 100% !important; /* GP global sets height:auto on all images — override */
    max-width: none !important;
    object-fit: cover;
    object-position: center 45%;
    transform: scale(1.0);
    transform-origin: center center;
    will-change: transform;
}

.nook-threshold-vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse 90% 90% at 50% 50%,
        transparent 55%,
        rgba(20, 16, 10, 0.28) 100%
    );
    pointer-events: none;
}

/* ============================================
   CHAPTER BREAK — breathing room after photo
   ============================================ */
.nook-chapter-break {
    width: 100%;
    height: 220px;
    background: var(--nook-cream-warm);
}

/* ============================================
   CHAPTER 2 — SPLIT STAGE
   ============================================ */
.nook-story-page .ch2-stage {
    display: flex;
    width: 100%;
    height: 100vh;
    background: var(--nook-cream-warm);
    position: relative;
}

/* LEFT: paragraph + cycling highlight */
.nook-story-page .ch2-left {
    width: 44%;
    height: 100%;
    position: relative;
    border-right: 1px solid #e4ddd4;
    flex-shrink: 0;
}

.nook-story-page .ch2-left-state {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 64px 56px 80px 80px;
    opacity: 0;
    pointer-events: none;
}

.nook-story-page .ch2-left-state.is-first {
    opacity: 1;
}

.ch2-chapter-label {
    font-family: var(--nook-font-sans);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--nook-tan);
    margin-bottom: 28px;
}

.ch2-opening-para {
    font-family: var(--nook-font-serif);
    font-size: 17px;
    line-height: 1.9;
    color: var(--nook-text-light);
    width: 100%;
}

.ch2-body-copy {
    font-family: 'Lora', Georgia, serif;
}

.ch2-opening-para mark {
    background: none;
    color: var(--nook-text-charcoal);
    border-bottom: 1.5px solid var(--nook-terracotta);
    padding-bottom: 1px;
}

/* State counter dots */
.ch2-state-counter {
    position: absolute;
    bottom: 32px;
    left: 80px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.ch2-sc-dots {
    display: flex;
    gap: 7px;
}

.ch2-sc-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--nook-ghost);
    transition: background 0.4s ease;
    flex-shrink: 0;
}

.ch2-sc-dot.on {
    background: var(--nook-terracotta);
}

.ch2-sc-label {
    font-family: var(--nook-font-sans);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--nook-caption);
}

.ch2-scroll-hint {
    position: absolute;
    bottom: 34px;
    right: 32px;
    font-family: var(--nook-font-sans);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--nook-ghost);
}

/* RIGHT: film strip */
.nook-story-page .ch2-right {
    flex: 1;
    height: 100%;
    overflow: hidden;
    position: relative;
}

/* Cream fade overlays top and bottom of right panel */
.ch2-strip-fade-top,
.ch2-strip-fade-bottom {
    position: absolute;
    left: 0; right: 0;
    height: 100px;
    pointer-events: none;
    z-index: 3;
}

.ch2-strip-fade-top    { top: 0;    background: linear-gradient(to bottom, var(--nook-cream-warm), transparent); }
.ch2-strip-fade-bottom { bottom: 0; background: linear-gradient(to top,    var(--nook-cream-warm), transparent); }

/* Scroll position track */
.ch2-strip-track {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    height: 70px;
    width: 1px;
    background: var(--nook-ghost);
    z-index: 4;
}

.ch2-strip-thumb {
    width: 100%;
    background: var(--nook-terracotta);
    position: absolute;
    top: 0;
}

.ch2-frame-caption.light-bg {
    color: var(--nook-caption);
}

/* Placeholder image treatments */
.ch2-ph {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
}

.ch2-ph-lbl {
    font-family: var(--nook-font-sans);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: rgba(255,255,255,0.4);
    position: relative;
    z-index: 2;
    text-align: center;
}

.ch2-ph-sub {
    font-family: var(--nook-font-sans);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: rgba(255,255,255,0.2);
    position: relative;
    z-index: 2;
}

.ch2-ph-founding { background: linear-gradient(145deg, #3d2a14 0%, #6b4420 50%, #8b5e2a 100%); }
.ch2-ph-product  { background: #ede6d9; }
.ch2-ph-product .ch2-ph-lbl { color: var(--nook-caption); }
.ch2-ph-product .ch2-ph-sub { color: #c0b0a0; }
.ch2-ph-product img {
    width: 52%;
    height: auto;
    object-fit: contain;
    position: relative;
    z-index: 2;
}
.ch2-ph-artisan  { background: linear-gradient(160deg, #2e1e0e 0%, #5c3c20 55%, #7a5434 100%); }
.ch2-ph-texture  {
    background-color: #7a6040;
    background-image:
        repeating-linear-gradient(0deg,   transparent, transparent 5px, rgba(0,0,0,0.2)  5px, rgba(0,0,0,0.2)  6px),
        repeating-linear-gradient(90deg,  transparent, transparent 4px, rgba(0,0,0,0.14) 4px, rgba(0,0,0,0.14) 5px);
}
.ch2-ph-ethics   { background: linear-gradient(170deg, #2a1e14 0%, #4a3222 50%, #6a4a34 100%); }

.ch2-weave-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.18;
}

/* Full-height single scroll image */
.ch2-full-scroll-img {
    width: 100%;
    height: auto;
    display: block;
    will-change: transform;
}

/* ============================================
   CH2 → CH3 TRANSITION BREATH
   ============================================ */
.nook-chapter-breath {
    width: 100%;
    background: var(--nook-cream-warm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 14vh 0 12vh;
    gap: 0;
}

.nook-breath-rule {
    width: 1px;
    height: 60px;
    background: #d8cfc4;
    margin-bottom: 32px;
}

.nook-breath-label {
    font-family: var(--nook-font-sans);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: #c8a882;
}

/* ============================================
   CH3 → CH4 COLD TYPE MARKER
   ============================================ */
.nook-descent-zone {
    height: 115vh;
    background: linear-gradient(
        to bottom,
        var(--nook-cream)  0%,
        var(--nook-cream)  12%,
        #F5F4EF            28%,
        #EEEDE8            40%,
        #E8E8E4            52%,
        #EEEDE8            64%,
        #F5F4EF            78%,
        var(--nook-cream)  92%,
        var(--nook-cream)  100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.nook-descent-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
    user-select: none;
    gap: 0;
    width: 400px;
    max-width: 90vw;
}

/* "CHAPTER FOUR" supertitle — word-by-word fade */
.nook-ch4-marker__super {
    font-family: var(--nook-font-sans);
    font-size: 10px;
    font-weight: 300;
    letter-spacing: 0.38em;
    text-transform: uppercase;
    color: var(--nook-tan);
    margin-bottom: 14px;
    display: flex;
    gap: 0.5em;
    align-items: center;
    justify-content: center;
}

.nook-ch4-super-word {
    opacity: 0;
    display: inline-block;
}

/* "THE DESCENT" — character-by-character type-on */
.nook-ch4-marker__title {
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--nook-charcoal);
    margin-bottom: 18px;
    display: flex;
    align-items: baseline;
    white-space: nowrap;
    justify-content: center;
}

.nook-ch4-title-char {
    opacity: 0;
    display: inline-block;
}

.nook-ch4-title-char--space {
    width: 0.4em;
}

/* Thin unbroken rule */
.nook-ch4-rule-wrap {
    width: 120px;
    height: 1px;
    overflow: hidden;
}

.nook-ch4-rule-line {
    height: 1px;
    width: 0;
    background: var(--nook-charcoal);
    opacity: 0.3;
}

/* ============================================
   SECTION 3 — THE SUMMIT & THE SHADOW
   ============================================ */
.nook-section-3 {
    width: 100%;
    background: var(--nook-cream-warm);
}

/* Part A: Victory Display */
.nook-summit-victory {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10vh 80px;
}

.nook-summit-grid {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) 20px 1.4fr 20px minmax(320px, 1fr);
    column-gap: 2.5rem;
    max-width: 1200px;
    width: 100%;
    align-items: center;
}

.nook-col-divider {
    height: 624px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nook-summit-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transform: scale(1.25);
    transform-origin: top center;
}

.nook-metric-number {
    font-family: Georgia, serif;
    font-weight: 700;
    font-size: clamp(52px, 7vw, 96px);
    line-height: 1.05;
    color: var(--nook-text-charcoal);
    letter-spacing: -0.03em;
    margin-bottom: 16px;
    opacity: 0;
}

.nook-metric-caption {
    font-family: var(--nook-font-sans);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--nook-text-light);
    line-height: 1.6;
    opacity: 0;
}

.nook-metric-rating {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 10px;
    margin-bottom: 16px;
}

.nook-rating-number {
    font-family: Georgia, serif;
    font-weight: 700;
    font-size: clamp(40px, 5.5vw, 72px);
    line-height: 1.05;
    color: var(--nook-text-charcoal);
    letter-spacing: -0.03em;
    opacity: 0;
}

.nook-rating-stars {
    display: flex;
    gap: 3px;
}

.nook-rating-stars .star {
    font-size: 22px;
    color: #ddd4c8;
    transition: color 0.3s ease;
}

/* Center column photos */
.nook-summit-photos {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nook-summit-photo-wrap {
    width: 100%;
    overflow: hidden;
    border-radius: 2px;
}

.nook-summit-photo {
    width: 100%;
    height: 240px !important;
    max-width: none !important;
    object-fit: cover;
    display: block;
    filter: saturate(1.05);
    opacity: 0;
}

/* Photo placeholders */
.nook-summit-photo-ph {
    width: 100%;
    height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
    opacity: 0;
}

.nook-summit-photo-ph:nth-child(1) { background: #d4c4b0; }
.nook-summit-photo-ph:nth-child(2) { background: #c8b89a; }
.nook-summit-photo-ph:nth-child(3) { background: #bca882; }

.nook-ph-label {
    font-family: var(--nook-font-sans);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: rgba(255,255,255,0.5);
}

@media (max-width: 1280px) {
    .nook-summit-grid {
        grid-template-columns: minmax(200px, 1fr) 20px 1.4fr 20px minmax(200px, 1fr);
        column-gap: 1rem;
    }
    .nook-summit-victory {
        padding: 10vh 40px;
    }
}

@media (max-width: 768px) {
    .nook-summit-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .nook-chapter-breath {
        padding: 10vh 0 8vh;
    }
}

/* ============================================
   CH3 INTRO — TRIPTYCH + PAPER AIRPLANE
   ============================================ */
.nook-ch3-intro {
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 24vh 80px 0;
    overflow: visible;
    background: var(--nook-cream-warm);
}

.nook-triptych-line {
    font-family: Georgia, serif;
    font-size: clamp(26px, 3.2vw, 42px);
    font-weight: 400;
    line-height: 1.4;
    color: var(--nook-text-charcoal);
    text-align: center;
    margin: 0 0 14px 0;
    opacity: 0;
    transform: translateY(8px);
    position: relative;
    z-index: 2;
}

.nook-triptych-line:last-of-type {
    font-style: italic;
    font-size: clamp(28px, 3.5vw, 46px);
    margin-bottom: 0;
}

/* "launched" starts terracotta, transitions to charcoal via JS */
.nook-tri-launched {
    color: var(--nook-terracotta);
}

/* Plane wrapper — absolutely positioned, flies across section */
.nook-plane-wrap {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    opacity: 0;
    z-index: 3;
    will-change: transform;
}

.nook-paper-plane {
    width: 130px;
    height: auto;
    display: block;
    /* removes white image background on cream bg */
    mix-blend-mode: multiply;
}

/* Trail canvas — sits behind text and plane */
#nook-plane-canvas {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 1;
}

@media (max-width: 768px) {
    .nook-ch3-intro {
        padding: 18vh 40px 0;
    }

    .nook-paper-plane {
        width: 90px;
    }
}

/* ============================================
   CH3 VICTORY — TICKER (LEFT COLUMN)
   ============================================ */
.nook-ticker-context {
    font-family: var(--nook-font-sans);
    font-size: 8px;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: #a89a8c;
    margin-bottom: 10px;
    opacity: 0;
    width: 100%;
    text-align: center;
}

.nook-ticker-display {
    font-family: var(--nook-font-serif);
    font-weight: 700;
    font-size: clamp(64px, 8vw, 100px);
    line-height: 1.0;
    color: var(--nook-text-charcoal);
    letter-spacing: -0.04em;
    min-width: 5ch;
    text-align: center;
    transition: color 0.5s ease;
    opacity: 0;
    font-variant-numeric: tabular-nums;
}

.nook-ticker-display.landed { color: var(--nook-terracotta); }

.nook-ticker-badge {
    font-family: var(--nook-font-sans);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--nook-terracotta);
    margin-top: 6px;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.nook-ticker-badge.show { opacity: 1; transform: translateY(0); }

.nook-summit-mini-ladder {
    display: flex;
    gap: 5px;
    align-items: flex-end;
    height: 28px;
    margin-top: 18px;
    opacity: 0;
}

.nook-summit-mini-bar {
    width: 9px;
    border-radius: 1px;
    background: var(--nook-tan);
    height: 0;
    flex-shrink: 0;
}

.nook-summit-mini-bar.is-you { background: var(--nook-terracotta); }

.nook-metric-whisper {
    font-family: var(--nook-font-sans);
    font-size: 10px;
    color: #a89a8c;
    letter-spacing: 0.03em;
    font-style: italic;
    text-transform: none;
}

/* ============================================
   CH3 VICTORY — POLAROID DROP (CENTER COLUMN)
   ============================================ */
.nook-photo-outer {
    width: 100%;
    will-change: transform;
}

.nook-photo-inner {
    width: 100%;
    transform-origin: center center;
    will-change: transform, opacity;
    opacity: 0;
}

/* Override nth-child colors (now nested inside .nook-photo-outer) */
#nook-pc1 { background: #d4c4b0; }
#nook-pc2 { background: #c8b89a; }
#nook-pc3 { background: #bca882; }

/* ============================================
   CH3 VICTORY — RIGHT COLUMN (REVIEW FRAGMENT)
   ============================================ */
.nook-summit-right {
    height: 624px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.nook-rc-revenue-block {
    margin-bottom: 32px;
}

.nook-rc-rating-block {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Shared large number style (revenue + rating) */
.nook-victory-large {
    font-family: Georgia, serif;
    font-weight: 700;
    font-size: clamp(40px, 5.5vw, 68px);
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin-bottom: 10px;
}

/* 4.7 rating number — hidden until Phase 2 animates it in */
#nook-rc-rat { opacity: 0; }

/* Split-flap number container */
.nook-sf-num {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Individual split-flap characters */
.nook-sf-char {
    display: inline-block;
    min-width: 0.58em;
    text-align: center;
    opacity: 0;
}

/* Review quote — clip-path start state */
.nook-victory-quote {
    font-family: Georgia, serif;
    font-size: 15px;
    font-style: italic;
    line-height: 1.6;
    color: var(--nook-text-charcoal);
    max-width: 200px;
    margin: 0 auto 16px;
    clip-path: inset(0 0 100% 0);
    transition: color 1.2s ease;
}

.nook-victory-quote.faded {
    color: #9a8e84;
}

/* Thin rule under quote */
.nook-victory-q-rule {
    width: 60%;
    height: 1px;
    background: rgba(200, 168, 130, 0.4);
    transform-origin: left center;
    transform: scaleX(0);
    margin: 0 auto 20px;
    opacity: 0;
}

/* Stars row */
.nook-victory-stars {
    display: flex;
    gap: 3px;
    justify-content: center;
    margin-bottom: 12px;
    opacity: 0;
}

.nook-story-page .v-star {
    font-size: 20px;
    color: var(--nook-ghost);
    transition: color 0.3s ease;
}

.nook-story-page .v-star.lit {
    color: var(--nook-gold);
}

/* ============================================
   SECTION 3 — PEAK ZONE
   ============================================ */

.nook-peak-zone {
    position: relative;
}

.nook-peak-space {
    min-height: 115vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--nook-cream-warm);
    position: relative;
}

/* Split-fade whisper: two words drift in from opposite sides */
.nook-split-whisper {
    display: flex;
    align-items: baseline;
    gap: 28px;
    pointer-events: none;
    user-select: none;
}

.nook-split-word {
    font-family: var(--nook-font-sans);
    font-size: 13px;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.32em;
    color: #bfb9b0;
    opacity: 0;
}

.nook-split-dot {
    font-family: var(--nook-font-sans);
    font-size: 13px;
    font-weight: 300;
    color: var(--nook-tan);
    opacity: 0;
    line-height: 1;
    position: relative;
    top: -1px;
}

@media (prefers-reduced-motion: reduce) {
    .nook-split-word { opacity: 0.72; }
    .nook-split-dot  { opacity: 0.62; }
}

/* The Quote */
.nook-peak-quote {
    min-height: 100vh;
    background: #FFFFFF;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10vh 40px 40vh;
}

.nook-peak-quote-text {
    font-family: var(--nook-font-serif);
    font-size: clamp(24px, 2.9vw, 42px);
    font-weight: 400;
    line-height: 1.65;
    color: var(--nook-text-charcoal);
    text-align: center;
    max-width: 1140px;
    width: 100%;
}

/* Word-by-word clip reveal */
.nook-word-clip {
    display: inline-block;
    overflow: hidden;
    vertical-align: bottom;
    margin-right: 0.22em;
}

.nook-word-clip:last-child {
    margin-right: 0;
}

.nook-word-inner {
    display: inline-block;
    transform: translateY(110%);
}

.nook-peak-quote-rule {
    width: 1px;
    height: 64px;
    background: #c8a882;
    margin-top: 52px;
    opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
    .nook-word-inner { transform: none !important; }
    .nook-peak-quote-rule { opacity: 0.7 !important; }
}

/* The Crease — cool gray rule marking the divide */
.nook-peak-crease-rule {
    width: 1px;
    height: 64px;
    background: #B8B4AE;
    margin-top: 32px;
    opacity: 0.7;
}

.nook-peak-crease-label {
    font-family: var(--nook-font-sans);
    font-size: 8px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: #d4664a;
    margin-top: 28px;
    opacity: 0.5;
}

/* ════════════════════════════════════════════
   CHAPTER 4 — THE DESCENT
   ════════════════════════════════════════════ */

/* LEDGER SECTION */
.nook-story-page .ledger-section {
    position: relative;
    padding: 10vh 80px 32vh;
    background: var(--nook-cream-warm);
}
.ledger-grid-overlay {
    position: absolute; inset: 0;
    pointer-events: none;
    opacity: 0;
    will-change: opacity;
}
.ledger-grid-overlay svg {
    width: 100%; height: 100%;
}
.ledger-grid-overlay line {
    stroke: rgba(0,0,0,0.16);
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
    filter: drop-shadow(0 0 1px rgba(0,0,0,0.08));
}
.ledger-grid-overlay line.drawing {
    stroke: rgba(76,175,80,0.4);
    filter: drop-shadow(0 0 3px rgba(76,175,80,0.3));
}
.nook-story-page .ledger-header {
    display: flex; border-bottom: 1.5px solid rgba(0,0,0,0.18);
    padding-bottom: 9px; position: relative; z-index: 2;
    margin-left: -80px; margin-right: -80px;
    padding-left: 80px; padding-right: 80px;
}
.ledger-col-head {
    font-size: 8px; text-transform: uppercase; letter-spacing: 0.18em;
    color: rgba(90,90,90,0.32); font-family: 'Courier New', monospace;
}
.ledger-col-head.num { width: 72px; flex-shrink: 0; }

.nook-story-page .ledger-row {
    display: flex; align-items: flex-end;
    border-bottom: 1px solid rgba(0,0,0,0.14);
    height: 72px; padding-bottom: 9px;
    position: relative; z-index: 2;
    margin-left: -80px; margin-right: -80px;
    padding-left: 80px; padding-right: 80px;
}
.nook-story-page .ledger-row-num {
    width: 72px; flex-shrink: 0;
    font-size: 9px; color: rgba(90,90,90,0.26);
    font-family: 'Courier New', monospace;
}
.nook-story-page .ledger-row-text {
    font-family: 'Courier Prime', 'Courier New', monospace; font-size: 18px;
    line-height: 1.85; color: var(--nook-text-light); flex: 1;
    letter-spacing: 0.01em;
}
.nook-story-page .ledger-row-text .char {
    opacity: 0;
    display: inline;
}
.nook-story-page .ledger-row-text .char.space {
    white-space: pre;
}
.nook-story-page .ledger-row-text .char.typing {
    color: rgba(76,175,80,0.85);
    text-shadow: 0 0 8px rgba(76,175,80,0.4);
}
.nook-story-page .ledger-row.less-life .ledger-row-text { color: var(--nook-text-charcoal); font-style: italic; font-weight: 700; letter-spacing: 0.005em; }
.nook-story-page .ledger-row.less-life .ledger-row-num  { color: rgba(90,90,90,0.1); }
.nook-story-page .ledger-row.less-life .ledger-row-text .char.typing {
    color: rgba(212,102,74,0.9);
    text-shadow: 0 0 12px rgba(212,102,74,0.5);
}

/* NETWORK SECTION */
.nook-story-page .network-section {
    position: relative;
    padding: 8vh 0 10vh;
    overflow: hidden;
    background: var(--nook-cream-warm);
}
.nook-story-page .network-eyebrow {
    font-size: 8px; text-transform: uppercase; letter-spacing: 0.22em;
    color: rgba(159,170,187,0.6); text-align: center; margin-bottom: 40px;
    opacity: 0;
}

.nook-story-page .network-svg {
    width: 100%; display: block;
}

.net-node-circle {
    fill: var(--nook-white);
    stroke: var(--nook-tan);
    stroke-width: 1.5;
    opacity: 0;
}
.net-node-circle.stressed { stroke: #9FAABB; }
.net-node-circle.you      { stroke: var(--nook-terracotta); }

.net-node-label {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    fill: var(--nook-text-light);
    opacity: 0;
    text-anchor: middle;
}
.net-node-label.you { fill: var(--nook-terracotta); }

.net-cost-label {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    font-weight: 600;
    fill: #7A8FA0;
    opacity: 0;
    text-anchor: middle;
}

.net-line {
    stroke: var(--nook-ghost);
    stroke-width: 1;
    fill: none;
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
}
.net-line.chaos {
    stroke: rgba(159,170,187,0.4);
    stroke-width: 0.7;
    stroke-dasharray: 3 4;
}

/* Renamed from gameOverBlink per WP integration notes */
@keyframes nook-game-over-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.15; }
}
.game-over-blink {
    animation: nook-game-over-blink 0.4s ease-in-out 4;
}
@media (prefers-reduced-motion: reduce) {
    .game-over-blink { animation: none; opacity: 1; }
}

/* CRISIS TRANSITION */
.nook-story-page .crisis-transition {
    min-height: 50vh;
    background: linear-gradient(to bottom,
        var(--nook-cream-warm) 0%,
        #FDFCF7 25%,
        #FAFAF8 50%,
        #F8F8F9 75%,
        var(--nook-white) 100%
    );
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8vh 80px;
    position: relative;
}
.nook-story-page .crisis-divider {
    width: 1px;
    height: 80px;
    background: linear-gradient(to bottom,
        rgba(200,168,130,0.3) 0%,
        rgba(159,170,187,0.2) 50%,
        rgba(159,170,187,0.1) 100%
    );
    margin-bottom: 24px;
}
.nook-story-page .crisis-whisper {
    font-size: 8px;
    text-transform: uppercase;
    letter-spacing: 0.28em;
    color: rgba(159,170,187,0.35);
    text-align: center;
}

/* THE HINGE */
.nook-story-page .hinge-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--nook-white);
    padding: 0 80px;
}
.nook-story-page .hinge-text {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 700;
    font-size: clamp(34px, 4.2vw, 62px);
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: rgba(43,43,43,0.6);
    text-align: center;
    opacity: 0;
}
.nook-story-page .hinge-period {
    color: var(--nook-terracotta);
}

/* EXCEL BLOW */
.nook-story-page .blow-excel {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 80px;
    background: var(--nook-white);
}
.nook-story-page .blow-excel-text {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: clamp(26px, 3vw, 42px);
    font-style: italic;
    font-weight: 400;
    letter-spacing: -0.02em;
    color: var(--nook-text-charcoal);
    text-align: center;
    white-space: nowrap;
    line-height: 1.3;
    opacity: 0;
    transform: translateY(8px);
}

/* THE CELL */
.nook-story-page .cell-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--nook-white);
}
.nook-story-page .spreadsheet-cell-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    opacity: 0;
}
.nook-story-page .cell-formula-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 320px;
    background: #ececea;
    border: 1px solid #d0cecc;
    border-bottom: none;
    padding: 7px 14px;
}
.nook-story-page .cell-fx {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #999;
    font-style: italic;
}
.nook-story-page .cell-expr {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #555;
}
.nook-story-page .spreadsheet-cell {
    width: 320px;
    height: 96px;
    border: 2px solid #4CAF50;
    background: var(--nook-white);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.12s ease, background 0.3s ease, box-shadow 0.15s ease;
}
.nook-story-page .spreadsheet-cell.error {
    border-color: #D32F2F;
    background: rgba(211,47,47,0.04);
    box-shadow: 0 0 0 5px rgba(211,47,47,0.07);
    animation: nook-cell-shake 0.38s ease;
}
/* Renamed from cell-shake per WP integration notes */
@keyframes nook-cell-shake {
    0%,100% { transform: translateX(0); }
    20%     { transform: translateX(-5px); }
    40%     { transform: translateX(5px); }
    60%     { transform: translateX(-3px); }
    80%     { transform: translateX(2px); }
}
.nook-story-page .cell-value {
    font-family: Georgia, serif;
    font-size: 38px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--nook-text-charcoal);
    transition: color 0.3s ease;
}
.nook-story-page .spreadsheet-cell.error .cell-value {
    color: #D32F2F;
}
.nook-story-page .cell-caption {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: rgba(60,60,60,0.82);
    font-family: 'Courier New', monospace;
    margin-top: 20px;
    opacity: 0;
}

/* CONCLUSION — compression + disappearance */
.nook-story-page .conclusion-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12vh 80px;
    background: var(--nook-white);
    position: relative;
}
.nook-story-page .conclusion-text-container {
    max-width: 720px;
    width: 100%;
    transition: none;
}
.nook-story-page .conclusion-para {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 400;
    font-size: clamp(18px, 2vw, 24px);
    line-height: 1.9;
    color: #555555;
    margin-bottom: 28px;
    opacity: 0;
}
.nook-story-page .conclusion-para:last-child {
    margin-bottom: 0;
    font-style: italic;
    color: rgba(55,55,55,0.85);
}

/* ════════════════════════════════════════════
   CHAPTER 5 — THE EQUATION REWRITE
   ════════════════════════════════════════════ */

/* CH4 → CH5 TRANSITION — THE BREATH */
.nook-story-page .ch5-transition {
    position: relative;
    width: 100%;
    min-height: 80vh;
    background: linear-gradient(to bottom,
        var(--nook-white) 0%,
        #f0f0f0 15%,
        #c0c0c0 35%,
        #808080 55%,
        #404040 75%,
        #1a1a1a 90%,
        #0a0a0a 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* SVG bloom — sits behind everything */
.nook-breath-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* Label wrap — sits above SVG */
.nook-breath-label-wrap {
    position: relative;
    z-index: 2;
    text-align: center;
}

/* Eyebrow: "CHAPTER FIVE ·" */
.nook-breath-eyebrow {
    display: block;
    font-family: var(--nook-font-sans);
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.30em;
    color: rgba(200, 168, 130, 1);
    margin-bottom: 14px;
    opacity: 0;
}

/* "Acceptance" */
.nook-breath-word {
    display: block;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(18px, 2.2vw, 28px);
    font-weight: 400;
    letter-spacing: 0.06em;
    color: rgba(201, 168, 106, 0.88);
    line-height: 1;
    opacity: 0;
}

/* Thin horizontal rules */
.nook-breath-lines {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-top: 22px;
    opacity: 0;
}

.nook-breath-rule-left,
.nook-breath-rule-right {
    height: 1px;
    width: 0;
    background: linear-gradient(
        to left,
        transparent 0%,
        rgba(201, 168, 106, 0.30) 100%
    );
}

.nook-breath-rule-right {
    background: linear-gradient(
        to right,
        transparent 0%,
        rgba(201, 168, 106, 0.30) 100%
    );
}

/* TERMINAL SECTION */
.nook-story-page .terminal-section {
    min-height: 300vh;
    background: linear-gradient(to bottom,
        var(--nook-white) 0%,
        #1a1a1a 10%,
        #0a0a0a 20%,
        #0a0a0a 100%
    );
    padding: 0;
    position: relative;
}

.terminal-stage {
    position: sticky;
    top: 8vh;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 40px;
}

.nook-story-page .terminal-window {
    background: #0a0a0a;
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 60px rgba(76, 175, 80, 0.15);
}

.terminal-header {
    background: #1a1a1a;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(76, 175, 80, 0.2);
}

.terminal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(76, 175, 80, 0.3);
}

.terminal-title {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: rgba(76, 175, 80, 0.7);
    margin-left: 12px;
}

.nook-story-page .terminal-body {
    padding: 40px 32px;
    min-height: 500px;
}

.terminal-line {
    font-family: 'Courier New', monospace;
    font-size: 20px;
    line-height: 2.0;
    margin-bottom: 16px;
    position: relative;
}

.terminal-prompt {
    color: rgba(76, 175, 80, 0.6);
    margin-right: 8px;
}

.terminal-text {
    color: var(--terminal-green);
    text-shadow: 0 0 8px rgba(76, 175, 80, 0.4);
}

/* Equation states */
.eq-old {
    opacity: 1;
    will-change: opacity;
}

.eq-arrow {
    display: none;
}

.eq-new {
    display: block;
    opacity: 0;
    will-change: opacity;
}

.eq-new::before {
    content: '$ ';
    color: rgba(76, 175, 80, 0.6);
}

/* Cursor — opacity controlled entirely by ScrollTrigger JS (inline style) */
.nook-story-page .cursor {
    display: inline-block;
    width: 10px;
    height: 24px;
    background: var(--terminal-green);
    margin-left: 4px;
    vertical-align: middle;
    opacity: 0;
}

/* Font morphing classes */
.nook-story-page .morph-serif {
    font-family: Georgia, serif;
    color: var(--amber-warm);
    text-shadow: 0 0 12px rgba(201, 168, 106, 0.3);
}

/* Final equation - special styling */
.final-equation {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid rgba(201, 168, 106, 0.2);
    font-size: 24px;
    text-align: center;
}

/* Comment lines */
.terminal-comment {
    color: rgba(76, 175, 80, 0.4);
    font-size: 14px;
    font-style: italic;
    margin-bottom: 24px;
    opacity: 0;
}

/* CLOSING GRADIENT TRANSITION — dark to light, no text here */
.nook-story-page .closing-section {
    min-height: 130vh;
    background: linear-gradient(to bottom,
        #0a0a0a 0%,
        #1a1410 18%,
        #2e2018 32%,
        #5a3d28 48%,
        #9e7a55 62%,
        #d4b896 76%,
        #ebe8dc 88%,
        #FFFEF9 100%
    );
}

/* CLOSING LIGHT SECTION — fully in the light, text lives here */
.nook-story-page .closing-light-section {
    background: var(--nook-cream-warm);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14vh 80px 16vh;
}

.nook-story-page .closing-text {
    max-width: 820px;
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: 20px;
    line-height: 1.95;
    color: var(--nook-text-charcoal);
}

.nook-story-page .closing-text p {
    margin-bottom: 32px;
    opacity: 0;
}

.nook-story-page .closing-text p:last-child {
    margin-bottom: 0;
}

.nook-story-page .closing-highlight {
    font-weight: 500;
    font-style: italic;
}

/* Decorative rule before P3 */
.nook-story-page .closing-engraving-rule-wrap {
    margin-top: 48px;
    margin-bottom: 48px;
    overflow: visible;
    opacity: 0;
}

.nook-story-page .closing-engraving-rule-svg {
    display: block;
    width: 100%;
    max-width: 320px;
    height: 18px;
    overflow: visible;
}

/* P3 climax phrase — warms to terracotta during emergence */
.nook-story-page .closing-climax-phrase {
    font-style: italic;
    color: var(--nook-text-charcoal);
}

/* ============================================
   ENDING — Dark bridge + door wipe onto mat photo
   ============================================ */
.nook-dark-bridge {
    width: 100%;
    height: 120px;
    background: linear-gradient(to bottom, #FFFEF9 0%, #18160f 100%);
}

.nook-ending-door {
    position: relative;
    width: 100%;
    background: #18160f;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.nook-door-stage {
    position: relative;
    width: 100%;
    height: 700px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.nook-door-light {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    clip-path: inset(0 100% 0 0%);
    overflow: hidden;
}

.nook-door-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 50%;
    display: block;
    filter: brightness(0.88);
}

.nook-door-thread-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
}

.nook-door-thread-path {
    fill: none;
    stroke: rgba(255, 255, 255, 0.28);
    stroke-width: 1;
    stroke-linecap: round;
}

.nook-door-vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse at 50% 40%,
        transparent 40%,
        rgba(18, 16, 14, 0.55) 100%
    );
    pointer-events: none;
}

.nook-door-frame-lines {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 3;
    opacity: 0;
}

.nook-door-dot-row-wrap {
    width: 100%;
    background: #18160f;
    padding: 48px 80px 0;
    opacity: 0;
}

.nook-door-dot-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.nook-door-journey-dot {
    width: 6px;
    height: 6px;
    background: #c8a882;
    border-radius: 50%;
    opacity: 0;
    flex-shrink: 0;
}

.nook-door-closing-wrap {
    width: 100%;
    background: #18160f;
    padding: 36px 40px 100px;
    text-align: center;
    opacity: 0;
}

.nook-door-closing-text {
    font-family: Georgia, serif;
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(200, 168, 130, 0.55);
    line-height: 2;
}

.nook-door-closing-period {
    color: #d4664a;
    opacity: 0.7;
}

.nook-mascot-figure {
    position: absolute;
    bottom: -30px;
    left: 44px;
    height: 260px !important;
    width: auto !important;
    max-width: none !important;
    opacity: 0.82;
    pointer-events: none;
    z-index: 5;
}

/* ============================================
   MOBILE BREAKPOINTS
   ============================================ */

/* Brand logo — prevent mid-word wrap at smaller desktop widths */
@media (max-width: 1200px) {
    .nook-brand-logo__nook {
        font-size: 60px;
    }
}

/* Brand logo + header — mobile layout fix */
@media (max-width: 600px) {
    .nook-brand-logo__nook {
        font-size: 44px;
    }
    .nook-brand-logo__mats {
        font-size: 28px;
    }
    /* Hide decorative elements that break the header layout on small screens */
    .nook-textile-pattern,
    .nook-organic-shape {
        display: none;
    }
    /* Center the logo in the now-single-column header */
    .nook-chapter-transition {
        justify-content: center;
    }
}

/* Ch2 split-screen — stack vertically on mobile */
@media (max-width: 768px) {
    .nook-story-page .ch2-stage {
        flex-direction: column;
        height: auto;
    }
    .nook-story-page .ch2-left {
        width: 100%;
        height: auto;
        min-height: 0;
        border-right: none;
        border-bottom: 1px solid #e4ddd4;
    }
    /* Show only the first state statically on mobile */
    .nook-story-page .ch2-left-state.is-first {
        position: relative;
        inset: auto;
        opacity: 1 !important;
        pointer-events: auto !important;
        padding: 48px 24px 56px;
    }
    .nook-story-page .ch2-left-state:not(.is-first) {
        display: none;
    }
    /* Hide scroll nav elements that only make sense in the pinned layout */
    .ch2-state-counter,
    .ch2-scroll-hint,
    .ch2-strip-track {
        display: none;
    }
    .nook-story-page .ch2-right {
        width: 100%;
        height: 60vw;
    }
    .ch2-full-scroll-img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transform: none !important;
    }
}

/* Terminal — reduce padding on mobile so content fits */
@media (max-width: 768px) {
    .terminal-stage {
        padding: 0 16px;
    }
    .terminal-line {
        font-size: 13px;
        line-height: 1.9;
    }
}

/* Mobile: assorted layout fixes */
@media (max-width: 768px) {
    /* Col dividers (woven thread SVGs) create a 624px phantom gap in
       single-column layout — hide them entirely on mobile */
    .nook-col-divider {
        display: none;
    }

    /* Excel blow-up sentence uses nowrap which clips on small screens */
    .nook-story-page .blow-excel-text {
        white-space: normal;
        text-align: center;
    }

    /* Network diagram SVG is 1100px wide — allow horizontal scroll
       inside the section rather than squashing all labels to ~3px */
    .nook-story-page .network-section {
        overflow-x: auto;
        padding-left: 0;
        padding-right: 0;
    }
    .nook-story-page .network-svg {
        width: 700px;
        min-width: 700px;
    }
}

/* ============================================
   NOTE: Mobile-only hide rules removed 2026-04-24.
   Nook Nook is now on the two-template pattern (page-nook-nook.php
   for desktop, page-nook-nook-mobile.php for mobile). The mobile-only
   blocks (.nook-photo-gallery, .nook-hero-top10, .network-svg-v) live
   only in the mobile template — they are literally absent from the
   desktop DOM, so hide rules would never match.
   See: Wordpress/MOBILE_ARCHITECTURE_PLAN.md
   ============================================ */

/* ============================================
   REMOVE GAP BEFORE FOOTER
   The template re-opens GeneratePress's #page and #content wrappers
   just before get_footer() so footer.php's closing tags match up.
   They inherit fl718-menu.css's global rule:
     body.fl718-menu-active #content { padding-top: 56px; }
   which is needed at the TOP of the page (spacer under the fixed
   #walkHeader menu). But because the template re-opens a second
   #page/#content wrapper pair right after the ending section, that
   same 56px padding reapplies there and renders as a dark-to-dark
   gap before the footer.
   Target only the SECOND wrapper pair via the adjacent-sibling
   selector (#nookEndingDoor + #page). The first pair keeps its
   spacer padding. !important needed because menu.css loads after
   nook.css in the cascade.
   ============================================ */
body.nook-story-page #nookEndingDoor + #page,
body.nook-story-page #nookEndingDoor + #page #content {
    max-width: none !important;
    width: auto !important;
    margin: 0 !important;
}
/* Cream breathing room between the dark ending section and the footer. */
body.nook-story-page .nook-footer-spacer {
    width: 100%;
    height: 580px;
    background: #FFFEF9;
}

/* ── Menu curtain (same pattern as Dánlann + Biography) ─────────────── */
body.nook-story-page #fl718-nook-thread {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(180, 148, 82, 0.30);
  z-index: 400;
  opacity: 0;
  pointer-events: none;
}

@keyframes fl718-nook-thread-glow {
  0%, 100% { opacity: 1;    background: rgba(180, 148, 82, 0.30); }
  50%       { opacity: 0.4; background: rgba(180, 148, 82, 0.12); }
}

body.nook-story-page #fl718-nook-thread.fl718-nook-thread--breathing {
  animation: fl718-nook-thread-glow 4.5s ease-in-out infinite;
}

body.nook-story-page #fl718-nook-hover-zone {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 40px;
  z-index: 410;
  cursor: pointer;
  display: none;
}

body.nook-story-page #fl718-nook-menu-recall {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 420;
  opacity: 0;
  pointer-events: none;
  cursor: pointer;
  padding: 4px 12px 6px;
  font-family: 'IM Fell English', serif;
  font-size: 0.72rem;
  color: rgba(180, 148, 82, 0.70);
  line-height: 1;
  user-select: none;
  transition: color 0.25s ease;
}

body.nook-story-page #fl718-nook-menu-recall:hover {
  color: rgba(220, 185, 110, 1);
}

@media (max-width: 767px) {
  body.nook-story-page #fl718-nook-menu-recall {
    padding: 10px 24px 14px;
    font-size: 0.85rem;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  body.nook-story-page #fl718-nook-hover-zone {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.nook-story-page #fl718-nook-thread.fl718-nook-thread--breathing {
    animation: none;
  }
}
