:root {
  color-scheme: light;
  --paper: #f6f1e8;
  --paper-deep: #e8dcc8;
  --ink: #231f1a;
  --muted: #70695f;
  --line: #cfc0aa;
  --accent: #9f2f23;
  --accent-2: #1f5c67;
  --gold: #b88739;
  --surface: #fffaf1;
  --shadow: 0 18px 50px rgba(55, 39, 20, 0.12);
  --serif: Georgia, "Times New Roman", "Noto Serif SC", "Songti SC", serif;
  --sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(246, 241, 232, 0.92), rgba(246, 241, 232, 0.92)),
    url("/assets/paper-grain.svg");
  font-family: var(--sans);
  line-height: 1.7;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.page-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.site-header {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-seal {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--surface);
  background: var(--ink);
  border: 2px solid var(--gold);
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: 0;
}

.brand-kicker,
.eyebrow,
.meta,
.date-line,
.read-time,
.section-label {
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-mark strong {
  display: block;
  font-family: var(--serif);
  font-size: clamp(1.45rem, 2vw, 2rem);
  line-height: 1.05;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.95rem;
  white-space: nowrap;
}

.top-nav a {
  padding: 8px 10px;
  border-bottom: 2px solid transparent;
}

.top-nav a:hover,
.top-nav a:focus-visible {
  color: var(--ink);
  border-color: var(--accent);
}

.app {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 56px;
}

.front-page {
  display: grid;
  gap: 30px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 34px;
  align-items: stretch;
  padding-bottom: 30px;
  border-bottom: 4px double var(--line);
}

.hero-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
}

.masthead-title {
  margin: 0;
  max-width: 920px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(3rem, 10vw, 8.5rem);
  line-height: 0.88;
  letter-spacing: 0;
}

.subtitle {
  max-width: 780px;
  margin: 18px 0 0;
  color: #4f473e;
  font-family: var(--serif);
  font-size: clamp(1.15rem, 2.6vw, 1.8rem);
  line-height: 1.42;
}

.issue-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.issue-strip div {
  background: rgba(255, 250, 241, 0.72);
  padding: 14px;
}

.issue-strip span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.issue-strip strong {
  display: block;
  margin-top: 4px;
  font-family: var(--serif);
  font-size: 1.08rem;
}

.feature-panel {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  display: flex;
  align-items: end;
  border: 1px solid var(--ink);
  background:
    linear-gradient(180deg, rgba(35, 31, 26, 0.08), rgba(35, 31, 26, 0.78)),
    url("/assets/editorial-shelf.svg") center / cover;
  box-shadow: var(--shadow);
}

.feature-panel::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(255, 250, 241, 0.62);
  pointer-events: none;
}

.feature-content {
  position: relative;
  z-index: 1;
  padding: 34px;
  color: var(--surface);
}

.feature-content h2 {
  margin: 10px 0 12px;
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1;
}

.feature-content p {
  margin: 0 0 24px;
  max-width: 540px;
  color: rgba(255, 250, 241, 0.88);
}

.read-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--surface);
  border-bottom: 1px solid currentColor;
  font-weight: 700;
}

.controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 18px;
  align-items: end;
  padding: 24px 0 4px;
}

.search-wrap label,
.tag-filter-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.search-box {
  display: flex;
  align-items: center;
  min-height: 46px;
  border-bottom: 2px solid var(--ink);
}

.search-box svg {
  flex: 0 0 auto;
  margin-right: 10px;
  color: var(--muted);
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 1.05rem;
}

.tag-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: 620px;
}

.tag-filters button {
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 250, 241, 0.52);
  cursor: pointer;
}

.tag-filters button.is-active,
.tag-filters button:hover {
  color: var(--surface);
  border-color: var(--ink);
  background: var(--ink);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 36px;
  align-items: start;
}

.archive-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.archive-card {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 22px;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
}

.archive-card time {
  color: var(--accent);
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.4;
}

.archive-card h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.55rem, 3vw, 2.45rem);
  line-height: 1.05;
}

