/* ── FALLING.CSS — Page Tomber amoureux d'un Prince ── */

body.falling-page {
    --cream: #f8f3ea;
    --cream-2: #eee5d6;
    --stone: #ded0bd;
    --warm-gray: #8b8072;
    --dark: #182030;
    --dark-2: #263246;
    --text: #242532;
    --text-light: #6f6a67;
    --text-on-dark: #fff8ec;
    --card-bg: rgba(255, 250, 241, 0.82);
    --border: rgba(24, 32, 48, 0.12);
    --nav-bg: rgba(248, 243, 234, 0.9);
    --nav-bg-mobile: rgba(248, 243, 234, 0.98);
    --royal-ink: #182030;
    --royal-wine: #8c3e4e;
    --royal-gold: var(--accent);
    --royal-sage: var(--accent-2);
    --royal-paper: #fff8ec;
    --royal-shadow: rgba(24, 32, 48, 0.14);
    --footer-bg: #182030;
    --footer-text: #fff8ec;
}

body.falling-page[data-theme='dark'] {
    --cream: #10131b;
    --cream-2: #181d29;
    --stone: #262b38;
    --warm-gray: #b8afa3;
    --dark: #f7efe4;
    --dark-2: #fff8ec;
    --text: #f7efe4;
    --text-light: #c9beb0;
    --text-on-dark: #11151f;
    --card-bg: rgba(22, 27, 38, 0.82);
    --border: rgba(255, 248, 236, 0.14);
    --nav-bg: rgba(16, 19, 27, 0.9);
    --nav-bg-mobile: rgba(16, 19, 27, 0.98);
    --royal-ink: #f7efe4;
    --royal-gold: color-mix(in srgb, var(--accent) 82%, white);
    --royal-sage: color-mix(in srgb, var(--accent-2) 82%, white);
    --royal-paper: #181d29;
    --royal-shadow: rgba(0, 0, 0, 0.36);
    --footer-bg: #080b12;
    --footer-text: #f7efe4;
}

.falling-page .bg-blobs {
    display: none;
}

.falling-page main,
.falling-page footer {
    position: relative;
    z-index: 1;
}

body.character-modal-open {
    overflow: hidden;
}

.falling-page nav {
    border-bottom-color: color-mix(in srgb, var(--royal-gold) 22%, var(--border));
    opacity: 0;
    visibility: hidden;
    transform: translateY(-100%);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

.falling-page:hover nav,
body.falling-page:hover nav {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-inner--falling {
    max-width: 1280px;
}

.falling-page .logo,
.falling-page .section-title,
.falling-page .hero-title,
.falling-page h1,
.falling-page h2,
.falling-page h3 {
    letter-spacing: 0;
}

.falling-page .nav-links a {
    border-radius: 8px;
}

.falling-page .nav-cta {
    background: var(--royal-ink) !important;
}

.falling-page .theme-toggle,
.falling-page .menu-toggle {
    border-radius: 8px;
}

.scroll-scene {
    --scene-progress: 0;
    position: relative;
    overflow: clip;
}

.reveal-on-scroll {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.65s ease, transform 0.65s ease;
}

.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── HERO CINÉMATIQUE ── */
.hero-cinematic {
    min-height: 100svh;
    display: flex;
    align-items: center;
    padding: calc(118px + var(--safe-top)) 0 72px;
    background:
        linear-gradient(135deg, rgba(255, 248, 236, 0.96), rgba(238, 229, 214, 0.68) 44%, rgba(109, 143, 130, 0.18)),
        repeating-linear-gradient(90deg, rgba(185, 134, 66, 0.045) 0 1px, transparent 1px 72px);
}

body.falling-page[data-theme='dark'] .hero-cinematic {
    background:
        linear-gradient(135deg, rgba(16, 19, 27, 0.98), rgba(24, 29, 41, 0.86) 48%, rgba(109, 143, 130, 0.18)),
        repeating-linear-gradient(90deg, rgba(214, 168, 91, 0.05) 0 1px, transparent 1px 72px);
}

body.falling-page[data-theme='dark'] .hero-backdrop::before {
    border-color: rgba(255, 248, 236, 0.14);
}

.hero-backdrop {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.hero-backdrop::before {
    content: '';
    position: absolute;
    inset: 72px 6% 46px;
    border: 1px solid rgba(185, 134, 66, 0.26);
    border-radius: 8px;
    mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.hero-parchment {
    position: absolute;
    width: min(29rem, 38%);
    aspect-ratio: 7 / 10;
    border: 1px solid rgba(185, 134, 66, 0.2);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 248, 236, 0.82), rgba(238, 229, 214, 0.44)),
        repeating-linear-gradient(180deg, transparent 0 26px, rgba(24, 32, 48, 0.07) 27px 28px);
    box-shadow: 0 28px 80px var(--royal-shadow);
    opacity: 0.42;
    transform: translate3d(0, var(--parallax-y, 0px), 0) rotate(var(--tilt));
    will-change: transform;
}

body.falling-page[data-theme='dark'] .hero-parchment {
    border-color: rgba(255, 248, 236, 0.12);
    background:
        linear-gradient(180deg, rgba(24, 29, 41, 0.88), rgba(16, 19, 27, 0.58)),
        repeating-linear-gradient(180deg, transparent 0 26px, rgba(255, 248, 236, 0.055) 27px 28px);
    opacity: 0.32;
}

.hero-parchment--left {
    --tilt: -12deg;
    left: -8rem;
    top: 18%;
}

.hero-parchment--right {
    --tilt: 10deg;
    right: -7rem;
    bottom: 5%;
}

.hero-crown,
.hero-feather {
    position: absolute;
    color: var(--royal-gold);
    opacity: 0.22;
    transform: translate3d(0, var(--parallax-y, 0px), 0);
    will-change: transform;
}

body.falling-page[data-theme='dark'] .hero-crown,
body.falling-page[data-theme='dark'] .hero-feather {
    opacity: 0.18;
}

.hero-crown--main {
    top: 13%;
    right: 11%;
    font-size: 8rem;
}

.hero-feather {
    left: 10%;
    bottom: 13%;
    font-size: 6rem;
    color: var(--royal-wine);
}

.royal-border {
    position: absolute;
    left: 50%;
    width: min(58rem, calc(100% - 48px));
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--royal-gold), var(--royal-sage), transparent);
    transform: translateX(-50%);
}

