:root {
  --paper: #F2F4F3;
  --card: #FFFFFF;
  --ink: #1C2A31;
  --muted: #5A6870;
  --line: #D9E0DE;
  --accent: #0B6B5A;
  --gutter: max(clamp(16px, 4vw, 48px), env(safe-area-inset-left, 0px));
  --serif: "Newsreader", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* ---------- masthead ---------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) var(--gutter) 0;
  background: rgba(242, 244, 243, 0.92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.masthead-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  margin: 0;
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-size: 1.9rem;
  font-weight: 650;
  line-height: 1;
  letter-spacing: -0.02em;
}

.updated {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.status-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.fresh {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 6px 12px;
  background: var(--accent);
  color: #FFFFFF;
  font: 600 0.8rem/1 var(--sans);
  cursor: pointer;
  white-space: nowrap;
}

.fresh[hidden] { display: none; }

.fresh:focus-visible, .more:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.tabs {
  display: flex;
  gap: 22px;
  margin-top: 8px;
}

.tab {
  appearance: none;
  border: 0;
  background: none;
  padding: 8px 0 10px;
  font: 500 0.95rem/1 var(--sans);
  color: var(--muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
}

.tab[aria-selected="true"] {
  color: var(--ink);
  font-weight: 600;
  border-bottom-color: var(--accent);
}

/* ---------- lanes ---------- */

main { padding: 8px 0 24px; outline: none; }

.lane { margin-top: 26px; }

.lane-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 0 var(--gutter);
  margin-bottom: 10px;
}

.lane-title {
  margin: 0;
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-size: clamp(1.45rem, 1.2rem + 1vw, 1.9rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.lane-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.unread {
  font-size: 0.8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.unread strong { color: var(--accent); font-weight: 600; }

.nudge {
  display: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.nudge:hover { border-color: var(--muted); }

@media (hover: hover) and (pointer: fine) {
  .nudge { display: inline-grid; place-items: center; }
}

.row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(76vw, 18.5rem);
  gap: 12px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  padding: 2px var(--gutter) 14px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.empty {
  margin: 0;
  padding: 0 var(--gutter);
  color: var(--muted);
  font-size: 0.92rem;
}

/* ---------- cards ---------- */

.card {
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.card:hover { border-color: #B9C4C1; }

.card:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.card figure {
  margin: 0;
  aspect-ratio: 2 / 1;
  overflow: hidden;
  position: relative;
}

.card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tile {
  display: flex;
  align-items: flex-end;
  width: 100%;
  height: 100%;
  padding: 12px 14px;
  background: hsl(var(--h) 28% 89%);
  color: hsl(var(--h) 38% 24%);
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: 1.55rem;
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.card-body { padding: 11px 14px 15px; }

.meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.78rem;
  line-height: 1.3;
}

.source {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.time {
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.card h3 {
  margin: 6px 0 0;
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-size: 1.14rem;
  font-weight: 560;
  line-height: 1.27;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.snippet {
  margin: 6px 0 0;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card.is-read { opacity: 0.5; }

.more {
  scroll-snap-align: start;
  appearance: none;
  display: grid;
  place-items: center;
  padding: 20px;
  border: 1px dashed #B9C4C1;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  font: 500 0.92rem/1.4 var(--sans);
  text-align: center;
  cursor: pointer;
}

.more:hover { color: var(--ink); border-color: var(--muted); }

.more-inline {
  display: inline-block;
  margin-top: 8px;
  padding: 10px 16px;
}

.empty p { margin: 0; }
.card.is-read h3 { font-weight: 430; }

/* ---------- notices & footer ---------- */

.notice {
  margin: 40px var(--gutter);
  color: var(--muted);
}

.foot {
  padding: 8px var(--gutter) 32px;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--muted);
}

.foot summary {
  cursor: pointer;
  padding: 12px 0;
}

.status-group { margin: 6px 0 14px; }
.status-group h4 { margin: 0 0 4px; font-size: 0.85rem; color: var(--ink); }
.status-group ul { margin: 0; padding-left: 18px; }
.status-group li { margin: 2px 0; }

@media (prefers-reduced-motion: reduce) {
  .row { scroll-behavior: auto; }
  .card { transition: none; }
}
