
:root {
  color-scheme: light;
  --paper: #f7f6f2;
  --surface: #ffffff;
  --ink: #10212a;
  --muted: #53636d;
  --line: #d8ddd9;
  --accent: #2646a6;
  --accent-dark: #183178;
  --accent-soft: #e8edff;
  --success: #17623b;
  --warn: #8a4b08;
  --focus: #a63f00;
  --shadow: 0 1px 2px rgb(16 33 42 / 8%), 0 12px 32px rgb(16 33 42 / 6%);
  --radius: 0.75rem;
  font-family: "Segoe UI", Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

html {
  background: var(--paper);
  color: var(--ink);
  scroll-behavior: smooth;
}

body {
  min-width: 20rem;
  margin: 0;
  background:
    linear-gradient(90deg, transparent 0, transparent calc(100% - 1px), rgb(16 33 42 / 3%) calc(100% - 1px)) 0 0 / 5rem 5rem,
    var(--paper);
  font-size: 1rem;
  line-height: 1.65;
}

a { color: var(--accent); text-underline-offset: 0.16em; }
a:hover { color: var(--accent-dark); }

:focus-visible {
  border-radius: 0.2rem;
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

img, svg { max-width: 100%; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.75rem 1rem;
  transform: translateY(-180%);
  background: var(--ink);
  color: white;
}

.skip-link:focus { transform: translateY(0); }

.shell {
  width: min(100% - 2rem, 74rem);
  margin-inline: auto;
}

.site-header {
  position: relative;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: rgb(247 246 242 / 96%);
}

.header-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 2rem;
  align-items: center;
  min-height: 5rem;
}

.brand {
  display: inline-flex;
  gap: 0.65rem;
  align-items: center;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 2.15rem;
  height: 2.15rem;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: white;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  letter-spacing: 0;
}

.site-nav ul {
  display: flex;
  gap: 0.25rem;
  justify-content: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav { grid-column: 2; grid-row: 1; }

.site-nav a {
  display: inline-flex;
  min-height: 2.75rem;
  padding: 0.55rem 0.75rem;
  align-items: center;
  border-radius: 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: var(--surface);
  color: var(--ink);
}

.header-search {
  display: flex;
  gap: 0.4rem;
  grid-column: 3;
  grid-row: 1;
}

input, select, button {
  min-height: 2.75rem;
  border: 1px solid #aeb9b5;
  border-radius: 0.45rem;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

input, select { padding: 0.55rem 0.7rem; }
button, .button {
  display: inline-flex;
  min-height: 2.75rem;
  padding: 0.55rem 0.9rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent);
  border-radius: 0.45rem;
  background: var(--accent);
  color: white;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

button:hover, .button:hover { background: var(--accent-dark); color: white; }
.button-secondary { background: transparent; color: var(--accent); }
.button-secondary:hover { background: var(--accent-soft); color: var(--accent-dark); }

.sync-banner {
  border-bottom: 1px solid #f0cf9f;
  background: #fff5e5;
  color: #63360a;
}

.sync-banner p { margin: 0; padding: 0.6rem 0; font-size: 0.88rem; }

main { min-height: 64vh; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2rem;
  align-items: end;
  padding-block: clamp(3.5rem, 8vw, 7rem) 3rem;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 0.65rem;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.hero h1,
.page-heading h1,
.story-heading h1 {
  max-width: 18ch;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.3rem, 5vw, 4.8rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.hero-copy {
  max-width: 48rem;
  margin: 1.25rem 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.25rem);
}

.sync-facts {
  display: grid;
  min-width: 15rem;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.sync-facts div { padding: 0.8rem 1rem; }
.sync-facts div + div { border-top: 1px solid var(--line); }
.sync-facts dt { color: var(--muted); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.sync-facts dd { margin: 0.15rem 0 0; font-size: 0.92rem; font-weight: 700; }

.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(16rem, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  padding-block: 3rem 5rem;
}

.home-layout { grid-template-columns: minmax(16rem, 1fr) minmax(0, 2fr); }

.section-heading {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.section-heading h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.65rem, 3vw, 2.4rem);
  font-weight: 500;
  letter-spacing: -0.025em;
}

.result-count { color: var(--muted); font-size: 0.88rem; }

.story-list { display: grid; gap: 1.2rem; }

.story-card {
  position: relative;
  overflow: hidden;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 1px 0 rgb(16 33 42 / 3%);
}

.story-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0.28rem;
  background: var(--accent);
  content: "";
}

.story-meta,
.story-links,
.tag-list,
.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.story-meta { color: var(--muted); font-size: 0.78rem; font-weight: 700; }

.label {
  display: inline-flex;
  min-height: 1.7rem;
  padding: 0.1rem 0.5rem;
  align-items: center;
  border: 1px solid #c9d2cf;
  border-radius: 999px;
  background: #f3f6f5;
  color: #31444e;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.2;
}

.label-status { border-color: #cbd4fa; background: var(--accent-soft); color: var(--accent-dark); }

.story-card h2 {
  max-width: 30ch;
  margin: 0.85rem 0 0.7rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.45rem, 3vw, 2.15rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.12;
}

.story-card h2 a { color: var(--ink); text-decoration-thickness: 1px; text-decoration-color: transparent; }
.story-card h2 a:hover { color: var(--accent); text-decoration-color: currentColor; }
.story-summary { margin: 0; color: #30444e; }
.why-preview { margin: 1rem 0 0; padding-left: 1rem; border-left: 2px solid #cbd4fa; color: var(--muted); font-size: 0.93rem; }
.why-preview strong { color: var(--ink); }
.story-card .tag-list { margin-top: 1rem; }
.story-links { margin-top: 1.2rem; }
.story-links a { min-height: 2.75rem; display: inline-flex; align-items: center; font-size: 0.87rem; font-weight: 750; }

.filter-panel {
  position: sticky;
  top: 1rem;
  align-self: start;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.feed-results { grid-column: 2; grid-row: 1; }
.feed-filter { grid-column: 1; grid-row: 1; }

.filter-panel h2 { margin: 0 0 1rem; font-family: Georgia, "Times New Roman", serif; font-size: 1.4rem; }
.filter-fields { display: grid; gap: 1rem; }
.field { display: grid; gap: 0.3rem; }
.field label { font-size: 0.78rem; font-weight: 800; }
.field input, .field select { width: 100%; }
.filter-actions { display: flex; gap: 0.65rem; flex-wrap: wrap; }
.filter-actions a { display: inline-flex; min-height: 2.75rem; align-items: center; font-weight: 700; }

.source-note {
  margin: 1.25rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
}

.pagination {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  margin-top: 2rem;
}

.pagination a, .pagination span {
  display: inline-flex;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0.35rem 0.7rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: var(--surface);
  font-weight: 700;
  text-decoration: none;
}

.pagination [aria-current="page"] { border-color: var(--ink); background: var(--ink); color: white; }

.empty-state {
  padding: 3rem 1.5rem;
  border: 1px dashed #aeb9b5;
  border-radius: var(--radius);
  text-align: center;
}

.page-heading { padding-block: clamp(3rem, 7vw, 6rem) 2.5rem; border-bottom: 1px solid var(--line); }
.page-heading p { max-width: 48rem; margin: 1rem 0 0; color: var(--muted); font-size: 1.08rem; }

.directory-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  padding-block: 2.5rem 5rem;
}

.directory-card {
  min-height: 9rem;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.directory-card h2, .directory-card h3 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.35rem; font-weight: 500; }
.directory-card p { margin: 0.5rem 0 0; color: var(--muted); }
.directory-card a { display: inline-flex; min-height: 2.75rem; align-items: center; font-weight: 750; }

.topic-section { padding-block: 2rem; }
.topic-section + .topic-section { border-top: 1px solid var(--line); }
.topic-section h2 { font-family: Georgia, "Times New Roman", serif; font-size: 2rem; font-weight: 500; }
.topic-cloud { display: flex; flex-wrap: wrap; gap: 0.65rem; margin: 0; padding: 0; list-style: none; }
.topic-cloud a { display: inline-flex; min-height: 2.75rem; padding: 0.5rem 0.8rem; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); text-decoration: none; }
.topic-cloud span { margin-left: 0.35rem; color: var(--muted); font-size: 0.78rem; }

.story-page { padding-block: 1.5rem 5rem; }
.crumbs { margin-bottom: 2rem; color: var(--muted); font-size: 0.83rem; }
.crumbs li + li::before { margin-right: 0.75rem; content: "/"; color: #8b999f; }
.story-heading { max-width: 62rem; padding-block: 2rem; }
.story-heading h1 { max-width: 22ch; font-size: clamp(2.25rem, 5.5vw, 4.9rem); }
.story-heading .story-meta { margin-bottom: 1.2rem; }
.story-deck { max-width: 55rem; margin: 1.5rem 0 0; color: #30444e; font-size: clamp(1.08rem, 2vw, 1.35rem); line-height: 1.55; }

.provenance {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
  margin: 1rem 0 3rem;
  padding: 1rem 1.2rem;
  border: 1px solid #cbd4fa;
  border-radius: var(--radius);
  background: var(--accent-soft);
}

.provenance p { margin: 0; font-size: 0.9rem; }
.provenance .story-links { margin: 0; }

.article-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(15rem, 1fr); gap: clamp(2rem, 6vw, 5rem); }
.article-body { max-width: 68ch; }
.article-section { padding: 0 0 2rem; }
.article-section + .article-section { padding-top: 2rem; border-top: 1px solid var(--line); }
.article-section h2 { margin: 0 0 0.8rem; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 500; }
.article-section p { margin: 0; white-space: pre-line; }
.article-section-why { padding-left: 1.25rem; border-left: 0.25rem solid var(--accent); }
.article-aside { align-self: start; padding: 1.25rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.article-aside h2 { margin: 0 0 1rem; font-family: Georgia, "Times New Roman", serif; font-size: 1.35rem; font-weight: 500; }
.facet-group + .facet-group { margin-top: 1.25rem; }
.facet-group h3 { margin: 0 0 0.45rem; color: var(--muted); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; }

.site-footer { border-top: 1px solid var(--line); background: #eef0ec; }
.footer-grid { display: grid; grid-template-columns: 1fr auto; gap: 2rem; padding-block: 2.5rem; }
.footer-grid p { max-width: 45rem; margin: 0; color: var(--muted); font-size: 0.88rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: start; }
.footer-links a { min-height: 2.75rem; display: inline-flex; align-items: center; font-weight: 700; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 62rem) {
  .header-row { grid-template-columns: 1fr; gap: 0.75rem; padding-block: 0.75rem; }
  .site-nav { grid-column: 1; grid-row: 2; overflow-x: auto; }
  .site-nav ul { justify-content: flex-start; }
  .header-search { grid-column: 1; grid-row: 3; }
  .content-layout, .home-layout, .article-layout { grid-template-columns: 1fr; }
  .filter-panel { position: static; }
  .feed-results { grid-column: 1; grid-row: 2; }
  .feed-filter { grid-column: 1; grid-row: 1; }
  .directory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-aside { max-width: 42rem; }
}

@media (max-width: 44rem) {
  .shell { width: min(100% - 1.25rem, 74rem); }
  .header-search { grid-column: 1; grid-row: 3; }
  .header-search input { width: 100%; }
  .site-nav { grid-row: 2; }
  .hero { grid-template-columns: 1fr; padding-top: 3.5rem; }
  .sync-facts { width: 100%; }
  .content-layout { padding-top: 1.5rem; }
  .directory-grid { grid-template-columns: 1fr; }
  .provenance { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .story-card { padding-left: 1.35rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media print {
  .site-header, .site-footer, .filter-panel, .pagination, .story-links { display: none !important; }
  body { background: white; color: black; }
  .shell { width: 100%; }
  .story-card, .article-aside { box-shadow: none; }
}