.archive-card h3 a:hover {
  color: var(--accent);
}

.archive-card p {
  margin: 12px 0 16px;
  color: #4f473e;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag {
  color: var(--accent-2);
  font-size: 0.82rem;
}

.side-rail {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 20px;
}

.rail-block {
  padding-top: 16px;
  border-top: 3px solid var(--ink);
}

.rail-block h2 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: 1.35rem;
}

.rail-block p,
.rail-block li {
  color: var(--muted);
  font-size: 0.95rem;
}

.rail-block ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.rail-block li + li {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.empty-state,
.loading-state {
  min-height: 280px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--line);
}

.article-page {
  display: grid;
  grid-template-columns: minmax(0, 780px) 260px;
  gap: 46px;
  align-items: start;
}

.article {
  min-width: 0;
}

.back-link {
  display: inline-flex;
  margin-bottom: 28px;
  color: var(--muted);
  border-bottom: 1px solid currentColor;
}

.article-header {
  padding-bottom: 26px;
  border-bottom: 4px double var(--line);
}

.article-header h1 {
  margin: 12px 0 18px;
  font-family: var(--serif);
  font-size: clamp(2.4rem, 7vw, 5.8rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.article-deck {
  margin: 0;
  color: #4f473e;
  font-family: var(--serif);
  font-size: clamp(1.15rem, 2.6vw, 1.6rem);
  line-height: 1.45;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.9rem;
}

.article-body {
  padding-top: 28px;
  font-family: var(--serif);
  font-size: clamp(1.08rem, 2vw, 1.23rem);
  line-height: 1.9;
}

.article-body p {
  margin: 0 0 1.25em;
}

.article-body p:first-child::first-letter {
  float: left;
  margin: 0.11em 0.12em 0 0;
  color: var(--accent);
  font-size: 4.4rem;
  line-height: 0.72;
  font-weight: 700;
}

.article-body h2 {
  margin: 1.7em 0 0.65em;
  font-family: var(--sans);
  font-size: 1.12rem;
  line-height: 1.35;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.article-body blockquote {
  margin: 2em 0;
  padding: 0 0 0 22px;
  border-left: 4px solid var(--accent);
  color: #4f473e;
  font-size: 1.22em;
  line-height: 1.65;
}

.article-body ul,
.article-body ol {
  padding-left: 1.3em;
}

.article-body li + li {
  margin-top: 0.35em;
}

.article-aside {
  position: sticky;
  top: 18px;
  border-top: 3px solid var(--ink);
  padding-top: 16px;
}

.article-aside h2 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: 1.35rem;
}

.article-aside dl {
  margin: 0;
}

.article-aside dt {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.78rem;
}

.article-aside dd {
  margin: 3px 0 0;
}

.site-footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 34px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 900px) {
  .site-header,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero,
  .content-grid,
  .article-page {
    grid-template-columns: 1fr;
  }

  .feature-panel {
    min-height: 430px;
  }

  .controls {
    grid-template-columns: 1fr;
  }

  .tag-filters {
    justify-content: flex-start;
  }

  .side-rail,
  .article-aside {
    position: static;
  }
}

@media (max-width: 620px) {
  .site-header,
  .app,
  .site-footer {
    width: min(100% - 22px, 1180px);
  }

  .site-header {
    padding-top: 16px;
  }

  .top-nav {
    width: 100%;
    justify-content: space-between;
  }

  .brand-seal {
    width: 42px;
    height: 42px;
  }

  .issue-strip {
    grid-template-columns: 1fr;
  }

  .feature-content {
    padding: 26px;
  }

  .archive-card {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .article-header h1,
  .masthead-title {
    overflow-wrap: anywhere;
  }
}

@media print {
  body {
    background: white;
  }

  .site-header,
  .site-footer,
  .back-link,
  .article-aside,
  .controls,
  .side-rail {
    display: none;
  }

  .app,
  .article-page {
    width: 100%;
    display: block;
    padding: 0;
  }
}