.royal-border::before,
.royal-border::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 8px;
    height: 8px;
    border: 1px solid var(--royal-gold);
    background: var(--cream);
    transform: translateY(-50%) rotate(45deg);
}

.royal-border::before { left: 18%; }
.royal-border::after { right: 18%; }
.royal-border--top { top: 96px; }
.royal-border--bottom { bottom: 42px; }

.hero-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    gap: 56px;
    align-items: center;
}

.hero-content {
    max-width: 760px;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 8px 12px;
    border: 1px solid rgba(185, 134, 66, 0.28);
    border-radius: 8px;
    background: rgba(255, 248, 236, 0.58);
    color: var(--royal-wine);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 24px;
}

body.falling-page[data-theme='dark'] .hero-eyebrow {
    background: rgba(24, 29, 41, 0.7);
    color: var(--accent);
}

.hero-title {
    font-family: 'DM Serif Display', serif;
    font-size: 5.4rem;
    line-height: 1.02;
    color: var(--royal-ink);
    margin-bottom: 24px;
    max-width: 820px;
}

.hero-title em {
    display: block;
    font-style: italic;
    color: var(--royal-gold);
}

.hero-subtitle {
    max-width: 650px;
    font-size: 1.18rem;
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 34px;
    font-weight: 300;
}

.hero-actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.hero-actions .btn-primary,
.hero-actions .btn-secondary {
    padding: 14px 22px;
    font-size: 0.95rem;
}

.manuscript-scene {
    position: relative;
    min-height: 520px;
    padding: 32px;
    border: 1px solid rgba(185, 134, 66, 0.3);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 248, 236, 0.96), rgba(238, 229, 214, 0.78)),
        repeating-linear-gradient(180deg, transparent 0 34px, rgba(24, 32, 48, 0.07) 35px 36px);
    box-shadow: 0 32px 90px var(--royal-shadow);
    transform: perspective(900px) rotateY(var(--manuscript-rotate, 0deg)) translateY(var(--manuscript-y, 0px));
    transition: transform 0.08s linear;
}

body.falling-page[data-theme='dark'] .manuscript-scene {
    background:
        linear-gradient(180deg, rgba(24, 29, 41, 0.96), rgba(16, 19, 27, 0.88)),
        repeating-linear-gradient(180deg, transparent 0 34px, rgba(255, 248, 236, 0.06) 35px 36px);
}

.manuscript-scene::before {
    content: '';
    position: absolute;
    inset: 14px;
    border: 1px solid rgba(185, 134, 66, 0.22);
    border-radius: 6px;
    pointer-events: none;
}

.manuscript-scene__seal {
    width: 76px;
    height: 76px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(185, 134, 66, 0.5);
    border-radius: 50%;
    color: var(--royal-gold);
    background: rgba(255, 248, 236, 0.62);
    font-size: 2rem;
    margin-bottom: 30px;
    box-shadow: inset 0 0 0 8px rgba(185, 134, 66, 0.08);
}

body.falling-page[data-theme='dark'] .manuscript-scene__seal {
    background: rgba(24, 29, 41, 0.72);
}

