/* ═══════════════════════════════
   ✦ SCARLET REMEMBRANCE
   ═══════════════════════════════ */

/* ═══════════════════════════════
   ✦ RESET & BASE
   ═══════════════════════════════ */

/* ✦ CSS Variables */
:root {
    --scarlet: #7b0019;
    --rot-gold: #b17e4a;
    --bone-pale: #f6efe6;
    --violet-shadow: #3a2035;
    --deep-black: #0a0005;
    --violet-ash: #7a6674;

    --scarlet-fade: rgba(123, 0, 25, 0.3);
    --gold-whisper: rgba(177, 126, 74, 0.4);
    --violet-deep: #2a1525;

    --font-title: 'Forum', serif;
    --font-header: 'Cinzel', serif;
    --font-body: 'Gentium Book Plus', serif;
    --font-glitch: 'Fira Mono', monospace;
    --font-mantra: 'Cardo', serif;
}

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

/* ✦ Base Styles — Dark Theme */
html {
    scroll-behavior: smooth;
    background: var(--deep-black);
}

body {
    background: var(--deep-black);
    color: var(--bone-pale);
    font-family: var(--font-body);
    font-size: 1.2rem;
    line-height: 1.8;
    overflow-x: hidden;

    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(246, 239, 230, 0.01) 2px,
            rgba(246, 239, 230, 0.01) 4px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(246, 239, 230, 0.01) 2px,
            rgba(246, 239, 230, 0.01) 4px
        );
    pointer-events: none;
    z-index: 9998;
    opacity: 0.3;
    mix-blend-mode: overlay;
}

/* ✦ Film grain — atmospheric texture layer */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='250' height='250'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
    pointer-events: none;
    z-index: 9997;
    opacity: 0.1;
    mix-blend-mode: overlay;
}

body.loading {
    overflow: hidden;
}

body.loaded {
    transition: opacity 0.8s ease;
}

/* ═══════════════════════════════
   ✦ COMPONENTS
   ═══════════════════════════════ */

/* ✦ Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--deep-black);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.8s ease, visibility 0.8s;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.bloom-loader {
    position: relative;
    width: 100px;
    height: 100px;
}

.loader-petal {
    position: absolute;
    width: 40px;
    height: 40px;
    background: var(--scarlet);
    border-radius: 50% 0;
    filter: blur(5px);
    animation: bloom-rotate 2s ease infinite;
}

.loader-petal:nth-child(2) {
    transform: rotate(120deg);
    animation-delay: 0.2s;
}

.loader-petal:nth-child(3) {
    transform: rotate(240deg);
    animation-delay: 0.4s;
}

@keyframes bloom-rotate {
    0%, 100% { opacity: 0.3; transform: scale(0.8) rotate(0deg); }
    50% { opacity: 1; transform: scale(1.2) rotate(180deg); }
}

.loading-text {
    margin-top: 2rem;
    font-family: var(--font-mantra);
    font-style: italic;
    color: var(--rot-gold);
    opacity: 0.7;
}

/* ✦ Sidebar Navigation */
.sidebar-nav {
    position: fixed;
    right: 3rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.sidebar-dot {
    width: 8px;
    height: 8px;
    border: 2px solid var(--rot-gold);
    border-radius: 50%;
    background: transparent;
    transition: all 0.3s ease;
}

.sidebar-link.active .sidebar-dot {
    background: var(--scarlet);
    border-color: var(--scarlet);
    box-shadow: 0 0 15px rgba(123, 0, 25, 0.8);
}

.sidebar-label {
    font-family: var(--font-header);
    font-size: 0.75rem;
    color: var(--rot-gold);
    text-transform: lowercase;
    letter-spacing: 0.05em;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}

.sidebar-link:hover .sidebar-label {
    opacity: 1;
    transform: translateX(0);
}

/* ✦ Chapters */
.chapter {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8rem 2rem;
    background: var(--deep-black);
    position: relative;
}

.chapter::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 25vh;
    background: linear-gradient(to bottom, rgba(10, 0, 5, 0) 0%, rgba(10, 0, 5, 0.5) 50%, var(--deep-black) 100%);
    pointer-events: none;
    z-index: 2;
}

.chapter::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30vh;
    background: linear-gradient(to top, rgba(10, 0, 5, 0) 0%, rgba(10, 0, 5, 0.5) 50%, var(--deep-black) 100%);
    pointer-events: none;
    z-index: 2;
}

.content {
    max-width: 800px;
    width: 100%;
    text-align: center;
    position: relative;
    z-index: 10;
}

/* ✦ Typography */
h1, h2, h3 {
    font-family: var(--font-header);
    font-weight: 600;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

h1 {
    font-family: var(--font-title);
    font-size: 3rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--scarlet);
    text-shadow: 0 0 20px rgba(123, 0, 25, 0.8);
}

h2.chapter-title {
    font-size: 2.5rem;
    color: var(--rot-gold);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

h3 {
    color: var(--rot-gold);
    font-size: 1.2rem;
}

p {
    color: var(--bone-pale);
    margin-bottom: 1.5rem;
}

strong, b {
    color: var(--rot-gold);
    font-weight: 600;
    text-shadow: 0 0 10px rgba(177, 126, 74, 0.3);
}

em, i {
    color: var(--violet-ash);
    font-style: italic;
    opacity: 0.95;
}

a, button, .voice-tab, .sidebar-link {
    cursor: pointer;
}

a:hover, button:hover, .voice-tab:hover, .sidebar-link:hover {
    cursor: crosshair;
}

/* ✦ Glitch Effect */
.glitch-text {
    animation: glitch 3s infinite;
}

@keyframes glitch {
    0%, 90%, 100% { transform: translate(0); filter: hue-rotate(0deg); }
    92% { transform: translate(-2px, 2px); filter: hue-rotate(90deg); }
    94% { transform: translate(2px, -2px); filter: hue-rotate(-90deg); }
    96% { transform: translate(-2px, -2px); }
}

/* ✦ Header Art */
.header-art-container {
    width: 100%;
    height: 400px;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
}

.header-art-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
    display: block;
    filter: brightness(0.85) contrast(1.1) saturate(0.9);
    animation: header-breathe 20s ease-in-out infinite;
}

