/* ===================================
   THE ISLAMABAD DOSSIER
   Document-style survival guide
   Stylishly clunky, readable, archival
   =================================== */

@import url('https://fonts.googleapis.com/css2?family=Courier+Prime:wght@400;700&family=Crimson+Pro:wght@400;600;700&family=Lora:wght@400;500;600&family=Atkinson+Hyperlegible:wght@400;700&family=Lexend:wght@300;400;500&family=EB+Garamond:wght@400;500;600&display=swap');

:root {
    /* Muted, warm document colors */
    --paper: #f5f0e6;
    --paper-dark: #e8e0d0;
    --ink: #2c2416;
    --ink-muted: #5c5040;
    --ink-light: #8a7e6a;
    --accent-red: #8b3a3a;
    --accent-gold: #9a7b4f;
    --border-dark: #c4b8a0;
    --border-light: #d8d0c0;
    --shadow: rgba(44, 36, 22, 0.12);

    /* Typography */
    --font-body: 'Crimson Pro', Georgia, 'Times New Roman', serif;
    --font-mono: 'Courier Prime', 'Courier New', monospace;

    /* Sizing */
    --header-height: 70px;
    --max-width: 900px;
    --radius: 3px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    background: var(--paper);
    color: var(--ink);
    line-height: 1.7;
    font-size: 17px;
    -webkit-font-smoothing: antialiased;
}

/* ===================================
   HEADER - Typewriter style
   =================================== */
.header {
    position: sticky;
    top: 0;
    background: var(--ink);
    color: var(--paper);
    padding: 0 20px;
    min-height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1000;
    border-bottom: 3px solid var(--accent-gold);
    transition: transform 0.25s ease, opacity 0.25s ease;
    flex-wrap: wrap;
}

.header.hidden {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--paper);
}

.logo img {
    height: 36px;
    width: 36px;
    border-radius: 2px;
}

.logo-text {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.logo-sub {
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-gold);
    margin-top: 2px;
}

/* Download Button - Intentionally clunky */
.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--accent-red);
    color: var(--paper);
    border: 2px solid var(--paper);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s;
}

.download-btn:hover {
    background: var(--paper);
    color: var(--ink);
    border-color: var(--ink);
}

.download-btn::before {
    content: '↓';
    font-size: 14px;
    font-weight: bold;
}

/* Header Actions Container */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Install Button - Square with diamond icon */
.install-btn {
    width: 38px;
    height: 38px;
    background: rgba(200, 120, 60, 0.35);
    border: 2px solid var(--paper);
    color: rgba(245, 240, 230, 0.7);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.install-btn:hover {
    background: rgba(200, 120, 60, 0.55);
    color: var(--paper);
}

/* Install Dialog Overlay */
.install-dialog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(44, 36, 22, 0.5);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 20vh;
}

.install-dialog-overlay.visible {
    opacity: 1;
    visibility: visible;
}

