/* =========================================================
   munj.uk  -  First Principles
   British editorial magazine
   Palette:
     #fafaf8  Paper White (background)
     #1a1a1a  Print Black (primary text)
     #003366  Navy Authority (primary accent)
     #c8a960  Gold Pioneer (secondary accent)
     #f2f0ec  Warm Ivory (section backgrounds)
     #666666  Column Gray (secondary text)
     #e0ddd5  Rule Line (borders)
   ========================================================= */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    background-color: #fafaf8;
    color: #1a1a1a;
    font-family: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
    font-weight: 400;
    font-size: 0.95rem;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Subtle paper grain background */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
        radial-gradient(rgba(26, 26, 26, 0.025) 1px, transparent 1px),
        radial-gradient(rgba(0, 51, 102, 0.012) 1px, transparent 1px);
    background-size: 3px 3px, 7px 7px;
    background-position: 0 0, 1px 2px;
    mix-blend-mode: multiply;
    opacity: 0.55;
}

a {
    color: #003366;
    text-decoration: none;
    border-bottom: 1px solid #e0ddd5;
    transition: border-color 220ms ease, color 220ms ease;
}

a:hover {
    border-bottom-color: #c8a960;
    color: #1a1a1a;
}

p {
    margin: 0 0 1.1rem 0;
}

em {
    font-family: "Spectral", "Source Sans 3", serif;
    font-style: italic;
}

strong {
    font-weight: 700;
    letter-spacing: 0.01em;
}

/* =========================================================
   Sticky masthead
   ========================================================= */
.masthead-sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background-color: rgba(250, 250, 248, 0.94);
    backdrop-filter: saturate(120%) blur(6px);
    -webkit-backdrop-filter: saturate(120%) blur(6px);
    border-bottom: 1px solid transparent;
    transform: translateY(-110%);
    transition: transform 360ms cubic-bezier(0.2, 0.7, 0.2, 1),
                border-color 360ms ease;
}

.masthead-sticky.is-visible {
    transform: translateY(0);
    border-bottom-color: #1a1a1a;
}

.sticky-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 0.7rem 2rem;
    display: flex;
    align-items: baseline;
    gap: 1.25rem;
}

.logomark {
    font-family: "DM Serif Text", "Georgia", serif;
    font-size: 1.3rem;
    color: #1a1a1a;
    border-bottom: none;
    letter-spacing: -0.01em;
}

.logomark .dot {
    color: #c8a960;
}

.logomark:hover {
    color: #003366;
    border-bottom: none;
}

.sticky-tagline {
    font-family: "Spectral", serif;
    font-style: italic;
    color: #666666;
    font-size: 0.85rem;
}

.sticky-issue {
    margin-left: auto;
    font-family: "Source Sans 3", sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.7rem;
    color: #666666;
}

/* =========================================================
   Outer paper container
   ========================================================= */