@keyframes header-breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

.header-art-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at center, transparent 30%, rgba(10, 0, 5, 0.7) 100%),
        linear-gradient(180deg, rgba(10, 0, 5, 0.3) 0%, transparent 25%, transparent 75%, rgba(10, 0, 5, 0.6) 100%),
        linear-gradient(135deg, rgba(123, 0, 25, 0.15) 0%, transparent 50%, rgba(58, 32, 53, 0.15) 100%);
    pointer-events: none;
    animation: vignette-pulse 12s ease-in-out infinite;
}

@keyframes vignette-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.75; }
}

.header-text-overlay {
    position: absolute;
    bottom: 1.5rem;
    left: 0;
    width: 100%;
    text-align: center;
    font-family: var(--font-header);
    font-size: 1.5rem;
    letter-spacing: 0.3em;
    color: var(--bone-pale);
    text-shadow: 0 0 20px rgba(123, 0, 25, 0.8), 0 2px 8px rgba(10, 0, 5, 0.9);
    z-index: 2;
}

/* ✦ Opening Section */
.opening-tagline {
    font-size: 1.2rem;
    font-style: italic;
    color: var(--rot-gold);
    margin: 1.5rem 0 3rem;
}

.opening-divider {
    width: 50%;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--violet-shadow), transparent);
    margin: 3rem auto;
}

.opening-text p {
    margin-bottom: 1.5rem;
    color: var(--bone-pale);
}

.voice-disclaimer {
    font-size: 1.1rem;
    color: rgba(122, 102, 116, 0.6);
    font-style: italic;
    margin-top: 0.5rem;
}

/* ✦ Origin Section */
.origin-text {
    text-align: left;
    max-width: 750px;
    margin: 0 auto;
}

.origin-text p {
    margin-bottom: 1.5rem;
    text-indent: 2em;
    color: var(--bone-pale);
}

.origin-text p:first-child {
    text-indent: 0;
}

.lore-primer {
    color: var(--rot-gold) !important;
    font-style: italic;
    text-indent: 0 !important;
}

.proper-noun {
    color: var(--rot-gold);
    font-weight: 600;
}

.origin-emphasis {
    color: var(--rot-gold) !important;
    font-style: italic;
    text-align: center !important;
    text-indent: 0 !important;
    margin: 2rem 0 !important;
}

.origin-final {
    text-align: center !important;
    font-size: 1.25rem !important;
    text-indent: 0 !important;
    color: var(--scarlet);
    margin-top: 3rem !important;
}

.origin-divider {
    width: 60%;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--violet-shadow), transparent);
    margin: 3rem auto;
}

/* ✦ Transition Interludes */
.transition-interlude {
    min-height: 50vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(180deg, var(--deep-black) 0%, rgba(123, 0, 25, 0.1) 50%, var(--deep-black) 100%);
}

.interlude-text, .epilogue-inscription {
    font-family: var(--font-mantra);
    font-size: 1.6rem;
    font-style: italic;
    text-align: center;
    max-width: 600px;
    padding: 2rem;
    color: var(--bone-pale);
}

.shimmer {
    display: block;
    background: linear-gradient(90deg, var(--rot-gold), var(--bone-pale), var(--rot-gold));
    background-size: 200% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 3s linear infinite;
    margin-bottom: 0.5rem;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.epilogue-shimmer {
    display: block;
    background: linear-gradient(90deg, var(--bone-pale), var(--rot-gold), var(--bone-pale));
    background-size: 200% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 4s linear infinite;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

/* ✦ Prologue */
.prologue-full {
    position: relative;
    overflow: visible;
}

.prologue-full .content {
    position: relative;
    z-index: 10;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.prologue-content {
    text-align: center;
}

.bloom-animation {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0.8;
    z-index: 5;
}

.aeonian-bloom-large {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--scarlet) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(30px);
    animation: bloom-pulse 4s ease-in-out infinite;
}

@keyframes bloom-pulse {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.3); opacity: 0.5; }
}

.bloom-petals {
    position: absolute;
    width: 100%;
    height: 100%;
}

.bloom-petal {
    position: absolute;
    width: 100px;
    height: 100px;
    background: var(--scarlet);
    border-radius: 50% 0;
    opacity: 0.2;
    filter: blur(10px);
}

.bloom-petal-1 { top: 30%; left: 40%; transform: rotate(0deg); }
.bloom-petal-2 { top: 30%; left: 50%; transform: rotate(90deg); }
.bloom-petal-3 { top: 40%; left: 40%; transform: rotate(180deg); }
.bloom-petal-4 { top: 40%; left: 50%; transform: rotate(270deg); }

.corrupted-text {
    position: relative;
    z-index: 10;
    margin-bottom: 3rem;
    text-align: center;
}

.flicker-text {
    animation: flicker 2s ease-in-out infinite;
}

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

.invocation-block {
    position: relative;
    z-index: 10;
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}

.invocation-line {
    font-size: 1.2rem;
    line-height: 2;
    margin-bottom: 2rem;
    color: var(--bone-pale);
    text-align: center;
}

.invocation-line.emphasis {
    font-size: 1.5rem;
    color: var(--rot-gold);
    font-style: italic;
}

