:root {
  --paper: #f4f0e8;
  --paper-deep: #e9e2d6;
  --ink: #191815;
  --ink-soft: #615d55;
  --rule: #cbc2b2;
  --accent: #9a352e;
  --accent-dark: #71231f;
  --sans: "IBM Plex Sans", sans-serif;
  --serif: "Newsreader", Georgia, serif;
  --content: 1180px;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 18% 0%, rgba(255,255,255,.72), transparent 28rem),
    var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .24;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.10'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
  z-index: 20;
}

a { color: inherit; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
[hidden] { display: none !important; }

.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;
}

.reading-progress {
  position: fixed;
  inset: 0 0 auto;
  height: 3px;
  z-index: 30;
}

.reading-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width .12s linear;
}

.site-header {
  width: min(calc(100% - 48px), var(--content));
  min-height: 82px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  border-bottom: 1px solid var(--ink);
}

.brand {
  width: max-content;
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.02em;
}

.header-date {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.header-date { justify-self: end; }

#app:focus { outline: none; }

.feed-shell {
  width: min(calc(100% - 48px), var(--content));
  margin: 0 auto;
  padding-bottom: 96px;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.feed-tools {
  position: sticky;
  top: 12px;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 210px 190px;
  gap: 8px;
  padding: 8px;
  background: rgba(244,240,232,.92);
  border: 1px solid var(--ink);
  border-radius: 4px;
  box-shadow: 0 14px 40px rgba(49,41,30,.08);
  backdrop-filter: blur(14px);
  margin-top: 72px;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 54px;
  padding: 0 15px;
  background: rgba(255,255,255,.36);
  border: 1px solid transparent;
}

.search-field:focus-within { border-color: var(--accent); }
.search-field svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); }
.search-field input::placeholder { color: #807a70; }
.search-field kbd { padding: 2px 7px; border: 1px solid var(--rule); border-radius: 3px; color: var(--ink-soft); font-size: 12px; }

.filter-trigger { display: none; }

.select-wrap {
  position: relative;
  display: grid;
  align-content: center;
  padding: 6px 36px 6px 15px;
  border-left: 1px solid var(--rule);
}

.select-wrap::after {
  content: "↓";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-soft);
  pointer-events: none;
}

