@font-face {
  font-family: "Ferieles Serif";
  src: local("Iowan Old Style"), local("Palatino Linotype"), local("Book Antiqua");
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #101512;
  --bg-deep: #0b0f0d;
  --surface: #171d19;
  --surface-2: #1d251f;
  --surface-3: #263029;
  --line: rgba(244, 239, 223, 0.13);
  --line-strong: rgba(244, 239, 223, 0.23);
  --text: #f3efdf;
  --muted: #a7afa7;
  --soft: #d2d2c6;
  --accent: #d8c47c;
  --accent-bright: #eedb91;
  --green: #8caa86;
  --paper: #171c19;
  --paper-text: #ece9de;
  --header-bg: rgba(16, 21, 18, 0.84);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
  --serif: "Ferieles Serif", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --reader-size: 1.2rem;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f3efe5;
  --bg-deep: #e7e0d2;
  --surface: #faf7ef;
  --surface-2: #e9e5d9;
  --surface-3: #d9ded2;
  --line: rgba(34, 48, 39, 0.13);
  --line-strong: rgba(34, 48, 39, 0.23);
  --text: #1c2921;
  --muted: #667069;
  --soft: #445149;
  --accent: #8b7430;
  --accent-bright: #725e23;
  --green: #607b5e;
  --paper: #fbf8f0;
  --paper-text: #29342d;
  --header-bg: rgba(243, 239, 229, 0.88);
  --shadow: 0 24px 70px rgba(42, 47, 39, 0.14);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 100px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
a { color: inherit; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  transform: translateY(-160%);
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 78px;
  padding: 0 clamp(20px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 680;
  letter-spacing: -0.04em;
  text-decoration: none;
}
.brand em { color: var(--accent); font-family: var(--serif); font-weight: 500; }
.brand-mark {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}
.brand-mark svg { width: 24px; fill: none; stroke: var(--accent); stroke-width: 1.7; stroke-linejoin: round; }
.header-actions { display: flex; align-items: center; gap: 14px; }
.offline-status { color: var(--muted); font-size: 0.74rem; }
.offline-status::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: var(--green); }
.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.icon-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
[data-theme="dark"] .icon-button .moon, [data-theme="light"] .icon-button .sun { display: none; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(420px, 1.1fr);
  min-height: min(720px, calc(100svh - 78px));
  border-bottom: 1px solid var(--line);
}
.hero-copy {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex-direction: column;
  padding: 84px clamp(26px, 6vw, 96px);
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 22px;
  color: var(--accent);
  font-size: 0.69rem;
  font-weight: 750;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.eyebrow span { display: inline-block; width: 24px; height: 1px; background: currentColor; }
h1, h2 { margin: 0; font-family: var(--serif); font-weight: 500; letter-spacing: -0.045em; }
h1 { max-width: 690px; font-size: clamp(3.5rem, 6.5vw, 6.4rem); line-height: 0.93; }
h1 i { color: var(--accent); font-weight: 400; }
.hero-intro { max-width: 520px; margin: 34px 0 38px; color: var(--soft); font-family: var(--serif); font-size: clamp(1.1rem, 1.6vw, 1.34rem); line-height: 1.6; }
.usp-pill { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 24px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 99px; background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--soft); font-size: .72rem; font-weight: 720; letter-spacing: .025em; }
.usp-pill span { color: var(--accent); }
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  min-height: 52px;
  padding: 0 22px;
  border: 0;
  border-radius: 3px;
  background: var(--accent);
  color: #171912;
  font-size: 0.78rem;
  font-weight: 760;
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}
.primary-button:hover { transform: translateY(-2px); background: var(--accent-bright); }