.path-reveal {
    margin: 3rem auto;
    padding: 1.5rem;
    max-width: 500px;
    background: rgba(58, 32, 53, 0.2);
    border: 1px solid var(--violet-shadow);
    border-radius: 10px;
    text-align: center;
}

.path-whisper {
    font-family: var(--font-mantra);
    font-style: italic;
    color: var(--rot-gold);
    margin: 1rem 0;
    text-align: center;
}

.voice-trinity {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1.5rem 0;
    text-align: center;
}

.voice-aspect {
    color: var(--bone-pale);
    font-size: 0.988rem;
    text-align: center;
}

/* ✦ Chapter Styles */
.chapter-theme {
    font-style: italic;
    color: var(--violet-ash);
    font-size: 1.2rem;
    margin-bottom: 3rem;
}

/* ✦ Voice Selector */
.voice-selector {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
    border-bottom: 1px solid var(--violet-shadow);
    padding-bottom: 1rem;
}

.voice-tab {
    background: transparent;
    border: 1px solid var(--rot-gold);
    color: var(--rot-gold);
    font-family: var(--font-header);
    font-size: 0.9rem;
    padding: 0.5rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 20px;
}

.voice-tab:hover {
    background: rgba(177, 126, 74, 0.1);
}

.voice-tab.active {
    background: var(--scarlet);
    color: var(--bone-pale);
    border-color: var(--scarlet);
}

/* ✦ Voice Content */
.voice-content {
    display: none;
    background: rgba(10, 0, 5, 0.5);
    padding: 2rem;
    border-radius: 10px;
    margin: 2rem 0;
    opacity: 0;
    transition: opacity 1.2s ease-in-out;
}

.voice-content.active {
    display: block !important;
    animation: voice-fade-in 1.2s ease-in-out forwards;
}

@keyframes voice-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ✦ Codex Voice — Fromsoftware Terminal Aesthetic */

.codex-text {
    text-align: left;
    max-width: 680px;
    margin: 0 auto;
    color: var(--bone-pale) !important;
    font-family: var(--font-glitch) !important;
    font-size: 0.95rem !important;
    letter-spacing: 0.03em;
}

.codex-entry {
    background: rgba(25, 10, 10, 0.45);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(177, 126, 74, 0.4);
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow:
        inset 0 0 35px rgba(120, 20, 30, 0.3),
        0 4px 20px rgba(123, 0, 25, 0.4);
    position: relative;
    animation: codex-glow 12s ease-in-out infinite;
    transition: all 0.4s ease;
}

.codex-entry:hover {
    background: rgba(70, 0, 20, 0.25);
    border-color: rgba(177, 126, 74, 0.6);
}

@keyframes codex-glow {
    0%, 100% {
        box-shadow:
            inset 0 0 35px rgba(120, 20, 30, 0.3),
            0 4px 20px rgba(123, 0, 25, 0.4);
    }
    50% {
        box-shadow:
            inset 0 0 45px rgba(120, 20, 30, 0.4),
            0 4px 25px rgba(123, 0, 25, 0.5);
    }
}

.codex-header {
    font-family: var(--font-glitch);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: rgba(177, 126, 74, 0.5);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(177, 126, 74, 0.2);
    animation: header-flicker 8s ease-in-out infinite;
}

@keyframes header-flicker {
    0%, 90%, 100% { opacity: 0.5; }
    45%, 55% { opacity: 0.8; }
}

.codex-entry h3 {
    color: var(--rot-gold);
    margin-bottom: 1rem;
    font-family: var(--font-header) !important;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    text-shadow: 0 0 15px rgba(177, 126, 74, 0.4);
}

.codex-divider {
    height: 1px;
    width: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(177, 126, 74, 0.6) 50%,
        transparent 100%
    );
    margin: 1.5rem 0;
    box-shadow: 0 0 8px rgba(177, 126, 74, 0.3);
}

.codex-entry p {
    text-indent: 0 !important;
    color: rgba(255, 255, 255, 0.85) !important;
    font-family: var(--font-glitch) !important;
    line-height: 1.8;
    margin-bottom: 1rem;
}

.codex-entry strong {
    color: var(--rot-gold) !important;
    font-weight: 600;
    text-shadow: 0 0 8px rgba(177, 126, 74, 0.3);
}

.codex-entry em {
    color: rgba(255, 182, 193, 0.8) !important;
    font-style: italic;
}

.codex-footer {
    font-family: var(--font-glitch);
    font-size: 0.7rem;
    text-align: right;
    color: rgba(177, 126, 74, 0.4);
    margin-top: 1.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(177, 126, 74, 0.2);
    font-style: italic;
}

.codex-list {
    list-style: none;
    padding-left: 1rem;
    margin: 1rem 0;
}

.codex-list li {
    color: var(--bone-pale);
    margin: 0.5rem 0;
    font-family: var(--font-glitch) !important;
}

.codex-list li::before {
    content: "◈ ";
    color: var(--scarlet);
}

.codex-entry pre {
    font-family: var(--font-glitch);
    font-size: 0.7rem;
    color: rgba(177, 126, 74, 0.3);
    margin: 1rem 0;
    letter-spacing: 0.05em;
    overflow-x: auto;
}

/* ✦ Chronicle Voice — Narrative Prose */
.chronicle-text {
    text-align: left;
    max-width: 650px;
    margin: 0 auto;
    color: var(--bone-pale) !important;
    font-family: var(--font-body) !important;
    font-size: 1.2rem !important;
    letter-spacing: normal !important;
}

.chronicle-text p {
    margin-bottom: 1.5rem;
    color: var(--bone-pale) !important;
    font-family: var(--font-body) !important;
    text-indent: 2em;
}

.chronicle-text p:first-child {
    text-indent: 0;
}

