/* ============================================================
   계엄령.quest — Testimony Archive
   Editorial-flow single-column. Zero animation. Static.
   Palette: Archival Paper
   ============================================================ */

:root {
    --paper-aged: #F5F0E6;
    --foxed-cream: #EDE4D4;
    --archive-dark: #2A2018;
    --ink-fade: #4A3E30;
    --testimony-brown: #5A4A38;
    --margin-gray: #8A7E70;
    --red-thread: #A04040;
    --fold-line: #C8BCA8;

    --column-width: 680px;
    --gutter: 24px;
}

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

html {
    background: var(--paper-aged);
}

body {
    background: var(--paper-aged);
    color: var(--ink-fade);
    font-family: 'Noto Serif KR', 'Nanum Myeongjo', Georgia, serif;
    font-size: 18px;
    line-height: 1.9;
    font-weight: 400;
    min-height: 100vh;
    overflow-x: hidden;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
}

/* ------------------------------------------------------------
   Paper Grain Texture — tiled SVG of faint dots
   ------------------------------------------------------------ */
.paper-grain {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='150' height='150' viewBox='0 0 150 150'><g fill='%232A2018' fill-opacity='0.025'><circle cx='12' cy='8' r='0.8'/><circle cx='37' cy='22' r='0.6'/><circle cx='61' cy='14' r='0.7'/><circle cx='89' cy='29' r='0.5'/><circle cx='114' cy='9' r='0.7'/><circle cx='138' cy='25' r='0.6'/><circle cx='22' cy='48' r='0.5'/><circle cx='51' cy='53' r='0.8'/><circle cx='78' cy='42' r='0.6'/><circle cx='102' cy='59' r='0.7'/><circle cx='128' cy='51' r='0.5'/><circle cx='8' cy='80' r='0.7'/><circle cx='34' cy='91' r='0.6'/><circle cx='62' cy='78' r='0.5'/><circle cx='86' cy='95' r='0.7'/><circle cx='115' cy='84' r='0.6'/><circle cx='141' cy='99' r='0.5'/><circle cx='19' cy='118' r='0.6'/><circle cx='44' cy='131' r='0.7'/><circle cx='73' cy='124' r='0.5'/><circle cx='99' cy='139' r='0.6'/><circle cx='126' cy='121' r='0.7'/></g></svg>");
    background-size: 150px 150px;
    background-repeat: repeat;
    opacity: 0.85;
}

/* ------------------------------------------------------------
   Fixed Chapter Counter — top-right
   ------------------------------------------------------------ */
.chapter-counter {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10;
    font-family: 'IBM Plex Mono', 'Menlo', monospace;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.08em;
    color: var(--margin-gray);
    background: rgba(245, 240, 230, 0.85);
    padding: 8px 14px;
    border: 1px solid rgba(200, 188, 168, 0.45);
    user-select: none;
}

.chapter-counter .counter-label {
    margin-right: 6px;
}

.chapter-counter .counter-current {
    color: var(--archive-dark);
    font-weight: 500;
}

.chapter-counter .counter-divider {
    margin: 0 4px;
    color: var(--fold-line);
}

.chapter-counter .counter-total {
    color: var(--margin-gray);
}

/* ------------------------------------------------------------
   Masthead — title section
   ------------------------------------------------------------ */
.masthead {
    position: relative;
    z-index: 2;
    padding: 160px 32px 120px;
    border-bottom: 1px solid rgba(200, 188, 168, 0.5);
}

.masthead-inner {
    max-width: var(--column-width);
    margin: 0 auto;
}

.masthead-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--margin-gray);
    padding-bottom: 36px;
    border-bottom: 1px solid rgba(200, 188, 168, 0.35);
    margin-bottom: 48px;
}

.masthead-meta .meta-archive {
    font-weight: 500;
}

.masthead-title {
    font-family: 'Nanum Myeongjo', serif;
    font-weight: 800;
    font-size: 76px;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--archive-dark);
    margin-bottom: 28px;
}