.select-wrap label { color: var(--ink-soft); font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.select-wrap select { width: 100%; padding: 3px 0 0; border: 0; outline: 0; appearance: none; background: transparent; color: var(--ink); font-weight: 500; }

.feed-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 40px 0 12px;
  border-bottom: 1px solid var(--ink);
  color: var(--ink-soft);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.feed-meta p { margin: 0; }
.text-button { padding: 0; border: 0; background: none; color: var(--accent); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }

.filter-dialog {
  width: min(calc(100% - 30px), 480px);
  max-height: calc(100dvh - 30px);
  padding: 0;
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 24px 90px rgba(25,24,21,.24);
  overflow: auto;
}

.filter-dialog::backdrop { background: rgba(25,24,21,.42); backdrop-filter: blur(3px); }
.filter-dialog-panel { min-width: 0; padding: 24px; }
.filter-dialog-panel header, .filter-dialog-panel footer { display: flex; align-items: center; justify-content: space-between; }
.filter-dialog-panel header { margin-bottom: 30px; padding-bottom: 18px; border-bottom: 1px solid var(--ink); }
.filter-dialog-panel h2 { margin: 0; font-family: var(--serif); font-size: 32px; font-weight: 500; }
.dialog-close { width: 36px; height: 36px; padding: 0; border: 0; background: none; color: var(--ink); font-size: 30px; font-weight: 300; line-height: 1; }
.dialog-field { min-width: 0; display: grid; gap: 8px; margin-bottom: 20px; }
.dialog-label { color: var(--ink-soft); font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.dialog-options { min-width: 0; max-height: 184px; display: grid; border: 1px solid var(--rule); border-radius: 2px; overflow-x: hidden; overflow-y: auto; }
.filter-option { width: 100%; min-width: 0; min-height: 46px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 13px; border: 0; border-bottom: 1px solid var(--rule); background: rgba(255,255,255,.22); color: var(--ink); text-align: left; }
.filter-option:last-child { border-bottom: 0; }
.filter-option[aria-checked="true"] { background: var(--paper-deep); font-weight: 600; }
.filter-option span:first-child { min-width: 0; overflow-wrap: anywhere; }
.filter-option .option-check { flex: 0 0 auto; color: var(--accent); opacity: 0; }
.filter-option[aria-checked="true"] .option-check { opacity: 1; }
.filter-dialog-panel footer { margin-top: 34px; }

.feed-item {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr) 30px;
  gap: 36px;
  align-items: start;
  padding: 34px 0 38px;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
}

.feed-item:hover .feed-title { color: var(--accent); }
.feed-item:hover .feed-arrow { transform: translate(4px,-4px); }

.feed-kicker { margin: 2px 0 12px; color: var(--accent); font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.feed-author { margin: 0; color: var(--ink); font-family: var(--serif); font-size: 17px; line-height: 1.25; }
.feed-date { margin: 3px 0 0; color: var(--ink-soft); font-size: 11px; line-height: 1.25; }
.feed-title { margin: 0 0 12px; font-family: var(--serif); font-size: clamp(28px, 3vw, 42px); font-weight: 500; letter-spacing: -.025em; line-height: 1.05; transition: color .2s ease; }
.feed-excerpt { max-width: 700px; margin: 0; color: var(--ink-soft); font-family: var(--serif); font-size: 18px; line-height: 1.5; }
.feed-arrow { font-size: 25px; transition: transform .2s ease; }

.empty-state { padding: 100px 0; text-align: center; }
.empty-state .eyebrow { margin: 0 0 12px; }
.empty-state h2 { margin: 0 0 28px; font-family: var(--serif); font-size: 42px; font-weight: 500; }
.button { padding: 13px 20px; border: 1px solid var(--ink); border-radius: 2px; background: var(--ink); color: var(--paper); }

.reader-shell { width: min(calc(100% - 48px), var(--content)); margin: 0 auto; padding-bottom: 100px; }
.reader-nav { display: flex; justify-content: space-between; align-items: center; padding: 28px 0; border-bottom: 1px solid var(--rule); font-size: 13px; }
.reader-nav a { color: var(--ink-soft); text-decoration: none; }
.reader-nav a:hover { color: var(--accent); }
.reader-header { max-width: 930px; margin: 0 auto; padding: 86px 0 66px; text-align: center; }
.reader-publication { margin: 0 0 24px; color: var(--accent); font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.reader-header h1 { margin: 0; font-family: var(--serif); font-size: clamp(48px, 7vw, 84px); font-weight: 500; letter-spacing: -.045em; line-height: .98; text-wrap: balance; }
.reader-byline { width: max-content; margin: 36px auto 0; text-align: center; }
.reader-byline a { font-family: var(--serif); font-size: 18px; font-weight: 500; text-decoration: none; }
.reader-byline p { margin: 5px 0 0; color: var(--ink-soft); font-size: 12px; }
.reader-layout { position: relative; max-width: 900px; margin: 0 auto; }
.article-body { max-width: 700px; margin: 0 auto; font-family: var(--serif); font-size: 22px; line-height: 1.68; }
.article-body p { margin: 0 0 1.35em; }
.reader-footer { max-width: 700px; margin: 80px auto 0; padding-top: 28px; border-top: 1px solid var(--ink); }
.next-label { margin: 0 0 10px; color: var(--accent); font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.next-link { display: flex; justify-content: space-between; gap: 24px; font-family: var(--serif); font-size: 30px; line-height: 1.1; text-decoration: none; }

@media (max-width: 820px) {
  .site-header, .feed-shell, .reader-shell { width: min(calc(100% - 30px), var(--content)); }
  .site-header { grid-template-columns: 1fr auto; min-height: 68px; }
  .feed-tools { position: static; grid-template-columns: minmax(0,1fr) auto; margin-top: 36px; }
  .search-field { min-width: 0; }
  .search-field kbd { display: none; }
  .desktop-filter { display: none; }
  .filter-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 92px;
    padding: 0 14px;
    border: 0;
    border-left: 1px solid var(--rule);
    background: transparent;
    color: var(--ink);
    font-size: 13px;
    font-weight: 500;
  }
  .filter-count { min-width: 20px; height: 20px; padding: 0 5px; display: grid; place-items: center; border-radius: 999px; background: var(--accent); color: var(--paper); font-size: 11px; }
  .feed-item { grid-template-columns: 140px minmax(0,1fr) 22px; gap: 20px; }
}

@media (max-width: 580px) {
  .header-date { font-size: 10px; }
  .feed-tools { grid-template-columns: minmax(0,1fr) auto; }
  .feed-item { grid-template-columns: 1fr 22px; gap: 12px; padding: 28px 0 30px; }
  .feed-identity { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
  .feed-kicker { margin: 0 0 7px; }
  .feed-title { font-size: 31px; }
  .feed-excerpt { font-size: 17px; }
  .reader-nav { padding: 22px 0; }
  .reader-header { padding: 56px 0 44px; }
  .reader-header h1 { font-size: 48px; }
  .article-body { font-size: 20px; line-height: 1.62; }
  .next-link { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