.millicent-voice {
    border-left: 3px solid var(--scarlet);
    padding-left: 2rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--rot-gold) !important;
    text-indent: 0 !important;
    font-family: var(--font-body) !important;
}

/* ✦ Ritual Voice — Poetic Style */
.ritual-text {
    text-align: center;
    max-width: 650px;
    margin: 0 auto;
    font-family: var(--font-mantra);
    color: var(--bone-pale);
}

.ritual-text p {
    margin-bottom: 1.5rem;
    color: var(--bone-pale);
    text-indent: 0;
}

.ritual-emphasis {
    font-size: 1.5rem;
    color: var(--scarlet) !important;
    margin: 3rem 0 !important;
    font-style: italic;
}

.ritual-meditation {
    background: rgba(123, 0, 25, 0.2);
    border: 1px solid var(--scarlet);
    padding: 2rem;
    margin: 3rem 0;
    border-radius: 10px;
}

.ritual-meditation p {
    color: var(--bone-pale) !important;
    line-height: 2;
}

/* ✦ Navigation */
.nav-container {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 4rem;
}

/* ✦ Navigation Links */
.nav-link {
    display: inline-block;
    color: var(--rot-gold);
    text-decoration: none;
    font-family: var(--font-mantra);
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    border-radius: 20px;
    text-align: center;
}

section > .content > .nav-link {
    display: block;
    width: fit-content;
    margin: 3rem auto;
}

.nav-link:hover {
    color: var(--bone-pale);
    border-color: var(--rot-gold);
    transform: translateY(-2px);
}

.nav-link.entry-link,
.nav-link.return-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 4rem auto;
    position: relative;
    width: fit-content;
}

section > .content > .nav-link.entry-link,
section > .content > .nav-link.return-link {
    display: block;
    width: fit-content;
    margin: 4rem auto;
}

.nav-link.entry-link,
.nav-link.return-link {
    display: flex;
}

.link-text {
    display: inline-block;
}

.link-decoration {
    display: inline-block;
    font-size: 1.2em;
    transition: transform 0.3s ease;
}

.nav-link:hover .link-decoration {
    transform: translateY(3px);
}

.back-link:hover .link-decoration {
    transform: translateY(-3px);
}

/* ✦ Epilogue */
.epilogue-text p {
    margin-bottom: 1.5rem;
    color: var(--bone-pale);
}

.memory-garden {
    background: rgba(58, 32, 53, 0.2);
    border: 1px solid var(--violet-shadow);
    border-radius: 10px;
    padding: 2rem;
    margin: 3rem 0;
}

.memory-garden h3 {
    color: var(--rot-gold);
    margin-bottom: 1rem;
}

.offering-interface {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 2rem auto;
    max-width: 480px;
}

#memoryName {
    background: rgba(10, 0, 5, 0.6);
    border: 1px solid rgba(177, 126, 74, 0.4);
    color: var(--bone-pale);
    padding: 0.45rem 1rem;
    font-family: var(--font-body);
    font-style: italic;
    font-size: 0.95rem;
    border-radius: 20px;
}

#memoryName::placeholder {
    color: rgba(246, 239, 230, 0.4);
    font-style: italic;
}

#memoryName:focus {
    outline: none;
    border-color: var(--rot-gold);
}

/* Honeypot — invisible to humans, reachable to bots. */
.offering-trap {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

#memoryOffering {
    flex: none;
    width: 100%;
    max-width: 100%;
    background: rgba(10, 0, 5, 0.8);
    border: 1px solid var(--rot-gold);
    color: var(--bone-pale);
    padding: 0.5rem 1rem;
    font-family: var(--font-body);
    border-radius: 20px;
}

.offering-interface button {
    align-self: flex-end;
    margin-top: 0.25rem;
    background: var(--scarlet);
    color: var(--bone-pale);
    border: none;
    padding: 0.5rem 2rem;
    font-family: var(--font-header);
    letter-spacing: 0.05em;
    cursor: pointer;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.offering-interface button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(123, 0, 25, 0.4);
}

.memory-collection {
    max-height: 200px;
    overflow-y: auto;
}

.offered-memory {
    padding: 0.5rem;
    margin: 0.5rem 0;
    background: rgba(123, 0, 25, 0.1);
    border-left: 2px solid var(--scarlet);
    font-style: italic;
    color: var(--bone-pale);
    animation: memory-appear 0.5s ease;
}

@keyframes memory-appear {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.epilogue-final {
    text-align: center;
    font-size: 1.2rem;
    color: var(--rot-gold);
    margin: 3rem 0;
}

/* ✦ Resume Pilgrimage Toast */
.resume-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(10, 0, 5, 0.95);
    border: 1px solid var(--rot-gold);
    border-radius: 10px;
    padding: 1rem 1.5rem;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    opacity: 0;
    transition: all 0.6s ease;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 20px rgba(123, 0, 25, 0.4);
    max-width: 90vw;
}

.resume-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.resume-toast-text {
    font-family: var(--font-mantra);
    font-style: italic;
    color: var(--bone-pale);
    font-size: 0.95rem;
    white-space: nowrap;
}

.resume-toast-actions {
    display: flex;
    gap: 0.75rem;
}