.masthead-subtitle {
    font-family: 'Nanum Myeongjo', serif;
    font-weight: 400;
    font-size: 24px;
    line-height: 1.45;
    color: var(--testimony-brown);
    margin-bottom: 36px;
    max-width: 540px;
}

.masthead-deck {
    font-family: 'Noto Serif KR', serif;
    font-style: italic;
    font-weight: 300;
    font-size: 17px;
    line-height: 1.75;
    color: var(--ink-fade);
    margin-bottom: 56px;
    max-width: 580px;
}

.masthead-byline {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.12em;
    color: var(--margin-gray);
    text-transform: uppercase;
}

.masthead-byline .byline-divider {
    margin: 0 12px;
    color: var(--fold-line);
}

/* ------------------------------------------------------------
   Document Body — single column flow
   ------------------------------------------------------------ */
.document {
    position: relative;
    z-index: 2;
    padding: 0;
}

.chapter {
    max-width: var(--column-width);
    margin: 0 auto;
    padding: 96px 32px 96px;
}

.chapter-header {
    margin-bottom: 56px;
    padding-bottom: 36px;
    border-bottom: 1px solid rgba(200, 188, 168, 0.35);
}

.chapter-number {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--red-thread);
    margin-bottom: 24px;
    display: inline-block;
}

.chapter-title {
    font-family: 'Nanum Myeongjo', serif;
    font-weight: 700;
    font-size: 48px;
    line-height: 1.18;
    letter-spacing: -0.012em;
    color: var(--archive-dark);
    margin-bottom: 24px;
}

.chapter-meta {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--margin-gray);
}

/* Body paragraphs */
.chapter p {
    font-family: 'Noto Serif KR', serif;
    font-size: 18px;
    line-height: 1.9;
    color: var(--ink-fade);
    margin-bottom: 28px;
    word-break: keep-all;
    overflow-wrap: break-word;
}

.chapter p.chapter-lede {
    font-size: 19px;
    line-height: 1.85;
    color: var(--archive-dark);
    font-weight: 500;
    margin-bottom: 36px;
}

.chapter p.chapter-lede::first-letter {
    font-family: 'Nanum Myeongjo', serif;
    font-weight: 700;
    font-size: 56px;
    line-height: 0.9;
    float: left;
    margin: 8px 12px 0 0;
    color: var(--archive-dark);
}

/* ------------------------------------------------------------
   Testimony Block — the centerpiece motif
   ------------------------------------------------------------ */
blockquote.testimony {
    border-left: 3px solid var(--red-thread);
    padding: 18px 0 18px 28px;
    margin: 56px 0 56px;
    position: relative;
    background: transparent;
}

blockquote.testimony::before {
    content: '\300C';
    position: absolute;
    top: -42px;
    left: 18px;
    font-family: 'Nanum Myeongjo', serif;
    font-weight: 700;
    font-size: 56px;
    line-height: 1;
    color: rgba(200, 188, 168, 0.55);
    pointer-events: none;
}

blockquote.testimony .testimony-text {
    font-family: 'Gowun Batang', 'Nanum Myeongjo', serif;
    font-weight: 400;
    font-size: 19px;
    line-height: 1.85;
    color: var(--testimony-brown);
    margin-bottom: 22px;
    word-break: keep-all;
    overflow-wrap: break-word;
}

blockquote.testimony .testimony-source {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.1em;
    color: var(--margin-gray);
    line-height: 1.6;
    border-top: 1px solid rgba(200, 188, 168, 0.35);
    padding-top: 14px;
    margin-top: 8px;
}

blockquote.testimony .source-name {
    color: var(--archive-dark);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    margin-right: 6px;
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
}

blockquote.testimony .source-context {
    color: var(--margin-gray);
    font-size: 11.5px;
    letter-spacing: 0.1em;
    text-transform: none;
    display: block;
}

/* ------------------------------------------------------------
   Margin Note — set apart contextual aside
   ------------------------------------------------------------ */
.margin-note {
    margin: 48px 0 0;
    padding: 22px 26px 22px 26px;
    border: 1px solid rgba(200, 188, 168, 0.55);
    background: rgba(237, 228, 212, 0.5);
    position: relative;
}