/* Install Dialog Box */
.install-dialog {
    background: var(--paper);
    border: 2px solid var(--ink);
    padding: 28px 32px 24px;
    max-width: 340px;
    transform: translateY(-20px);
    opacity: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.install-dialog-overlay.visible .install-dialog {
    transform: translateY(0);
    opacity: 1;
}

.install-message {
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
    color: var(--ink);
    margin: 0 0 20px;
    text-align: center;
}

.install-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.install-action-btn {
    width: 38px;
    height: 38px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.install-confirm {
    background: var(--ink);
    color: var(--paper);
    border: 2px solid var(--ink);
    width: auto;
    padding: 0 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.install-confirm:hover {
    background: var(--accent-gold);
    border-color: var(--accent-gold);
}

.install-cancel {
    background: transparent;
    color: var(--ink-muted);
    border: 2px solid var(--border-dark);
    font-size: 14px;
}

.install-cancel:hover {
    background: var(--accent-red);
    color: var(--paper);
    border-color: var(--accent-red);
}

/* ===================================
   SEARCH - Expandable search bar
   =================================== */
.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-toggle {
    width: 38px;
    height: 38px;
    background: transparent;
    border: 2px solid var(--paper);
    color: var(--paper);
    font-size: 16px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-toggle:hover {
    background: var(--paper);
    color: var(--ink);
}

.search-box {
    width: 0;
    overflow: hidden;
    transition: width 0.3s ease, opacity 0.2s ease;
    opacity: 0;
}

.search-container.open .search-box {
    width: 200px;
    opacity: 1;
}

@media (max-width: 600px) {
    .search-container.open .search-box {
        width: 140px;
    }
}

.search-input {
    width: 100%;
    padding: 8px 12px;
    background: var(--paper);
    border: none;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--ink);
    outline: none;
}

.search-input::placeholder {
    color: var(--ink-light);
}

.search-results {
    position: absolute;
    top: 100%;
    right: 0;
    width: 280px;
    max-height: 400px;
    overflow-y: auto;
    background: var(--paper);
    border: 1px solid var(--border-dark);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    display: none;
}

.search-results.visible {
    display: block;
}

.search-result-item {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background 0.15s;
}

.search-result-item:hover {
    background: var(--paper-dark);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-category {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--ink-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.search-result-section {
    font-family: var(--font-serif);
    font-size: 14px;
    color: var(--ink);
    font-weight: 600;
}

.search-no-results {
    padding: 20px;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--ink-light);
}

/* ===================================
   NAVIGATION - Horizontal scroll tabs
   =================================== */
.nav-bar {
    position: sticky;
    top: var(--header-height);
    background: var(--paper-dark);
    border-bottom: 1px solid var(--border-dark);
    z-index: 999;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    transition: top 0.25s ease;
    cursor: grab;
    user-select: none;
}

.nav-bar.dragging {
    cursor: grabbing;
}

.header.hidden~.nav-bar,
body:has(.header.hidden) .nav-bar {
    top: 0;
}

.nav-bar::-webkit-scrollbar {
    height: 6px;
}

.nav-bar::-webkit-scrollbar-track {
    background: transparent;
    margin: 0 10px;
    /* Adds padding on sides */
}

.nav-bar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.4);
    border-radius: 3px;
}

.nav-bar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.6);
}

.nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    min-width: max-content;
}

.nav-item {
    border-right: 1px solid var(--border-dark);
}

.nav-item:last-child {
    border-right: none;
}

.nav-link {
    display: block;
    padding: 14px 20px;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ink-muted);
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.15s;
    border-bottom: 3px solid transparent;
}

.nav-link:hover {
    background: var(--paper);
    color: var(--ink);
}

.nav-link.active {
    background: var(--paper);
    color: var(--accent-red);
    border-bottom-color: var(--accent-red);
}

/* HELPLINES special styling - disproportionate stripes favoring blue */
.nav-link[data-id="helplines"] {
    position: relative;
    overflow: hidden;
    background: repeating-linear-gradient(-45deg,
            rgba(180, 60, 60, 0.12) 0px,
            rgba(180, 60, 60, 0.12) 3px,
            rgba(60, 90, 140, 0.12) 3px,
            rgba(60, 90, 140, 0.12) 12px,
            rgba(180, 60, 60, 0.12) 12px,
            rgba(180, 60, 60, 0.12) 14px,
            rgba(60, 90, 140, 0.12) 14px,
            rgba(60, 90, 140, 0.12) 30px);
}

.nav-link[data-id="helplines"]::before,
.nav-link[data-id="helplines"]::after {
    display: none;
}

.nav-link[data-id="helplines"] {
    z-index: 1;
}

/* SCAM-ALERTS warning styling - subtle amber left edge */
.nav-link[data-id="scam-alerts"] {
    border-left: 3px solid rgba(180, 130, 40, 0.6);
}

/* HOUSING-FRAUD warning styling - subtle amber left edge */
.nav-link[data-id="housing-fraud"] {
    border-left: 3px solid rgba(180, 130, 40, 0.5);
}

/* SCAM-RECOVERY positive styling - subtle green left edge */
.nav-link[data-id="scam-recovery"] {
    border-left: 3px solid rgba(60, 140, 80, 0.5);
}

/* ===================================
   MAIN CONTENT - Document style
   =================================== */
