:root {
  --ink: #171a16;
  --paper: #f2eedf;
  --paper-deep: #e7e0cc;
  --red: #e85035;
  --green: #264c3b;
  --muted: #706d62;
  --line: rgba(23, 26, 22, .22);
  --display: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  --ui: "Avenir Next", "Futura", "Trebuchet MS", sans-serif;
  --mono: "SFMono-Regular", "Menlo", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 91% 8%, rgba(232, 80, 53, .12), transparent 29rem),
    radial-gradient(circle at 5% 47%, rgba(38, 76, 59, .09), transparent 26rem),
    var(--paper);
  font-family: var(--display);
  min-height: 100vh;
}

.paper-noise {
  position: fixed; inset: 0; z-index: 20; pointer-events: none; opacity: .19;
  background-image: repeating-linear-gradient(97deg, transparent 0 3px, rgba(40, 33, 22, .055) 4px, transparent 5px 9px);
  mix-blend-mode: multiply;
}

button, input { font: inherit; }
button { color: inherit; }
a { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

.masthead {
  height: 88px; padding: 0 4vw; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--ink); position: relative; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.brand-mark { font: 800 38px/1 var(--ui); letter-spacing: -6px; }
.brand-mark span { color: var(--red); font-size: 18px; vertical-align: top; }
.brand-copy { display: flex; flex-direction: column; }
.brand-copy b { font: 700 17px/1.1 var(--ui); letter-spacing: .02em; text-transform: uppercase; }
.brand-copy small { margin-top: 5px; font: 600 8px/1 var(--mono); letter-spacing: .18em; }
.mast-actions { display: flex; align-items: center; gap: 20px; }
.status-chip { display: flex; align-items: center; gap: 8px; font: 600 10px/1 var(--mono); text-transform: uppercase; }
.status-chip i { width: 8px; height: 8px; border-radius: 50%; background: #a89e81; box-shadow: 0 0 0 4px rgba(168,158,129,.16); }
.status-chip[data-state="completed"] i { background: #3a7758; box-shadow: 0 0 0 4px rgba(58,119,88,.16); }
.status-chip[data-state="running"] i { background: var(--red); animation: pulse 1s infinite alternate; }
.status-chip[data-state="error"] i { background: #a72727; }
.refresh-button {
  border: 1px solid var(--ink); background: var(--ink); color: var(--paper); padding: 12px 15px 12px 18px;
  display: flex; align-items: center; gap: 22px; cursor: pointer; font: 650 12px/1 var(--ui); transition: .2s ease;
}
.refresh-button:hover { background: var(--red); border-color: var(--red); transform: translateY(-2px); }
.refresh-button:disabled { opacity: .5; cursor: wait; transform: none; }
.refresh-button b { font-size: 17px; }

main { position: relative; z-index: 1; }
.hero { min-height: 580px; position: relative; padding: 52px 6vw 54px; border-bottom: 1px solid var(--ink); overflow: hidden; }
.issue-meta { display: flex; gap: 28px; font: 700 10px/1 var(--mono); letter-spacing: .14em; }
.issue-meta span:first-child { color: var(--red); }
.hero h1 { margin: 42px 0 24px; font-size: clamp(62px, 9.2vw, 146px); line-height: .82; letter-spacing: -.085em; font-weight: 600; max-width: 1100px; }
.hero h1 span { padding-left: 8vw; }
.hero h1 em { color: var(--red); font-style: italic; font-weight: 400; }
.hero-deck { width: min(520px, 56vw); margin: 0 0 0 45vw; font-size: 17px; line-height: 1.8; }
.stats { position: absolute; right: 5vw; top: 52px; display: grid; grid-template-columns: repeat(2, 100px); border: 1px solid var(--ink); background: rgba(242,238,223,.7); backdrop-filter: blur(8px); }
.stat { padding: 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat:nth-child(even) { border-right: 0; }
.stat:nth-last-child(-n+2) { border-bottom: 0; }
.stat b { display: block; font: 700 30px/1 var(--ui); }
.stat span { font: 650 8px/1.3 var(--mono); letter-spacing: .12em; color: var(--muted); }
.orbital-note { position: absolute; right: -52px; bottom: -52px; width: 240px; height: 240px; border: 1px solid var(--ink); border-radius: 50%; animation: rotate 30s linear infinite; }
.orbital-note span { position: absolute; font: 700 9px/1 var(--mono); letter-spacing: .15em; }
.orbital-note span:nth-child(1) { top: 16px; left: 91px; }
.orbital-note span:nth-child(2) { top: 116px; left: 4px; transform: rotate(-90deg); }
.orbital-note span:nth-child(3) { right: 6px; top: 116px; transform: rotate(90deg); }

.reading-grid { display: grid; grid-template-columns: 235px minmax(0, 1fr); }
.archive-panel { min-height: 720px; padding: 38px 26px; border-right: 1px solid var(--ink); position: relative; }
.panel-label { font: 700 10px/1 var(--mono); letter-spacing: .16em; color: var(--red); margin-bottom: 24px; }
#archive { display: grid; }
.archive-date { border: 0; border-top: 1px solid var(--line); background: transparent; text-align: left; padding: 14px 0; cursor: pointer; font: 600 14px/1 var(--ui); }
.archive-date:last-child { border-bottom: 1px solid var(--line); }
.archive-date.active { color: var(--red); padding-left: 10px; }
.archive-date:hover { color: var(--red); }
.archive-foot { position: sticky; top: calc(100vh - 100px); margin-top: 80px; font: 500 9px/1.7 var(--mono); color: var(--muted); }
.dispatch { min-width: 0; }
.dispatch-toolbar { min-height: 82px; padding: 18px 3vw; border-bottom: 1px solid var(--ink); display: flex; justify-content: space-between; align-items: center; gap: 20px; position: sticky; top: 0; background: rgba(242,238,223,.93); backdrop-filter: blur(12px); z-index: 4; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filter { border: 1px solid var(--line); background: transparent; padding: 9px 13px; cursor: pointer; font: 650 11px/1 var(--ui); }
.filter.active, .filter:hover { background: var(--green); color: var(--paper); border-color: var(--green); }
.search { border-bottom: 1px solid var(--ink); padding: 7px 0; display: flex; min-width: 210px; }
.search input { border: 0; outline: 0; background: transparent; min-width: 0; width: 100%; font-size: 13px; }
.search b { font: 400 20px/1 var(--ui); }
.warning-box { margin: 28px 3vw 0; padding: 16px 18px; background: rgba(232,80,53,.09); border-left: 3px solid var(--red); font-size: 13px; line-height: 1.7; }
.content-list { padding: 0 3vw 70px; }
.story { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 30px; padding: 44px 0; border-bottom: 1px solid var(--ink); opacity: 0; animation: rise .55s ease forwards; animation-delay: calc(var(--i) * 55ms); }
.story-rail { font: 700 9px/1.5 var(--mono); letter-spacing: .12em; color: var(--muted); }
.story-index { display: block; font: 400 52px/.9 var(--display); color: var(--red); margin-bottom: 12px; letter-spacing: -.08em; }
.story-type { text-transform: uppercase; }
.story-body h2 { margin: 0 0 22px; font-size: clamp(28px, 4vw, 55px); line-height: 1.05; letter-spacing: -.045em; font-weight: 600; }
.story-section-label { font: 700 9px/1 var(--mono); letter-spacing: .14em; color: var(--red); text-transform: uppercase; margin-bottom: 10px; }
.story-summary { font-size: 18px; line-height: 1.9; margin: 0; max-width: 850px; }
.recommendation { margin: 28px 0 0; padding: 19px 22px; border-left: 1px solid var(--ink); background: rgba(255,255,255,.18); }
.recommendation p { margin: 7px 0 0; line-height: 1.75; color: #3d4039; }
.translation { margin-top: 25px; border-top: 1px dashed var(--line); }
.translation summary { padding: 18px 0; cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; font: 650 12px/1 var(--ui); }
.translation summary::-webkit-details-marker { display: none; }
.translation summary::after { content: "+"; font: 400 25px/1 var(--ui); }
.translation[open] summary::after { content: "−"; }
.translation-text { white-space: pre-wrap; font-size: 16px; line-height: 2; padding: 10px 0 30px; color: #2f322d; max-width: 880px; }
.source-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.source-link { font: 650 10px/1 var(--mono); text-decoration: none; border: 1px solid var(--ink); padding: 9px 11px; }
.source-link:hover { background: var(--red); color: var(--paper); border-color: var(--red); }
.empty-state { min-height: 500px; display: grid; place-content: center; text-align: center; }
.empty-state span { font: 700 10px/1 var(--mono); letter-spacing: .18em; color: var(--red); }
.empty-state h2 { font-size: 48px; margin: 18px 0 8px; }
.empty-state p { color: var(--muted); max-width: 420px; line-height: 1.7; }

footer { min-height: 180px; background: var(--ink); color: var(--paper); display: grid; grid-template-columns: 1fr 2fr auto; align-items: center; gap: 40px; padding: 35px 5vw; position: relative; z-index: 2; }
footer > span { font: 750 20px/1 var(--ui); }
footer p { font-size: 14px; color: #bcb8aa; }
footer a { font: 700 10px/1 var(--mono); letter-spacing: .12em; text-decoration: none; color: #f08670; }

@keyframes rise { to { opacity: 1; transform: translateY(0); } from { opacity: 0; transform: translateY(18px); } }
@keyframes pulse { to { transform: scale(1.35); opacity: .65; } }
@keyframes rotate { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; scroll-behavior: auto !important; } }

@media (max-width: 900px) {
  .status-chip { display: none; }
  .hero { min-height: 510px; padding-inline: 5vw; }
  .hero h1 { font-size: clamp(56px, 14vw, 100px); margin-top: 62px; }
  .hero h1 span { padding-left: 0; }
  .hero-deck { width: 70vw; margin-left: 20vw; }
  .stats { top: 20px; right: 5vw; grid-template-columns: repeat(4, 62px); }
  .stat { border-bottom: 0; }
  .stat:nth-child(even) { border-right: 1px solid var(--line); }
  .stat:last-child { border-right: 0; }
  .stat b { font-size: 22px; }
  .reading-grid { grid-template-columns: 1fr; }
  .archive-panel { min-height: auto; border-right: 0; border-bottom: 1px solid var(--ink); padding: 20px 5vw; }
  #archive { display: flex; gap: 8px; overflow-x: auto; }
  .archive-date { border: 1px solid var(--line); padding: 10px 12px; white-space: nowrap; }
  .archive-date:last-child { border-bottom: 1px solid var(--line); }
  .archive-foot { display: none; }
}

@media (max-width: 620px) {
  .masthead { height: 72px; padding-inline: 18px; }
  .brand { gap: 9px; }
  .brand-mark { font-size: 32px; }
  .brand-copy b { font-size: 13px; white-space: nowrap; }
  .brand-copy small { display: none; }
  .mast-actions { gap: 0; position: absolute; right: 18px; }
  .refresh-button { width: 42px; height: 42px; padding: 0; gap: 0; justify-content: center; flex: 0 0 42px; }
  .refresh-button span { display: none; }
  .hero { min-height: 650px; padding: 34px 20px; }
  .issue-meta span:last-child { display: none; }
  .hero h1 { font-size: 16vw; line-height: .88; letter-spacing: -.07em; margin-top: 105px; }
  .hero h1 em { display: block; width: auto; margin-left: 52%; text-align: left; padding: 0; }
  .hero-deck { width: 100%; margin: 24px 0 0; padding-left: 14%; font-size: 15px; }
  .stats { left: 20px; right: auto; top: 54px; }
  .orbital-note { display: none; }
  .dispatch-toolbar { align-items: stretch; flex-direction: column; padding: 14px 18px; }
  .filters { overflow-x: auto; flex-wrap: nowrap; }
  .filter { white-space: nowrap; }
  .search { width: 100%; }
  .content-list { padding-inline: 18px; }
  .story { grid-template-columns: 1fr; gap: 13px; padding: 34px 0; }
  .story-rail { display: flex; gap: 10px; align-items: baseline; }
  .story-index { display: inline; font-size: 28px; }
  .story-body h2 { font-size: 34px; }
  .story-summary { font-size: 16px; }
  footer { grid-template-columns: 1fr; gap: 12px; }
}