.margin-note .margin-note-label {
    position: absolute;
    top: -8px;
    left: 22px;
    background: var(--paper-aged);
    padding: 0 8px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--red-thread);
    font-weight: 500;
}

.margin-note p {
    font-family: 'Noto Serif KR', serif;
    font-style: italic;
    font-weight: 300;
    font-size: 15.5px;
    line-height: 1.75;
    color: var(--testimony-brown);
    margin: 0;
    word-break: keep-all;
}

/* ------------------------------------------------------------
   Document Break — full-width foxed-cream band with diamond
   ------------------------------------------------------------ */
hr.document-break {
    border: none;
    background: var(--foxed-cream);
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    height: 120px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

hr.document-break::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(200, 188, 168, 0.55);
    transform: translateY(-50%);
}

hr.document-break::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    border: 1px solid var(--fold-line);
    background: var(--foxed-cream);
    transform: translate(-50%, -50%) rotate(45deg);
    z-index: 2;
}

/* ------------------------------------------------------------
   Colophon — closing note
   ------------------------------------------------------------ */
.colophon {
    position: relative;
    z-index: 2;
    background: var(--foxed-cream);
    border-top: 1px solid rgba(200, 188, 168, 0.5);
    padding: 96px 32px 120px;
    margin-top: 0;
}

.colophon-inner {
    max-width: var(--column-width);
    margin: 0 auto;
    text-align: center;
}

.colophon-line {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.1em;
    color: var(--margin-gray);
    line-height: 1.9;
    margin-bottom: 14px;
}

.colophon-line:first-child {
    color: var(--testimony-brown);
    font-size: 13px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 500;
    margin-bottom: 22px;
}

.colophon-line.colophon-fine {
    font-style: italic;
    font-size: 11.5px;
    color: var(--margin-gray);
    letter-spacing: 0.04em;
    margin-top: 22px;
    line-height: 1.7;
    font-family: 'Noto Serif KR', serif;
    text-transform: none;
}

.colophon-mark {
    font-family: 'Nanum Myeongjo', serif;
    font-size: 16px;
    color: var(--fold-line);
    letter-spacing: 0.5em;
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid rgba(200, 188, 168, 0.4);
}

/* ------------------------------------------------------------
   Selection
   ------------------------------------------------------------ */
::selection {
    background: rgba(160, 64, 64, 0.18);
    color: var(--archive-dark);
}

::-moz-selection {
    background: rgba(160, 64, 64, 0.18);
    color: var(--archive-dark);
}

/* ------------------------------------------------------------
   Responsive — narrow column adjustments
   ------------------------------------------------------------ */
@media (max-width: 720px) {
    body {
        font-size: 17px;
    }

    .chapter-counter {
        top: 16px;
        right: 16px;
        font-size: 11.5px;
        padding: 6px 10px;
    }

    .masthead {
        padding: 120px 22px 88px;
    }

    .masthead-meta {
        flex-direction: column;
        gap: 8px;
        font-size: 11px;
    }

    .masthead-title {
        font-size: 52px;
        letter-spacing: -0.015em;
    }

    .masthead-subtitle {
        font-size: 19px;
    }

    .masthead-deck {
        font-size: 16px;
    }

    .chapter {
        padding: 72px 22px 72px;
    }

    .chapter-title {
        font-size: 36px;
    }

    .chapter p {
        font-size: 17px;
        line-height: 1.85;
    }

    .chapter p.chapter-lede {
        font-size: 18px;
    }

    .chapter p.chapter-lede::first-letter {
        font-size: 46px;
    }

    blockquote.testimony {
        padding-left: 22px;
        margin: 44px 0;
    }

    blockquote.testimony::before {
        font-size: 44px;
        top: -34px;
        left: 14px;
    }

    blockquote.testimony .testimony-text {
        font-size: 17.5px;
    }

    hr.document-break {
        height: 96px;
    }

    .colophon {
        padding: 72px 22px 96px;
    }
}

@media (max-width: 420px) {
    .masthead-title {
        font-size: 42px;
    }

    .chapter-title {
        font-size: 30px;
    }
}
