/* ============================================
   FRONT LINE STORIES — Design System
   Military palette, dark theme, graphic novel aesthetic
   ============================================ */

/* CSS Custom Properties */
:root {
    --bg-primary: #1A1A1A;
    --bg-secondary: #222222;
    --bg-card: rgba(42, 42, 42, 0.8);
    --bg-card-solid: #2A2A2A;

    --olive: #4A5D23;
    --olive-light: #6B7F3A;
    --olive-dark: #354418;
    --tan: #C4A882;
    --tan-light: #D4C0A0;
    --tan-dark: #A08960;
    --steel: #708090;
    --steel-light: #8899A6;
    --steel-dark: #566573;
    --earth: #3B2F2F;
    --earth-light: #5C4A4A;
    --earth-dark: #2A1F1F;
    --gunmetal: #2C3539;
    --medal-gold: #FFD700;
    --medal-silver: #C0C0C0;
    --medal-bronze: #CD7F32;

    --text-primary: #E8E8E8;
    --text-secondary: #A0A0A0;
    --text-muted: #707070;

    --border-subtle: rgba(74, 93, 35, 0.3);
    --border-card: rgba(196, 168, 130, 0.2);

    --font-stencil: 'Black Ops One', cursive;
    --font-heading: 'Oswald', sans-serif;
    --font-body: 'Source Sans 3', sans-serif;
    --font-mono: 'Share Tech Mono', monospace;
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.7;
    min-height: 100vh;
}

/* Typography Scale */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.02em;
}

.font-stencil { font-family: var(--font-stencil); }
.font-heading { font-family: var(--font-heading); }
.font-mono { font-family: var(--font-mono); }

/* ============================================
   Glass Card Component
   ============================================ */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    border-radius: 0.75rem;
    transition: border-color 0.3s ease, transform 0.3s ease;
}

.glass-card:hover {
    border-color: rgba(74, 93, 35, 0.5);
}

.glass-card-solid {
    background: var(--bg-card-solid);
    border: 1px solid var(--border-card);
    border-radius: 0.75rem;
}

/* ============================================
   Panel Frame — Graphic Novel Border
   ============================================ */
.panel-frame {
    border: 4px solid var(--tan);
    border-radius: 4px;
    box-shadow:
        inset 0 0 0 2px var(--earth),
        0 4px 20px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    position: relative;
}

.panel-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ============================================
   Panel Viewer — Graphic Novel Carousel
   ============================================ */
.panel-viewer-container {
    background: #000;
    position: relative;
    overflow: hidden;
}

.panel-viewer {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0;
}

.panel-viewer::-webkit-scrollbar { display: none; }

.panel-slide {
    scroll-snap-align: center;
    flex: 0 0 100%;
    min-width: 0;
    padding: 0.5rem;
}

@media (min-width: 768px) {
    .panel-slide { flex: 0 0 50%; }
}

@media (min-width: 1280px) {
    .panel-slide { flex: 0 0 33.333%; }
}

.panel-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 0;
}

.panel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--steel-dark);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.panel-dot.active {
    background: var(--tan);
    transform: scale(1.3);
}

/* Panel navigation arrows */
.panel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: var(--tan);
    border: 1px solid var(--tan-dark);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.panel-nav:hover {
    background: rgba(0, 0, 0, 0.85);
    border-color: var(--tan);
}

.panel-nav.prev { left: 1rem; }
.panel-nav.next { right: 1rem; }

/* ============================================
   Panel Stream — Vertical Webcomic Reader
   ============================================ */
.panel-stream {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-width: 900px;
    margin: 0 auto 2rem;
}

.panel-block {
    position: relative;
}

.panel-block .panel-frame {
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: 2px solid var(--tan-dark);
    border-bottom: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.panel-block:first-child .panel-frame {
    border-top: 4px solid var(--tan);
    border-radius: 4px 4px 0 0;
}

.panel-block:last-child .panel-frame {
    border-bottom: 4px solid var(--tan);
    border-radius: 0 0 4px 4px;
}

.panel-block .panel-frame img {
    width: 100%;
    height: auto;
    display: block;
    cursor: zoom-in;
}

.panel-caption {
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--steel-light);
    text-align: center;
    padding: 1.25rem 2rem;
    background: var(--bg-primary);
    line-height: 1.5;
    letter-spacing: 0.02em;
}