.hero-art { position: relative; min-height: 520px; overflow: hidden; background: #19241f; isolation: isolate; }
.moon-orb { position: absolute; top: 17%; right: 19%; width: clamp(110px, 14vw, 190px); aspect-ratio: 1; border-radius: 50%; background: #e2d8aa; box-shadow: 0 0 70px rgba(229, 219, 170, 0.2); }
.moon-orb::after { content: ""; position: absolute; inset: 19% auto auto 16%; width: 17%; aspect-ratio: 1; border-radius: 50%; background: rgba(116, 116, 95, 0.12); box-shadow: 45px 35px 0 9px rgba(116, 116, 95, 0.08), 18px 72px 0 2px rgba(116, 116, 95, 0.09); }
.stars { position: absolute; top: 14%; left: 12%; color: rgba(244, 239, 223, 0.55); font-family: var(--serif); font-size: 1.1rem; line-height: 4; letter-spacing: 0.5em; }
.mountains { position: absolute; inset: auto 0 0; width: 100%; height: 75%; }
.mountain-back { fill: #506258; }
.mountain-front { fill: #2c3932; }
.trail { fill: none; stroke: rgba(218, 203, 146, 0.35); stroke-width: 3; stroke-dasharray: 5 9; }
.hero-caption { position: absolute; right: clamp(20px, 5vw, 64px); bottom: 36px; color: rgba(244, 239, 223, 0.72); font-family: var(--serif); font-size: 0.9rem; font-style: italic; line-height: 1.5; text-align: right; }

.library { max-width: 1500px; margin: 0 auto; padding: 104px clamp(20px, 5vw, 72px) 120px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 38px; }
.section-heading .eyebrow { margin-bottom: 14px; }
.section-heading h2 { font-size: clamp(2.45rem, 4vw, 4rem); }
#story-count { margin: 0 0 7px; color: var(--muted); font-family: var(--serif); font-size: 0.95rem; font-style: italic; }
.library-status { max-width: 390px; text-align: right; }
.toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 24px; margin-bottom: 48px; padding: 22px 0 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.filters { display: grid; min-width: 0; gap: 14px; }
.length-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(10px, 1.7vw, 22px); }
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 680;
  cursor: pointer;
}
.filter-chip:hover { color: var(--text); background: var(--surface); }
.filter-chip.is-active { border-color: var(--line-strong); background: var(--surface-2); color: var(--text); }
.length-filter { justify-content: flex-start; gap: 12px; min-height: 98px; padding: 16px 16px 16px 21px; overflow: hidden; border: 0; border-radius: 27px; color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.16), 0 14px 30px rgba(0,0,0,.17); transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease; }
.length-filter:hover { color: #fff; filter: brightness(1.06); transform: translateY(-2px); }
.length-filter.is-active { color: #fff; box-shadow: inset 0 0 0 3px rgba(255,255,255,.92), 0 16px 36px rgba(0,0,0,.25); transform: translateY(-2px); }
.length-short, .length-short:hover, .length-short.is-active { background: linear-gradient(125deg, #263a30, #4f6a51); }
.length-medium, .length-medium:hover, .length-medium.is-active { background: linear-gradient(125deg, #665a35, #a18749); }
.length-long, .length-long:hover, .length-long.is-active { background: linear-gradient(125deg, #5a403b, #855643); }
.filter-copy { display: grid; min-width: 0; gap: 4px; margin-right: auto; text-align: left; }
.filter-copy strong { font-size: clamp(1rem, 1.7vw, 1.35rem); line-height: 1.05; white-space: nowrap; }
.filter-copy small { color: rgba(255,255,255,.94); font-size: .86rem; font-weight: 650; line-height: 1; }
.filter-arrow { display: grid; flex: 0 0 48px; width: 48px; height: 48px; place-items: center; border: 1px solid rgba(216,196,124,.42); border-radius: 50%; background: rgba(243,239,223,.94); color: #1c2921; font-size: 1.65rem; font-weight: 400; line-height: 1; }
.filter-utilities { display: flex; flex-wrap: wrap; gap: 7px; }
.filter-utility { min-height: 36px; padding: 0 13px; border-color: var(--line); }
.sort-label { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 0.74rem; font-weight: 700; white-space: nowrap; }
.sort-label svg { width: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; }

.story-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(18px, 2.2vw, 32px); }
.story-card { min-width: 0; }
.card-open { display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.cover { position: relative; display: block; aspect-ratio: 1.32; overflow: hidden; border: 1px solid rgba(255,255,255,.08); border-radius: 4px 4px 0 0; background: #33443a; box-shadow: var(--shadow); transition: transform 220ms ease, filter 220ms ease; }
.card-open:hover .cover { transform: translateY(-4px); filter: brightness(1.06); }
.cover-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.cover.has-image::before, .cover.has-image::after, .cover.has-image .cover-stars, .cover.has-image .cover-icon { display: none; }
.cover.has-image .cover-sky { background: linear-gradient(180deg, transparent 46%, rgba(8, 12, 9, .3)); }
.cover::before, .cover::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.08); }
.cover::before { width: 70%; aspect-ratio: 1; right: -23%; top: -48%; }
.cover::after { width: 55%; aspect-ratio: 1; left: -15%; bottom: -40%; }
.cover-sky { position: absolute; inset: 0; background: linear-gradient(158deg, rgba(255,255,255,.11), transparent 45%, rgba(0,0,0,.18)); }
.cover-stars { position: absolute; top: 15%; right: 12%; color: rgba(255,255,255,.48); font-family: var(--serif); font-size: clamp(.8rem, 1.4vw, 1.1rem); letter-spacing: .3em; }
.cover-icon { position: absolute; left: 50%; top: 51%; transform: translate(-50%, -50%); font-size: clamp(3.9rem, 7vw, 6.6rem); filter: grayscale(.18) drop-shadow(0 15px 20px rgba(0,0,0,.25)); line-height: 1; }
.read-badge { position: absolute; left: 14px; bottom: 14px; display: none; align-items: center; gap: 5px; padding: 6px 9px; border: 1px solid rgba(255,255,255,.18); border-radius: 99px; background: rgba(10,15,12,.76); color: #f4efdf; font-size: .63rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; backdrop-filter: blur(10px); }
.read-badge svg { width: 13px; fill: none; stroke: #d8c47c; stroke-width: 2; }
.story-card.is-read .read-badge { display: inline-flex; }
.story-card.is-read .cover-icon { opacity: .68; }
.palette-ember { background: #7f4438; }.palette-moss { background: #38513e; }.palette-plum { background: #5a4057; }.palette-wheat { background: #887044; }.palette-midnight { background: #263651; }.palette-fjord { background: #36616a; }.palette-meadow { background: #587846; }.palette-aurora { background: #3e5962; }.palette-sunset { background: #9a6040; }.palette-berry { background: #754c55; }.palette-clay { background: #8c5d45; }.palette-ocean { background: #285d73; }
.card-body { display: block; min-height: 225px; padding: 20px 18px 22px; border: 1px solid var(--line); border-top: 0; background: var(--surface); }
.card-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .66rem; font-weight: 720; letter-spacing: .11em; text-transform: uppercase; }
.length-label { color: var(--accent); }
.card-title { display: block; margin: 15px 0 9px; font-family: var(--serif); font-size: clamp(1.28rem, 2vw, 1.7rem); font-weight: 500; line-height: 1.08; letter-spacing: -.025em; }
.card-blurb { display: -webkit-box; min-height: 3.9em; overflow: hidden; color: var(--muted); font-family: var(--serif); font-size: .91rem; line-height: 1.48; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.card-cta { display: flex; align-items: center; justify-content: space-between; margin-top: 19px; color: var(--soft); font-size: .68rem; font-weight: 760; letter-spacing: .08em; text-transform: uppercase; }
.card-cta span { color: var(--accent); font-size: 1rem; transition: transform 160ms ease; }
.card-open:hover .card-cta span { transform: translateX(4px); }
.empty-state { padding: 60px 20px; border: 1px dashed var(--line-strong); color: var(--muted); font-family: var(--serif); font-size: 1.1rem; text-align: center; }

.trust-note { display: flex; align-items: baseline; justify-content: center; gap: 12px 28px; max-width: 1356px; margin: -58px auto 28px; padding: 20px clamp(22px, 4vw, 42px); border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--line)); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); text-align: center; }
.trust-note strong { color: var(--text); font-family: var(--serif); font-size: 1.12rem; font-weight: 500; }
.trust-note span { color: var(--muted); font-size: .78rem; }

.offline-note { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 24px; max-width: 1356px; margin: 0 auto 100px; padding: 30px clamp(22px, 4vw, 42px); border: 1px solid var(--line); background: var(--surface); }
.offline-icon { display: grid; width: 54px; height: 54px; place-items: center; border-radius: 50%; background: var(--surface-3); color: var(--accent); }
.offline-icon svg { width: 26px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.offline-note h2 { font-size: 1.28rem; letter-spacing: -.02em; }
.offline-note p { max-width: 650px; margin: 7px 0 0; color: var(--muted); font-family: var(--serif); font-size: .93rem; line-height: 1.5; }
.text-button { border: 0; border-bottom: 1px solid currentColor; background: none; color: var(--muted); font-size: .7rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; cursor: pointer; }
.text-button:hover { color: var(--text); }

footer { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 36px clamp(20px, 5vw, 72px); border-top: 1px solid var(--line); color: var(--muted); font-size: .68rem; }
footer p { margin: 0; }
footer a:not(.brand) { text-underline-offset: 3px; }
.footer-brand { font-size: 1rem; }

.reader { width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 0; border: 0; background: var(--paper); color: var(--paper-text); }
.reader::backdrop { background: rgba(0,0,0,.6); }
.reader[open] { animation: reader-in 240ms ease-out; }
@keyframes reader-in { from { opacity: 0; transform: translateY(16px); } }
.reader-shell { display: flex; flex-direction: column; height: 100svh; }
.story-border { --border-primary: var(--accent); --border-secondary: var(--green); position: fixed; z-index: 2; top: 70px; bottom: 0; display: flex; width: 46px; overflow: hidden; flex-direction: column; padding: 0; border: 0; background: var(--paper); box-shadow: 0 0 14px rgba(0,0,0,.12); opacity: .78; pointer-events: none; }
.story-border .border-ribbon { position: absolute; inset: 0; display: block; width: 46px; height: 100%; overflow: hidden; }
.story-border .border-line { fill: none; stroke: var(--border-primary); stroke-linecap: round; stroke-linejoin: round; }
.story-border .border-line, .story-border .border-sparks { vector-effect: non-scaling-stroke; }
.story-border .border-line-main { stroke-width: 1.75; }
.story-border .border-line-soft { stroke: var(--border-secondary); stroke-width: .9; opacity: .62; }
.story-border .border-sparks { fill: var(--border-primary); opacity: .82; }
.story-border .border-sparks path:nth-child(2), .story-border .border-sparks circle { animation: border-twinkle 5s ease-in-out infinite alternate; transform-origin: center; }
.story-border.palette-ocean, .story-border.palette-fjord, .story-border.palette-aurora { --border-secondary: #76a5ad; }
.story-border.palette-ember, .story-border.palette-clay, .story-border.palette-sunset { --border-secondary: #b88765; }
.story-border.palette-plum, .story-border.palette-berry { --border-secondary: #a7839f; }
.story-border.palette-wheat { --border-secondary: #b8a469; }
@keyframes border-twinkle { from { opacity: .35; transform: scale(.82); } to { opacity: 1; transform: scale(1.08); } }
.story-border-left { left: 0; }
.story-border-right { right: 0; transform: scaleX(-1); }
.reader-progress { position: fixed; inset: 0 0 auto; z-index: 4; height: 3px; background: transparent; }
.reader-progress span { display: block; width: 0; height: 100%; background: var(--accent); transition: width 100ms linear; }
.reader-header { position: relative; z-index: 3; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; flex: 0 0 70px; padding: 0 clamp(16px, 4vw, 48px); border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--paper) 90%, transparent); backdrop-filter: blur(16px); }
.reader-back { display: inline-flex; align-items: center; gap: 8px; justify-self: start; padding: 8px 0; border: 0; background: none; color: var(--muted); cursor: pointer; }
.reader-back svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.reader-back span { font-size: .7rem; font-weight: 720; letter-spacing: .07em; text-transform: uppercase; }
#reader-running-title { max-width: 34vw; overflow: hidden; margin: 0; color: var(--muted); font-family: var(--serif); font-size: .82rem; font-style: italic; text-overflow: ellipsis; white-space: nowrap; }
.reading-tools { display: flex; justify-self: end; gap: 4px; }
.reading-tools button { min-width: 36px; height: 36px; padding: 0 7px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--paper-text); cursor: pointer; }
.reading-tools small { font-size: .62em; }
.reading-tools svg { width: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.reader-scroll { flex: 1; overflow: auto; overscroll-behavior: contain; scroll-behavior: smooth; }
.story-article { width: min(100% - 148px, 1180px); margin: 0 auto; padding: clamp(68px, 10vw, 120px) 28px 80px; }
.story-kicker { margin: 0 0 22px; color: var(--accent); font-size: .65rem; font-weight: 750; letter-spacing: .18em; text-align: center; text-transform: uppercase; }
.story-article h1 { margin: 0 auto; font-size: clamp(2.55rem, 8vw, 5.2rem); line-height: .98; text-align: center; }
.story-byline { margin: 25px 0 52px; color: var(--muted); font-family: var(--serif); font-size: .88rem; font-style: italic; text-align: center; }
.story-ornament { width: 80px; height: 1px; margin: 0 auto 50px; background: var(--accent); opacity: .7; }
.story-hero-figure { width: min(100%, 980px); margin: 0 auto 70px; }
.story-hero-figure img { display: block; width: 100%; max-height: 620px; object-fit: cover; aspect-ratio: 3 / 2; border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 20px 55px rgba(0,0,0,.2); }
.story-reading-layout { display: grid; grid-template-columns: minmax(0, 690px) minmax(280px, 390px); align-items: start; justify-content: space-between; gap: clamp(54px, 7vw, 100px); }
.story-content { font-family: var(--serif); font-size: var(--reader-size); line-height: 1.84; letter-spacing: .003em; }
.story-content p { margin: 0 0 1.38em; }
.story-content p:first-child::first-letter { float: left; margin: .02em .1em 0 0; color: var(--accent); font-size: 4.1em; line-height: .73; }
.story-figure { width: 100%; margin: 3.2em 0; }
.story-figure.is-after-story { margin-top: 5.4em; }
.story-figure img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 3px; box-shadow: 0 20px 55px rgba(0, 0, 0, .2); }
.story-visual-rail { position: sticky; top: 104px; overflow: hidden; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); box-shadow: 0 20px 55px rgba(0,0,0,.18); }
.story-visual-rail img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; transition: opacity 180ms ease; }
@media (min-width: 981px) {
  .story-reading-layout .story-figure { display: none; }
}
.moral-box, .source-box { width: min(100%, 690px); }
.moral-box { margin-top: 66px; padding: 28px; border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.moral-box strong { display: block; margin-bottom: 8px; color: var(--paper-text); font-family: var(--serif); font-size: 1.3rem; font-weight: 500; }
.moral-box p { margin: 0; color: var(--soft); font-family: var(--serif); font-size: 1rem; line-height: 1.65; }
.source-box { margin-top: 24px; padding: 24px; border: 1px solid var(--line); color: var(--muted); font-family: var(--sans); font-size: .76rem; line-height: 1.6; }
.source-box strong { display: block; margin-bottom: 6px; color: var(--paper-text); font-family: var(--serif); font-size: 1rem; font-weight: 500; }
.source-box a { color: var(--accent); text-underline-offset: 3px; }
.reader-end { width: min(100% - 42px, 720px); margin: 0 auto; padding: 30px 0 110px; text-align: center; }
.reader-end > span { color: var(--accent); font-size: 1.5rem; }
.reader-end h2 { margin-top: 14px; font-size: 2.2rem; }
.reader-end p { margin: 8px 0 28px; color: var(--muted); font-family: var(--serif); font-style: italic; }
.reader-end .primary-button { margin: 0 auto 22px; }
.reader-end .text-button { display: block; margin: 0 auto; }
body.reader-open { overflow: hidden; }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr 1fr; min-height: 620px; }
  .hero-copy { padding-left: 34px; padding-right: 34px; }
  h1 { font-size: clamp(3.2rem, 7vw, 5rem); }
  .story-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .offline-note { margin-left: 20px; margin-right: 20px; }
  .trust-note { margin-left: 20px; margin-right: 20px; }
  .story-border { display: none; }
  .story-article { width: min(100% - 42px, 720px); padding-right: 0; padding-left: 0; }
  .story-reading-layout { display: block; }
  .story-visual-rail { display: none; }
  .story-figure { width: min(calc(100vw - 48px), 980px); margin-left: 50%; transform: translateX(-50%); }
}

@media (max-width: 720px) {
  .site-header { height: 66px; padding: 0 18px; }
  .offline-status { display: none; }
  .hero { display: flex; min-height: auto; flex-direction: column; }
  .hero-copy { min-height: auto; padding: 72px 22px 68px; }
  h1 { font-size: clamp(3.25rem, 15vw, 5rem); }
  .hero-intro { margin: 28px 0 32px; }
  .hero-art { display: none; }
  .library { padding-top: 78px; padding-bottom: 82px; }
  .section-heading { display: block; }
  .library-status { max-width: none; text-align: left; }
  #story-count { margin-top: 15px; }
  .toolbar { display: block; }
  .length-filters { display: grid; grid-template-columns: 1fr; gap: 10px; width: 100%; padding: 2px 0 12px; overflow: visible; }
  .length-filter { width: 100%; min-height: 82px; padding: 13px 15px 13px 18px; border-radius: 22px; }
  .length-filter .filter-copy strong { font-size: 1.08rem; }
  .length-filter .filter-arrow { width: 44px; height: 44px; flex-basis: 44px; }
  .filter-utilities { margin-top: 0; }
  .filter-utility { flex: 0 0 auto; }
  .sort-label { margin-top: 17px; }
  .offline-note { grid-template-columns: auto 1fr; }
  .trust-note { align-items: center; flex-direction: column; gap: 5px; }
  .offline-note .text-button { grid-column: 2; justify-self: start; }
  footer { flex-direction: column; align-items: flex-start; }
  .reader-header { grid-template-columns: 1fr auto; }
  #reader-running-title { display: none; }
}

@media (max-width: 520px) {
  .story-grid { grid-template-columns: 1fr; gap: 28px; }
  .cover { aspect-ratio: 1.48; }
  .card-body { min-height: 0; }
  .card-title { font-size: 1.55rem; }
  .offline-note { margin-bottom: 72px; }
  .offline-icon { width: 46px; height: 46px; }
  .reader-back span { display: none; }
  .reader-header { padding: 0 12px; }
  .story-article { width: min(100% - 34px, 720px); padding-top: 60px; }
  .story-content { line-height: 1.76; }
}

@media (prefers-reduced-motion: reduce) {
  html, .reader-scroll { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.seo-story-page { background: var(--paper); color: var(--paper-text); }
.seo-header { position: relative; background: var(--paper); }
.seo-usp { color: var(--muted); font-size: .72rem; font-weight: 700; }
.seo-story-article { width: min(100% - 42px, 760px); }
.seo-back { display: inline-block; margin-bottom: 42px; color: var(--muted); font-size: .72rem; font-weight: 720; letter-spacing: .06em; text-decoration: none; text-transform: uppercase; }
.seo-back:hover { color: var(--paper-text); }
.seo-story-content .story-figure { width: min(calc(100vw - 48px), 980px); margin-left: 50%; transform: translateX(-50%); }
.seo-story-article .moral-box, .seo-story-article .source-box { width: 100%; }
.seo-footer { justify-content: center; background: var(--paper); }
@media (max-width: 520px) { .seo-usp { display: none; } }