.main-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 40px 24px 100px;
}

/* ===================================
   HOME / COVER PAGE
   =================================== */
.cover-page {
    position: relative;
    text-align: center;
    padding: 60px 20px 80px;
    border: 2px solid var(--border-dark);
    background: var(--paper);
    margin-bottom: 40px;
}

.cover-stamp {
    display: inline-block;
    padding: 8px 24px;
    border: 3px solid var(--accent-red);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-red);
    text-transform: uppercase;
    letter-spacing: 3px;
    transform: rotate(-3deg);
    margin-bottom: 30px;
}

.cover-title {
    font-family: var(--font-mono);
    font-size: clamp(24px, 5vw, 36px);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 4px;
    margin: 0 0 10px;
    color: var(--ink);
}

.cover-subtitle {
    font-family: var(--font-body);
    font-size: 18px;
    font-style: italic;
    color: var(--ink-muted);
    margin: 0 0 30px;
}

.cover-meta {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--ink-light);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.toc-title {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--ink-muted);
    margin: 40px 0 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-dark);
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    columns: 2;
    column-gap: 40px;
}

@media (max-width: 600px) {
    .toc-list {
        columns: 1;
    }
}

.toc-item {
    break-inside: avoid;
    margin-bottom: 12px;
}

.toc-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--paper-dark);
    border: 1px solid var(--border-light);
    border-left: 4px solid var(--accent-gold);
    text-decoration: none;
    color: var(--ink);
    font-size: 15px;
    transition: all 0.15s;
}

.toc-link:hover {
    background: var(--paper);
    border-left-color: var(--accent-red);
    transform: translateX(4px);
}

.toc-icon {
    font-size: 18px;
}

.toc-label {
    font-weight: 600;
}

/* ===================================
   CATEGORY / SECTION PAGE
   =================================== */
.section-header {
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--ink);
}

.section-title {
    font-family: var(--font-mono);
    font-size: clamp(20px, 4vw, 28px);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0 0 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-icon {
    font-size: 28px;
}

.section-description {
    font-size: 16px;
    color: var(--ink-muted);
    font-style: italic;
    margin: 0;
}

/* ===================================
   SUBSECTION - Inline document style
   =================================== */
.subsection {
    margin-bottom: 48px;
    padding-bottom: 32px;
    border-bottom: 1px dashed var(--border-dark);
}

.subsection:last-child {
    border-bottom: none;
}

.subsection-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.subsection-title {
    font-family: var(--font-body);
    font-size: 22px;
    font-weight: 700;
    color: var(--ink);
    margin: 0;
}

.time-tag {
    display: inline-block;
    padding: 4px 12px;
    background: var(--accent-gold);
    color: #fff;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Steps - Numbered list style */
.step-list {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
    counter-reset: step-counter;
}

.step-item {
    position: relative;
    padding: 16px 20px 16px 56px;
    margin-bottom: 12px;
    background: var(--paper-dark);
    border-left: 3px solid var(--border-dark);
    counter-increment: step-counter;
}

/* Subtle warning indicator for red-flag/avoid/scam sections */
.subsection[data-theme="warning"] .step-item {
    border-left-color: rgba(180, 100, 50, 0.5);
}

/* Subtle positive indicator for recovery/success sections */
.subsection[data-theme="positive"] .step-item {
    border-left-color: rgba(60, 130, 80, 0.5);
}

/* Emergency/critical indicator */
.subsection[data-theme="emergency"] .step-item {
    border-left-color: rgba(180, 60, 60, 0.6);
}

.step-item::before {
    content: counter(step-counter);
    position: absolute;
    left: 16px;
    top: 16px;
    width: 24px;
    height: 24px;
    background: var(--ink);
    color: var(--paper);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
}

.step-text {
    font-size: 16px;
    line-height: 1.6;
}

/* Insider Tip - Typed note style */
.insider-tip {
    margin-top: 12px;
    padding: 12px 16px;
    background: #fffbeb;
    border: 1px dashed var(--accent-gold);
    font-family: var(--font-mono);
    font-size: 13px;
    color: #7a5a20;
    line-height: 1.5;
}

.insider-tip::before {
    content: '► TIP: ';
    font-weight: 700;
}

/* Documents Required */
.info-block {
    margin-bottom: 24px;
}

.info-label {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--ink-muted);
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-light);
}