.manuscript-scene__label {
    color: var(--royal-wine);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.manuscript-scene__title {
    max-width: 300px;
    font-family: 'DM Serif Display', serif;
    font-size: 2.1rem;
    line-height: 1.08;
    color: var(--royal-ink);
    margin-bottom: 30px;
}

.hero-stats {
    display: grid;
    gap: 12px;
}

.hero-stats div {
    display: grid;
    gap: 2px;
    padding: 12px 0;
    border-top: 1px solid rgba(24, 32, 48, 0.12);
}

body.falling-page[data-theme='dark'] .hero-stats div {
    border-top-color: rgba(255, 248, 236, 0.14);
}

.hero-stats strong {
    font-family: 'DM Serif Display', serif;
    color: var(--royal-ink);
    font-size: 1.48rem;
    line-height: 1.1;
}

.hero-stats span {
    color: var(--text-light);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.manuscript-lines {
    position: absolute;
    right: 28px;
    bottom: 30px;
    display: grid;
    gap: 9px;
    width: 150px;
    opacity: 0.5;
}

.manuscript-lines span {
    height: 2px;
    background: linear-gradient(90deg, var(--royal-gold), transparent);
}

/* ── STORY SECTION ── */
.story-section,
.characters-section,
.trajectory-section,
.versions-section {
    padding: 112px 0;
}

.story-section {
    background:
        linear-gradient(180deg, rgba(109, 143, 130, 0.12), transparent 42%),
        linear-gradient(90deg, rgba(140, 62, 78, 0.08), transparent 46%, rgba(185, 134, 66, 0.1));
}

.story-layout {
    display: grid;
    grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.28fr);
    gap: 42px;
    align-items: start;
}

.section-header {
    margin-bottom: 52px;
}

.story-copy {
    position: sticky;
    top: calc(88px + var(--safe-top));
    margin-bottom: 0;
}

.section-desc {
    font-size: 1.05rem;
    color: var(--text-light);
    line-height: 1.8;
    max-width: 650px;
    margin: 18px 0 0;
}

.section-header:not(.story-copy) {
    text-align: center;
}

.section-header:not(.story-copy) .section-desc {
    margin-left: auto;
    margin-right: auto;
}

.story-grid {
    display: grid;
    gap: 18px;
}

.story-act {
    position: relative;
    min-height: 230px;
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card-bg);
    box-shadow: 0 18px 50px rgba(24, 32, 48, 0.08);
    overflow: hidden;
}

.story-act::before {
    content: '';
    position: absolute;
    inset: 0;
    border-left: 4px solid var(--royal-gold);
    pointer-events: none;
}

.story-act::after {
    content: '';
    position: absolute;
    right: 22px;
    top: 22px;
    width: 72px;
    height: 72px;
    border: 1px solid rgba(185, 134, 66, 0.22);
    transform: rotate(45deg);
    opacity: 0.5;
}

.story-act:hover {
    border-color: rgba(185, 134, 66, 0.42);
    transform: translateY(-4px);
    box-shadow: 0 24px 64px rgba(24, 32, 48, 0.12);
}

.act-icon {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid rgba(185, 134, 66, 0.24);
    color: var(--royal-gold);
    background: rgba(255, 248, 236, 0.44);
    margin-bottom: 20px;
}

body.falling-page[data-theme='dark'] .act-icon {
    background: rgba(24, 29, 41, 0.64);
}

.act-number {
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: var(--royal-wine);
    text-transform: uppercase;
    margin-bottom: 6px;
}

.story-act h3 {
    font-family: 'DM Serif Display', serif;
    font-size: 1.65rem;
    color: var(--royal-ink);
    line-height: 1.14;
    margin-bottom: 12px;
}

.story-act p {
    color: var(--text-light);
    line-height: 1.76;
    margin-bottom: 18px;
    font-weight: 300;
}

.act-highlight {
    display: inline;
    font-family: 'DM Serif Display', serif;
    font-size: 1.08rem;
    font-style: italic;
    color: var(--royal-gold);
}

.story-timeline {
    position: relative;
    margin-top: 48px;
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: color-mix(in srgb, var(--card-bg) 82%, transparent);
    box-shadow: 0 18px 50px rgba(24, 32, 48, 0.07);
}

body.falling-page[data-theme='dark'] .story-timeline {
    background: rgba(22, 27, 38, 0.78);
}

.story-timeline::before {
    content: '';
    position: absolute;
    left: 52px;
    right: 52px;
    top: 57px;
    height: 2px;
    background: linear-gradient(90deg, var(--royal-gold), var(--royal-sage), var(--royal-wine));
    opacity: 0.62;
}

.story-timeline__list {
    position: relative;
    display: grid;
    grid-template-columns: repeat(8, minmax(112px, 1fr));
    gap: 12px;
    list-style: none;
}

.story-timeline__list li {
    position: relative;
    display: grid;
    gap: 9px;
    min-height: 182px;
    padding: 52px 8px 0;
    text-align: center;
}

.story-timeline__list span {
    position: absolute;
    left: 50%;
    top: 16px;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--royal-gold);
    border-radius: 50%;
    background: var(--royal-paper);
    color: var(--royal-gold);
    font-size: 0.68rem;
    font-weight: 800;
    transform: translateX(-50%);
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--cream) 76%, transparent);
}

body.falling-page[data-theme='dark'] .story-timeline__list span {
    background: #10131b;
    box-shadow: 0 0 0 6px rgba(16, 19, 27, 0.88);
}

