/* ==========================================================================
   Storiographer — soft serif editorial blog
   Palette: cream #faf6f0, ink #2a2420, accent #8b4513,
            rule #d4c8b0, byline #8a7a6a
   Fonts:   Playfair Display (display), Lora (body), Josefin Sans (byline)
   ========================================================================== */

:root {
    --cream: #faf6f0;
    --ink: #2a2420;
    --accent: #8b4513;
    --rule: #d4c8b0;
    --byline: #8a7a6a;

    --font-display: "Playfair Display", "Times New Roman", Georgia, serif;
    --font-body: "Lora", Georgia, "Times New Roman", serif;
    --font-byline: "Josefin Sans", "Helvetica Neue", Arial, sans-serif;

    --measure: 720px;
    --measure-wide: 880px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    background: var(--cream);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    margin: 0;
    background: var(--cream);
    color: var(--ink);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 1.0625rem;
    line-height: 1.85;
    font-feature-settings: "kern", "liga", "onum";
}

/* ==========================================================================
   Typography primitives
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    color: var(--ink);
    font-weight: 700;
    line-height: 1.18;
    letter-spacing: -0.005em;
    margin: 0 0 0.65em;
}

p {
    margin: 0 0 1.35em;
    hyphens: auto;
    -webkit-hyphens: auto;
}

a {
    color: var(--accent);
    text-decoration-line: underline;
    text-decoration-color: rgba(139, 69, 19, 0.35);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
    transition: text-decoration-color 250ms ease, color 250ms ease;
}

a:hover {
    text-decoration-color: var(--accent);
    color: #6b3410;
}

em, i {
    font-style: italic;
}

::selection {
    background: rgba(139, 69, 19, 0.18);
    color: var(--ink);
}

.kicker {
    font-family: var(--font-byline);
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.78rem;
    color: var(--byline);
    margin: 0 0 1.1em;
}

.byline,
.story-byline,
.story-full-byline {
    font-family: var(--font-body);
    font-style: italic;
    color: var(--byline);
    font-size: 0.98rem;
    margin: 0 0 0.6em;
}

.byline em,
.story-byline em,
.story-full-byline em {
    font-style: italic;
    color: var(--ink);
}

.byline-meta {
    font-family: var(--font-byline);
    font-style: normal;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.74rem;
    color: var(--byline);
    margin-left: 0.4em;
}

.smallcaps {
    font-family: var(--font-byline);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.82em;
    color: var(--ink);
}

/* ==========================================================================
   Hairline & Fleuron rules
   ========================================================================== */

hr.hairline {
    border: 0;
    height: 1px;
    background: var(--rule);
    width: 3.5rem;
    margin: 0.8rem 0 1.6rem;
    opacity: 0.9;
}

hr.fleuron-rule {
    border: 0;
    position: relative;
    height: 1px;
    background: linear-gradient(
        to right,
        transparent 0%,
        var(--rule) 18%,
        var(--rule) 42%,
        transparent 48%,
        transparent 52%,
        var(--rule) 58%,
        var(--rule) 82%,
        transparent 100%
    );
    margin: 3.5rem auto;
    max-width: var(--measure);
    overflow: visible;
}

hr.fleuron-rule::before {
    content: attr(data-ornament);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--cream);
    color: var(--accent);
    font-family: var(--font-display);
    font-size: 1.4rem;
    line-height: 1;
    padding: 0 0.85rem;
    letter-spacing: 0.12em;
}

/* ==========================================================================
   Masthead
   ========================================================================== */

.masthead {
    padding: 4rem 1.5rem 0;
}

.masthead-inner {
    max-width: var(--measure-wide);
    margin: 0 auto;
    text-align: center;
}

.masthead-eyebrow {
    font-family: var(--font-byline);
    font-weight: 300;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    font-size: 0.78rem;
    color: var(--byline);
    margin: 0 0 1.4em;
}

.masthead-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(2.6rem, 6.4vw, 4.6rem);
    line-height: 1;
    letter-spacing: -0.02em;
    margin: 0 0 0.45em;
    color: var(--ink);
}

.masthead-title a {
    color: inherit;
    text-decoration: none;
}

.masthead-tagline {
    font-family: var(--font-body);
    font-style: italic;
    color: var(--byline);
    font-size: 1.05rem;
    margin: 0 0 2.6em;
}

.masthead-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.6rem 2.4rem;
    font-family: var(--font-byline);
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.82rem;
    margin-bottom: 1.4rem;
}

.masthead-nav a {
    color: var(--ink);
    text-decoration: none;
    padding-bottom: 0.25em;
    border-bottom: 1px solid transparent;
    transition: border-color 250ms ease, color 250ms ease;
}