.doc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.doc-list li {
    position: relative;
    padding: 8px 0 8px 28px;
    font-size: 15px;
    border-bottom: 1px dotted var(--border-light);
}

.doc-list li:last-child {
    border-bottom: none;
}

.doc-list li::before {
    content: '□';
    position: absolute;
    left: 0;
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--ink-light);
}

/* Fee Info */
.fee-box {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 24px;
    padding: 16px 20px;
    background: #e8f5e8;
    border: 1px solid #b8d8b8;
    margin-bottom: 24px;
}

.fee-item {
    display: flex;
    flex-direction: column;
}

.fee-label {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #2d6a2d;
}

.fee-value {
    font-family: var(--font-mono);
    font-size: 20px;
    font-weight: 700;
    color: #1e4d1e;
}

/* Locations */
.location-item {
    display: block;
    padding: 14px 16px;
    margin-bottom: 8px;
    background: var(--paper-dark);
    border: 1px solid var(--border-light);
    text-decoration: none;
    color: inherit;
    transition: all 0.15s;
}

.location-item:hover {
    border-color: var(--accent-gold);
    transform: translateX(4px);
}

.location-name {
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 4px;
}

.location-address {
    font-size: 14px;
    color: var(--ink-muted);
}

.location-time {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent-gold);
    margin-top: 6px;
}

/* Links / Sources */
.source-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    margin-right: 8px;
    margin-bottom: 8px;
    background: var(--paper-dark);
    color: var(--ink-muted);
    border: 1px solid var(--border-dark);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    transition: all 0.15s;
}

.source-link:hover {
    background: var(--ink);
    color: var(--paper);
    border-color: var(--ink);
}

.source-link::before {
    content: '◇';
    font-size: 10px;
}

/* ===================================
   LOADING & EMPTY STATES
   =================================== */
.loading {
    text-align: center;
    padding: 80px 20px;
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--ink-light);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.loading::after {
    content: '...';
    animation: dots 1.5s infinite;
}

@keyframes dots {

    0%,
    20% {
        content: '.';
    }

    40% {
        content: '..';
    }

    60%,
    100% {
        content: '...';
    }
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--ink-muted);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.4;
}

/* ===================================
   DESKTOP ENHANCEMENTS
   =================================== */
@media (min-width: 768px) {
    .header {
        padding: 0 40px;
    }

    .logo-text {
        font-size: 16px;
    }

    .nav-link {
        padding: 16px 28px;
        font-size: 13px;
    }

    .main-content {
        padding: 60px 40px 120px;
    }

    .cover-page {
        padding: 80px 40px;
    }

    .subsection-title {
        font-size: 24px;
    }

    .step-item {
        padding: 20px 24px 20px 64px;
    }

    .step-item::before {
        left: 20px;
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
}

@media (min-width: 1024px) {
    .main-content {
        max-width: 1000px;
    }
}

/* ===================================
   FOOTER DISCLAIMER
   =================================== */
.footer-disclaimer {
    padding: 30px 20px 20px;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--ink-light);
    margin-top: 60px;
}

.footer-line {
    width: 60px;
    height: 2px;
    background: var(--border-dark);
    margin: 0 auto 15px;
}

.footer-disclaimer p {
    margin: 0;
    letter-spacing: 0.5px;
}

/* ===================================
   PRINT STYLES (for download/save)
   =================================== */
@media print {

    .header,
    .nav-bar,
    .download-btn {
        display: none;
    }

    .main-content {
        max-width: 100%;
        padding: 20px;
    }

    .subsection {
        break-inside: avoid;
    }
}

/* ===================================
   GEAR ENTRY & LONG-FORM SECTION
   =================================== */

/* Gear entry button - horizontal scratch/smear effect, bottom-right */
.gear-entry {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(100, 80, 60, 0.2) 10%,
            rgba(90, 70, 55, 0.35) 40%,
            rgba(80, 60, 50, 0.25) 70%,
            rgba(70, 55, 45, 0.1) 90%,
            transparent 100%);
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    /* No hover transition - stays static */
}