.story-timeline__list h3 {
    font-family: 'DM Serif Display', serif;
    color: var(--royal-ink);
    font-size: 1rem;
    line-height: 1.15;
}

.story-timeline__list p {
    color: var(--text-light);
    font-size: 0.82rem;
    line-height: 1.45;
}

/* ── CHARACTERS SECTION ── */
.characters-section {
    background:
        linear-gradient(180deg, transparent, rgba(24, 32, 48, 0.04)),
        repeating-linear-gradient(135deg, rgba(185, 134, 66, 0.06) 0 1px, transparent 1px 32px);
}

.characters-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    max-width: 1180px;
    margin: 0 auto;
}

.character-card {
    --card-progress: 0;
    position: relative;
    min-height: 260px;
    padding: 18px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card-bg);
    backdrop-filter: blur(14px);
    text-align: center;
    overflow: hidden;
    box-shadow: 0 18px 46px rgba(24, 32, 48, 0.08);
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
    cursor: pointer;
    outline: none;
}

.character-card::before {
    content: '';
    position: absolute;
    left: 18px;
    right: 18px;
    top: 18px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--royal-gold), transparent);
}

.character-card::after {
    content: '';
    position: absolute;
    inset: 13px;
    border: 1px solid rgba(185, 134, 66, 0.16);
    border-radius: 6px;
    pointer-events: none;
}

.character-card:hover {
    border-color: rgba(185, 134, 66, 0.48);
    transform: translateY(-5px);
    box-shadow: 0 26px 70px rgba(24, 32, 48, 0.14);
}

.character-card:focus-visible {
    border-color: var(--royal-gold);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--royal-gold) 22%, transparent), 0 26px 70px rgba(24, 32, 48, 0.14);
}

.character-badge {
    width: 56px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 14px auto 12px;
    border-radius: 50%;
    border: 1px solid rgba(185, 134, 66, 0.34);
    color: var(--royal-gold);
    background: rgba(255, 248, 236, 0.58);
    font-size: 1.4rem;
    transform: translateY(var(--card-lift, 8px));
}

body.falling-page[data-theme='dark'] .character-badge {
    background: rgba(24, 29, 41, 0.66);
}

.character-card h3 {
    font-family: 'DM Serif Display', serif;
    font-size: 1.56rem;
    color: var(--royal-ink);
    margin-bottom: 6px;
    line-height: 1.18;
}

.character-role {
    min-height: 34px;
    color: var(--royal-wine);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.character-quote {
    color: var(--text-light);
    line-height: 1.65;
    font-style: italic;
    margin-bottom: 20px;
}

.character-card__hint {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 11px;
    border: 1px solid rgba(185, 134, 66, 0.24);
    border-radius: 8px;
    color: var(--royal-ink);
    background: color-mix(in srgb, var(--royal-paper) 72%, transparent);
    font-size: 0.78rem;
    font-weight: 800;
}

.character-accent {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 4px;
    transform: scaleX(var(--card-progress, 0));
    transform-origin: left;
    transition: transform 0.24s ease;
}

.accent-blue { background: linear-gradient(90deg, #416a92, #182030); }
.accent-gold { background: linear-gradient(90deg, #b98642, #dfb86d); }
.accent-green { background: linear-gradient(90deg, #6d8f82, #38584d); }
.accent-rose { background: linear-gradient(90deg, #8c3e4e, #bd7582); }

/* ── FICHES PERSONNAGES ── */
.character-modal[hidden] {
    display: none;
}

.character-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: max(22px, env(safe-area-inset-top)) 22px max(22px, env(safe-area-inset-bottom));
}

.character-modal__backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background:
        linear-gradient(135deg, rgba(24, 32, 48, 0.76), rgba(140, 62, 78, 0.42)),
        rgba(8, 10, 15, 0.64);
    cursor: pointer;
}

.character-dialog {
    position: relative;
    z-index: 1;
    width: min(920px, 100%);
    max-height: min(760px, calc(100svh - 44px));
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--royal-gold) 30%, var(--border));
    border-radius: 8px;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--royal-paper) 92%, transparent), color-mix(in srgb, var(--cream-2) 84%, transparent)),
        repeating-linear-gradient(90deg, rgba(185, 134, 66, 0.05) 0 1px, transparent 1px 48px);
    box-shadow: 0 34px 110px rgba(0, 0, 0, 0.32);
    color: var(--text);
}

body.falling-page[data-theme='dark'] .character-dialog {
    background:
        linear-gradient(135deg, rgba(22, 27, 38, 0.98), rgba(16, 19, 27, 0.96)),
        repeating-linear-gradient(90deg, rgba(214, 168, 91, 0.04) 0 1px, transparent 1px 48px);
}

.character-dialog__close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    background: color-mix(in srgb, var(--royal-paper) 82%, transparent);
    cursor: pointer;
}

.character-dialog__close:focus-visible,
.character-dialog__close:hover {
    border-color: var(--royal-gold);
    color: var(--royal-gold);
}

.character-dialog__visual {
    position: relative;
    min-height: 500px;
    max-height: min(760px, calc(100svh - 44px));
    padding: 18px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--royal-gold) transparent;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    border-right: 1px solid var(--border);
    background:
        linear-gradient(180deg, rgba(24, 32, 48, 0.08), rgba(185, 134, 66, 0.08)),
        var(--cream-2);
}

