:root {
  --ink: #171915;
  --muted: #70736b;
  --paper: #f5f3ed;
  --card: #fbfaf6;
  --line: #d8d5cc;
  --accent: #b9472e;
  --green: #22493d;
  --header-bg: rgba(245, 243, 237, .88);
  --panel-bg: rgba(245, 243, 237, .96);
  --accent-soft: rgba(185, 71, 46, .06);
  --accent-soft-strong: rgba(185, 71, 46, .12);
  --popular-ink: #f7f4eb;
  --popular-muted: rgba(255,255,255,.6);
  --serif: "Newsreader", Georgia, serif;
  --sans: "DM Sans", system-ui, sans-serif;
}

html[data-theme="dark"] {
  --ink: #f4efe4;
  --muted: #b9b1a4;
  --paper: #11130f;
  --card: #191b16;
  --line: #34372f;
  --accent: #d96a4f;
  --green: #233f35;
  --header-bg: rgba(17, 19, 15, .9);
  --panel-bg: rgba(17, 19, 15, .96);
  --accent-soft: rgba(217, 106, 79, .12);
  --accent-soft-strong: rgba(217, 106, 79, .2);
  --popular-ink: #fff7ea;
  --popular-muted: rgba(255,247,234,.66);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 80% 4%, rgba(180, 71, 46, .08), transparent 24rem),
    var(--paper);
  font-family: var(--sans);
}
button, input { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
.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;
}

.site-header {
  height: 82px;
  padding: 0 clamp(22px, 5vw, 82px);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0;
  width: max-content;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 600;
}
.brand-logo {
  display: block;
  width: 186px;
  height: auto;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--paper);
  background: var(--accent);
  border-radius: 50% 50% 50% 15%;
  font-size: 21px;
}
.main-nav { display: flex; gap: 34px; height: 100%; }
.nav-link {
  position: relative;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-weight: 600;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform .2s ease;
}
.nav-link.active::after { transform: scaleX(1); }
.header-actions { justify-self: end; display: flex; gap: 12px; }
.theme-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 78px;
  height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}
.theme-button:hover,
.theme-button:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}
.theme-icon { font-size: 15px; line-height: 1; }
.search-button, .circle-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.search-button svg {
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}
.follow-button {
  padding: 0 18px;
  border: 0;
  border-radius: 2px;
  background: var(--green);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.search-panel {
  position: sticky;
  top: 82px;
  z-index: 19;
  padding: 14px clamp(22px, 5vw, 82px);
  border-bottom: 1px solid var(--line);
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
}
.search-panel[hidden] { display: none; }
.search-inner {
  max-width: 1216px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
}
.search-inner svg {
  width: 20px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.7;
}
.search-inner input {
  min-width: 0;
  padding: 8px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 21px;
}
.search-inner input::placeholder { color: var(--muted); }
.search-inner button {
  padding: 7px 10px;
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}
.search-hint {
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--muted);
  font-size: 9px;
}

main { max-width: 1380px; margin: 0 auto; padding: 0 clamp(22px, 5vw, 82px); }
.hero {
  min-height: 320px;
  padding: 66px 0 50px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-bottom: 1px solid var(--line);
}
.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
}
h1, h2, h3, p { margin-top: 0; }
h1 {
  max-width: 760px;
  margin-bottom: 16px;
  font-family: var(--serif);
  font-size: clamp(50px, calc(7vw - 2px), 94px);
  font-weight: 500;
  line-height: .94;
  letter-spacing: -.04em;
}
.hero-copy { color: var(--muted); font-size: 17px; }
.date-block {
  width: 145px;
  padding-left: 25px;
  border-left: 1px solid var(--line);
  display: grid;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .12em;
}
.date-block strong {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 64px;
  font-weight: 500;
  line-height: .9;
}