/* Large V-shaped arrow pointing down - static, no animation */
/* Thin long vertical line */
.gear-entry::before {
    content: '';
    position: absolute;
    top: -85px;
    left: 50%;
    transform: translateX(-50%);
    width: 1.5px;
    height: 55px;
    background: linear-gradient(to bottom,
            transparent 0%,
            var(--ink-light) 8%,
            var(--ink-light) 92%,
            transparent 100%);
    opacity: 0.45;
}

/* Comically big V arrowhead - two angled lines */
.gear-entry::after {
    content: '';
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 20px;
    /* V shape using clip-path */
    background: var(--ink-light);
    clip-path: polygon(0% 0%,
            /* top left */
            8% 0%,
            /* top left inner */
            50% 85%,
            /* bottom center */
            92% 0%,
            /* top right inner */
            100% 0%,
            /* top right */
            50% 100%
            /* bottom point */
        );
    opacity: 0.45;
}

/* No hover effect - stays exactly the same */
.gear-entry:hover {
    cursor: pointer;
    /* just to keep ruleset non-empty */
}

.gear-icon {
    font-size: 22px;
    color: #8b5a2b;
    text-shadow: 2px 2px 0 #5c3d1a, -1px -1px 0 #a07050;
    display: inline-block;
    /* Static - no transform on hover */
}

.gear-label-left,
.gear-label-right {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--ink-muted);
    text-transform: uppercase;
}

/* Methodology entry button - dark blue stacked text */
.methodology-entry {
    position: absolute;
    bottom: 18px;
    left: 15px;
    background: transparent;
    border: none;
    padding: 8px 14px;
    cursor: pointer;
    font-family: 'Courier Prime', 'Courier New', monospace;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #1a2a3a;
    text-shadow:
        1px 1px 0 rgba(255, 255, 255, 0.3);
    opacity: 0.85;
    transition: opacity 0.2s;
    line-height: 1.2;
    text-align: center;
}

.methodology-entry:hover {
    opacity: 1;
}

/* Long-form mode - body state */
body.longform-mode .header {
    position: relative;
    transition: all 0.3s;
}

/* Four-border system - no viewport height calculations */
/* Desktop borders - thin and subtle */
.longform-border-top,
.longform-border-bottom,
.longform-border-left,
.longform-border-right {
    position: fixed;
    background: #a08060;
    pointer-events: none;
    z-index: 50;
}

.longform-border-top {
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
}

.longform-border-bottom {
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
}

.longform-border-left {
    top: 0;
    bottom: 0;
    left: 0;
    width: 2px;
}

.longform-border-right {
    top: 0;
    bottom: 0;
    right: 0;
    width: 2px;
}

/* Blueprint logo effect */
.logo img.blueprint {
    filter: sepia(100%) hue-rotate(180deg) saturate(200%) brightness(0.9);
    transition: filter 0.5s;
}

/* Faded elements */
.logo-sub.faded-out {
    opacity: 0.15;
    transition: opacity 0.5s;
}

.download-btn.disabled,
#search-toggle.disabled {
    opacity: 0.3;
    pointer-events: none;
    transition: opacity 0.3s;
}

/* Long-form window frame */
.longform-window {
    position: relative;
    background: var(--paper);
    min-height: 100vh;
    padding: 0;
    margin: 0;
}

/* Close button */
.longform-close {
    position: fixed;
    top: 20px;
    right: 30px;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: 50%;
    font-size: 24px;
    color: var(--ink-light);
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.3s, color 0.3s;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.longform-close:hover {
    opacity: 0.8;
    color: var(--ink);
}

/* Long-form article styling */
.longform-article {
    max-width: 700px;
    margin: 0 auto;
    padding: 50px 12.5px;
    /* Reduced side padding by half */
}

.longform-header {
    text-align: center;
    margin-bottom: 50px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border-light);
}

.longform-title {
    font-family: var(--font-mono);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 1px;
    margin: 0 0 10px;
    text-transform: uppercase;
}

