/* ===================================================
   RRIDDL.com v2 - Dark Academia Investigation Desk
   =================================================== */

/* --- Palette --- */
:root {
    --vellum: #F2EDE4;
    --dark-walnut: #1C1915;
    --aged-ink: #2C2520;
    --correction-red: #B33A3A;
    --pencil-graphite: #6B6560;
    --manila: #D4C5A0;
    --chalk-dust: #E8E2D8;
    --blackboard-green: #2A3A2E;
    --hidden-near: #EFEAD2;

    --font-display: 'Libre Baskerville', Georgia, serif;
    --font-body: 'Source Sans 3', 'Helvetica Neue', sans-serif;
    --font-hand: 'Caveat', cursive;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--aged-ink);
    background: var(--vellum);
    line-height: 1.65;
    overflow-x: hidden;
    cursor: default;
}

button {
    font: inherit;
    color: inherit;
    background: transparent;
    border: none;
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

ol, ul {
    list-style: none;
}

em {
    font-style: italic;
    color: var(--correction-red);
}

/* --- Strings overlay --- */
.strings-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.strings-overlay path,
.strings-overlay line {
    stroke: var(--correction-red);
    stroke-width: 1.2;
    fill: none;
    will-change: stroke-dashoffset;
}

/* --- Scenes --- */
.scene {
    position: relative;
    width: 100%;
    overflow: hidden;
    padding: 4rem 6vw;
}

.scene-opening {
    min-height: 100vh;
    background: var(--dark-walnut);
    color: var(--vellum);
    display: flex;
    align-items: center;
    justify-content: center;
}

.scene-evidence {
    min-height: 150vh;
    background: var(--vellum);
    color: var(--aged-ink);
}

.scene-chalkboard {
    min-height: 100vh;
    background: var(--blackboard-green);
    color: var(--vellum);
    display: flex;
    align-items: center;
    justify-content: center;
}

.scene-revelation {
    min-height: 100vh;
    background: var(--vellum);
    color: var(--aged-ink);
    display: flex;
    align-items: center;
    justify-content: center;
}

.scene-next {
    min-height: 50vh;
    background: var(--vellum);
    color: var(--aged-ink);
    border-top: 1px dashed var(--chalk-dust);
}

/* ===================================================
   SCENE 1: Failed Equations / Opening
   =================================================== */
.desk-surface {
    position: relative;
    width: 100%;
    max-width: 1400px;
    min-height: 90vh;
    margin: 0 auto;
    background-image:
        radial-gradient(ellipse at 30% 20%, rgba(180, 155, 120, 0.05), transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(180, 155, 120, 0.04), transparent 60%);
}

.equation-stage {
    position: relative;
    width: 100%;
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
}

.equation {
    position: absolute;
    font-family: var(--font-hand);
    font-style: italic;
    font-weight: 400;
    color: var(--vellum);
    font-size: clamp(28px, 4.6vw, 72px);
    letter-spacing: 0.01em;
    opacity: 0;
    text-align: center;
    transform: translateY(8px);
    will-change: opacity, transform;
}

.equation .strike-mark {
    position: absolute;
    left: -4%;
    top: 50%;
    width: 0;
    height: 3px;
    background: var(--correction-red);
    transform: translateY(-40%) rotate(-2deg);
    border-radius: 2px;
    box-shadow: 0 0 1px rgba(179, 58, 58, 0.6);
    will-change: width;
}

.equation.eq-active {
    opacity: 1;
    animation: eqFadeIn 0.45s ease forwards;
}

.equation.eq-strike .strike-mark {
    animation: strikeOut 0.55s ease forwards;
}

.equation.eq-leave {
    animation: eqFadeOut 0.5s ease forwards;
}

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

@keyframes eqFadeOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}

@keyframes strikeOut {
    from { width: 0; }
    to   { width: 108%; }
}

.rriddl-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(64px, 15vw, 200px);
    letter-spacing: 0.04em;
    color: var(--vellum);
    text-align: center;
    opacity: 0;
    transform: scale(0.96);
    transition: opacity 1.2s ease, transform 1.2s ease;
    line-height: 1;
}

.rriddl-title.is-revealed {
    opacity: 1;
    transform: scale(1);
}