.resume-toast-btn {
    background: transparent;
    border: 1px solid var(--rot-gold);
    color: var(--rot-gold);
    font-family: var(--font-header);
    font-size: 0.8rem;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.resume-toast-btn:hover {
    cursor: crosshair;
}

.resume-toast-btn.resume-yes {
    background: var(--scarlet);
    border-color: var(--scarlet);
    color: var(--bone-pale);
}

.resume-toast-btn.resume-yes:hover {
    box-shadow: 0 0 15px rgba(123, 0, 25, 0.6);
}

.resume-toast-btn.resume-no:hover {
    background: rgba(177, 126, 74, 0.1);
}

.signature {
    text-align: center;
    font-style: italic;
    color: var(--violet-ash);
    margin-top: 2rem;
}

/* ✦ Enhanced Typography Styles */
.fade-letter {
    display: inline-block;
    animation: letter-fade 8s ease-in-out infinite;
    animation-delay: calc(var(--i) * 0.1s);
}

.fade-letter:nth-child(1) { --i: 0; }
.fade-letter:nth-child(2) { --i: 1; }
.fade-letter:nth-child(3) { --i: 2; }
.fade-letter:nth-child(4) { --i: 3; }
.fade-letter:nth-child(5) { --i: 4; }
.fade-letter:nth-child(6) { --i: 5; }
.fade-letter:nth-child(7) { --i: 6; }
.fade-letter:nth-child(8) { --i: 7; }
.fade-letter:nth-child(9) { --i: 8; }
.fade-letter:nth-child(10) { --i: 9; }
.fade-letter:nth-child(11) { --i: 10; }
.fade-letter:nth-child(12) { --i: 11; }
.fade-letter:nth-child(13) { --i: 12; }
.fade-letter:nth-child(14) { --i: 13; }
.fade-letter:nth-child(15) { --i: 14; }
.fade-letter:nth-child(16) { --i: 15; }
.fade-letter:nth-child(17) { --i: 16; }
.fade-letter:nth-child(18) { --i: 17; }
.fade-letter:nth-child(19) { --i: 18; }
.fade-letter:nth-child(20) { --i: 19; }
.fade-letter:nth-child(21) { --i: 20; }
.fade-letter:nth-child(22) { --i: 21; }
.fade-letter:nth-child(23) { --i: 22; }
.fade-letter:nth-child(24) { --i: 23; }
.fade-letter:nth-child(25) { --i: 24; }
.fade-letter:nth-child(26) { --i: 25; }

@keyframes letter-fade {
    0%, 100% { opacity: 0.3; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-5px); }
}

.title-word {
    display: inline-block;
    animation: title-reveal 0.6s cubic-bezier(0.85, 0, 0.15, 1) both;
    animation-delay: calc(var(--i) * 0.1s);
}

.title-word:nth-child(1) { --i: 0; }
.title-word:nth-child(2) { --i: 1; }
.title-word:nth-child(3) { --i: 2; }
.title-word:nth-child(4) { --i: 3; }
.title-word:nth-child(5) { --i: 4; }
.title-word:nth-child(6) { --i: 5; }
.title-word:nth-child(7) { --i: 6; }

@keyframes title-reveal {
    from {
        opacity: 0;
        transform: translateY(20px) rotateX(90deg);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotateX(0);
    }
}

.myth-voice {
    font-family: var(--font-mantra);
    font-style: italic;
    color: var(--rot-gold);
    text-align: center;
    margin: 2rem 0;
    font-size: 1.2rem;
    opacity: 0.9;
}

.sister-name {
    color: var(--violet-ash);
    font-style: italic;
    font-weight: 500;
}

.fade-in-line {
    opacity: 0;
    animation: fade-in-up 1s ease forwards;
}

.fade-in-line.delay-1 { animation-delay: 0.3s; }
.fade-in-line.delay-2 { animation-delay: 0.6s; }

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chapter-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.1;
    z-index: 1;
    pointer-events: none;
}

.origin-texture {
    background:
        radial-gradient(circle at 20% 80%, rgba(123, 0, 25, 0.2) 0%, transparent 50%),
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 10px,
            rgba(177, 126, 74, 0.02) 10px,
            rgba(177, 126, 74, 0.02) 20px
        );
}

.awakening-texture {
    background:
        radial-gradient(circle at 80% 20%, rgba(58, 32, 53, 0.2) 0%, transparent 50%),
        repeating-conic-gradient(
            from 45deg at 50% 50%,
            transparent 0deg,
            rgba(123, 0, 25, 0.03) 20deg,
            transparent 40deg
        );
}

.pilgrimage-texture {
    background:
        linear-gradient(90deg, transparent 0%, rgba(177, 126, 74, 0.05) 50%, transparent 100%),
        radial-gradient(ellipse at top, rgba(123, 0, 25, 0.1) 0%, transparent 70%);
}

.sisters-texture {
    background:
        radial-gradient(circle at 30% 70%, rgba(123, 0, 25, 0.15) 0%, transparent 60%),
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 10px,
            rgba(177, 126, 74, 0.03) 10px,
            rgba(177, 126, 74, 0.03) 20px
        );
}

.choice-texture {
    background:
        radial-gradient(ellipse at 50% 50%, rgba(58, 32, 53, 0.2) 0%, transparent 70%),
        linear-gradient(135deg, transparent 0%, rgba(123, 0, 25, 0.05) 50%, transparent 100%);
}

.return-texture {
    background:
        linear-gradient(180deg, rgba(123, 0, 25, 0.1) 0%, transparent 50%, rgba(177, 126, 74, 0.05) 100%),
        radial-gradient(circle at 70% 30%, rgba(58, 32, 53, 0.15) 0%, transparent 60%);
}

.epilogue-texture {
    background:
        linear-gradient(180deg, transparent 0%, rgba(123, 0, 25, 0.1) 50%, transparent 100%),
        radial-gradient(ellipse at center, rgba(177, 126, 74, 0.05) 0%, transparent 70%);
}

/* ═══════════════════════════════
   THRESHOLD CHAPTER TEXTURE
   ==================================== */
.threshold-chapter {
    position: relative;
}