.panel-equipment .panel-frame {
    border: 2px solid var(--olive);
    border-radius: 4px;
    margin: 1rem 0;
}

.panel-caption.equip-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--olive-light);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.75rem 2rem 1.5rem;
}

/* Prose narration boxes — comic book caption style */
.panel-prose {
    max-width: 800px;
    margin: 0.75rem auto;
    padding: 1.75rem 2.25rem;
    background:
        linear-gradient(135deg, #2a2518 0%, #1f1d17 50%, #2a2518 100%);
    border: 2px solid var(--tan-dark);
    border-radius: 4px;
    box-shadow:
        inset 0 1px 0 rgba(196, 168, 130, 0.08),
        0 2px 12px rgba(0, 0, 0, 0.4);
    position: relative;
    font-size: 1.05rem;
    line-height: 1.8;
    color: #d4cbb8;
}

.panel-prose::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(196, 168, 130, 0.015) 2px,
            rgba(196, 168, 130, 0.015) 3px
        );
    pointer-events: none;
    border-radius: 3px;
}

.panel-prose p {
    margin-bottom: 1.15rem;
    text-indent: 1.5em;
    position: relative;
}

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

.panel-prose p:first-child::first-letter {
    font-family: var(--font-stencil);
    font-size: 2.5em;
    float: left;
    line-height: 0.8;
    margin-right: 0.08em;
    margin-top: 0.08em;
    color: var(--tan);
}

.panel-prose p:last-child {
    margin-bottom: 0;
}

.panel-prose blockquote {
    text-indent: 0;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--tan-dark);
    border-radius: 3px;
    padding: 1rem 1.5rem;
    margin: 1.25rem 0;
    color: var(--tan-light);
    font-family: var(--font-heading);
    font-style: normal;
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    text-align: center;
    position: relative;
}

.panel-prose blockquote::before {
    content: '\275D';
    position: absolute;
    top: -0.6rem;
    left: 1rem;
    font-size: 1.5rem;
    color: var(--tan-dark);
    background: #2a2518;
    padding: 0 0.3rem;
}

.panel-prose em {
    color: var(--tan);
    font-style: italic;
}

.panel-prose .story-term {
    color: var(--olive-light);
    cursor: pointer;
    border-bottom: 1px dotted rgba(107, 127, 58, 0.5);
    transition: all 0.2s ease;
}

.panel-prose .story-term:hover {
    color: var(--tan);
    border-bottom-color: var(--tan);
    background: rgba(74, 93, 35, 0.15);
    padding: 0 2px;
    border-radius: 2px;
}

.sidebar-entry.intel-highlight {
    border-left-color: var(--olive-light);
    background: rgba(74, 93, 35, 0.1);
}

.sidebar-entry.intel-highlight .entry-title {
    color: var(--tan-light);
}

/* ============================================
   Navigation
   ============================================ */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(26, 26, 26, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
}

.nav-link {
    color: var(--steel);
    text-decoration: none;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: color 0.3s ease;
    padding: 0.5rem 0;
}

.nav-link:hover,
.nav-link.active {
    color: var(--tan);
}

/* Mobile menu */
.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 26, 26, 0.98);
    z-index: 50;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}

.mobile-menu.active { display: flex; }

.mobile-menu .nav-link {
    font-size: 1.5rem;
}

/* ============================================
   Reading Progress Bar
   ============================================ */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--olive), var(--olive-light));
    z-index: 50;
    transition: width 0.1s linear;
    width: 0%;
}

/* ============================================
   Metadata Bar
   ============================================ */
.metadata-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--steel);
}

.metadata-bar strong {
    color: var(--tan);
}

.metadata-bar .medal {
    color: var(--medal-gold);
}

/* ============================================
   Expandable Sections
   ============================================ */
.expand-section {
    margin-bottom: 1rem;
    overflow: hidden;
}

.expand-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 1.25rem 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    text-align: left;
}