.paper {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

@media (min-width: 720px) {
    .paper {
        padding: 3rem 2rem 4rem;
    }
}

/* =========================================================
   Hero
   ========================================================= */
.hero {
    padding: 4rem 0 3rem;
    text-align: center;
}

.hero-meta-top {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    font-size: 0.7rem;
    color: #666666;
    margin-bottom: 2.5rem;
}

.hero-divider {
    color: #c8a960;
}

.hero-title {
    font-family: "DM Serif Text", "Georgia", serif;
    font-weight: 400;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    line-height: 1.0;
    letter-spacing: -0.02em;
    color: #1a1a1a;
    margin: 0;
}

.hero-dot {
    color: #c8a960;
}

.hero-rule {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    margin: 1.8rem auto 1.4rem;
    max-width: 360px;
}

.hero-rule-bar {
    flex: 1;
    height: 1px;
    background-color: #1a1a1a;
}

.hero-rule-mark {
    color: #c8a960;
    font-size: 0.95rem;
    transform: translateY(-1px);
}

.hero-subtitle {
    font-family: "Source Sans 3", sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.45em;
    font-size: 0.85rem;
    color: #003366;
    margin: 0 0 1.6rem 0;
    padding-left: 0.45em; /* optical balance for letter-spacing */
}

.hero-translation {
    margin: 0 auto 2rem;
    max-width: 560px;
    color: #1a1a1a;
}

.hangul {
    font-family: "DM Serif Text", "Source Sans 3", serif;
    font-size: 1.6rem;
    color: #003366;
    margin-right: 0.4rem;
    letter-spacing: 0.05em;
}

.hero-gloss {
    font-family: "Spectral", serif;
    font-style: italic;
    color: #666666;
    font-size: 1rem;
}

.hero-deck {
    font-family: "Spectral", serif;
    font-size: 1.15rem;
    line-height: 1.6;
    color: #1a1a1a;
    max-width: 620px;
    margin: 0 auto;
    font-style: italic;
}

/* =========================================================
   Double-line section header
   ========================================================= */
.section-head.double-rule {
    border-top: 2px solid #1a1a1a;
    border-bottom: 1px solid #1a1a1a;
    padding: 0.5rem 0;
    margin: 3.5rem 0 2rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-size: 0.8rem;
    color: #1a1a1a;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.section-head.double-rule.wide {
    margin-top: 4rem;
}

.section-head .head-no {
    color: #c8a960;
    font-family: "Spectral", serif;
    font-style: italic;
    text-transform: none;
    letter-spacing: 0.05em;
    font-size: 0.85rem;
    font-weight: 400;
}

.section-head .head-title {
    flex: 1;
    text-align: center;
    font-family: "Source Sans 3", sans-serif;
    font-weight: 700;
}

.section-head .head-folio {
    color: #666666;
    font-weight: 400;
    font-family: "Spectral", serif;
    font-style: italic;
    text-transform: none;
    letter-spacing: 0.04em;
    font-size: 0.85rem;
    text-align: right;
}

/* =========================================================
   Leader / Editor's Note
   ========================================================= */
.leader-body {
    max-width: 640px;
    margin: 0 auto;
    padding-bottom: 2rem;
}

.leader-lede {
    font-family: "Spectral", serif;
    font-size: 1.18rem;
    line-height: 1.65;
    color: #1a1a1a;
}

.dropcap {
    float: left;
    font-family: "DM Serif Text", "Georgia", serif;
    font-size: 4.2rem;
    line-height: 0.85;
    padding: 0.4rem 0.6rem 0 0;
    color: #003366;
}

.signoff {
    font-family: "Spectral", serif;
    font-style: italic;
    color: #666666;
    margin-top: 1.5rem;
}

/* =========================================================
   Feature article
   ========================================================= */
.feature {
    position: relative;
    padding: 2rem 0 2.5rem;
    border-bottom: 1px solid #e0ddd5;
    background-color: transparent;
}

.feature:last-of-type {
    border-bottom: none;
}

.feature::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 1px;
    background: linear-gradient(
        to right,
        transparent 0%,
        #c8a960 12%,
        #c8a960 88%,
        transparent 100%
    );
    opacity: 0.0;
    transition: opacity 600ms ease;
}

.feature.in-view::before {
    opacity: 0.35;
}

.pioneer-number {
    float: left;
    font-family: "DM Serif Text", "Georgia", serif;
    font-size: 3rem;
    font-weight: 700;
    color: #c8a960;
    opacity: 0.4;
    line-height: 1;
    margin-right: 1rem;
    margin-top: 0.1rem;
    letter-spacing: -0.02em;
    transition: opacity 500ms ease, transform 500ms ease;
}

.feature.in-view .pioneer-number {
    opacity: 0.6;
    transform: translateX(0);
}

.feature-kicker {
    font-family: "Source Sans 3", sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    font-size: 0.7rem;
    color: #003366;
    margin: 0.2rem 0 0.4rem;
    font-weight: 600;
}

.feature-title {
    font-family: "DM Serif Text", "Georgia", serif;
    font-weight: 400;
    font-size: clamp(1.7rem, 3.3vw, 2.4rem);
    line-height: 1.15;
    color: #1a1a1a;
    margin: 0 0 0.4rem 0;
    letter-spacing: -0.01em;
}

.feature-byline {
    font-family: "Spectral", serif;
    font-style: italic;
    color: #666666;
    font-size: 0.95rem;
    margin: 0 0 1.4rem 0;
    border-bottom: 1px solid #e0ddd5;
    padding-bottom: 0.9rem;
}

/* Magazine two-column layout for body */
.magazine-cols {
    column-count: 2;
    column-gap: 2.5rem;
    column-rule: 1px solid #e0ddd5;
    margin-top: 1rem;
}

.magazine-cols p {
    break-inside: avoid;
}

.magazine-cols p:first-child::first-line {
    font-variant: small-caps;
    letter-spacing: 0.05em;
    color: #1a1a1a;
}

/* Pull quotes */
.pull-quote {
    column-span: all;
    font-family: "Spectral", serif;
    font-style: italic;
    font-weight: 400;
    font-size: 1.4rem;
    line-height: 1.45;
    color: #003366;
    border-left: 3px solid #c8a960;
    padding-left: 1rem;
    margin: 2rem 0;
    max-width: 720px;
}

/* Single-column fallback at narrow widths */
@media (max-width: 640px) {
    .magazine-cols {
        column-count: 1;
        column-rule: none;
    }
    .pull-quote {
        font-size: 1.2rem;
    }
    .pioneer-number {
        font-size: 2.4rem;
    }
}

