/* ============================================================
   storiographer.com — A Cartographer's Workshop for Narratives
   Palette:
     #1a1410 Midnight Walnut (deep bg)
     #d4c5a9 Aged Parchment (primary surface)
     #2c2418 Dark Sepia Ink (text)
     #c4453a Vermillion Wax Seal
     #b8963e Brass Instrument
     #2a6b63 Cartographer's Teal
     #e8b84a Lantern Amber
     #5a6e7a Faded Ink Blue
   Fonts: Cormorant Garamond, Crimson Text, IM Fell English, Courier Prime
   ============================================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Crimson Text", Georgia, serif;
    font-size: 17px;
    line-height: 28px;
    color: #2c2418;
    background-color: #1a1410;
    overflow-x: hidden;
    position: relative;
}

/* ---- Lantern reveal sequence ---- */
.lantern-reveal {
    position: fixed;
    inset: 0;
    background: #1a1410;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: opacity 1.2s ease 0.4s;
}

.lantern-reveal.is-fading {
    opacity: 0;
}

.lantern-reveal.is-gone {
    display: none;
}

.lantern-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 50%,
        rgba(232, 184, 74, 0.55) 0%,
        rgba(184, 150, 62, 0.35) 12%,
        rgba(28, 20, 14, 0.85) 35%,
        rgba(26, 20, 16, 1) 70%);
    transform: scale(0);
    transform-origin: center;
    animation: lanternBloom 2.4s ease-out forwards;
}

@keyframes lanternBloom {
    0%   { transform: scale(0); opacity: 0; }
    20%  { opacity: 1; }
    100% { transform: scale(2.5); opacity: 1; }
}

.lantern-logo {
    position: relative;
    width: 200px;
    height: 200px;
    z-index: 2;
    filter: drop-shadow(0 0 18px rgba(232, 184, 74, 0.6));
}

.logo-path,
.logo-quill,
.logo-ring,
.logo-ring-inner {
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    animation: drawLogo 2.5s ease-out 0.4s forwards;
}

.logo-quill {
    animation-delay: 1.2s;
}

@keyframes drawLogo {
    to { stroke-dashoffset: 0; }
}

/* ---- Background parchment plane ---- */
.bg-parchment {
    position: fixed;
    inset: -10vh -5vw;
    z-index: -3;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(184, 150, 62, 0.12), transparent 55%),
        radial-gradient(ellipse at 80% 70%, rgba(196, 69, 58, 0.08), transparent 50%),
        radial-gradient(ellipse at 50% 50%, #d4c5a9 0%, #c8b89a 60%, #b8a888 100%);
    will-change: transform;
}

.bg-parchment::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(0deg,
            rgba(44, 36, 24, 0.025) 0px,
            rgba(44, 36, 24, 0.025) 1px,
            transparent 1px,
            transparent 3px),
        repeating-linear-gradient(90deg,
            rgba(44, 36, 24, 0.025) 0px,
            rgba(44, 36, 24, 0.025) 1px,
            transparent 1px,
            transparent 3px);
    mix-blend-mode: multiply;
}

.bg-parchment::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 13% 22%, rgba(44, 36, 24, 0.08), transparent 4%),
        radial-gradient(circle at 67% 41%, rgba(44, 36, 24, 0.06), transparent 3%),
        radial-gradient(circle at 28% 78%, rgba(184, 150, 62, 0.10), transparent 5%),
        radial-gradient(circle at 89% 88%, rgba(44, 36, 24, 0.07), transparent 4%),
        radial-gradient(circle at 52% 12%, rgba(196, 69, 58, 0.05), transparent 3%);
    pointer-events: none;
}

.bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(44, 36, 24, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(44, 36, 24, 0.04) 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0.6;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

.bg-foxing {
    position: absolute;
    border-radius: 50%;
    filter: blur(12px);
    opacity: 0.5;
}

.foxing-1 { top: 8%;  left: 12%; width: 180px; height: 140px; background: radial-gradient(circle, rgba(184, 150, 62, 0.35), transparent 70%); }
.foxing-2 { top: 35%; left: 78%; width: 220px; height: 180px; background: radial-gradient(circle, rgba(196, 69, 58, 0.2), transparent 70%); }
.foxing-3 { top: 62%; left: 8%;  width: 240px; height: 200px; background: radial-gradient(circle, rgba(44, 36, 24, 0.25), transparent 70%); }
.foxing-4 { top: 88%; left: 72%; width: 200px; height: 160px; background: radial-gradient(circle, rgba(184, 150, 62, 0.3), transparent 70%); }

.bg-compass-fragment {
    position: absolute;
    width: 320px;
    height: 320px;
    opacity: 0.18;
    pointer-events: none;
}

.frag-tl { top: -60px; left: -60px; }
.frag-br { bottom: -80px; right: -80px; transform: rotate(45deg); }

/* ---- Decorative overlay plane ---- */
.overlay-plane {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    will-change: transform;
}

.overlay-route {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ---- Top navigation ---- */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    padding: 18px 36px;
    background: linear-gradient(180deg,
        rgba(26, 20, 16, 0.92) 0%,
        rgba(26, 20, 16, 0.78) 70%,
        rgba(26, 20, 16, 0) 100%);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.topbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1480px;
    margin: 0 auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #d4c5a9;
}

.brand-mark {
    width: 32px;
    height: 32px;
}

.brand-text {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 22px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #d4c5a9;
}

.topnav {
    display: flex;
    gap: 28px;
}

.topnav-link {
    font-family: "IM Fell English", Georgia, serif;
    font-size: 14px;
    color: #d4c5a9;
    text-decoration: none;
    letter-spacing: 0.06em;
    position: relative;
    padding: 4px 0;
    transition: color 0.4s ease;
}

.topnav-link::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: #e8b84a;
    clip-path: inset(0 100% 0 0);
    transition: clip-path 0.5s cubic-bezier(0.65, 0, 0.35, 1);
}

.topnav-link:hover {
    color: #e8b84a;
}

.topnav-link:hover::after {
    clip-path: inset(0 0 0 0);
}

.topnav-link.is-active {
    color: #e8b84a;
}

.topnav-link.is-active::after {
    clip-path: inset(0 0 0 0);
}

/* ---- Sidebar waypoints ---- */
.waypoint-sidebar {
    position: fixed;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    z-index: 40;
    padding: 18px 12px 18px 18px;
    background: rgba(26, 20, 16, 0.0);
    transition: background 0.4s ease;
}

.waypoint-sidebar:hover {
    background: rgba(26, 20, 16, 0.85);
}

.waypoint-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.waypoint-list a {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: #d4c5a9;
    font-family: "IM Fell English", Georgia, serif;
    font-size: 13px;
    letter-spacing: 0.05em;
}

.wp-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #5a6e7a;
    border: 1px solid #d4c5a9;
    flex-shrink: 0;
    transition: background 0.3s ease, transform 0.3s ease;
}

.waypoint-list a:hover .wp-dot,
.waypoint-list a.is-active .wp-dot {
    background: #c4453a;
    transform: scale(1.3);
    box-shadow: 0 0 10px rgba(232, 184, 74, 0.6);
}

.wp-label {
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    white-space: nowrap;
}

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

/* ---- Content plane ---- */
.content-plane {
    position: relative;
    z-index: 1;
    max-width: 1280px;
    margin: 0 auto;
    padding: 120px 80px 80px;
}

.chapter {
    position: relative;
    padding: 80px 60px 100px;
    margin-bottom: 60px;
    border: 1px solid rgba(44, 36, 24, 0.25);
    background:
        linear-gradient(180deg, rgba(212, 197, 169, 0.55) 0%, rgba(212, 197, 169, 0.35) 100%);
    box-shadow:
        0 1px 0 rgba(232, 184, 74, 0.2) inset,
        0 0 30px rgba(26, 20, 16, 0.08);
}

.chapter::before {
    content: "";
    position: absolute;
    inset: 12px;
    border: 0.5px solid rgba(44, 36, 24, 0.3);
    pointer-events: none;
}

.watermark {
    position: absolute;
    top: 30px;
    right: 50px;
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 220px;
    color: #2c2418;
    opacity: 0.05;
    line-height: 1;
    pointer-events: none;
    user-select: none;
    font-weight: 400;
    letter-spacing: 0.02em;
}

.chapter-marker {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 36px;
}

.marker-numeral {
    font-family: "IM Fell English", Georgia, serif;
    font-size: 14px;
    color: #c4453a;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.marker-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, #c4453a 0%, rgba(196, 69, 58, 0.3) 60%, transparent 100%);
    max-width: 200px;
}