.rriddl-sub {
    font-family: var(--font-hand);
    font-size: clamp(18px, 1.6vw, 26px);
    color: var(--correction-red);
    margin-top: 1.5rem;
    text-align: center;
    opacity: 0;
    transition: opacity 0.8s ease 0.6s;
}

.rriddl-title.is-revealed + .rriddl-sub {
    opacity: 1;
}

/* Opening cards */
.opening-cards {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.card-tagline {
    position: absolute;
    width: clamp(220px, 22vw, 320px);
    padding: 1.4rem 1.6rem 1.6rem;
    background: var(--manila);
    color: var(--aged-ink);
    box-shadow:
        0 6px 16px rgba(0,0,0,0.35),
        2px 2px 0 rgba(0,0,0,0.12),
        4px 4px 0 rgba(0,0,0,0.08);
    pointer-events: auto;
    opacity: 0;
    transform: translateY(40px) rotate(0deg);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.card-tagline.is-visible { opacity: 1; }

.card-tagline.card-1 {
    top: 8%;
    left: 4%;
    transform: translateY(40px) rotate(-3deg);
}
.card-tagline.card-1.is-visible { transform: translateY(0) rotate(-3deg); transition-delay: 2.4s; }

.card-tagline.card-2 {
    top: 56%;
    right: 6%;
    transform: translateY(40px) rotate(2deg);
}
.card-tagline.card-2.is-visible { transform: translateY(0) rotate(2deg); transition-delay: 2.55s; }

.card-tagline.card-3 {
    bottom: 6%;
    left: 18%;
    transform: translateY(40px) rotate(-1.5deg);
}
.card-tagline.card-3.is-visible { transform: translateY(0) rotate(-1.5deg); transition-delay: 2.7s; }

.card-pin {
    position: absolute;
    top: -6px;
    left: 50%;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #d44a4a, #7a1f1f 75%);
    box-shadow: 0 2px 3px rgba(0,0,0,0.4);
    transform: translateX(-50%);
}

.card-eyebrow {
    font-family: var(--font-hand);
    font-size: 1.25rem;
    color: var(--correction-red);
    margin-bottom: 0.4rem;
}

.card-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(18px, 1.4vw, 22px);
    line-height: 1.25;
    margin-bottom: 0.6rem;
    color: var(--aged-ink);
}

.card-body {
    font-family: var(--font-body);
    font-size: clamp(14px, 1vw, 15.5px);
    color: var(--aged-ink);
    line-height: 1.55;
}

.cross-out {
    position: relative;
    color: var(--pencil-graphite);
}
.cross-out::after {
    content: "";
    position: absolute;
    left: -4%;
    right: -4%;
    top: 55%;
    height: 2px;
    background: var(--correction-red);
    transform: rotate(-3deg);
}

.marginalia {
    position: absolute;
    font-family: var(--font-hand);
    font-size: 1.1rem;
    color: var(--correction-red);
    pointer-events: none;
}

.mg-1 {
    top: -22px;
    right: 14px;
    transform: rotate(4deg);
}

/* Scroll cue */
.scroll-cue {
    position: absolute;
    bottom: 2vh;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-hand);
    color: var(--manila);
    opacity: 0.7;
    font-size: 1.2rem;
    animation: cueBob 2.4s ease-in-out infinite;
}

@keyframes cueBob {
    0%, 100% { transform: translate(-50%, 0); }
    50%      { transform: translate(-50%, 6px); }
}

/* ===================================================
   SCENE 2: Evidence Board
   =================================================== */
.evidence-header {
    max-width: 720px;
    margin: 0 auto 4rem;
    text-align: center;
    padding-top: 3rem;
}

.section-eyebrow {
    font-family: var(--font-hand);
    color: var(--correction-red);
    font-size: 1.4rem;
    letter-spacing: 0.04em;
    margin-bottom: 0.4rem;
}

.section-heading {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(34px, 5vw, 64px);
    letter-spacing: 0.02em;
    color: var(--aged-ink);
    line-height: 1.1;
    margin-bottom: 1.2rem;
}

.section-lede {
    font-family: var(--font-body);
    font-size: clamp(15px, 1.1vw, 18px);
    color: var(--pencil-graphite);
    line-height: 1.65;
    max-width: 60ch;
    margin: 0 auto;
}

