:root {
  --ink: #1d1d1f;
  --ink-soft: #6e6e73;
  --ink-faint: #86868b;
  --line: #d2d2d7;
  --paper: #ffffff;
  --paper-tint: #fafaf9;
  --accent: #0071e3;
  --accent-soft: #f0f6ff;
  --serif: "New York", "Iowan Old Style", "Palatino Linotype", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f5f5f7;
    --ink-soft: #a1a1a6;
    --ink-faint: #6e6e73;
    --line: #3a3a3c;
    --paper: #000000;
    --paper-tint: #0a0a0c;
    --accent: #2997ff;
    --accent-soft: #0d1b2e;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}

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

/* Top bar */
.topbar { border-bottom: 1px solid var(--line); }
.topbar__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 8px 0;
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: 0.01em;
}
.topbar__date { white-space: nowrap; }
.topbar__right { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.topbar__updated { white-space: nowrap; }
.update-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 100px;
  padding: 6px 14px;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}
.update-btn:hover { opacity: 0.75; }
.update-btn:active { transform: scale(0.96); }
.update-btn:disabled { cursor: default; opacity: 0.5; }
.update-btn__icon { display: inline-block; font-size: 13px; }
.update-btn.is-loading .update-btn__icon { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Masthead */
.masthead { padding: 64px 32px 36px; text-align: center; }
.brand { display: inline-flex; flex-direction: column; align-items: center; gap: 10px; }
.brand__mark { width: 56px; height: auto; margin-bottom: 4px; border-radius: 14px; }
.brand__name {
  font-family: var(--serif);
  font-size: 58px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
  line-height: 1.05;
}
.brand__name em { font-style: italic; color: var(--accent); }
.brand__tag {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Search + saved toggle */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 28px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}
.search-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}
.search-icon {
  position: absolute;
  left: 16px;
  width: 17px;
  height: 17px;
  color: var(--ink-faint);
  pointer-events: none;
  transition: color 0.2s ease;
}
.search-wrap:focus-within .search-icon { color: var(--accent); }
.search-input {
  width: 100%;
  font-family: var(--sans);
  font-size: 14.5px;
  padding: 13px 40px 13px 44px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: var(--paper-tint);
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.search-input::-webkit-search-cancel-button { display: none; }
.search-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--paper);
  box-shadow: 0 0 0 4px var(--accent-soft), 0 1px 2px rgba(0, 0, 0, 0.04);
}
.search-input::placeholder { color: var(--ink-faint); }
.search-clear {
  position: absolute;
  right: 8px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  color: var(--ink-faint);
  background: var(--line);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.search-clear:hover { background: var(--ink-faint); color: var(--paper); }
.search-clear[hidden] { display: none; }

.saved-toggle {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-soft);
  background: var(--paper-tint);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 12px 18px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.saved-toggle__icon { width: 15px; height: 15px; flex-shrink: 0; }
.saved-toggle:hover { border-color: var(--ink-faint); color: var(--ink); }
.saved-toggle.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.saved-toggle.is-active .saved-toggle__icon { fill: var(--accent); }

/* Topline: category pill + save button, shared across hero/story-row/card */
.topline { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.save-btn {
  flex-shrink: 0;
  font-size: 16px;
  line-height: 1;
  color: var(--ink-faint);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
}
.save-btn:hover { color: var(--accent); }
.save-btn.is-saved { color: #c8720a; }

/* Ticker */
.ticker {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  white-space: nowrap;
  padding: 10px 0;
}
.ticker__track {
  display: inline-flex;
  gap: 40px;
  padding-left: 100%;
  animation: scroll-left 90s linear infinite;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-soft);
}
.ticker:hover .ticker__track { animation-play-state: paused; }
.ticker__item { display: inline-flex; align-items: center; gap: 10px; }
.ticker__item:hover { color: var(--accent); }
.ticker__item::before {
  content: "";
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--ink-faint);
  display: inline-block;
}
@keyframes scroll-left { to { transform: translateX(-100%); } }
@media (prefers-reduced-motion: reduce) {
  .ticker__track { animation: none; padding-left: 32px; }
}

/* Digest */
.digest { padding: 44px 32px; text-align: center; }
.digest__label {
  display: block;
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.digest__text {
  margin: 0 auto;
  max-width: 760px;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 500;
  font-style: italic;
  letter-spacing: -0.005em;
  line-height: 1.45;
  color: var(--ink);
}

/* Analysis pull-quote ("why it matters") */
.analysis {
  margin: 6px 0 0;
  padding: 10px 0 10px 16px;
  border-left: 3px solid var(--accent);
}
.analysis__label {
  display: block;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}
.analysis__text {
  margin: 0;
  font-family: var(--serif);
  font-size: 15.5px;
  font-style: italic;
  line-height: 1.5;
  color: var(--ink);
}

/* Also-covered-by badge */
.also-sources { font-size: 12.5px; color: var(--ink-faint); }
.also-sources a { color: var(--ink-faint); text-decoration: underline; text-underline-offset: 2px; }
.also-sources a:hover { color: var(--accent); }

/* Explicit "leaves to the publisher" link */
.read-at {
  display: inline-block;
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
  margin-top: 2px;
}

/* Layout */
main { padding-top: 56px; }
.section-title {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 22px;
}

.hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 56px;
  padding-bottom: 56px;
  margin-bottom: 56px;
  border-bottom: 1px solid var(--line);
}
.hero__media {
  --cat-color: var(--accent);
  position: relative;
  aspect-ratio: 16/10;
  border-radius: 24px;
  background: color-mix(in srgb, var(--cat-color) 14%, var(--paper-tint));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.hero__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.hero__media:hover img { transform: scale(1.04); }
.hero__media svg { width: 46%; opacity: 0.7; }
.hero__body { display: flex; flex-direction: column; gap: 14px; justify-content: center; }
.pill {
  display: inline-flex;
  align-self: flex-start;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.hero__title {
  font-family: var(--serif);
  font-size: 38px;
  line-height: 1.12;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}
.hero__title a:hover { color: var(--accent); }
.hero__summary { font-size: 16.5px; line-height: 1.6; color: var(--ink-soft); margin: 0; }
.meta { font-size: 12.5px; color: var(--ink-faint); display: flex; gap: 6px; align-items: center; }

/* Top stories sidebar list */
.top-stories__list .story-row + .story-row { border-top: 1px solid var(--line); }
.story-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  padding: 22px 14px;
  margin: 0 -14px;
  align-items: flex-start;
  border-radius: 14px;
  transition: background 0.15s;
}
.story-row:hover { background: var(--paper-tint); }
.story-row__index {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  font-style: italic;
  color: var(--line);
  line-height: 1.3;
}
.story-row__body { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.story-row__title {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.3;
  font-weight: 600;
  margin: 0;
}
.story-row__title a:hover { color: var(--accent); }
.story-row__thumb {
  width: 84px;
  height: 84px;
  border-radius: 14px;
  flex-shrink: 0;
  object-fit: cover;
  background: var(--paper-tint);
}
.story-row__thumb--fallback,
.card__thumb--fallback {
  --cat-color: var(--accent);
  background: color-mix(in srgb, var(--cat-color) 14%, var(--paper-tint));
  display: flex;
  align-items: center;
  justify-content: center;
}
.story-row__thumb--fallback svg,
.card__thumb--fallback svg { width: 60%; opacity: 0.8; }

.media-wrap { position: relative; display: block; }
.ai-badge {
  position: absolute;
  left: 8px;
  bottom: 8px;
  font-family: var(--sans);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
  padding: 3px 7px;
  border-radius: 6px;
  backdrop-filter: blur(4px);
}

/* Coverage grid */
.coverage { margin-top: 64px; padding-bottom: 84px; }
.coverage__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 44px 32px; }
.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-radius: 20px;
  padding: 14px;
  margin: -14px;
  transition: background 0.2s, transform 0.2s;
}
.card:hover { background: var(--paper-tint); transform: translateY(-3px); }
.card__thumb {
  width: 100%;
  aspect-ratio: 16/10;
  border-radius: 16px;
  object-fit: cover;
  background: var(--paper-tint);
  transition: transform 0.4s ease;
}
.card:hover .card__thumb { transform: scale(1.02); }
.card__title {
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.28;
  font-weight: 600;
  letter-spacing: -0.005em;
  margin: 0;
}
.card__title a:hover { color: var(--accent); }
.card__summary {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.empty-state { color: var(--ink-faint); font-size: 14px; padding: 40px 0; }

/* Email capture */
.subscribe {
  margin: 72px 0;
  padding: 48px 40px;
  border-radius: 24px;
  background: var(--paper-tint);
  border: 1px solid var(--line);
  text-align: center;
}
.subscribe__heading {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}
.subscribe__sub {
  font-family: var(--sans);
  font-size: 14.5px;
  color: var(--ink-soft);
  margin: 0 0 24px;
}
.subscribe__form {
  display: flex;
  gap: 10px;
  max-width: 440px;
  margin: 0 auto;
}
.subscribe__input {
  flex: 1;
  font-family: var(--sans);
  font-size: 14.5px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: var(--paper);
  color: var(--ink);
}
.subscribe__input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.subscribe__btn {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--paper);
  background: var(--ink);
  border: none;
  border-radius: 100px;
  padding: 12px 22px;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
}
.subscribe__btn:hover { opacity: 0.8; }
.subscribe__btn:disabled { opacity: 0.5; cursor: default; }
.subscribe__status {
  margin: 14px 0 0;
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 500;
}
.subscribe__status--ok { color: #0f8a5f; }
.subscribe__status--error { color: #c8720a; }

@media (max-width: 560px) {
  .subscribe { padding: 36px 24px; margin: 48px 0; }
  .subscribe__form { flex-direction: column; }
}

/* Footer */
.footer { border-top: 1px solid var(--line); background: var(--paper-tint); padding: 56px 0 0; }
.footer__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; padding-bottom: 40px; }
.footer__block h3 {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 10px;
  font-weight: 700;
}
.footer__block p { font-size: 13.5px; line-height: 1.6; color: var(--ink-soft); margin: 0; }
.footer__base {
  border-top: 1px solid var(--line);
  padding: 20px 32px;
  font-size: 12px;
  color: var(--ink-faint);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer__rss { color: var(--ink-faint); text-decoration: underline; text-underline-offset: 2px; }
.footer__rss:hover { color: var(--accent); }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .coverage__grid { grid-template-columns: repeat(2, 1fr); }
  .footer__grid { grid-template-columns: 1fr; }
  .brand__name { font-size: 40px; }
  .digest__text { font-size: 21px; }
  .masthead { padding: 48px 24px 32px; }
}
@media (max-width: 560px) {
  .coverage__grid { grid-template-columns: 1fr; }
  .wrap { padding: 0 20px; }
  .story-row { grid-template-columns: auto 1fr; }
  .story-row > .media-wrap { display: none; }
  .topbar__row { flex-wrap: wrap; }
  .brand__mark { width: 44px; }
  .brand__name { font-size: 32px; }
  .brand__tag { font-size: 11px; }
  .masthead { padding: 36px 20px 24px; }
  .hero__title { font-size: 26px; }
  .digest { padding: 32px 20px; }
  .subscribe__heading { font-size: 22px; }
  .search-bar { flex-direction: column; align-items: stretch; }
  .saved-toggle { justify-content: center; }
  .footer__base { flex-direction: column; gap: 8px; align-items: flex-start; }
}
