/* =========================================
   a6c.quest - The Cartographer's Workshop
   ========================================= */

/* --- Custom Properties (Palette) --- */
:root {
    --leather: #5C3A1E;
    --teal: #1E5C5A;
    --parchment: #F2E8D5;
    --ink: #2A1810;
    --wax: #A8432A;
    --gold: #C49A3C;
    --dark: #1A120B;
    --sage: #8B9A7A;
    --leather-highlight: #7A5233;
    --leather-shadow: #3D2613;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 17px;
    line-height: 1.75;
    color: var(--ink);
    background-color: var(--dark);
    overflow-x: hidden;
    position: relative;
}

/* --- Leather Texture Background --- */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background-color: var(--leather);
    background-image:
        radial-gradient(ellipse 2px 3px at 20% 30%, var(--leather-highlight) 0%, transparent 100%),
        radial-gradient(ellipse 3px 2px at 40% 60%, var(--leather-shadow) 0%, transparent 100%),
        radial-gradient(ellipse 2px 2px at 60% 20%, var(--leather-highlight) 0%, transparent 100%),
        radial-gradient(ellipse 4px 3px at 80% 70%, var(--leather-shadow) 0%, transparent 100%),
        radial-gradient(ellipse 2px 4px at 10% 80%, var(--leather-highlight) 0%, transparent 100%),
        radial-gradient(ellipse 3px 2px at 90% 40%, var(--leather-shadow) 0%, transparent 100%),
        radial-gradient(ellipse 1px 2px at 50% 50%, var(--leather-highlight) 0%, transparent 100%),
        radial-gradient(ellipse 2px 1px at 70% 30%, var(--leather-shadow) 0%, transparent 100%),
        radial-gradient(ellipse 100px 100px at 25% 25%, rgba(122, 82, 51, 0.15) 0%, transparent 70%),
        radial-gradient(ellipse 120px 80px at 75% 60%, rgba(61, 38, 19, 0.12) 0%, transparent 70%),
        radial-gradient(ellipse 80px 120px at 50% 80%, rgba(122, 82, 51, 0.1) 0%, transparent 70%),
        radial-gradient(ellipse 150px 100px at 15% 65%, rgba(61, 38, 19, 0.08) 0%, transparent 70%);
    background-size:
        7px 9px,
        11px 8px,
        9px 7px,
        13px 11px,
        8px 12px,
        10px 9px,
        6px 8px,
        12px 7px,
        100% 100%,
        100% 100%,
        100% 100%,
        100% 100%;
    background-blend-mode: multiply, multiply, screen, multiply, screen, multiply, multiply, screen, normal, normal, normal, normal;
}

/* --- Particle Canvas --- */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    will-change: transform;
}

/* --- Typography --- */
h1, h2, h3 {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.caveat-text {
    font-family: 'Caveat', cursive;
    font-weight: 400;
}

.mono-label {
    font-family: 'Source Code Pro', monospace;
    font-weight: 400;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--sage);
}

.pull-quote {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    letter-spacing: 0.01em;
    color: var(--leather);
    line-height: 1.3;
    margin: 1.2rem 0;
    padding-left: 1.2rem;
    border-left: 3px solid var(--gold);
}

/* =========================================
   HERO: The Workshop Table
   ========================================= */
.workshop-table {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
    padding: 2rem;
}