.threshold-chapter::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        linear-gradient(180deg, rgba(177, 126, 74, 0.03) 0%, transparent 30%, rgba(123, 0, 25, 0.05) 70%, transparent 100%),
        radial-gradient(ellipse at 30% 50%, rgba(177, 126, 74, 0.04) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 80%, rgba(123, 0, 25, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.threshold-texture {
    background:
        linear-gradient(180deg, transparent 0%, rgba(177, 126, 74, 0.08) 50%, transparent 100%),
        radial-gradient(ellipse at center, rgba(123, 0, 25, 0.04) 0%, transparent 70%);
}

.voice-intro {
    font-style: italic;
    color: var(--rot-gold);
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

.footnote {
    font-size: 0.9rem;
    color: var(--violet-ash);
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(177, 126, 74, 0.2);
}

.threshold-signature {
    margin-top: 2rem;
    text-align: right;
    font-style: italic;
    color: var(--rot-gold);
}

/* ✦ Connect Section */
.connect-text {
    text-align: center;
    max-width: 650px;
    margin: 0 auto;
}

.connect-text > p {
    margin-bottom: 1.5rem;
}

.connect-link {
    color: var(--rot-gold);
    text-decoration: none;
    border-bottom: 1px dotted var(--rot-gold);
    transition: all 0.3s ease;
}

.connect-link:hover {
    border-bottom-style: solid;
}

.connect-section {
    margin: 2.5rem 0;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(177, 126, 74, 0.15);
}

.connect-heading {
    font-family: var(--font-header);
    font-size: 1rem;
    color: var(--rot-gold);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 0.75rem;
}

.connect-description {
    font-size: 0.95rem;
    color: var(--violet-ash);
    font-style: italic;
    margin-bottom: 1.5rem;
}

.linkback-buttons {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
}

.linkback-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.linkback-item a {
    flex-shrink: 0;
    line-height: 0;
    transition: opacity 0.3s ease;
}

.linkback-item a:hover {
    opacity: 0.8;
}

.linkback-item img {
    display: block;
    border: 1px solid var(--violet-shadow);
    image-rendering: pixelated;
}

.linkback-code {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    max-width: 320px;
    width: 100%;
}

.linkback-code code {
    font-family: var(--font-glitch);
    font-size: 0.7rem;
    color: var(--violet-ash);
    background: rgba(10, 0, 5, 0.6);
    border: 1px solid var(--violet-shadow);
    border-radius: 4px;
    padding: 0.4rem 0.6rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1;
}

.copy-btn {
    background: transparent;
    border: 1px solid var(--rot-gold);
    color: var(--rot-gold);
    font-family: var(--font-glitch);
    font-size: 0.7rem;
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    letter-spacing: 0.05em;
}

.copy-btn:hover {
    background: rgba(177, 126, 74, 0.1);
    cursor: crosshair;
}

.copy-btn.copied {
    border-color: var(--scarlet);
    color: var(--scarlet);
}

.devotion-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.devotion-link {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(10, 0, 5, 0.4);
    border: 1px solid rgba(177, 126, 74, 0.15);
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.devotion-link:hover {
    background: rgba(123, 0, 25, 0.15);
    border-color: rgba(177, 126, 74, 0.35);
    transform: translateX(4px);
    cursor: crosshair;
}

.devotion-name {
    font-family: var(--font-header);
    font-size: 0.9rem;
    color: var(--rot-gold);
    letter-spacing: 0.05em;
}

.devotion-subject {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--violet-ash);
    font-style: italic;
    white-space: nowrap;
}

.placeholder-link {
    opacity: 0.4;
    pointer-events: none;
}

/* ✦ Footer Challenge Badge & Custom Tooltip */
.footer-challenge {
    margin: 0.75rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.challenge-badge {
    display: inline-block;
    position: relative;
    line-height: 0;
    transition: opacity 0.3s ease;
}

.challenge-badge img {
    display: block;
    border: 1px solid var(--violet-shadow);
    transition: border-color 0.3s ease;
}

.challenge-badge:hover img {
    border-color: var(--rot-gold);
}

.badge-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: rgba(10, 0, 5, 0.95);
    border: 1px solid var(--rot-gold);
    border-radius: 6px;
    padding: 0.4rem 0.75rem;
    font-family: var(--font-mantra);
    font-style: italic;
    font-size: 0.8rem;
    color: var(--bone-pale);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(123, 0, 25, 0.3);
    line-height: 1.4;
}

.badge-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--rot-gold);
}

.challenge-badge:hover .badge-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}


.mobile-nav-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    background: rgba(10, 0, 5, 0.9);
    border: 1px solid var(--rot-gold);
    border-radius: 50%;
    z-index: 1001;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.nav-toggle-line {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--rot-gold);
    margin: 3px 0;
    transition: all 0.3s ease;
}

.mobile-nav-toggle.active .nav-toggle-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-nav-toggle.active .nav-toggle-line:nth-child(2) {
    opacity: 0;
}

.mobile-nav-toggle.active .nav-toggle-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, var(--scarlet) 0%, var(--rot-gold) 100%);
    z-index: 1000;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(123, 0, 25, 0.6);
}

.skip-link {
    position: absolute;
    top: -100px;
    left: 10px;
    background: var(--scarlet);
    color: var(--bone-pale);
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    z-index: 10000;
    border-radius: 5px;
    font-weight: 600;
    transition: top 0.3s ease;
    box-shadow: 0 4px 12px rgba(123, 0, 25, 0.8);
}

.skip-link:focus {
    top: 10px;
    outline: 3px solid var(--rot-gold);
    outline-offset: 2px;
}