.evidence-board {
    position: relative;
    max-width: 1300px;
    margin: 0 auto;
    height: 110vh;
    min-height: 1000px;
}

/* Common evidence card */
.ev-card {
    position: absolute;
    padding: 1.4rem 1.5rem;
    background: var(--vellum);
    color: var(--aged-ink);
    box-shadow:
        0 8px 18px rgba(40, 30, 20, 0.18),
        2px 2px 0 rgba(40,30,20,0.05),
        4px 4px 0 rgba(40,30,20,0.04);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    opacity: 0;
    transform: translateY(40px) rotate(var(--rot, 0deg));
}

.ev-card.is-visible {
    opacity: 1;
    transform: translateY(0) rotate(var(--rot, 0deg));
}

.ev-card:hover {
    transform: translateY(-4px) rotate(var(--rot, 0deg));
    box-shadow:
        0 14px 26px rgba(40, 30, 20, 0.28),
        2px 2px 0 rgba(40,30,20,0.05);
    z-index: 10;
}

/* Lined card backgrounds for index-card style */
.ev-cardstack,
.ev-document {
    background-image: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 23px,
        rgba(212, 197, 160, 0.55) 24px
    );
}

/* Photo card */
.ev-photo {
    width: clamp(220px, 20vw, 280px);
    --rot: -3deg;
    background: #faf6ef;
    padding: 12px 12px 18px;
}

.ev-photo .photo-frame {
    width: 100%;
}

.photo-stand-in {
    width: 100%;
    height: 180px;
    background:
        linear-gradient(135deg, #6B6560 0%, #2C2520 50%, #1C1915 100%);
    background-blend-mode: multiply;
    position: relative;
    overflow: hidden;
}

.photo-stand-in::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 30%, rgba(255,255,255,0.18), transparent 50%),
        radial-gradient(circle at 70% 60%, rgba(0,0,0,0.45), transparent 60%);
}

.photo-stand-in-2 {
    background: linear-gradient(160deg, #2A3A2E 0%, #1C1915 70%);
}

.photo-caption {
    font-family: var(--font-hand);
    font-size: 1.1rem;
    color: var(--aged-ink);
    margin-top: 0.6rem;
    text-align: center;
}

/* Document card */
.ev-document {
    width: clamp(280px, 26vw, 360px);
    padding: 1.6rem;
}

.doc-stamp {
    display: inline-block;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    color: var(--correction-red);
    border: 1.5px solid var(--correction-red);
    padding: 3px 8px;
    margin-bottom: 0.8rem;
    transform: rotate(-2deg);
}

.doc-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.15rem;
    margin-bottom: 0.7rem;
    color: var(--aged-ink);
}

.doc-body {
    font-family: var(--font-body);
    font-size: 0.97rem;
    line-height: 1.65;
    color: var(--aged-ink);
}

.doc-meta {
    margin-top: 0.8rem;
    font-family: var(--font-hand);
    font-size: 1rem;
    color: var(--pencil-graphite);
}

/* Cipher text */
.cipher-text {
    font-family: var(--font-hand);
    font-size: 1.7rem;
    letter-spacing: 0.18em;
    color: var(--correction-red);
}

/* Hidden text - reveals on hover */
.hidden-text,
.hidden-text-inline {
    color: var(--hidden-near);
    transition: color 0.3s ease;
}

.hidden-text-inline {
    display: inline;
}

.ev-card:hover .hidden-text,
.ev-card:hover .hidden-text-inline {
    color: var(--aged-ink);
}

/* Torn-page card */
.ev-torn {
    width: clamp(240px, 22vw, 320px);
    background: var(--vellum);
    padding: 1.4rem 1.6rem 1.8rem;
    clip-path: polygon(
        0% 4%, 4% 0%, 18% 3%, 32% 0%, 48% 2%, 64% 0%, 80% 3%, 92% 0%, 100% 5%,
        100% 96%, 96% 100%, 82% 97%, 68% 100%, 52% 98%, 36% 100%, 20% 97%, 8% 100%, 0% 95%
    );
}

.torn-prefix {
    font-family: var(--font-hand);
    font-size: 1.1rem;
    color: var(--pencil-graphite);
    margin-bottom: 0.4rem;
}