/* =========================================================
   Index of Firsts
   ========================================================= */
.index-firsts {
    background-color: #f2f0ec;
    padding: 2.5rem 1.8rem 3rem;
    margin: 4rem -1.8rem 0;
    border-top: 1px solid #e0ddd5;
    border-bottom: 1px solid #e0ddd5;
}

.index-firsts .section-head.double-rule.wide {
    margin-top: 0;
}

.firsts-list {
    max-width: 720px;
    margin: 0 auto;
}

.first-row {
    display: flex;
    align-items: baseline;
    gap: 1.4rem;
    padding: 0.85rem 0;
    border-bottom: 1px dotted #c8a960;
    transition: background-color 280ms ease, padding-left 280ms ease;
}

.first-row:last-child {
    border-bottom: none;
}

.first-row:hover {
    background-color: rgba(200, 169, 96, 0.08);
    padding-left: 0.5rem;
}

.first-year {
    font-family: "DM Serif Text", "Georgia", serif;
    font-size: 1.2rem;
    color: #003366;
    flex: 0 0 auto;
    min-width: 4.2rem;
    letter-spacing: 0.01em;
}

.first-entry {
    font-family: "Source Sans 3", sans-serif;
    color: #1a1a1a;
    line-height: 1.55;
    font-size: 0.95rem;
}

/* =========================================================
   Colophon
   ========================================================= */
.colophon {
    padding-top: 1rem;
}

.colophon-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem 2.5rem;
    max-width: 720px;
    margin: 1.5rem auto 0;
}

@media (max-width: 640px) {
    .colophon-grid {
        grid-template-columns: 1fr;
    }
}

.colophon-block p {
    color: #666666;
    font-size: 0.9rem;
    line-height: 1.65;
    margin: 0;
}

.colophon-label {
    font-family: "Source Sans 3", sans-serif !important;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    font-size: 0.7rem;
    color: #1a1a1a !important;
    margin-bottom: 0.5rem !important;
    font-weight: 600;
    border-bottom: 1px solid #c8a960;
    padding-bottom: 0.3rem;
    display: inline-block;
}

.motto {
    color: #003366 !important;
    font-family: "Spectral", serif;
    font-style: italic;
    font-size: 1.05rem !important;
}

/* =========================================================
   Footer
   ========================================================= */
.paper-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    text-align: center;
}

.footer-rule {
    width: 60px;
    height: 1px;
    background-color: #1a1a1a;
    margin: 0 auto 1.5rem;
    position: relative;
}

.footer-rule::before,
.footer-rule::after {
    content: "";
    position: absolute;
    top: 0;
    width: 4px;
    height: 4px;
    background-color: #c8a960;
    border-radius: 50%;
    transform: translateY(-1.5px);
}

.footer-rule::before { left: -10px; }
.footer-rule::after { right: -10px; }

.footer-line {
    font-family: "Source Sans 3", sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    font-size: 0.75rem;
    color: #1a1a1a;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin: 0 0 0.8rem;
}

.footer-dot {
    color: #c8a960;
}

.footer-fine {
    font-family: "Spectral", serif;
    font-style: italic;
    color: #666666;
    font-size: 0.85rem;
    max-width: 540px;
    margin: 0 auto;
}

/* =========================================================
   To-top button
   ========================================================= */
.to-top {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 40;
    background-color: #fafaf8;
    color: #1a1a1a;
    border: 1px solid #1a1a1a;
    border-radius: 0;
    font-family: "Source Sans 3", sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.7rem;
    padding: 0.6rem 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 320ms ease, transform 320ms ease,
                background-color 220ms ease, color 220ms ease;
}

.to-top.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.to-top:hover {
    background-color: #1a1a1a;
    color: #fafaf8;
}

.to-top:hover .to-top-arrow {
    color: #c8a960;
}

.to-top-arrow {
    color: #c8a960;
    font-size: 0.95rem;
    transition: color 220ms ease;
}

@media (max-width: 640px) {
    .to-top-label {
        display: none;
    }
    .to-top {
        padding: 0.6rem 0.7rem;
    }
}

/* =========================================================
   Reveal-on-scroll utility
   ========================================================= */
.feature,
.leader,
.index-firsts,
.colophon,
.hero {
    opacity: 1;
}

.reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 700ms ease, transform 700ms ease;
}

.reveal.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================================
   Print niceties (still single column for safety)
   ========================================================= */
@media print {
    body { background: #ffffff; }
    .masthead-sticky,
    .to-top { display: none; }
    .magazine-cols { column-count: 2; }
}