.expand-trigger h2 {
    color: var(--olive-light);
    font-size: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.expand-arrow {
    width: 24px;
    height: 24px;
    color: var(--tan);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.expand-section.active .expand-arrow {
    transform: rotate(180deg);
}

.expand-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease;
    padding: 0 1.5rem;
}

.expand-section.active .expand-content {
    max-height: 4000px;
    padding-bottom: 1.5rem;
}

/* ============================================
   Weapon Card
   ============================================ */
.weapon-card {
    padding: 1.25rem;
    transition: transform 0.3s ease;
}

.weapon-card:hover {
    transform: translateY(-2px);
}

.weapon-card h3 {
    color: var(--tan);
    font-family: var(--font-heading);
}

.weapon-card dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.25rem 1rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--steel);
}

.weapon-card dt {
    color: var(--text-muted);
}

.weapon-card dd {
    color: var(--steel-light);
}

/* ============================================
   Bio Card
   ============================================ */
.bio-card {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
}

.bio-card .bio-photo {
    width: 120px;
    height: 120px;
    border-radius: 0.5rem;
    border: 2px solid var(--tan-dark);
    object-fit: cover;
    flex-shrink: 0;
    background: var(--earth);
}

.bio-card .bio-info h3 {
    color: var(--tan);
    font-family: var(--font-heading);
    font-size: 1.25rem;
}

.bio-card .bio-rank {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--olive-light);
    margin-top: 0.25rem;
}

/* ============================================
   Medal Card
   ============================================ */
.medal-card {
    text-align: center;
    padding: 2rem;
}

.medal-card .medal-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.medal-card .medal-name {
    font-family: var(--font-stencil);
    font-size: 1.5rem;
    color: var(--medal-gold);
}

.medal-card .citation {
    font-style: italic;
    color: var(--steel-light);
    border-left: 3px solid var(--medal-gold);
    padding-left: 1rem;
    margin: 1.5rem auto;
    max-width: 600px;
    text-align: left;
    line-height: 1.8;
}

/* ============================================
   Story Prose
   ============================================ */
.story-prose {
    max-width: 720px;
    margin: 0 auto;
    font-size: 1.125rem;
    line-height: 1.85;
    color: var(--text-primary);
}

.story-prose p {
    margin-bottom: 1.5rem;
}

.story-prose p:first-of-type::first-letter {
    font-family: var(--font-stencil);
    font-size: 3.5em;
    float: left;
    line-height: 0.8;
    margin-right: 0.1em;
    margin-top: 0.1em;
    color: var(--tan);
}

.story-prose blockquote {
    border-left: 3px solid var(--olive);
    padding-left: 1.25rem;
    margin: 2rem 0;
    color: var(--steel-light);
    font-style: italic;
}

.story-prose a {
    color: var(--olive-light);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.story-prose a:hover {
    color: var(--tan);
}

/* ============================================
   Lightbox
   ============================================ */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 100;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 95vw;
    max-height: 95vh;
    object-fit: contain;
    border-radius: 4px;
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.6);
    color: var(--tan);
    border: 1px solid var(--tan-dark);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-caption {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    color: var(--steel-light);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    background: rgba(0, 0, 0, 0.6);
    padding: 0.5rem 1rem;
    border-radius: 4px;
}

/* ============================================
   Hero Section
   ============================================ */
.hero-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    background: radial-gradient(ellipse at center, var(--earth-dark) 0%, var(--bg-primary) 70%);
}

.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 50px,
            rgba(74, 93, 35, 0.03) 50px,
            rgba(74, 93, 35, 0.03) 51px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 50px,
            rgba(74, 93, 35, 0.03) 50px,
            rgba(74, 93, 35, 0.03) 51px
        );
    pointer-events: none;
}

.hero-title {
    font-family: var(--font-stencil);
    font-size: clamp(2.5rem, 8vw, 5rem);
    color: var(--tan);
    letter-spacing: 0.05em;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    position: relative;
}

.hero-tagline {
    font-family: var(--font-heading);
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    color: var(--steel);
    margin-top: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 400;
}

.hero-cta {
    display: inline-block;
    margin-top: 2.5rem;
    padding: 1rem 2.5rem;
    background: var(--olive);
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-decoration: none;
    border-radius: 4px;
    border: 1px solid var(--olive-light);
    transition: all 0.3s ease;
}