.longform-subtitle {
    font-family: var(--font-body);
    font-size: 18px;
    color: var(--ink-muted);
    font-style: italic;
    margin: 0;
}

.longform-body {
    font-family: 'Lexend', sans-serif;
    font-size: 14px;
    font-weight: 300;
    line-height: 1.7;
    letter-spacing: 0.015em;
    color: var(--ink);
}

.longform-heading {
    font-family: var(--font-mono);
    font-size: 20px;
    font-weight: 700;
    margin: 50px 0 20px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Aside with decorative fading bars */
.longform-aside {
    position: relative;
    margin: 30px 0;
    padding: 20px 25px;
    font-family: var(--font-mono);
    font-size: 13px;
    font-style: italic;
    color: var(--ink-muted);
    background: transparent;
}

/* Top bar - fades from center outward */
.longform-aside::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 1px;
    background: linear-gradient(90deg,
            transparent 0%,
            var(--ink-light) 15%,
            var(--ink-light) 85%,
            transparent 100%);
    opacity: 0.4;
}

/* Bottom bar - fades from center outward */
.longform-aside::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 1px;
    background: linear-gradient(90deg,
            transparent 0%,
            var(--ink-light) 15%,
            var(--ink-light) 85%,
            transparent 100%);
    opacity: 0.4;
}

.longform-para {
    margin: 0 0 20px;
    text-align: justify;
}

.longform-intro {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    margin-bottom: 50px;
}

.longform-intro.right {
    flex-direction: column;
}

.longform-intro p {
    margin: 0;
    text-align: justify;
}

/* Decorative flourish - gradient line fading at edges */
.longform-flourish {
    position: relative;
    height: 1px;
    width: 40%;
    margin: -45px auto 5px;
    background: linear-gradient(90deg,
            transparent 0%,
            var(--ink-light) 20%,
            var(--ink-light) 80%,
            transparent 100%);
    opacity: 0.4;
}

/* Landscape image - reduced width, centered */
.longform-landscape {
    width: 90%;
    margin: 40px auto 6px;
    clear: both;
    display: block;
}

.longform-img-wide {
    width: 100%;
    height: auto;
    display: block;
    border: 1px solid var(--border-dark);
}

.longform-img-inline {
    width: 200px;
    max-width: 60%;
    height: auto;
    border: 1px solid var(--border-dark);
}

/* Desktop: intro side by side */
@media (min-width: 600px) {
    .longform-intro {
        flex-direction: row;
        align-items: flex-start;
    }

    .longform-intro.right {
        flex-direction: row;
    }

    .longform-intro p {
        flex: 1;
    }

    .longform-img-inline {
        width: 180px;
        max-width: none;
        flex-shrink: 0;
    }
}

/* Inline figures - centered block on mobile, float on desktop */
.longform-figure {
    display: block;
    margin: 20px auto;
    max-width: 200px;
    text-align: center;
}

.longform-figure img {
    width: 100%;
    height: auto;
    border: 1px solid var(--border-dark);
}

.longform-figure figcaption {
    display: none;
}

/* Desktop: float images */
@media (min-width: 600px) {
    .longform-figure {
        float: left;
        margin: 5px 20px 15px 0;
        max-width: 160px;
    }

    .longform-figure:nth-of-type(even) {
        float: right;
        margin: 5px 0 15px 20px;
    }
}

.longform-figure figcaption {
    display: none;
}

.longform-list {
    margin: 20px 0 30px 20px;
    padding-left: 20px;
}

.longform-list li {
    margin-bottom: 12px;
    line-height: 1.6;
}

/* Aside - subtle, less conspicuous */
.longform-aside {
    margin: 25px 0;
    padding: 12px 20px;
    font-size: 13px;
    color: var(--ink-light);
    font-style: italic;
    line-height: 1.6;
    clear: both;
}

/* Clear floats after sections */
.longform-heading {
    clear: both;
}