.title-primary {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 72px;
    line-height: 1.05;
    font-weight: 500;
    color: #2c2418;
    letter-spacing: 0.04em;
    margin-bottom: 24px;
}

.title-section {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 52px;
    line-height: 1.1;
    font-weight: 500;
    color: #2c2418;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 18px;
    position: relative;
    padding-bottom: 18px;
}

.title-section::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 120px;
    height: 1px;
    background: #2c2418;
}

.title-section::before {
    content: "";
    position: absolute;
    bottom: -3px;
    left: 56px;
    width: 8px;
    height: 8px;
    background: #c4453a;
    transform: rotate(45deg);
}

.title-sub {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 22px;
    line-height: 1.5;
    font-style: italic;
    color: #2c2418;
    margin-bottom: 24px;
    max-width: 640px;
}

.section-lede {
    font-family: "Crimson Text", Georgia, serif;
    font-size: 19px;
    line-height: 32px;
    font-style: italic;
    color: #2c2418;
    margin-bottom: 56px;
    max-width: 720px;
}

/* ---- Chapter I — Overture ---- */
.chapter-overture {
    min-height: 80vh;
    padding-top: 100px;
}

.overture-grid {
    display: grid;
    grid-template-columns: 1.4fr 0.6fr;
    grid-template-rows: auto auto;
    gap: 40px 60px;
    margin-top: 30px;
}

.overture-lead {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
}

.overture-quote {
    grid-column: 1 / 2;
    grid-row: 2 / 3;
    border-left: 1px solid #c4453a;
    padding: 24px 0 24px 32px;
    max-width: 640px;
}

.ornament-rule {
    width: 200px;
    height: 12px;
    margin-bottom: 16px;
    display: block;
}

.pull-quote {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 28px;
    line-height: 1.4;
    font-style: italic;
    color: #2c2418;
    margin-bottom: 12px;
}

.quote-attribution {
    font-family: "IM Fell English", Georgia, serif;
    font-size: 14px;
    color: #5a6e7a;
    letter-spacing: 0.06em;
}

.overture-aside {
    grid-column: 2 / 3;
    grid-row: 1 / 3;
    align-self: center;
    padding: 24px;
    border-top: 1px solid rgba(44, 36, 24, 0.3);
    border-bottom: 1px solid rgba(44, 36, 24, 0.3);
    transform: rotate(-1deg);
    background: rgba(232, 184, 74, 0.06);
    position: relative;
}

.aside-label {
    font-family: "IM Fell English", Georgia, serif;
    font-style: italic;
    font-size: 13px;
    color: #c4453a;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
}

.aside-text {
    font-family: "IM Fell English", Georgia, serif;
    font-size: 16px;
    line-height: 1.6;
    color: #2c2418;
    font-style: italic;
    opacity: 0.85;
}

/* ---- Ornate divider ---- */
.chapter-divider {
    display: flex;
    justify-content: center;
    padding: 30px 0;
}

.divider-svg {
    width: 600px;
    max-width: 80%;
    height: 24px;
}

/* ---- Chapter II — Craft ---- */
.craft-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px 60px;
    margin-top: 40px;
}

.craft-card {
    position: relative;
    padding: 30px 32px 36px;
    background: rgba(212, 197, 169, 0.45);
    border: 1px solid rgba(44, 36, 24, 0.2);
    transition: transform 0.5s cubic-bezier(0.65, 0, 0.35, 1), box-shadow 0.5s ease;
}

.craft-card::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 24px 24px 0;
    border-color: transparent rgba(44, 36, 24, 0.18) transparent transparent;
    transition: border-width 0.4s ease;
}

.craft-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(26, 20, 16, 0.18);
}

.craft-card:hover::before {
    border-width: 0 36px 36px 0;
    border-color: transparent rgba(232, 184, 74, 0.35) transparent transparent;
}