.hero-cta:hover {
    background: var(--olive-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 93, 35, 0.4);
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: var(--steel-dark);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-10px); }
    60% { transform: translateX(-50%) translateY(-5px); }
}

/* ============================================
   Feature Grid (Landing)
   ============================================ */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.feature-card {
    text-align: center;
    padding: 2.5rem 2rem;
}

.feature-card .feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

.feature-card h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: var(--tan);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.feature-card p {
    color: var(--steel);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* ============================================
   Story Card (Archive Grid)
   ============================================ */
.story-card {
    text-decoration: none;
    color: inherit;
    display: block;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.story-card:hover {
    transform: translateY(-4px);
}

.story-card .card-image {
    aspect-ratio: 3/2;
    overflow: hidden;
}

.story-card .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.story-card:hover .card-image img {
    transform: scale(1.05);
}

.story-card .card-body {
    padding: 1.25rem;
}

.story-card .card-award {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--medal-gold);
}

.story-card .card-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    color: var(--tan);
    margin-top: 0.25rem;
}

.story-card .card-meta {
    color: var(--steel);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.story-card.locked {
    opacity: 0.35;
    cursor: default;
    pointer-events: none;
}

.story-card.locked .card-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--earth);
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
    border-top: 1px solid var(--earth);
    margin-top: 5rem;
    padding: 3rem 0;
    color: var(--steel);
}

.site-footer h4 {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--tan);
    margin-bottom: 0.75rem;
}

.site-footer a {
    color: var(--steel);
    text-decoration: none;
    transition: color 0.3s ease;
    display: block;
    padding: 0.25rem 0;
    font-size: 0.9rem;
}

.site-footer a:hover {
    color: var(--tan);
}

/* ============================================
   Section Divider
   ============================================ */
.section-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 3rem 0;
    color: var(--earth-light);
}

.section-divider::before,
.section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--earth);
}

.section-divider .star {
    color: var(--olive);
    font-size: 0.75rem;
}

/* ============================================
   Utility Classes
   ============================================ */
.text-olive { color: var(--olive-light); }
.text-tan { color: var(--tan); }
.text-steel { color: var(--steel); }
.text-medal { color: var(--medal-gold); }
.text-muted { color: var(--text-muted); }
.bg-earth { background: var(--earth); }

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.container-narrow {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

.animate-delay-1 { animation-delay: 0.1s; opacity: 0; }
.animate-delay-2 { animation-delay: 0.2s; opacity: 0; }
.animate-delay-3 { animation-delay: 0.3s; opacity: 0; }
.animate-delay-4 { animation-delay: 0.4s; opacity: 0; }

/* ============================================
   Story Layout with Intel Sidebar
   ============================================ */
.story-layout {
    display: flex;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.story-main {
    flex: 1;
    min-width: 0;
}

/* Sidebar — desktop: sticky column, mobile: slide-in panel */
.story-sidebar {
    width: 300px;
    flex-shrink: 0;
}

.sidebar-inner {
    position: sticky;
    top: 70px;
    max-height: calc(100vh - 90px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--earth-light) transparent;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 0.75rem;
}

.sidebar-inner::-webkit-scrollbar { width: 4px; }
.sidebar-inner::-webkit-scrollbar-track { background: transparent; }
.sidebar-inner::-webkit-scrollbar-thumb { background: var(--earth-light); border-radius: 4px; }

/* Sidebar toggle (mobile only) */
.sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 2rem;
    right: 1.5rem;
    z-index: 44;
    background: var(--olive);
    color: var(--text-primary);
    border: 1px solid var(--olive-light);
    padding: 0.75rem 1.25rem;
    border-radius: 2rem;
    font-family: var(--font-heading);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background: var(--olive-light);
    transform: translateY(-2px);
}

/* Sidebar close (mobile) */
.sidebar-close {
    display: none;
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    color: var(--steel);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 2;
    padding: 0.25rem;
    line-height: 1;
}

.sidebar-close:hover { color: var(--tan); }

/* Sidebar overlay (mobile) */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 44;
}

.sidebar-overlay.active { display: block; }