/* Mobile responsive */
@media (max-width: 600px) {
    .longform-intro {
        flex-direction: column;
    }

    .longform-img-inline {
        width: 100%;
        max-width: 200px;
        margin: 0 auto 15px;
    }

    .longform-close {
        top: 20px;
        right: 12px;
        width: 32px;
        height: 32px;
        font-size: 20px;
    }

    .gear-entry {
        margin-left: 10%;
    }

    .longform-figure {
        float: none;
        max-width: 140px;
        margin: 15px auto;
    }

    .longform-figure:nth-of-type(even) {
        float: none;
        margin: 15px auto;
    }

    /* Mobile: Thicker borders, darker color */
    .longform-border-top,
    .longform-border-bottom {
        height: 4px;
        background: #8a6a4a;
    }

    .longform-border-left,
    .longform-border-right {
        width: 6px;
        background: #8a6a4a;
    }

    /* Fix overscroll bounce and border pop */
    .longform-window {
        overscroll-behavior: none;
        -webkit-overflow-scrolling: auto;
    }

    /* Close button - Uniform Opacity */
    .longform-close {
        top: 20px;
        right: 15px;
        width: 32px;
        height: 32px;
        font-size: 20px;
        opacity: 0;
        /* Hidden by default */
        pointer-events: none;
        transition: opacity 0.3s;
    }

    .longform-close.visible {
        opacity: 0.35;
        /* Target opacity */
        pointer-events: auto;
    }

    /* Scroll-to-top button - Even Smaller (18px) */
    .longform-window .scroll-top-btn,
    .longform-window [class*="scroll"][class*="top"],
    .longform-window button[aria-label*="top"] {
        right: 15px !important;
        width: 18px !important;
        height: 18px !important;
        font-size: 10px !important;
        opacity: 0.35 !important;
    }

    /* Scroll Progress Dots - Ensure Uniform Opacity */
    .scroll-progress-dot {
        opacity: 0.35 !important;
    }
}

/* ===================================
   METHODOLOGY SECTION
   Different style from longform
   Uses Atkinson Hyperlegible for
   enhanced readability
   =================================== */

body.methodology-mode .header {
    position: relative;
    transition: all 0.3s;
}

/* Brown border for methodology mode */
body.methodology-mode::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid #7a6a5a;
    pointer-events: none;
    z-index: 50;
}

.methodology-window {
    position: relative;
    background: #faf8f3;
    min-height: 100vh;
    padding: 0;
    margin: 0;
}

.methodology-close {
    position: fixed;
    top: 20px;
    right: 30px;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: 50%;
    font-size: 24px;
    color: var(--ink-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    /* Hidden by default */
    pointer-events: none;
    transition: opacity 0.3s, color 0.3s;
}

.methodology-close.visible {
    opacity: 0.35;
    /* Appears on scroll */
    pointer-events: auto;
}

.methodology-close:hover {
    opacity: 0.8;
    color: var(--ink);
}

.methodology-article {
    max-width: 700px;
    margin: 0 auto;
    padding: 40px 30px 80px;
}

.methodology-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
    position: relative;
}

.methodology-dates {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: row;
    gap: 20px;
    background: var(--paper);
    padding: 0 15px;
    font-family: 'Courier Prime', monospace;
    font-size: 9px;
    color: var(--ink-muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    opacity: 0.6;
}

.methodology-dates span {
    white-space: nowrap;
}

.methodology-title {
    font-family: 'Atkinson Hyperlegible', sans-serif;
    font-size: 26px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: 1px;
    margin: 0;
}

.methodology-body {
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.7;
    color: var(--ink);
}

.methodology-heading {
    font-family: 'Atkinson Hyperlegible', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--ink);
    margin: 35px 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 1px dotted var(--border-dark);
}

.methodology-para {
    margin: 0 0 18px 0;
    text-align: justify;
    hyphens: auto;
}

/* Mobile responsive for methodology */
@media (max-width: 600px) {
    .methodology-article {
        padding: 30px 20px 60px;
    }

    .methodology-title {
        font-size: 22px;
    }

    .methodology-body {
        font-size: 15px;
    }

    .methodology-close {
        top: 20px;
        right: 15px;
        width: 32px;
        height: 32px;
        font-size: 20px;
    }
}