body.falling-page[data-theme='dark'] .character-dialog__visual {
    background:
        linear-gradient(180deg, rgba(255, 248, 236, 0.04), rgba(214, 168, 91, 0.08)),
        #111620;
}

.character-portrait {
    position: relative;
    min-height: 318px;
    border: 1px solid color-mix(in srgb, var(--royal-gold) 34%, var(--border));
    border-radius: 8px;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 18%, rgba(255, 248, 236, 0.72), transparent 34%),
        linear-gradient(160deg, rgba(65, 106, 146, 0.26), rgba(140, 62, 78, 0.18), rgba(185, 134, 66, 0.2));
}

.character-portrait img {
    width: 100%;
    height: 100%;
    min-height: 318px;
    display: block;
    object-fit: cover;
    object-position: center;
}

.character-portrait__fallback {
    min-height: 318px;
    display: grid;
    place-items: center;
    gap: 14px;
    align-content: center;
    color: var(--royal-gold);
}

.character-portrait__fallback i {
    font-size: 3.8rem;
    opacity: 0.42;
}

.character-portrait__fallback span {
    width: 92px;
    height: 92px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(185, 134, 66, 0.42);
    border-radius: 50%;
    font-family: 'DM Serif Display', serif;
    font-size: 2.25rem;
    color: var(--royal-ink);
    background: color-mix(in srgb, var(--royal-paper) 64%, transparent);
}

.character-cover-strip {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.character-cover-strip[hidden] {
    display: none;
}

.character-cover-ref {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: color-mix(in srgb, var(--royal-paper) 72%, transparent);
}

.character-cover-ref img {
    width: 46px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid rgba(24, 32, 48, 0.12);
}

.character-cover-ref strong {
    display: block;
    color: var(--royal-ink);
    font-size: 0.76rem;
    line-height: 1.25;
}

.character-cover-ref span {
    display: block;
    color: var(--text-light);
    font-size: 0.7rem;
    line-height: 1.3;
    margin-top: 3px;
}

.character-dialog__content {
    max-height: min(760px, calc(100svh - 44px));
    overflow: auto;
    padding: 30px 32px 28px;
    scrollbar-width: thin;
    scrollbar-color: var(--royal-gold) transparent;
}

.character-dialog__kicker {
    color: var(--royal-wine);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin: 0 42px 8px 0;
}

.character-dialog h2 {
    font-family: 'DM Serif Display', serif;
    color: var(--royal-ink);
    font-size: 2.22rem;
    line-height: 1.04;
    margin: 0 42px 12px 0;
}

.character-dialog__intro {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.62;
    margin-bottom: 14px;
}

.character-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.character-tags span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 8px;
    border: 1px solid rgba(185, 134, 66, 0.28);
    border-radius: 8px;
    color: var(--royal-ink);
    background: color-mix(in srgb, var(--royal-paper) 62%, transparent);
    font-size: 0.72rem;
    font-weight: 800;
}

.character-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.character-detail {
    padding: 11px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: color-mix(in srgb, var(--royal-paper) 66%, transparent);
}

body.falling-page[data-theme='dark'] .character-card__hint,
body.falling-page[data-theme='dark'] .character-dialog__close,
body.falling-page[data-theme='dark'] .character-cover-ref,
body.falling-page[data-theme='dark'] .character-tags span,
body.falling-page[data-theme='dark'] .character-detail {
    background: rgba(16, 19, 27, 0.62);
}

.character-detail h3 {
    font-family: 'DM Sans', sans-serif;
    color: var(--royal-wine);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    line-height: 1.28;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.character-detail p {
    color: var(--text-light);
    font-size: 0.82rem;
    line-height: 1.5;
}

.character-dialog__note {
    margin-top: 12px;
    padding: 11px 12px;
    border-left: 3px solid var(--royal-gold);
    color: var(--text-light);
    background: color-mix(in srgb, var(--royal-gold) 8%, transparent);
    font-size: 0.82rem;
    line-height: 1.5;
}

/* ── TRAJECTOIRE ── */
.trajectory-section {
    background:
        linear-gradient(180deg, rgba(24, 32, 48, 0.05), rgba(185, 134, 66, 0.09)),
        linear-gradient(90deg, transparent, rgba(109, 143, 130, 0.12), transparent);
}

.trajectory-shell {
    position: relative;
    max-width: 1040px;
    margin: 0 auto;
    padding: 18px 0 0 54px;
}

.trajectory-rail {
    position: absolute;
    left: 18px;
    top: 26px;
    bottom: 18px;
    width: 2px;
    background: rgba(185, 134, 66, 0.22);
}

.trajectory-progress {
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, var(--royal-gold), var(--royal-wine), var(--royal-sage));
    transform-origin: top;
    transform: scaleY(var(--trajectory-progress, 0));
    transition: transform 0.08s linear;
}