.featured-strip { padding: 42px 0 48px; border-bottom: 1px solid var(--line); }
.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 25px;
}
.section-heading h2 {
  margin-bottom: 0;
  font-family: var(--serif);
  font-size: 35px;
  font-weight: 500;
}
.strip-controls { display: flex; gap: 8px; }
.circle-button { transition: background .2s, color .2s; }
.circle-button:hover { background: var(--ink); color: var(--paper); }
.authors {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(210px, 1fr);
  gap: 14px;
  overflow-x: auto;
  scrollbar-width: none;
}
.authors::-webkit-scrollbar { display: none; }
.author-card {
  min-height: 132px;
  padding: 20px;
  border: 1px solid var(--line);
  background: rgba(251, 250, 246, .52);
  color: inherit;
  display: grid;
  grid-template-columns: 48px 1fr;
  align-content: center;
  gap: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: transform .2s, background .2s;
}
.author-card:hover,
.author-card:focus-visible {
  transform: translateY(-3px);
  background: var(--card);
}
.author-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.author-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--green);
  color: white;
  font-family: var(--serif);
  font-size: 20px;
}
.author-card:nth-child(even) .author-avatar { background: var(--accent); }
.author-card h3 { margin: 3px 0 3px; font-family: var(--serif); font-size: 19px; }
.author-card span { color: var(--muted); font-size: 11px; }