/* Mobile sidebar behavior */
@media (max-width: 1023px) {
    .story-layout { display: block; }

    .story-sidebar {
        position: fixed;
        top: 0;
        right: -340px;
        width: 320px;
        height: 100vh;
        z-index: 45;
        transition: right 0.3s ease;
    }

    .story-sidebar.open { right: 0; }

    .sidebar-inner {
        position: static;
        max-height: 100vh;
        height: 100%;
        border: none;
        border-radius: 0;
        border-left: 1px solid var(--border-subtle);
    }

    .sidebar-toggle { display: flex; }
    .sidebar-close { display: block; }
}

/* Sidebar sections */
.sidebar-heading {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--tan);
    padding: 0.75rem 1rem 0.5rem;
    border-bottom: 1px solid var(--earth);
    margin: 0;
}

/* TOC links */
.sidebar-toc {
    display: flex;
    flex-direction: column;
    padding: 0.25rem 0;
}

.toc-link {
    display: block;
    padding: 0.4rem 1rem;
    color: var(--steel);
    text-decoration: none;
    font-size: 0.85rem;
    font-family: var(--font-body);
    transition: all 0.2s;
    border-left: 2px solid transparent;
}

.toc-link:hover,
.toc-link.active {
    color: var(--tan);
    border-left-color: var(--olive);
    background: rgba(74, 93, 35, 0.05);
}

/* Intel entries */
.sidebar-entries {
    padding: 0.25rem 0;
}

.sidebar-entry {
    padding: 0.6rem 1rem;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
}

.sidebar-entry:hover {
    background: rgba(74, 93, 35, 0.05);
}

.sidebar-entry.active {
    border-left-color: var(--olive-light);
    background: rgba(74, 93, 35, 0.1);
}

.entry-type {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1px 6px;
    border-radius: 2px;
    display: inline-block;
}

.entry-type.weapon { color: var(--tan); background: rgba(196, 168, 130, 0.15); }
.entry-type.person { color: var(--olive-light); background: rgba(107, 127, 58, 0.15); }
.entry-type.battle { color: #E74C3C; background: rgba(231, 76, 60, 0.12); }
.entry-type.unit   { color: var(--steel-light); background: rgba(136, 153, 166, 0.15); }
.entry-type.medal  { color: var(--medal-gold); background: rgba(255, 215, 0, 0.12); }
.entry-type.place  { color: #5DADE2; background: rgba(93, 173, 226, 0.12); }

.entry-title {
    color: var(--tan);
    font-family: var(--font-heading);
    font-size: 0.85rem;
    margin-top: 0.2rem;
}

.entry-brief {
    color: var(--steel);
    font-size: 0.78rem;
    margin-top: 0.15rem;
    line-height: 1.4;
}

.entry-detail {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.sidebar-entry.active .entry-detail {
    max-height: 300px;
}

.entry-detail-inner {
    color: var(--steel-light);
    font-size: 0.78rem;
    padding-top: 0.5rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--earth);
}

.entry-specs {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.1rem 0.6rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    margin-bottom: 0.5rem;
}

.entry-specs dt { color: var(--text-muted); }
.entry-specs dd { color: var(--steel-light); }

.entry-link {
    display: inline-block;
    color: var(--olive-light);
    text-decoration: none;
    font-family: var(--font-heading);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.2s;
    margin-top: 0.25rem;
}

.entry-link:hover { color: var(--tan); }

/* Story terms (inline annotations) */
.story-term {
    color: var(--olive-light);
    cursor: pointer;
    border-bottom: 1px dotted rgba(74, 93, 35, 0.6);
    transition: all 0.2s ease;
}

.story-term:hover {
    color: var(--tan);
    border-bottom-color: var(--tan);
}

.story-term.active {
    color: var(--tan);
    background: rgba(74, 93, 35, 0.2);
    border-bottom-color: var(--tan);
    padding: 0 2px;
    border-radius: 2px;
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .site-nav, .reading-progress, .panel-nav, .panel-dots,
    .expand-arrow, .lightbox, .scroll-indicator, .site-footer,
    .story-sidebar, .sidebar-toggle, .sidebar-overlay { display: none !important; }
    body { background: white; color: black; }
    .glass-card { background: white; border: 1px solid #ccc; }
    .expand-content { max-height: none !important; }
    .story-layout { display: block; }
    .story-term { color: inherit; border-bottom: none; cursor: default; }
}