.trajectory-milestones {
    display: grid;
    gap: 18px;
}

.trajectory-card {
    position: relative;
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr) auto;
    gap: 22px;
    align-items: center;
    min-height: 150px;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card-bg);
    box-shadow: 0 18px 50px rgba(24, 32, 48, 0.08);
}

.trajectory-card::before {
    content: '';
    position: absolute;
    left: -44px;
    top: 50%;
    width: 18px;
    height: 18px;
    border: 3px solid var(--cream);
    border-radius: 50%;
    background: var(--royal-gold);
    box-shadow: 0 0 0 1px rgba(185, 134, 66, 0.42);
    transform: translateY(-50%) scale(0.8);
    transition: background 0.2s ease, transform 0.2s ease;
}

.trajectory-card.is-visible::before,
.trajectory-card.is-active::before {
    background: var(--royal-wine);
    transform: translateY(-50%) scale(1);
}

.trajectory-date {
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: start;
    font-family: 'DM Serif Display', serif;
    color: var(--royal-gold);
    font-size: 1.25rem;
    line-height: 1.12;
}

.trajectory-card h3 {
    grid-column: 2;
    grid-row: 1;
    align-self: end;
    font-family: 'DM Serif Display', serif;
    color: var(--royal-ink);
    font-size: 1.44rem;
    line-height: 1.16;
    margin-bottom: 8px;
}

.trajectory-card p {
    grid-column: 2;
    grid-row: 2;
    color: var(--text-light);
    line-height: 1.66;
}

.trajectory-chip {
    grid-column: 3;
    grid-row: 1 / span 2;
    align-self: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 130px;
    padding: 9px 12px;
    border: 1px solid rgba(185, 134, 66, 0.28);
    border-radius: 8px;
    color: var(--royal-ink);
    background: rgba(255, 248, 236, 0.52);
    font-size: 0.82rem;
    font-weight: 800;
    white-space: nowrap;
}

body.falling-page[data-theme='dark'] .trajectory-chip {
    background: rgba(24, 29, 41, 0.68);
}

/* ── LECTEUR DE VERSIONS ── */
.versions-section {
    background:
        linear-gradient(180deg, rgba(255, 248, 236, 0.2), rgba(109, 143, 130, 0.12)),
        repeating-linear-gradient(90deg, rgba(24, 32, 48, 0.04) 0 1px, transparent 1px 58px);
}

.reader-layout {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.panel,
.reader-shell {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card-bg);
    backdrop-filter: blur(14px);
    box-shadow: 0 20px 58px rgba(24, 32, 48, 0.08);
}

.panel {
    padding: 20px;
    position: sticky;
    top: calc(88px + var(--safe-top));
}

.input-label {
    display: block;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--royal-wine);
    margin-bottom: 9px;
}

.field {
    width: 100%;
    min-height: 46px;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--royal-paper);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.92rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.field:focus {
    border-color: var(--royal-gold);
    box-shadow: 0 0 0 3px rgba(185, 134, 66, 0.18);
}

.version-list {
    display: grid;
    gap: 10px;
    max-height: 348px;
    overflow: auto;
    padding-right: 2px;
    scrollbar-width: thin;
    scrollbar-color: rgba(185, 134, 66, 0.86) rgba(238, 229, 214, 0.86);
}

.version-list::-webkit-scrollbar { width: 10px; }
.version-list::-webkit-scrollbar-track {
    background: rgba(238, 229, 214, 0.86);
    border-radius: 999px;
    border: 1px solid rgba(24, 32, 48, 0.08);
}
.version-list::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--royal-gold), var(--royal-sage));
    border-radius: 999px;
    border: 2px solid rgba(238, 229, 214, 0.95);
}