.wax-seal {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 30%, #e0584d 0%, #c4453a 50%, #8a2e26 100%);
    box-shadow:
        inset -3px -3px 6px rgba(0, 0, 0, 0.4),
        inset 3px 3px 6px rgba(255, 255, 255, 0.15),
        0 4px 12px rgba(26, 20, 16, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    position: relative;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.wax-seal::before {
    content: "";
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: radial-gradient(circle, transparent 65%, rgba(196, 69, 58, 0.35) 75%, transparent 100%);
    z-index: -1;
}

.wax-seal svg {
    width: 36px;
    height: 36px;
}

.craft-card:hover .wax-seal {
    transform: rotate(-8deg);
    box-shadow:
        inset -3px -3px 6px rgba(0, 0, 0, 0.4),
        inset 3px 3px 6px rgba(255, 255, 255, 0.15),
        0 4px 18px rgba(232, 184, 74, 0.7);
}

.card-title {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 32px;
    font-weight: 500;
    color: #2c2418;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
}

.card-meta {
    font-family: "IM Fell English", Georgia, serif;
    font-size: 14px;
    font-style: italic;
    color: #5a6e7a;
    letter-spacing: 0.04em;
    margin-bottom: 16px;
}

.card-body {
    font-family: "Crimson Text", Georgia, serif;
    font-size: 16.5px;
    line-height: 27px;
    color: #2c2418;
}

/* ---- Chapter III — Atlas ---- */
.atlas-spread {
    display: grid;
    grid-template-columns: 0.35fr 0.65fr;
    gap: 60px;
    margin-top: 40px;
}

.atlas-legend {
    position: sticky;
    top: 100px;
    align-self: start;
    padding: 28px 24px;
    border: 0.5px solid rgba(44, 36, 24, 0.4);
    background: rgba(232, 184, 74, 0.08);
}

.legend-label {
    font-family: "IM Fell English", Georgia, serif;
    font-size: 14px;
    font-style: italic;
    color: #c4453a;
    letter-spacing: 0.08em;
    margin-bottom: 16px;
}

.legend-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 22px;
}

.legend-list li {
    font-family: "IM Fell English", Georgia, serif;
    font-size: 14px;
    color: #2c2418;
    display: flex;
    align-items: center;
    gap: 12px;
}

.legend-mark {
    width: 24px;
    height: 6px;
    flex-shrink: 0;
}

.mark-shore  { background: repeating-linear-gradient(90deg, #2a6b63 0 3px, transparent 3px 6px); }
.mark-ridge  { background: repeating-linear-gradient(90deg, #2c2418 0 6px, transparent 6px 9px); }
.mark-river  { background: linear-gradient(90deg, #5a6e7a, #2a6b63); height: 2px; align-self: center; }
.mark-canyon { background: repeating-linear-gradient(90deg, #c4453a 0 2px, transparent 2px 5px); }

.legend-contour {
    width: 100%;
    height: auto;
    margin-top: 16px;
    display: block;
}

.atlas-entries {
    display: flex;
    flex-direction: column;
    gap: 50px;
}

.atlas-entry {
    position: relative;
    padding-left: 56px;
    border-bottom: 0.5px solid rgba(44, 36, 24, 0.2);
    padding-bottom: 32px;
}

.entry-numeral {
    position: absolute;
    left: 0;
    top: 4px;
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 38px;
    font-weight: 500;
    color: #c4453a;
    line-height: 1;
    letter-spacing: 0.04em;
}

.entry-title {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 30px;
    font-weight: 500;
    color: #2c2418;
    letter-spacing: 0.04em;
    margin-bottom: 14px;
}

.entry-text {
    font-family: "Crimson Text", Georgia, serif;
    font-size: 17px;
    line-height: 28px;
    color: #2c2418;
    margin-bottom: 14px;
}

.entry-coord {
    font-family: "Courier Prime", monospace;
    font-size: 13px;
    line-height: 22px;
    color: #5a6e7a;
    letter-spacing: 0.04em;
}

/* ---- Chapter IV — Marginalia ---- */
.marginalia-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 36px 32px;
    margin-top: 40px;
}

.margin-note {
    padding: 24px 22px;
    background: rgba(232, 184, 74, 0.10);
    border-top: 1px solid rgba(44, 36, 24, 0.25);
    border-bottom: 1px solid rgba(44, 36, 24, 0.25);
    transition: transform 0.5s ease, background 0.5s ease;
    position: relative;
}

.margin-note::before {
    content: "";
    position: absolute;
    top: -8px;
    left: 18px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #e0584d 0%, #c4453a 60%, #8a2e26 100%);
    box-shadow: 0 2px 6px rgba(26, 20, 16, 0.4);
}

.note-1 { transform: rotate(-1.5deg); }
.note-2 { transform: rotate(1deg); }
.note-3 { transform: rotate(-0.6deg); }
.note-4 { transform: rotate(1.5deg); }
.note-5 { transform: rotate(-1deg); }
.note-6 { transform: rotate(0.8deg); }

.margin-note:hover {
    transform: rotate(0deg) translateY(-3px);
    background: rgba(232, 184, 74, 0.18);
}

.margin-text {
    font-family: "IM Fell English", Georgia, serif;
    font-size: 16px;
    line-height: 1.55;
    font-style: italic;
    color: #2c2418;
    margin-bottom: 14px;
}

.margin-hand {
    font-family: "IM Fell English", Georgia, serif;
    font-size: 13px;
    color: #5a6e7a;
    letter-spacing: 0.04em;
    text-align: right;
}

/* ---- Chapter V — Correspondence ---- */
.correspondence-spread {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 60px;
    margin-top: 40px;
    margin-bottom: 60px;
}

.letter-block {
    padding: 36px 40px;
    border: 0.5px solid rgba(44, 36, 24, 0.3);
    background: rgba(212, 197, 169, 0.6);
    box-shadow: 0 4px 14px rgba(26, 20, 16, 0.1);
}

.letter-salutation {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 22px;
    font-style: italic;
    color: #2c2418;
    margin-bottom: 18px;
}

.letter-body {
    font-family: "Crimson Text", Georgia, serif;
    font-size: 17px;
    line-height: 30px;
    color: #2c2418;
    margin-bottom: 24px;
}

.letter-signoff {
    font-family: "IM Fell English", Georgia, serif;
    font-size: 16px;
    font-style: italic;
    color: #2c2418;
    line-height: 1.6;
}

.contact-card {
    padding: 32px 28px;
    border: 0.5px solid rgba(44, 36, 24, 0.4);
    background: rgba(26, 20, 16, 0.04);
    align-self: start;
}

.contact-label {
    font-family: "IM Fell English", Georgia, serif;
    font-style: italic;
    font-size: 14px;
    color: #c4453a;
    letter-spacing: 0.08em;
    margin-bottom: 18px;
}

.contact-line {
    font-family: "Crimson Text", Georgia, serif;
    font-size: 16px;
    line-height: 30px;
    color: #2c2418;
}

.mono {
    font-family: "Courier Prime", monospace;
    font-size: 14px;
    color: #2a6b63;
    letter-spacing: 0.02em;
}

.contact-btn {
    margin-top: 24px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 22px;
    background: transparent;
    border: 0.5px solid #2c2418;
    color: #2c2418;
    font-family: "IM Fell English", Georgia, serif;
    font-size: 15px;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: background 0.4s ease, color 0.4s ease, transform 0.4s ease;
}

.btn-seal {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #e0584d 0%, #c4453a 60%, #8a2e26 100%);
    box-shadow: inset -1px -1px 2px rgba(0, 0, 0, 0.3);
    transition: transform 0.5s cubic-bezier(0.65, 0, 0.35, 1);
}

.contact-btn:hover {
    background: #2c2418;
    color: #d4c5a9;
    transform: translateY(-2px);
}

.contact-btn:hover .btn-seal {
    transform: rotate(360deg) scale(1.1);
    box-shadow: 0 0 12px rgba(232, 184, 74, 0.7);
}

.contact-btn.is-stamped {
    background: #c4453a;
    color: #d4c5a9;
    border-color: #c4453a;
}

/* ---- Folio footer ---- */
.folio-footer {
    margin-top: 60px;
    padding-top: 30px;
    text-align: center;
}

.footer-rule {
    width: 100%;
    height: 12px;
    margin-bottom: 18px;
}

.footer-text {
    font-family: "IM Fell English", Georgia, serif;
    font-size: 14px;
    color: #5a6e7a;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.footer-text-small {
    font-family: "Courier Prime", monospace;
    font-size: 12px;
    color: #5a6e7a;
    letter-spacing: 0.04em;
    opacity: 0.8;
}

/* ---- Mini-map ---- */
.minimap {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 45;
    width: 200px;
    pointer-events: auto;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.minimap.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.minimap-frame {
    background: rgba(26, 20, 16, 0.92);
    border: 0.5px solid #b8963e;
    padding: 12px 12px 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    position: relative;
}

.minimap-frame::before {
    content: "";
    position: absolute;
    inset: 4px;
    border: 0.5px solid rgba(184, 150, 62, 0.4);
    pointer-events: none;
}

.minimap-title {
    font-family: "IM Fell English", Georgia, serif;
    font-size: 12px;
    font-style: italic;
    color: #b8963e;
    text-align: center;
    letter-spacing: 0.1em;
    margin-bottom: 6px;
    position: relative;
    z-index: 1;
}

.minimap-svg {
    width: 100%;
    height: auto;
    display: block;
    position: relative;
    z-index: 1;
}

.mm-waypoint {
    cursor: pointer;
    transition: transform 0.3s ease;
}

.mm-waypoint:hover {
    transform: scale(1.15);
    transform-origin: center;
}

.mm-waypoint:hover circle {
    fill: #c4453a;
    stroke: #e8b84a;
}

.mm-waypoint.is-active circle {
    fill: #e8b84a;
    stroke: #c4453a;
    filter: drop-shadow(0 0 4px rgba(232, 184, 74, 0.8));
}

.minimap-pos {
    position: absolute;
    left: 6px;
    width: 4px;
    background: linear-gradient(180deg, #e8b84a, #c4453a);
    border-radius: 2px;
    transition: top 0.3s ease, height 0.3s ease;
    top: 30px;
    height: 20px;
    box-shadow: 0 0 8px rgba(232, 184, 74, 0.5);
}

/* ---- Typewriter effect ---- */
.typewriter-target {
    display: inline-block;
    position: relative;
}

.typewriter-target.is-typing::after {
    content: "|";
    color: #c4453a;
    animation: blink 0.7s steps(1) infinite;
    margin-left: 2px;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* ---- Ink splatter ---- */
.ink-splatter-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 30;
}

.ink-drop {
    position: absolute;
    border-radius: 50%;
    background: #2c2418;
    opacity: 0;
    animation: inkSplatter 1.4s ease-out forwards;
}

@keyframes inkSplatter {
    0%   { transform: translate(0, 0) scale(0); opacity: 0.85; }
    20%  { opacity: 0.85; }
    100% { transform: translate(var(--dx, 0), var(--dy, 0)) scale(1); opacity: 0; }
}

/* ---- Section reveal animations ---- */
.chapter {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.9s cubic-bezier(0.5, 0, 0.2, 1), transform 0.9s cubic-bezier(0.5, 0, 0.2, 1);
}

.chapter.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---- Initial page hidden state ---- */
body.is-pre-reveal {
    overflow: hidden;
}

body.is-pre-reveal .topbar,
body.is-pre-reveal .waypoint-sidebar,
body.is-pre-reveal .minimap,
body.is-pre-reveal .content-plane,
body.is-pre-reveal .bg-parchment,
body.is-pre-reveal .overlay-plane {
    opacity: 0;
}

body.is-revealed .topbar,
body.is-revealed .waypoint-sidebar,
body.is-revealed .content-plane,
body.is-revealed .bg-parchment,
body.is-revealed .overlay-plane {
    opacity: 1;
    transition: opacity 1.2s ease;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .content-plane { padding: 100px 40px 60px; }
    .title-primary { font-size: 56px; }
    .title-section { font-size: 40px; }
    .overture-grid { grid-template-columns: 1fr; }
    .overture-aside { grid-column: 1 / 2; grid-row: 3 / 4; max-width: 480px; }
    .craft-grid { grid-template-columns: 1fr; }
    .atlas-spread { grid-template-columns: 1fr; }
    .atlas-legend { position: relative; top: 0; }
    .marginalia-grid { grid-template-columns: 1fr 1fr; }
    .correspondence-spread { grid-template-columns: 1fr; }
    .topnav { display: none; }
    .minimap { display: none; }
    .watermark { font-size: 140px; right: 20px; }
}

@media (max-width: 640px) {
    .content-plane { padding: 90px 22px 40px; }
    .chapter { padding: 50px 26px 60px; }
    .title-primary { font-size: 42px; }
    .title-section { font-size: 30px; letter-spacing: 0.06em; }
    .pull-quote { font-size: 22px; }
    .marginalia-grid { grid-template-columns: 1fr; }
    .waypoint-sidebar { display: none; }
    .watermark { font-size: 100px; }
}