.torn-body {
    font-family: var(--font-body);
    font-size: 0.97rem;
    line-height: 1.55;
    color: var(--aged-ink);
}

/* Card stack (numbered list) */
.ev-cardstack {
    width: clamp(260px, 24vw, 340px);
    padding: 1.5rem 1.6rem;
}

.numbered-list {
    counter-reset: ri;
    margin-top: 0.6rem;
}

.numbered-list li {
    counter-increment: ri;
    position: relative;
    padding-left: 2.2rem;
    padding-bottom: 0.6rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--aged-ink);
}

.numbered-list li::before {
    content: counter(ri);
    position: absolute;
    left: 0;
    top: -2px;
    font-family: var(--font-hand);
    font-size: 1.6rem;
    color: var(--correction-red);
}

/* Position each evidence card */
.ev-card[data-pin="A"] { top: 4%;  left: 3%;   --rot: -3deg; }
.ev-card[data-pin="B"] { top: 6%;  left: 32%;  --rot: 1.5deg; }
.ev-card[data-pin="C"] { top: 4%;  right: 3%;  --rot: -2deg; }
.ev-card[data-pin="D"] { top: 36%; left: 12%;  --rot: 2.4deg; }
.ev-card[data-pin="E"] { top: 38%; left: 42%;  --rot: -1.2deg; }
.ev-card[data-pin="F"] { top: 40%; right: 4%;  --rot: 2deg; }
.ev-card[data-pin="G"] { top: 70%; left: 6%;   --rot: 1.8deg; }
.ev-card[data-pin="H"] { top: 73%; left: 38%;  --rot: -2.4deg; }

.mg-photo {
    bottom: -22px;
    right: 8px;
    transform: rotate(-3deg);
}
.mg-photo-2 {
    bottom: -20px;
    left: 14px;
    transform: rotate(3deg);
}
.mg-torn {
    bottom: -10px;
    right: 18px;
    color: var(--correction-red);
    transform: rotate(-2deg);
}
.mg-torn-2 {
    margin-top: 0.6rem;
    color: var(--correction-red);
    position: relative;
    transform: rotate(2deg);
    display: inline-block;
}

/* Coffee rings */
.coffee-ring {
    position: absolute;
    width: 120px;
    height: 120px;
    border: 2px solid rgba(180, 155, 120, 0.2);
    border-radius: 50%;
    pointer-events: none;
}
.coffee-ring::after {
    content: "";
    position: absolute;
    inset: 6px;
    border: 1px solid rgba(180, 155, 120, 0.15);
    border-radius: 50%;
}
.coffee-ring-1 { top: 10%; right: 6%; transform: rotate(8deg); }
.coffee-ring-2 { top: 24%; right: 28%; }
.coffee-ring-3 { bottom: -40px; left: 12%; }

/* ===================================================
   SCENE 3: Chalkboard
   =================================================== */
.scene-chalkboard {
    color: var(--vellum);
    isolation: isolate;
}

.chalkboard-noise {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.91  0 0 0 0 0.89  0 0 0 0 0.84  0 0 0 0.55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
    opacity: 0.06;
    mix-blend-mode: screen;
}