.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: clamp(40px, 7vw, 92px);
  padding: 58px 0 80px;
}
.feed-heading { padding-bottom: 22px; margin-bottom: 0; border-bottom: 2px solid var(--ink); }
.live-label { color: var(--muted); font-size: 11px; }
.live-label i {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: #3b825b;
  box-shadow: 0 0 0 4px rgba(59, 130, 91, .12);
}
.feed-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}
.category-scroll {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  min-width: 0;
}
.category-scroll-button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  font-size: 16px;
  transition: border-color .2s, background .2s, color .2s, opacity .2s;
}
.category-scroll-button:hover:not(:disabled) {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}
.category-scroll-button:disabled { opacity: .3; cursor: default; }
.category-scroll-button[hidden] { display: none; }
.category-filters {
  display: flex;
  min-width: 0;
  gap: 8px;
  padding: 18px 8px;
  overflow-x: auto;
  scroll-behavior: smooth;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
}
.category-filters::-webkit-scrollbar { display: none; }
.category-chip {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  transition: background .2s, border-color .2s, color .2s;
}
.category-chip span {
  margin-left: 5px;
  opacity: .62;
  font-variant-numeric: tabular-nums;
}
.category-chip:hover { border-color: var(--ink); color: var(--ink); }
.category-chip.active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}
.source-filter {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.source-filter select {
  min-width: 0;
  padding: 8px 26px 8px 10px;
  border: 1px solid var(--line);
  border-radius: 2px;
  outline: 0;
  background: var(--card);
  color: var(--ink);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
}
.source-filter select:focus { border-color: var(--ink); }
.article {
  display: grid;
  grid-template-columns: 128px 1fr 28px;
  gap: 26px;
  padding: 27px 0;
  border-bottom: 1px solid var(--line);
}
.article-meta {
  display: grid;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}
.article-meta span {
  display: block;
  margin-bottom: 3px;
  color: #999b94;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.article-meta strong {
  display: block;
  color: var(--ink);
  font-weight: 700;
}
.article-source { color: var(--accent) !important; text-transform: uppercase; }
.article h3 {
  margin-bottom: 8px;
  font-family: var(--serif);
  font-size: clamp(23px, 2.5vw, 31px);
  font-weight: 500;
  line-height: 1.08;
}
.article p { max-width: 700px; margin-bottom: 13px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.read-source {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid rgba(185, 71, 46, .32);
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 11px;
  font-weight: 700;
}
.read-source::after { content: "↗"; }
.read-source:hover,
.read-source:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft-strong);
}
.article-link { align-self: center; font-size: 20px; transition: transform .2s; }
.article:hover .article-link { transform: translate(4px, -4px); }
.load-more {
  width: 100%;
  margin-top: 25px;
  padding: 14px;
  border: 1px solid var(--ink);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.popular-card { padding: 27px; background: var(--green); color: var(--popular-ink); }
.popular-card .eyebrow { color: #e9a48f; }
.popular-card h2 { margin-bottom: 23px; font-family: var(--serif); font-size: 34px; font-weight: 500; }
.popular-item {
  display: grid;
  grid-template-columns: 35px 1fr;
  gap: 12px;
  padding: 16px 0;
  border-top: 1px solid rgba(255,255,255,.16);
}
.popular-rank { color: #e9a48f; font-family: var(--serif); font-size: 24px; }
.popular-item h3 { margin: 0 0 7px; font-family: var(--serif); font-size: 18px; font-weight: 500; line-height: 1.15; }
.popular-item span { color: var(--popular-muted); font-size: 10px; }
.popular-empty {
  padding: 20px 0 4px;
  border-top: 1px solid rgba(255,255,255,.16);
  color: rgba(255,255,255,.65);
  font-size: 12px;
  line-height: 1.6;
}
.newsletter { margin-top: 20px; padding: 28px; border: 1px solid var(--line); background: var(--card); }
.mail-icon { color: var(--accent); font-size: 25px; }
.newsletter h3 { margin: 15px 0 8px; font-family: var(--serif); font-size: 26px; }
.newsletter p { color: var(--muted); font-size: 12px; line-height: 1.5; }
.newsletter form { display: flex; border-bottom: 1px solid var(--ink); }
.newsletter input { width: 100%; padding: 10px 0; border: 0; outline: 0; background: transparent; font-size: 12px; }
.newsletter button { border: 0; background: transparent; font-weight: 700; font-size: 11px; cursor: pointer; }

footer {
  min-height: 150px;
  padding: 36px clamp(22px, 5vw, 82px);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
}
.footer-brand { color: var(--ink); }
.footer-brand .brand-logo { width: 176px; }
.footer-center { max-width: 720px; text-align: center; }
.footer-center p { margin: 0 0 14px; }
.footer-disclaimer {
  max-width: 560px;
  margin-inline: auto !important;
  color: var(--muted);
  line-height: 1.55;
}
.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 28px;
}
.footer-links a { color: var(--ink); }
.footer-links a:hover { color: var(--accent); }
.toast {
  position: fixed;
  right: 25px;
  bottom: 25px;
  padding: 13px 17px;
  background: var(--ink);
  color: white;
  font-size: 12px;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: .2s;
}
.toast.show { opacity: 1; transform: translateY(0); }
.empty-state { padding: 50px 0; color: var(--muted); }

@media (max-width: 860px) {
  .site-header { grid-template-columns: 1fr auto; }
  .main-nav {
    position: fixed;
    left: 0;
    right: 0;
    top: 82px;
    height: 48px;
    justify-content: center;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
  }
  .search-panel { top: 130px; }
  .header-actions .search-button { display: none; }
  main { padding-top: 48px; }
  .content-layout { grid-template-columns: 1fr; }
  .popular { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
}
@media (max-width: 600px) {
  .brand-logo { width: 154px; }
  .follow-button { display: none; }
  .header-actions .search-button { display: grid; place-items: center; }
  .search-hint { display: none; }
  .hero { min-height: 310px; padding-top: 45px; align-items: flex-start; }
  .date-block { display: none; }
  h1 { font-size: 53px; }
  .article { grid-template-columns: 1fr 24px; gap: 14px; }
  .article-meta {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }
  .article h3 { font-size: 25px; }
  .feed-tools { display: block; padding-bottom: 15px; }
  .category-scroll { margin: 0 -4px; }
  .category-scroll-button { width: 30px; height: 30px; }
  .category-filters { padding-bottom: 12px; }
  .source-filter { grid-template-columns: 45px 1fr; }
  .popular { grid-template-columns: 1fr; }
  footer { align-items: flex-start; flex-direction: column; gap: 20px; }
  .footer-center { text-align: left; }
  .footer-links { justify-content: flex-start; }
}