.masthead-nav a:hover {
    border-bottom-color: var(--accent);
    color: var(--accent);
}

.masthead-nav .nav-subscribe {
    color: var(--accent);
    border-bottom: 1px solid var(--rule);
}

.masthead-nav .nav-subscribe:hover {
    border-bottom-color: var(--accent);
}

/* ==========================================================================
   Page container — single column, generous margins
   ========================================================================== */

.page {
    max-width: var(--measure);
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

.section-heading {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.8rem, 3.4vw, 2.6rem);
    margin: 0 0 1.4rem;
    letter-spacing: -0.01em;
}

/* ==========================================================================
   Lead — Editor's letter
   ========================================================================== */

.lead {
    padding: 2rem 0 1rem;
}

.lead-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.1;
    letter-spacing: -0.012em;
    margin: 0 0 0.8rem;
}

.lead-body {
    margin-top: 1.4rem;
}

.lead-paragraph::first-letter,
.opening-paragraph::first-letter {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 4em;
    float: left;
    line-height: 0.8;
    margin: 0.07em 0.1em 0 0;
    color: var(--accent);
    padding: 0.04em 0.05em 0 0;
}

.lead-paragraph,
.opening-paragraph {
    font-size: 1.0625rem;
    line-height: 1.85;
}

/* ==========================================================================
   Story Teaser cards (single-column editorial cards)
   ========================================================================== */

.stories {
    margin-top: 1rem;
}

.story-teaser {
    border-bottom: 1px solid var(--rule);
    padding: 2rem 0;
    transition: background 350ms ease;
}

.story-teaser:last-of-type {
    border-bottom: 1px solid var(--rule);
}

.story-teaser .story-eyebrow {
    font-family: var(--font-byline);
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.74rem;
    color: var(--byline);
    margin: 0 0 0.7em;
}

.story-teaser .story-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.55rem, 3vw, 2.15rem);
    line-height: 1.18;
    letter-spacing: -0.01em;
    margin: 0 0 0.45em;
}

.story-teaser .story-title a {
    color: var(--ink);
    text-decoration: none;
    background-image: linear-gradient(to right, var(--accent), var(--accent));
    background-position: 0 100%;
    background-repeat: no-repeat;
    background-size: 0% 1px;
    transition: background-size 380ms ease, color 380ms ease;
}

.story-teaser .story-title a:hover {
    color: var(--accent);
    background-size: 100% 1px;
}

.story-teaser .story-byline {
    margin-bottom: 0.5em;
}

.story-teaser .story-excerpt {
    font-family: var(--font-body);
    font-style: italic;
    color: var(--ink);
    font-size: 1.05rem;
    line-height: 1.78;
    margin: 1rem 0 1rem;
}

.story-teaser .story-meta {
    font-family: var(--font-byline);
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.72rem;
    color: var(--byline);
    margin: 0;
}

.story-teaser:hover {
    background: rgba(212, 200, 176, 0.16);
}

/* ==========================================================================
   Full Story article
   ========================================================================== */

.story-full {
    padding: 1rem 0 1.5rem;
}

.story-full-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.1;
    letter-spacing: -0.012em;
    margin: 0 0 0.6rem;
}

.story-full-byline {
    margin-bottom: 0.6em;
}

.story-prose p {
    font-size: 1.0625rem;
    line-height: 1.85;
    margin-bottom: 1.4em;
}

.story-prose p + p {
    text-indent: 1.6em;
}

.story-prose p.opening-paragraph,
.story-prose p:first-of-type {
    text-indent: 0;
}

/* Pull quote */
.pull-quote {
    margin: 2.2rem 0;
    border-left: 3px solid var(--accent);
    padding: 0.4rem 0 0.4rem 1.5rem;
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 400;
    font-size: 1.32rem;
    line-height: 1.5;
    color: var(--ink);
    quotes: "\201C" "\201D";
}

.pull-quote::before {
    content: open-quote;
    font-family: var(--font-display);
    font-size: 2.4em;
    line-height: 0;
    vertical-align: -0.34em;
    color: var(--accent);
    margin-right: 0.06em;
}

.pull-quote::after {
    content: close-quote;
    font-family: var(--font-display);
    font-size: 2.4em;
    line-height: 0;
    vertical-align: -0.5em;
    color: var(--accent);
    margin-left: 0.04em;
}

/* Page number footer (per-article) */
.page-number {
    text-align: center;
    font-family: var(--font-byline);
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.4em;
    font-size: 0.78rem;
    color: var(--byline);
    margin: 3rem 0 0;
}