.chalk-dust {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.chalk-dust .dust {
    position: absolute;
    width: 3px;
    height: 3px;
    background: rgba(232, 226, 216, 0.7);
    border-radius: 50%;
    filter: blur(0.5px);
    opacity: 0;
    animation-name: chalkFall;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
}

.dust.d1  { left: 4%;  animation-duration: 11s; animation-delay: 0s;   }
.dust.d2  { left: 10%; animation-duration: 14s; animation-delay: 1.4s; }
.dust.d3  { left: 16%; animation-duration: 9s;  animation-delay: 0.7s; }
.dust.d4  { left: 22%; animation-duration: 13s; animation-delay: 3.1s; }
.dust.d5  { left: 28%; animation-duration: 10s; animation-delay: 0.4s; }
.dust.d6  { left: 33%; animation-duration: 15s; animation-delay: 5s;   }
.dust.d7  { left: 38%; animation-duration: 12s; animation-delay: 2.4s; }
.dust.d8  { left: 44%; animation-duration: 9s;  animation-delay: 6.2s; }
.dust.d9  { left: 50%; animation-duration: 14s; animation-delay: 1.1s; }
.dust.d10 { left: 56%; animation-duration: 11s; animation-delay: 4.5s; }
.dust.d11 { left: 62%; animation-duration: 13s; animation-delay: 0.9s; }
.dust.d12 { left: 68%; animation-duration: 10s; animation-delay: 7.3s; }
.dust.d13 { left: 74%; animation-duration: 15s; animation-delay: 2.8s; }
.dust.d14 { left: 80%; animation-duration: 12s; animation-delay: 5.6s; }
.dust.d15 { left: 86%; animation-duration: 9s;  animation-delay: 0.2s; }
.dust.d16 { left: 90%; animation-duration: 14s; animation-delay: 6s;   }
.dust.d17 { left: 94%; animation-duration: 13s; animation-delay: 3.7s; }
.dust.d18 { left: 98%; animation-duration: 11s; animation-delay: 8.2s; }

@keyframes chalkFall {
    0%   { transform: translateY(-10vh); opacity: 0; }
    10%  { opacity: 0.8; }
    90%  { opacity: 0.6; }
    100% { transform: translateY(110vh); opacity: 0; }
}

.chalkboard-frame {
    position: relative;
    z-index: 2;
    width: min(1100px, 90vw);
    padding: 4vw 5vw;
    text-align: center;
    color: var(--vellum);
}

.chalk-eyebrow {
    font-family: var(--font-hand);
    font-size: clamp(18px, 1.6vw, 26px);
    color: var(--chalk-dust);
    margin-bottom: 1.4rem;
    opacity: 0.85;
}

.chalk-equation {
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
    margin-bottom: 2.2rem;
}

.chalk-line {
    font-family: var(--font-hand);
    font-weight: 400;
    color: var(--vellum);
    font-size: clamp(28px, 4vw, 56px);
    line-height: 1.15;
    letter-spacing: 0.01em;
    text-shadow: 0 0 1px rgba(255,255,255,0.05);
    opacity: 0.94;
}

.chalk-line.chalk-highlight {
    color: var(--correction-red);
    animation: redPulse 3s ease-in-out infinite;
}

@keyframes redPulse {
    0%, 100% { opacity: 0.8; }
    50%      { opacity: 1; }
}

.chalk-scratch {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.4rem 2.4rem;
    margin-bottom: 1.6rem;
}

.chalk-word {
    font-family: var(--font-hand);
    font-size: clamp(22px, 2.2vw, 36px);
    color: var(--chalk-dust);
    position: relative;
    padding: 0 0.4em;
    opacity: 0.85;
}

.chalk-word.chalk-circled::before {
    content: "";
    position: absolute;
    inset: -8px -10px;
    border: 2px solid var(--correction-red);
    border-radius: 50%;
    transform: rotate(-2deg);
    opacity: 0.85;
}

.chalk-word.chalk-circled {
    color: var(--vellum);
}

.chalk-footer {
    font-family: var(--font-hand);
    color: var(--chalk-dust);
    font-size: 1.05rem;
    opacity: 0.6;
    margin-top: 1rem;
}

/* ===================================================
   SCENE 4: Revelation
   =================================================== */
.revelation-stage {
    position: relative;
    text-align: center;
    padding: 2rem 4vw;
    max-width: 1400px;
    margin: 0 auto;
}

.rev-prefix {
    font-family: var(--font-hand);
    color: var(--correction-red);
    font-size: 1.4rem;
    margin-bottom: 2.5rem;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.revelation-text {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 400;
    font-size: clamp(54px, 12vw, 160px);
    letter-spacing: 0.04em;
    line-height: 1.05;
    color: var(--aged-ink);
}

.rev-letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.rev-letter.is-typed {
    opacity: 1;
    transform: translateY(0);
}

.rev-period {
    color: var(--correction-red);
}

.rev-cursor {
    display: inline-block;
    width: 4px;
    height: clamp(54px, 11vw, 140px);
    background: var(--aged-ink);
    margin-left: 6px;
    vertical-align: middle;
    opacity: 0;
}

.rev-cursor.is-blinking {
    animation: cursorBlink 0.9s steps(2) 4;
}

@keyframes cursorBlink {
    0%, 49%   { opacity: 1; }
    50%, 100% { opacity: 0; }
}

.revelation-stage.is-active .rev-prefix { opacity: 1; }

/* ===================================================
   SCENE 5: Next Puzzle
   =================================================== */
.next-clutter {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    height: 40vh;
    min-height: 320px;
}

.next-card {
    position: absolute;
    width: clamp(180px, 18vw, 240px);
    padding: 1.1rem 1.2rem;
    background: var(--manila);
    box-shadow:
        0 6px 14px rgba(40, 30, 20, 0.18),
        2px 2px 0 rgba(40,30,20,0.05);
    opacity: 0;
    transform: translateY(20px) rotate(0deg);
    transition: opacity 1.1s ease, transform 1.1s ease;
}

.next-card.is-visible { opacity: 1; }

.next-card.next-card-1 {
    top: 14%;
    left: 8%;
    transform: translateY(20px) rotate(-3deg);
}
.next-card.next-card-1.is-visible { transform: translateY(0) rotate(-3deg); transition-delay: 0.05s; }

.next-card.next-card-2 {
    top: 36%;
    left: 38%;
    transform: translateY(20px) rotate(2.4deg);
}
.next-card.next-card-2.is-visible { transform: translateY(0) rotate(2.4deg); transition-delay: 0.35s; }

.next-card.next-card-3 {
    top: 22%;
    right: 6%;
    transform: translateY(20px) rotate(-1.8deg);
    background: var(--vellum);
}
.next-card.next-card-3.is-visible { transform: translateY(0) rotate(-1.8deg); transition-delay: 0.65s; }

.next-card-text {
    font-family: var(--font-hand);
    font-size: 1.4rem;
    color: var(--aged-ink);
}

.continuing-card .to-be-continued {
    font-family: var(--font-hand);
    font-size: 1.6rem;
    color: var(--correction-red);
}

/* ===================================================
   Navigation: Magnifying Glass
   =================================================== */
.nav-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    background: var(--vellum);
    color: var(--aged-ink);
    border-radius: 50%;
    box-shadow: 0 8px 18px rgba(0,0,0,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 30;
    transition: color 0.25s ease, transform 0.25s ease, background 0.25s ease;
}

.nav-toggle:hover {
    color: var(--correction-red);
    transform: scale(1.05) rotate(-6deg);
}

.nav-toggle.is-active {
    background: var(--correction-red);
    color: var(--vellum);
}

.nav-panel {
    position: fixed;
    bottom: 88px;
    right: 24px;
    width: 240px;
    background: var(--vellum);
    box-shadow: 0 14px 30px rgba(0,0,0,0.32);
    padding: 1.2rem 1.4rem 1.4rem;
    z-index: 29;
    transform-origin: bottom right;
    transform: scale(0.92) translateY(10px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.nav-panel.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1) translateY(0);
}

.nav-heading {
    font-family: var(--font-hand);
    color: var(--correction-red);
    font-size: 1.05rem;
    margin-bottom: 0.6rem;
    border-bottom: 1px dashed var(--manila);
    padding-bottom: 0.4rem;
}

.nav-tab {
    display: block;
    font-family: var(--font-hand);
    font-size: 1.3rem;
    color: var(--aged-ink);
    padding: 0.35rem 0.6rem 0.35rem 1.4rem;
    position: relative;
    border-left: 3px solid var(--manila);
    margin-bottom: 0.3rem;
    transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.nav-tab::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 6px;
    height: 1px;
    background: var(--correction-red);
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.nav-tab:hover {
    color: var(--correction-red);
    border-left-color: var(--correction-red);
    background: rgba(179, 58, 58, 0.05);
}

.nav-tab:hover::before { opacity: 1; }

/* ===================================================
   Responsive
   =================================================== */
@media (max-width: 800px) {
    .scene { padding: 3rem 5vw; }

    .opening-cards { display: none; }

    .evidence-board {
        height: auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }

    .ev-card {
        position: relative;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        width: 100%;
        max-width: 460px;
        margin: 0 auto;
        --rot: 0deg;
    }

    .strings-overlay { display: none; }

    .nav-toggle { width: 44px; height: 44px; }
    .nav-panel { width: 220px; }
}