.chapter-title {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.chapter-numeral {
    font-size: 1.2em;
    color: var(--scarlet);
}

.chapter-name {
    font-size: 0.9em;
    text-transform: uppercase;
}

.shimmer.delay { animation-delay: 0.5s; }
.shimmer.delay-2 { animation-delay: 1s; }
.shimmer.delay-3 { animation-delay: 1.5s; }

.title-bloom-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    opacity: 0.3;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* ✦ Info Trigger Button */
.info-trigger {
    display: inline;
    background: none;
    border: none;
    color: var(--rot-gold);
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s ease;
}

.info-trigger:hover {
    color: var(--scarlet);
    text-decoration-style: solid;
}

/* ✦ Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10001;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 0, 5, 0.95);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: var(--deep-black);
    border: 2px solid var(--rot-gold);
    border-radius: 15px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 3rem;
    box-shadow: 0 10px 50px rgba(123, 0, 25, 0.8);
    animation: modal-appear 0.3s ease;
}

@keyframes modal-appear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--rot-gold);
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0.5rem;
}

.modal-close:hover {
    color: var(--scarlet);
    transform: rotate(90deg);
}

.modal-content h2 {
    color: var(--scarlet);
    font-family: var(--font-header);
    font-size: 2rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.modal-body p {
    margin-bottom: 1.5rem;
    line-height: 1.8;
    color: var(--bone-pale);
}

.modal-body strong {
    color: var(--rot-gold);
}

.modal-final {
    text-align: center;
    font-style: italic;
    color: var(--rot-gold);
    margin-top: 2rem;
    font-size: 1.2rem;
}

.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(58, 32, 53, 0.2);
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--scarlet);
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--rot-gold);
}

@media (max-width: 768px) {
    .mobile-nav-toggle {
        display: flex;
    }

    .sidebar-nav.mobile-visible {
        display: flex;
        background: rgba(10, 0, 5, 0.95);
        padding: 1rem;
        border-radius: 10px;
        transform: translateY(-50%) translateX(0);
    }

}
.shrine-footer {
    text-align: center;
    padding: 1.5rem 2rem;
    background:
        radial-gradient(ellipse at top, rgba(123, 0, 25, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at bottom, rgba(58, 32, 53, 0.3) 0%, transparent 60%),
        linear-gradient(180deg,
            rgba(10, 0, 5, 0.8) 0%,
            rgba(20, 10, 15, 0.9) 40%,
            rgba(30, 15, 20, 0.95) 100%
        );
    border-top: 1px solid var(--violet-shadow);
    position: relative;
}

.shrine-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--rot-gold) 20%,
        var(--scarlet) 50%,
        var(--rot-gold) 80%,
        transparent 100%
    );
    opacity: 0.3;
}

.shrine-footer p {
    color: var(--bone-pale);
    margin: 0.5rem 0;
}

.footer-title {
    color: var(--rot-gold);
    font-weight: 600;
}

.footer-condensed {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--violet-ash);
}

.footer-meta {
    font-size: 0.95rem;
    color: var(--bone-pale);
    margin-top: 0.5rem;
    font-style: italic;
}

.shrine-footer a {
    color: var(--rot-gold);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.shrine-footer a:hover {
    border-bottom-color: var(--rot-gold);
}

.footer-legal {
    font-size: 0.9rem;
    color: var(--violet-ash);
    margin-top: 1rem;
}

.rot-whisper {
    font-style: italic;
    color: var(--rot-gold);
    opacity: 0.6;
    margin-top: 1.5rem;
    animation: fade-pulse 3s ease-in-out infinite;
}

@keyframes fade-pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 0.3; }
}

/* ═══════════════════════════════
   ✦ MEDIA QUERIES
   ═══════════════════════════════ */

/* ✦ Responsive */
@media (max-width: 768px) {
    .sidebar-nav {
        display: none;
    }

    h1 { font-size: 2rem; }
    h2.chapter-title { font-size: 1.8rem; }

    .header-art-container {
        height: 250px;
    }

    .header-text-overlay {
        font-size: 1rem;
        letter-spacing: 0.2em;
        bottom: 1rem;
    }

    .voice-selector {
        flex-wrap: wrap;
    }

    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }

    .offering-interface {
        flex-direction: column;
    }

    #memoryOffering {
        max-width: 100%;
    }

    .devotion-link {
        flex-direction: column;
        gap: 0.25rem;
    }

    .badge-tooltip {
        font-size: 0.7rem;
    }
}

/* ═══════════════════════════════
   NEW EFFECTS AND ENHANCEMENTS
   ============================================ */

/* ✦ Text Decay Effect */
@keyframes text-decay {
    0% {
        filter: blur(0px) brightness(1) sepia(0);
        text-shadow: 0 0 0px var(--scarlet);
    }
    50% {
        filter: blur(0.3px) brightness(0.95) sepia(0.1);
        text-shadow: 0 0 3px var(--scarlet-fade);
    }
    100% {
        filter: blur(0px) brightness(1) sepia(0);
        text-shadow: 0 0 0px var(--scarlet);
    }
}

.emphasis-decay {
    animation: text-decay 4s ease-in-out infinite;
    display: inline-block;
}

/* ✦ Petal Fall Effect */
.petal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
    overflow: hidden;
}

.petal {
    position: absolute;
    width: 8px;
    height: 10px;
    background: var(--scarlet);
    opacity: 0;
    border-radius: 0 100% 0 100%;
    transform-origin: center;
    animation: petal-fall 15s linear infinite;
    box-shadow: 0 0 5px var(--scarlet-fade);
}