.version-item {
    width: 100%;
    text-align: left;
    border: 1px solid var(--border);
    background: var(--royal-paper);
    border-radius: 8px;
    padding: 12px 13px;
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.version-item:hover {
    background: var(--cream-2);
    transform: translateY(-1px);
}

.version-item:focus-visible {
    outline: none;
    border-color: var(--royal-gold);
    box-shadow: 0 0 0 3px rgba(185, 134, 66, 0.2);
}

.version-item.is-active {
    background: linear-gradient(120deg, rgba(185, 134, 66, 0.16), rgba(109, 143, 130, 0.16));
    border-color: rgba(185, 134, 66, 0.72);
    box-shadow: 0 10px 24px rgba(24, 32, 48, 0.08);
}

.version-item-name {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.34;
}

.version-item-meta {
    display: block;
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 4px;
}

.version-empty {
    padding: 14px;
    border-radius: 8px;
    border: 1px dashed var(--border);
    color: var(--text-light);
    font-size: 0.9rem;
    text-align: center;
}

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.status {
    margin-top: 12px;
    font-size: 0.9rem;
    color: var(--text-light);
}

.status.ok { color: #3f8c59; }
.status.error { color: #c25a62; }

.version-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.meta-chip {
    border: 1px solid var(--border);
    background: var(--cream-2);
    color: var(--text-light);
    border-radius: 8px;
    font-size: 0.78rem;
    padding: 6px 10px;
}

.reader-shell {
    min-height: 590px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
}

.reader-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
}

.reader-title {
    font-family: 'DM Serif Display', serif;
    color: var(--royal-ink);
    font-size: 1.16rem;
    line-height: 1.2;
}

.reader-hint {
    color: var(--text-light);
    font-size: 0.85rem;
}

.reader-content {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--royal-paper);
    padding: 16px;
    overflow: auto;
    white-space: pre-wrap;
    line-height: 1.7;
    font-size: 0.95rem;
    color: var(--text);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.empty-reader-state {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    text-align: center;
    color: var(--text-light);
}

.empty-reader-state i {
    color: var(--royal-gold);
    font-size: 2.4rem;
    opacity: 0.74;
}

.reader-frame {
    width: 100%;
    height: 100%;
    min-height: 500px;
    border: 0;
    border-radius: 8px;
    background: #fff;
}

.local-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    text-align: center;
    padding: 40px 24px;
    border: 1px dashed var(--border);
    border-radius: 8px;
    color: var(--text-light);
}

.local-placeholder i {
    font-size: 2.8rem;
    color: var(--royal-gold);
}

.local-placeholder p {
    font-size: 0.95rem;
    line-height: 1.6;
    max-width: 340px;
}

.local-placeholder .btn-primary {
    font-size: 1rem;
    padding: 13px 24px;
}

.falling-page footer {
    margin-top: 0;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--footer-bg) 92%, black), var(--footer-bg));
    color: var(--footer-text);
    border-top: 0;
}

.falling-page .footer-logo,
.falling-page footer p,
.falling-page .footer-version-btn {
    color: var(--footer-text);
}

.falling-page .footer-logo em {
    color: var(--accent);
    font-style: italic;
}

.falling-page .footer-version-btn {
    border-color: rgba(255, 248, 236, 0.18);
    background: rgba(255, 248, 236, 0.08);
    border-radius: 8px;
}

.falling-page .footer-version-btn:hover {
    background: rgba(255, 248, 236, 0.14);
}

/* ── MODE SOMBRE ── */
body.falling-page[data-theme='dark'] .royal-border::before,
body.falling-page[data-theme='dark'] .royal-border::after {
    background: var(--cream);
}

body.falling-page[data-theme='dark'] .story-act,
body.falling-page[data-theme='dark'] .character-card,
body.falling-page[data-theme='dark'] .trajectory-card,
body.falling-page[data-theme='dark'] .panel,
body.falling-page[data-theme='dark'] .reader-shell {
    box-shadow: 0 22px 64px rgba(0, 0, 0, 0.24);
}

body.falling-page[data-theme='dark'] .field,
body.falling-page[data-theme='dark'] .reader-content,
body.falling-page[data-theme='dark'] .version-item {
    background: #141923;
    color: var(--text);
}

body.falling-page[data-theme='dark'] .version-item:hover {
    background: #1c2330;
}

body.falling-page[data-theme='dark'] .version-list {
    scrollbar-color: rgba(214, 168, 91, 0.9) rgba(38, 43, 56, 0.95);
}

body.falling-page[data-theme='dark'] .version-list::-webkit-scrollbar-track {
    background: rgba(38, 43, 56, 0.95);
    border-color: rgba(255, 255, 255, 0.08);
}

body.falling-page[data-theme='dark'] .version-list::-webkit-scrollbar-thumb {
    border-color: rgba(38, 43, 56, 0.95);
}

/* ── RESPONSIVE ── */
@media (max-width: 1120px) {
    .falling-page .logo {
        font-size: 1.1rem;
    }

    .falling-page .nav-links a {
        padding: 8px 9px;
        font-size: 0.82rem;
    }

    .hero-title {
        font-size: 4.4rem;
    }

    .characters-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .reader-layout {
        grid-template-columns: 320px minmax(0, 1fr);
    }
}