/* Compass illustration */
.hero-compass {
    position: absolute;
    top: 12%;
    right: 15%;
    opacity: 0;
    animation: fadeRotateIn 2s 0.5s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

.compass-svg {
    animation: spinSlow 60s linear infinite;
}

@keyframes spinSlow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.compass-label {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 700;
}

/* Title card on parchment */
.hero-title-card {
    text-align: center;
    padding: 3rem 4rem 2.5rem;
    position: relative;
    z-index: 3;
    opacity: 0;
    animation: fadeSlideUp 1.5s 0.2s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

.site-title {
    font-size: clamp(2.8rem, 7vw, 6rem);
    font-weight: 700;
    color: var(--ink);
    line-height: 1.1;
    margin-bottom: 0.5rem;
}

.site-subtitle {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    color: var(--leather);
    transform: rotate(-1.5deg);
}

.title-card-flourish {
    margin-top: 1rem;
    opacity: 0.6;
}

/* Quill illustration */
.hero-quill {
    position: absolute;
    bottom: 18%;
    left: 12%;
    opacity: 0;
    animation: fadeRotateIn 2s 0.8s cubic-bezier(0.65, 0, 0.35, 1) forwards;
    transform: rotate(-15deg);
}

/* Scattered objects */
.hero-scattered-objects {
    position: absolute;
    bottom: 25%;
    right: 10%;
    opacity: 0;
    animation: fadeRotateIn 2s 1.0s cubic-bezier(0.65, 0, 0.35, 1) forwards;
    transform: rotate(3deg);
}

.hero-treasure-mark {
    position: absolute;
    top: 25%;
    left: 22%;
    opacity: 0;
    animation: fadeRotateIn 1.8s 1.2s cubic-bezier(0.65, 0, 0.35, 1) forwards;
    transform: rotate(12deg);
}

/* Contour lines decoration in hero */
.hero-contour-lines {
    position: absolute;
    bottom: 5%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    animation: fadeIn 3s 1.6s ease forwards;
    pointer-events: none;
    z-index: 1;
}

/* Scroll hint */
.hero-scroll-hint {
    position: absolute;
    bottom: 5%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    font-size: 16px;
    color: var(--gold);
    opacity: 0;
    animation: fadeIn 1.5s 1.5s ease forwards;
    transform: rotate(0.5deg);
    z-index: 5;
}

.scroll-arrow {
    animation: bobDown 2s ease-in-out infinite;
}

@keyframes bobDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

/* =========================================
   Parchment Panel Base Styles
   ========================================= */
.parchment-panel {
    background-color: var(--parchment);
    background-image:
        radial-gradient(ellipse 80px 60px at 30% 40%, rgba(200, 180, 150, 0.3) 0%, transparent 70%),
        radial-gradient(ellipse 60px 80px at 70% 60%, rgba(180, 160, 130, 0.2) 0%, transparent 70%);
    box-shadow:
        0 8px 24px rgba(42, 24, 16, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(92, 58, 30, 0.2);
}

/* =========================================
   PINBOARD: Main Content
   ========================================= */
.pinboard-section {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 2rem 80px;
}

/* --- Content Panel Base --- */
.content-panel {
    position: relative;
    max-width: 680px;
    padding: 2.5rem 2.8rem 2rem;
    margin-bottom: 80px;
    background-color: var(--parchment);
    box-shadow: 0 8px 24px rgba(42, 24, 16, 0.15);
    border: 1px solid rgba(92, 58, 30, 0.15);
    opacity: 0;
    transition: box-shadow 0.3s ease-out, transform 0.3s ease-out;
}

.content-panel.visible {
    opacity: 1;
}

/* Hover lift effect - rotation snaps 1deg closer to 0 */
.content-panel:hover {
    box-shadow: 0 16px 40px rgba(42, 24, 16, 0.22);
}

/* Pin decoration */
.panel-pin {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 18px;
    height: 18px;
    background: radial-gradient(circle at 40% 35%, var(--gold), #8a6a20);
    border-radius: 50%;
    box-shadow: 0 3px 6px rgba(26, 18, 11, 0.4);
    z-index: 5;
}

.panel-pin::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
}

/* Panel labels */
.panel-label {
    display: inline-block;
    background: rgba(26, 18, 11, 0.06);
    padding: 3px 10px;
    border: 1px solid rgba(92, 58, 30, 0.15);
    margin-bottom: 1rem;
}

.panel-title {
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    margin-bottom: 0.8rem;
    line-height: 1.2;
}

.panel-body {
    font-size: 17px;
    line-height: 1.75;
    color: var(--ink);
    margin-bottom: 0.5rem;
}

.panel-body em, .panel-body strong {
    font-weight: 600;
}

.panel-annotation {
    font-size: 16px;
    color: var(--sage);
    transform: rotate(0.8deg);
    margin-top: 0.8rem;
}

/* Inline sketches within panels */
.panel-inline-sketch {
    margin: 1rem 0 0.5rem;
    opacity: 0.7;
}

/* Compass heading in journal panel */
.panel-compass-heading {
    margin-top: 1.2rem;
    font-size: 20px;
    color: var(--teal);
    transform: rotate(-0.5deg);
}

.heading-arrow {
    font-size: 24px;
    vertical-align: middle;
    margin-right: 4px;
}

/* --- Panel Variants --- */

/* Parchment: cream with aged spots */
.panel-parchment {
    background-color: var(--parchment);
    background-image:
        radial-gradient(ellipse 40px 30px at 15% 20%, rgba(180, 160, 130, 0.25) 0%, transparent 70%),
        radial-gradient(ellipse 30px 40px at 85% 80%, rgba(180, 160, 130, 0.2) 0%, transparent 70%);
    clip-path: polygon(0% 1%, 2% 0%, 15% 0.5%, 30% 0%, 50% 0.3%, 70% 0%, 85% 0.4%, 98% 0%, 100% 2%, 100% 15%, 99.5% 35%, 100% 55%, 99.8% 75%, 100% 95%, 99% 100%, 85% 99.5%, 65% 100%, 45% 99.7%, 25% 100%, 5% 99.5%, 0% 98%, 0.3% 80%, 0% 60%, 0.4% 40%, 0% 20%);
}

/* Graph paper: faint grid lines */
.panel-graph {
    background-color: #F5F0E8;
    background-image:
        linear-gradient(rgba(30, 92, 90, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(30, 92, 90, 0.06) 1px, transparent 1px);
    background-size: 20px 20px;
    clip-path: polygon(0.5% 0%, 12% 0.3%, 28% 0%, 45% 0.5%, 62% 0%, 80% 0.2%, 100% 0%, 99.5% 12%, 100% 30%, 99.7% 50%, 100% 70%, 99.5% 88%, 100% 100%, 82% 99.6%, 60% 100%, 38% 99.4%, 18% 100%, 0% 99.8%, 0.3% 82%, 0% 62%, 0.5% 42%, 0% 22%);
}

/* Torn notebook */
.panel-notebook {
    background-color: #FAF6EE;
    background-image:
        linear-gradient(transparent 27px, rgba(168, 67, 42, 0.12) 27px, rgba(168, 67, 42, 0.12) 28px, transparent 28px);
    background-size: 100% 28px;
    border-left: 3px solid var(--wax);
    clip-path: polygon(0% 0%, 100% 0.5%, 99.5% 18%, 100% 40%, 99.7% 60%, 100% 82%, 99.5% 100%, 0% 99.5%);
}

/* Envelope style */
.panel-envelope {
    background-color: #EDE4D0;
    background-image:
        linear-gradient(135deg, transparent 45%, rgba(92, 58, 30, 0.04) 45%, rgba(92, 58, 30, 0.04) 55%, transparent 55%);
    border: 2px solid rgba(92, 58, 30, 0.2);
    clip-path: polygon(0% 2%, 50% 0%, 100% 2%, 100% 98%, 50% 100%, 0% 98%);
}

/* Parchment alternate */
.panel-parchment-alt {
    background-color: #EEE5D2;
    background-image:
        radial-gradient(ellipse 50px 40px at 70% 30%, rgba(170, 150, 120, 0.2) 0%, transparent 70%),
        radial-gradient(ellipse 35px 50px at 20% 70%, rgba(170, 150, 120, 0.15) 0%, transparent 70%);
    clip-path: polygon(1% 0%, 18% 0.4%, 40% 0%, 60% 0.6%, 82% 0%, 99% 0.3%, 100% 2%, 99.6% 22%, 100% 45%, 99.4% 68%, 100% 90%, 99% 100%, 78% 99.4%, 55% 100%, 32% 99.6%, 10% 100%, 0% 99%, 0.5% 75%, 0% 50%, 0.4% 25%);
}

/* Journal entry */
.panel-journal {
    background-color: #F0E8D8;
    background-image:
        repeating-linear-gradient(transparent, transparent 27px, rgba(42, 24, 16, 0.06) 27px, rgba(42, 24, 16, 0.06) 28px);
    border-top: 4px solid var(--leather);
    clip-path: polygon(0% 0%, 100% 0%, 100% 97%, 95% 100%, 85% 98%, 72% 100%, 60% 99%, 45% 100%, 30% 98%, 15% 100%, 5% 99%, 0% 100%);
}

/* --- Panel Rotations (with parallax-y integration) --- */
.panel-rotate-1 {
    --panel-rotation: -2deg;
    --panel-hover-rotation: -1deg;
    transform: rotate(var(--panel-rotation)) translateY(var(--parallax-y, 0px));
    margin-left: 5%;
}
.panel-rotate-1.entering {
    animation: panelEnter1 600ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.panel-rotate-1:hover {
    transform: rotate(var(--panel-hover-rotation)) translateY(calc(var(--parallax-y, 0px) - 2px));
}

.panel-rotate-2 {
    --panel-rotation: 3deg;
    --panel-hover-rotation: 2deg;
    transform: rotate(var(--panel-rotation)) translateY(var(--parallax-y, 0px));
    margin-left: auto;
    margin-right: 2%;
}
.panel-rotate-2.entering {
    animation: panelEnter2 600ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.panel-rotate-2:hover {
    transform: rotate(var(--panel-hover-rotation)) translateY(calc(var(--parallax-y, 0px) - 2px));
}

.panel-rotate-3 {
    --panel-rotation: -1.5deg;
    --panel-hover-rotation: -0.5deg;
    transform: rotate(var(--panel-rotation)) translateY(var(--parallax-y, 0px));
    margin-left: 10%;
}
.panel-rotate-3.entering {
    animation: panelEnter3 600ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.panel-rotate-3:hover {
    transform: rotate(var(--panel-hover-rotation)) translateY(calc(var(--parallax-y, 0px) - 2px));
}

.panel-rotate-4 {
    --panel-rotation: 2.5deg;
    --panel-hover-rotation: 1.5deg;
    transform: rotate(var(--panel-rotation)) translateY(var(--parallax-y, 0px));
    margin-left: auto;
    margin-right: 8%;
}
.panel-rotate-4.entering {
    animation: panelEnter4 600ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.panel-rotate-4:hover {
    transform: rotate(var(--panel-hover-rotation)) translateY(calc(var(--parallax-y, 0px) - 2px));
}

.panel-rotate-5 {
    --panel-rotation: -3deg;
    --panel-hover-rotation: -2deg;
    transform: rotate(var(--panel-rotation)) translateY(var(--parallax-y, 0px));
    margin-left: 3%;
}
.panel-rotate-5.entering {
    animation: panelEnter5 600ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.panel-rotate-5:hover {
    transform: rotate(var(--panel-hover-rotation)) translateY(calc(var(--parallax-y, 0px) - 2px));
}

.panel-rotate-6 {
    --panel-rotation: 1.8deg;
    --panel-hover-rotation: 0.8deg;
    transform: rotate(var(--panel-rotation)) translateY(var(--parallax-y, 0px));
    margin-left: auto;
    margin-right: 5%;
}
.panel-rotate-6.entering {
    animation: panelEnter6 600ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.panel-rotate-6:hover {
    transform: rotate(var(--panel-hover-rotation)) translateY(calc(var(--parallax-y, 0px) - 2px));
}

/* Panel entrance animations - spring easing with rotation + translate */
@keyframes panelEnter1 {
    from {
        opacity: 0;
        transform: rotate(-6deg) translateY(40px);
    }
    to {
        opacity: 1;
        transform: rotate(-2deg) translateY(0px);
    }
}

@keyframes panelEnter2 {
    from {
        opacity: 0;
        transform: rotate(7deg) translateY(35px);
    }
    to {
        opacity: 1;
        transform: rotate(3deg) translateY(0px);
    }
}

@keyframes panelEnter3 {
    from {
        opacity: 0;
        transform: rotate(-4.5deg) translateY(40px);
    }
    to {
        opacity: 1;
        transform: rotate(-1.5deg) translateY(0px);
    }
}

@keyframes panelEnter4 {
    from {
        opacity: 0;
        transform: rotate(6.5deg) translateY(35px);
    }
    to {
        opacity: 1;
        transform: rotate(2.5deg) translateY(0px);
    }
}

@keyframes panelEnter5 {
    from {
        opacity: 0;
        transform: rotate(-7deg) translateY(40px);
    }
    to {
        opacity: 1;
        transform: rotate(-3deg) translateY(0px);
    }
}

@keyframes panelEnter6 {
    from {
        opacity: 0;
        transform: rotate(5.8deg) translateY(35px);
    }
    to {
        opacity: 1;
        transform: rotate(1.8deg) translateY(0px);
    }
}

/* --- Wax Seal Decoration --- */
.wax-seal {
    display: block;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: radial-gradient(circle at 38% 35%, #c95a3a, var(--wax), #7a2e1a);
    box-shadow:
        0 2px 6px rgba(42, 24, 16, 0.3),
        inset 0 -2px 4px rgba(122, 46, 26, 0.4),
        inset 0 2px 3px rgba(255, 150, 100, 0.2);
    position: absolute;
    bottom: -15px;
    right: 30px;
}

.seal-large {
    width: 65px;
    height: 65px;
    bottom: -20px;
    right: 40px;
}

.wax-seal::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 55%;
    height: 55%;
    border: 1.5px solid rgba(255, 200, 150, 0.25);
    border-radius: 50%;
}

.wax-seal::before {
    content: '';
    position: absolute;
    top: 20%;
    left: 25%;
    width: 18%;
    height: 12%;
    background: rgba(255, 200, 150, 0.15);
    border-radius: 50%;
    transform: rotate(-20deg);
}

/* --- Trail Connectors --- */
.trail-connector {
    display: block;
    width: 200px;
    height: 60px;
    margin: -20px auto 20px;
    opacity: 0.5;
}

.trail-1 {
    margin-left: 30%;
    transform: rotate(2deg);
}

.trail-2 {
    margin-left: 20%;
    transform: rotate(-1deg);
}

/* --- Compass Rose Divider --- */
.compass-rose-divider {
    text-align: center;
    margin: 40px auto 60px;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.compass-rose-divider.visible {
    opacity: 1;
}

.divider-2 {
    margin: 60px auto 40px;
}

.divider-3 {
    margin: 50px auto 50px;
}

/* =========================================
   MARGIN: Sidebar Annotations
   ========================================= */
.margin-annotations {
    position: fixed;
    right: 20px;
    top: 0;
    width: 200px;
    height: 100vh;
    z-index: 10;
    pointer-events: none;
    display: none;
}

@media (min-width: 1200px) {
    .margin-annotations {
        display: block;
    }
}

.margin-note {
    position: absolute;
    right: 0;
    font-size: 15px;
    color: var(--sage);
    max-width: 180px;
    transform: rotate(1deg);
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
    line-height: 1.4;
}

.margin-note.visible {
    opacity: 0.85;
    transform: rotate(1deg) translateX(0);
}

.margin-asterisk {
    color: var(--wax);
    font-weight: 700;
    font-size: 1.3em;
    margin-right: 2px;
}

.margin-note del {
    color: var(--sage);
    opacity: 0.5;
}

.margin-tiny-label {
    display: block;
    font-size: 12px;
    color: var(--teal);
    opacity: 0.6;
    margin-top: 2px;
    font-style: italic;
}

.circled-label {
    display: inline-block;
    border: 2px solid var(--wax);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    line-height: 32px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--wax);
    margin-right: 4px;
    vertical-align: middle;
}

.margin-doodle {
    display: block;
    margin-bottom: 4px;
}

/* =========================================
   FOOTER: The Endpaper
   ========================================= */
.endpaper-section {
    position: relative;
    z-index: 2;
    padding: 80px 2rem 60px;
    background-color: var(--dark);
    overflow: hidden;
}

#endpaper-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.15;
    pointer-events: none;
}

.endpaper-content {
    position: relative;
    text-align: center;
    z-index: 2;
}

.endpaper-text {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 3rem);
    color: var(--parchment);
    opacity: 0.7;
    letter-spacing: -0.02em;
}

.endpaper-sub {
    font-size: 18px;
    color: var(--gold);
    opacity: 0.5;
    margin-top: 0.5rem;
    transform: rotate(-1deg);
}

.endpaper-compass {
    margin-top: 2rem;
    opacity: 0.4;
}

/* =========================================
   SVG Draw-On Animation
   ========================================= */
.draw-on {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 1.8s cubic-bezier(0.65, 0, 0.35, 1);
}

.draw-on.drawn {
    stroke-dashoffset: 0;
}

/* =========================================
   Keyframe Animations
   ========================================= */
@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(40px) rotate(-1deg);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotate(0deg);
    }
}

@keyframes fadeRotateIn {
    from {
        opacity: 0;
        transform: rotate(-10deg) scale(0.9);
    }
    to {
        opacity: 1;
        transform: rotate(0deg) scale(1);
    }
}

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

/* =========================================
   Responsive Adjustments
   ========================================= */
@media (max-width: 768px) {
    .pinboard-section {
        padding: 40px 1rem 60px;
    }

    .content-panel {
        max-width: 100%;
        padding: 1.8rem 1.5rem 1.5rem;
        margin-bottom: 50px;
    }

    /* Reduced rotations for mobile readability */
    .panel-rotate-1 {
        --panel-rotation: -1deg;
        --panel-hover-rotation: -0.5deg;
        margin-left: 0;
    }

    .panel-rotate-2 {
        --panel-rotation: 1.5deg;
        --panel-hover-rotation: 1deg;
        margin-right: 0;
    }

    .panel-rotate-3 {
        --panel-rotation: -0.8deg;
        --panel-hover-rotation: -0.3deg;
        margin-left: 0;
    }

    .panel-rotate-4 {
        --panel-rotation: 2deg;
        --panel-hover-rotation: 1deg;
        margin-right: 0;
    }

    .panel-rotate-5 {
        --panel-rotation: -1deg;
        --panel-hover-rotation: -0.5deg;
        margin-left: 0;
    }

    .panel-rotate-6 {
        --panel-rotation: 1deg;
        --panel-hover-rotation: 0.5deg;
        margin-right: 0;
    }

    @keyframes panelEnter1 {
        from { opacity: 0; transform: rotate(-4deg) translateY(30px); }
        to { opacity: 1; transform: rotate(-1deg) translateY(0px); }
    }
    @keyframes panelEnter2 {
        from { opacity: 0; transform: rotate(4.5deg) translateY(30px); }
        to { opacity: 1; transform: rotate(1.5deg) translateY(0px); }
    }
    @keyframes panelEnter3 {
        from { opacity: 0; transform: rotate(-3.8deg) translateY(30px); }
        to { opacity: 1; transform: rotate(-0.8deg) translateY(0px); }
    }
    @keyframes panelEnter4 {
        from { opacity: 0; transform: rotate(5deg) translateY(30px); }
        to { opacity: 1; transform: rotate(2deg) translateY(0px); }
    }
    @keyframes panelEnter5 {
        from { opacity: 0; transform: rotate(-4deg) translateY(30px); }
        to { opacity: 1; transform: rotate(-1deg) translateY(0px); }
    }
    @keyframes panelEnter6 {
        from { opacity: 0; transform: rotate(4deg) translateY(30px); }
        to { opacity: 1; transform: rotate(1deg) translateY(0px); }
    }

    .hero-compass {
        top: 8%;
        right: 5%;
    }

    .hero-compass svg {
        width: 120px;
        height: 120px;
    }

    .hero-quill {
        bottom: 22%;
        left: 5%;
    }

    .hero-quill svg {
        width: 60px;
        height: 90px;
    }

    .hero-scattered-objects {
        bottom: 28%;
        right: 5%;
    }

    .hero-scattered-objects svg {
        width: 50px;
        height: 32px;
    }

    .hero-treasure-mark {
        top: 20%;
        left: 8%;
    }

    .hero-treasure-mark svg {
        width: 25px;
        height: 25px;
    }

    .hero-title-card {
        padding: 2rem 2.5rem;
    }

    .trail-connector {
        display: none;
    }

    .wax-seal {
        width: 40px;
        height: 40px;
        bottom: -10px;
        right: 20px;
    }

    .seal-large {
        width: 50px;
        height: 50px;
    }

    .hero-contour-lines {
        display: none;
    }
}

@media (max-width: 480px) {
    .site-title {
        font-size: clamp(2rem, 10vw, 3rem);
    }

    .content-panel {
        padding: 1.5rem 1.2rem 1.2rem;
    }

    .pull-quote {
        font-size: 1.4rem;
    }

    .hero-scattered-objects,
    .hero-treasure-mark {
        display: none;
    }

    .title-card-flourish {
        display: none;
    }
}

/* =========================================
   Utility: Map Contour Lines in Panels
   ========================================= */
.panel-parchment::after,
.panel-parchment-alt::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(ellipse 300px 200px at 60% 40%, transparent 40%, rgba(30, 92, 90, 0.05) 41%, transparent 42%),
        radial-gradient(ellipse 250px 180px at 60% 40%, transparent 50%, rgba(30, 92, 90, 0.04) 51%, transparent 52%),
        radial-gradient(ellipse 200px 150px at 60% 40%, transparent 58%, rgba(30, 92, 90, 0.03) 59%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

.panel-parchment > *,
.panel-parchment-alt > * {
    position: relative;
    z-index: 1;
}

/* =========================================
   Selection styling
   ========================================= */
::selection {
    background-color: rgba(30, 92, 90, 0.2);
    color: var(--ink);
}