.petal:nth-child(1) { left: 10%; animation-delay: 0s; }
.petal:nth-child(2) { left: 20%; animation-delay: 3s; }
.petal:nth-child(3) { left: 30%; animation-delay: 6s; }
.petal:nth-child(4) { left: 40%; animation-delay: 9s; }
.petal:nth-child(5) { left: 50%; animation-delay: 2s; }
.petal:nth-child(6) { left: 60%; animation-delay: 5s; }
.petal:nth-child(7) { left: 70%; animation-delay: 8s; }
.petal:nth-child(8) { left: 80%; animation-delay: 11s; }
.petal:nth-child(9) { left: 90%; animation-delay: 4s; }

@keyframes petal-fall {
    0% {
        top: -10px;
        opacity: 0;
        transform: translateX(0) rotate(0deg) scale(1);
    }
    10% {
        opacity: 0.6;
    }
    50% {
        opacity: 0.4;
        transform: translateX(50px) rotate(180deg) scale(0.8);
    }
    90% {
        opacity: 0.2;
    }
    100% {
        top: 100vh;
        opacity: 0;
        transform: translateX(-50px) rotate(360deg) scale(0.6);
    }
}

/* ✦ Millicent's Whispers */
.whisper {
    position: fixed;
    font-family: var(--font-mantra);
    font-style: italic;
    color: var(--violet-ash);
    font-size: 0.9rem;
    opacity: 0;
    pointer-events: none;
    z-index: 1000;
    animation: whisper-fade 5s ease-in-out;
    text-shadow: 0 0 10px var(--scarlet-fade);
}

@keyframes whisper-fade {
    0% { opacity: 0; transform: translateY(10px); }
    20% { opacity: 0.5; transform: translateY(0); }
    80% { opacity: 0.5; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-10px); }
}

.whisper-left { left: 5%; top: 30%; }
.whisper-right { right: 5%; top: 50%; }
.whisper-center { left: 50%; top: 70%; transform: translateX(-50%); }

/* ✦ Night Decay Mode */
body.night-decay {
    background: linear-gradient(180deg,
        var(--deep-black) 0%,
        var(--violet-deep) 50%,
        var(--deep-black) 100%) !important;
}

body.night-decay .chapter-title {
    text-shadow: 0 0 20px var(--scarlet-fade);
}

body.night-decay .shimmer {
    animation-duration: 4s;
}

/* ✦ Enhanced Memory Garden */
.offered-memories {
    position: relative;
    min-height: 200px;
}

.offered-memories:empty::before {
    content: "The garden awaits its first bloom...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-style: italic;
    color: var(--violet-ash);
    opacity: 0.6;
    text-align: center;
    font-family: var(--font-mantra);
}

.offered-memory {
    transition: all 0.3s ease;
    position: relative;
    padding-left: 1.5rem;
}

.offered-memory:hover {
    transform: translateX(5px);
    color: var(--rot-gold);
}

.offered-memory::before {
    content: "❀";
    position: absolute;
    left: 0;
    color: var(--scarlet);
    opacity: 0.5;
}

/* ✦ Em-dash signature for named offerings */
.offered-memory-text {
    display: block;
}

.offered-memory-sig {
    display: block;
    margin-top: 0.35rem;
    color: var(--rot-gold);
    font-style: italic;
    font-size: 0.9rem;
    opacity: 0.85;
    letter-spacing: 0.02em;
}

/* ✦ Offering whisper — wider than standard whispers */
.whisper-offering {
    max-width: min(480px, 90vw);
    text-align: center;
    line-height: 1.5;
}

/* ✦ Enhanced Chapter Theme */
.chapter-theme {
    font-style: italic;
    color: var(--violet-ash);
    font-size: 1.2rem;
    margin-bottom: 3rem;
    text-shadow: 0 0 10px rgba(123, 0, 25, 0.2);
    opacity: 0.9;
}

/* ✦ Enhanced Signature */
.signature {
    text-align: center;
    font-style: italic;
    color: var(--violet-ash);
    margin-top: 2rem;
    opacity: 0.85;
    text-shadow: 0 0 5px var(--scarlet-fade);
}

/* ✦ Enhanced Footnotes */
.footnote {
    font-size: 0.95rem;
    font-style: italic;
    color: var(--violet-ash);
    opacity: 0.85;
    line-height: 1.6;
    margin-top: 1.5rem;
    padding-left: 1rem;
    border-left: 2px solid var(--violet-shadow);
}

/* ✦ Enhanced Interlude Pulses */
.transition-interlude {
    position: relative;
    overflow: hidden;
}

.transition-interlude::before,
.transition-interlude::after {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle,
        var(--scarlet-fade) 0%,
        transparent 50%);
    animation: interlude-pulse 8s ease-in-out infinite;
}

.transition-interlude::before {
    top: -50%;
    left: -50%;
}

.transition-interlude::after {
    bottom: -50%;
    right: -50%;
    animation-delay: 4s;
}

@keyframes interlude-pulse {
    0%, 100% {
        transform: scale(0.8) rotate(0deg);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.2) rotate(180deg);
        opacity: 0.1;
    }
}

/* ✦ Enhanced Voice Tabs */
.voice-tab {
    position: relative;
    transition: all 0.3s ease;
}

.voice-tab::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg,
        transparent,
        var(--rot-gold),
        transparent);
    transition: transform 0.3s ease;
}

.voice-tab:hover::after,
.voice-tab.active::after {
    transform: translateX(-50%) scaleX(1);
}

/* ✦ Enhanced Rot Whisper */
.rot-whisper {
    color: var(--violet-ash) !important;
    text-shadow: 0 0 5px var(--scarlet-fade);
    animation: text-decay 8s ease-in-out infinite;
}


/* ✦ Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .petal-container {
        display: none;
    }
}

/* ✦ Responsive Improvements */
@media (max-width: 768px) {
    .chapter-theme {
        font-size: 1rem;
    }

    .whisper {
        font-size: 0.8rem;
    }

    .petal-container {
        display: none;
    }
}