@media (max-width: 920px) {
    .hero-layout,
    .story-layout,
    .reader-layout {
        grid-template-columns: 1fr;
    }

    .hero-content {
        max-width: none;
    }

    .manuscript-scene {
        min-height: 360px;
        transform: translateY(0);
    }

    .story-copy,
    .panel {
        position: relative;
        top: auto;
    }

    .story-copy {
        text-align: center;
    }

    .story-copy .section-desc {
        margin-left: auto;
        margin-right: auto;
    }

    .story-timeline__list {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .story-timeline::before {
        left: 35px;
        right: auto;
        top: 42px;
        bottom: 42px;
        width: 2px;
        height: auto;
        background: linear-gradient(180deg, var(--royal-gold), var(--royal-sage), var(--royal-wine));
    }

    .story-timeline__list li {
        min-height: auto;
        padding: 12px 0 18px 54px;
        text-align: left;
    }

    .story-timeline__list span {
        left: 0;
        top: 11px;
        transform: none;
    }

    .character-dialog {
        grid-template-columns: 1fr;
        overflow: auto;
    }

    .character-dialog__visual {
        min-height: auto;
        display: grid;
        grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
        gap: 14px;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .character-portrait,
    .character-portrait img,
    .character-portrait__fallback {
        min-height: 300px;
    }

    .character-cover-strip {
        margin-top: 0;
        align-content: start;
    }

    .character-dialog__content {
        max-height: none;
    }

    .trajectory-card {
        grid-template-columns: 128px minmax(0, 1fr);
    }

    .trajectory-date {
        grid-column: 1;
        grid-row: 1 / span 2;
    }

    .trajectory-card h3 {
        grid-column: 2;
        grid-row: 1;
    }

    .trajectory-card p {
        grid-column: 2;
        grid-row: 2;
    }

    .trajectory-chip {
        justify-self: start;
        grid-column: 2;
        grid-row: 3;
    }
}

@media (max-width: 768px) {
    .falling-page .nav-links a {
        border-radius: 8px;
    }

    .hero-cinematic {
        min-height: auto;
        padding: calc(96px + var(--safe-top)) 0 58px;
    }

    .hero-layout {
        gap: 34px;
    }

    .hero-title {
        font-size: 3.28rem;
    }

    .hero-subtitle {
        font-size: 1.02rem;
        margin-bottom: 28px;
    }

    .hero-actions {
        flex-direction: column;
    }

    .hero-actions .btn-primary,
    .hero-actions .btn-secondary {
        width: 100%;
        justify-content: center;
    }

    .hero-crown--main {
        right: 4%;
        top: 96px;
        font-size: 5rem;
    }

    .hero-feather,
    .hero-parchment {
        display: none;
    }

    .royal-border {
        width: calc(100% - 32px);
    }

    .story-section,
    .characters-section,
    .trajectory-section,
    .versions-section {
        padding: 78px 0;
    }

    .section-header {
        margin-bottom: 36px;
    }

    .section-title {
        font-size: 2.55rem;
    }

    .section-desc {
        font-size: 1rem;
    }

    .story-act,
    .story-timeline,
    .character-card,
    .trajectory-card,
    .panel,
    .reader-shell {
        padding: 20px;
    }

    .characters-grid {
        grid-template-columns: 1fr;
    }

    .character-card {
        min-height: 280px;
    }

    .character-modal {
        padding: 12px;
    }

    .character-dialog {
        max-height: calc(100svh - 24px);
    }

    .character-dialog__visual {
        grid-template-columns: 1fr;
        padding: 18px;
    }

    .character-dialog__content {
        padding: 26px 20px 22px;
    }

    .character-dialog h2 {
        font-size: 2rem;
        margin-right: 42px;
    }

    .character-detail-grid {
        grid-template-columns: 1fr;
    }

    .trajectory-shell {
        padding-left: 38px;
    }

    .trajectory-rail {
        left: 12px;
    }

    .trajectory-card {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .trajectory-card::before {
        left: -35px;
    }

    .trajectory-date,
    .trajectory-card h3,
    .trajectory-card p {
        grid-column: auto;
        grid-row: auto;
    }

    .trajectory-chip {
        grid-column: auto;
        grid-row: auto;
    }

    .reader-shell {
        min-height: 460px;
    }

    .reader-header {
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .hero-cinematic {
        padding: calc(82px + var(--safe-top)) 0 44px;
    }

    .hero-eyebrow {
        font-size: 0.7rem;
        line-height: 1.35;
    }

    .hero-title {
        font-size: 2.55rem;
    }

    .manuscript-scene {
        min-height: 330px;
        padding: 24px;
    }

    .manuscript-scene__title {
        font-size: 1.76rem;
    }

    .hero-stats strong {
        font-size: 1.24rem;
    }

    .character-dialog__close {
        top: 10px;
        right: 10px;
    }

    .character-dialog__kicker {
        margin-right: 42px;
    }

    .character-portrait,
    .character-portrait img,
    .character-portrait__fallback {
        min-height: 220px;
    }

    .story-section,
    .characters-section,
    .trajectory-section,
    .versions-section {
        padding: 62px 0;
    }

    .section-title {
        font-size: 2.08rem;
    }

    .story-act h3,
    .trajectory-card h3 {
        font-size: 1.32rem;
    }

    .actions,
    .falling-page .footer-inner {
        align-items: stretch;
    }

    .actions .btn-secondary,
    .local-placeholder .btn-primary,
    .falling-page .footer-version-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .reveal-on-scroll {
        opacity: 1;
        transform: none;
    }

    .hero-parchment,
    .hero-crown,
    .hero-feather,
    .manuscript-scene {
        transform: none !important;
    }

    .trajectory-progress {
        height: 100%;
    }
}