/* ==========================================================================
   Contributors
   ========================================================================== */

.contributors {
    padding: 1.5rem 0 1rem;
}

.contributor {
    padding: 1.4rem 0;
    border-bottom: 1px solid var(--rule);
}

.contributor:last-child {
    border-bottom: 0;
}

.contributor-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.35rem;
    margin: 0 0 0.45em;
    letter-spacing: -0.005em;
}

.contributor-bio {
    font-size: 1rem;
    line-height: 1.78;
    color: var(--ink);
    margin: 0;
}

/* ==========================================================================
   Subscribe
   ========================================================================== */

.subscribe {
    padding: 1rem 0;
}

.subscribe-intro {
    font-size: 1.05rem;
    line-height: 1.78;
    margin-bottom: 1.6em;
}

.subscribe-form {
    margin-top: 1.4rem;
}

.subscribe-label {
    display: block;
    font-family: var(--font-byline);
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.74rem;
    color: var(--byline);
    margin-bottom: 0.7em;
}

.subscribe-row {
    display: flex;
    gap: 0.8rem;
    align-items: stretch;
    border-bottom: 1px solid var(--ink);
    padding-bottom: 0.55rem;
    transition: border-color 320ms ease;
}

.subscribe-row:focus-within {
    border-bottom-color: var(--accent);
}

.subscribe-row input[type="email"] {
    flex: 1 1 auto;
    border: 0;
    background: transparent;
    font-family: var(--font-body);
    font-size: 1.05rem;
    color: var(--ink);
    padding: 0.5rem 0;
    outline: none;
    min-width: 0;
}

.subscribe-row input[type="email"]::placeholder {
    color: rgba(138, 122, 106, 0.7);
    font-style: italic;
}

.subscribe-button {
    border: 1px solid var(--accent);
    background: transparent;
    color: var(--accent);
    font-family: var(--font-byline);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.78rem;
    padding: 0.65rem 1.3rem;
    cursor: pointer;
    transition: background 280ms ease, color 280ms ease;
}

.subscribe-button:hover {
    background: var(--accent);
    color: var(--cream);
}

.subscribe-note,
.subscribe-confirm {
    font-family: var(--font-byline);
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.72rem;
    color: var(--byline);
    margin: 1em 0 0;
}

.subscribe-confirm {
    color: var(--accent);
    font-style: normal;
}

/* ==========================================================================
   Colophon
   ========================================================================== */

.colophon {
    padding: 1rem 0;
}

.colophon p {
    font-size: 1rem;
    line-height: 1.8;
}

/* ==========================================================================
   Endpiece (footer)
   ========================================================================== */

.endpiece {
    max-width: var(--measure);
    margin: 0 auto;
    padding: 1rem 1.5rem 4rem;
    text-align: center;
}

.endpiece-line {
    font-family: var(--font-body);
    font-style: italic;
    color: var(--byline);
    font-size: 0.95rem;
    margin: 0 0 0.8rem;
}

.endpiece-folio {
    font-family: var(--font-byline);
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.5em;
    font-size: 0.82rem;
    color: var(--accent);
    margin: 0;
}

/* ==========================================================================
   Back-to-top — fleuron link
   ========================================================================== */

.back-to-top {
    position: fixed;
    right: 1.6rem;
    bottom: 1.6rem;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.95rem;
    background: var(--cream);
    border: 1px solid var(--rule);
    color: var(--accent);
    text-decoration: none;
    font-family: var(--font-byline);
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.72rem;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 360ms ease, transform 360ms ease, border-color 280ms ease;
    z-index: 12;
}

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

.back-to-top:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.back-to-top-mark {
    font-family: var(--font-display);
    font-size: 1rem;
    line-height: 1;
}

/* ==========================================================================
   Reveal animation
   ========================================================================== */

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

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   Reading progress strip — a hairline at the very top of the page
   ========================================================================== */

.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 0;
    background: var(--accent);
    z-index: 14;
    transition: width 90ms linear;
}

/* ==========================================================================
   Responsive niceties
   ========================================================================== */

@media (max-width: 600px) {
    .masthead {
        padding-top: 2.4rem;
    }

    .masthead-nav {
        gap: 1rem 1.4rem;
    }

    hr.fleuron-rule {
        margin: 2.6rem auto;
    }

    .pull-quote {
        font-size: 1.15rem;
        padding-left: 1.2rem;
    }

    .back-to-top {
        right: 1rem;
        bottom: 1rem;
        padding: 0.45rem 0.8rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .reveal,
    .reveal.is-visible,
    .back-to-top,
    .reading-progress {
        transition: none;
    }
}
