:root {
  color-scheme: light dark;
  --bg: #f3f6fb;
  --bg-2: #edf2fb;
  --surface: rgba(255, 255, 255, 0.74);
  --surface-strong: rgba(255, 255, 255, 0.92);
  --text: #102033;
  --muted: #5d6b7b;
  --line: rgba(16, 32, 51, 0.12);
  --shadow: 0 18px 50px rgba(16, 32, 51, 0.10);
  --shadow-soft: 0 10px 28px rgba(16, 32, 51, 0.08);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --accent: #155eef;
  --accent-soft: rgba(21, 94, 239, 0.12);
  --news: #2563eb;
  --event: #0f9f76;
  --alert: #d97706;
  --civic: #7c3aed;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #09111d;
    --bg-2: #0d1728;
    --surface: rgba(14, 22, 35, 0.72);
    --surface-strong: rgba(14, 22, 35, 0.88);
    --text: #edf3fb;
    --muted: #9fb0c3;
    --line: rgba(237, 243, 251, 0.10);
    --shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
    --shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.24);
    --accent-soft: rgba(88, 145, 255, 0.16);
  }
}


html[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f6fb;
  --bg-2: #edf2fb;
  --surface: rgba(255, 255, 255, 0.74);
  --surface-strong: rgba(255, 255, 255, 0.92);
  --text: #102033;
  --muted: #5d6b7b;
  --line: rgba(16, 32, 51, 0.12);
  --shadow: 0 18px 50px rgba(16, 32, 51, 0.10);
  --shadow-soft: 0 10px 28px rgba(16, 32, 51, 0.08);
  --accent: #155eef;
  --accent-soft: rgba(21, 94, 239, 0.12);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #09111d;
  --bg-2: #0d1728;
  --surface: rgba(14, 22, 35, 0.72);
  --surface-strong: rgba(14, 22, 35, 0.88);
  --text: #edf3fb;
  --muted: #9fb0c3;
  --line: rgba(237, 243, 251, 0.10);
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
  --shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.24);
  --accent-soft: rgba(88, 145, 255, 0.16);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(21, 94, 239, 0.16), transparent 28%),
    radial-gradient(circle at top right, rgba(15, 159, 118, 0.12), transparent 24%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}

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

a:hover { text-decoration: none; }

.page-shell {
  width: min(1280px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0 3rem;
}

.hero,
.filters,
.card,
.stat-card,
.notice {
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.hero {
  display: grid;
  grid-template-columns: 1.45fr .75fr;
  gap: 1rem;
  padding: 1.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, var(--surface-strong), var(--surface));
  box-shadow: var(--shadow);
}

.eyebrow {
  display: inline-flex;
  padding: .42rem .72rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .02em;
}

.brand-lockup-wrap {
  margin: .9rem 0 .45rem;
}

.brand-lockup {
  display: none;
  width: min(100%, 620px);
  height: auto;
  filter: drop-shadow(0 12px 24px rgba(16, 32, 51, 0.10));
}

html[data-theme="light"] .brand-lockup-light {
  display: block;
}

html[data-theme="dark"] .brand-lockup-dark {
  display: block;
}

html[data-theme="auto"] .brand-lockup-light {
  display: block;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] .brand-lockup-light {
    display: none;
  }

  html[data-theme="auto"] .brand-lockup-dark {
    display: block;
  }
}

h1 {
  margin: 0;
  font-size: clamp(2.5rem, 5vw, 4.8rem);
  line-height: .94;
  letter-spacing: -0.06em;
}

.hero-text {
  max-width: 50ch;
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: .8rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

.hero-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: .9rem;
  padding: 1.1rem;
  border-radius: calc(var(--radius-xl) - 8px);
  background: linear-gradient(180deg, rgba(255,255,255,0.26), rgba(255,255,255,0.08));
  border: 1px solid var(--line);
}

.status-row,
.meta-stack,
.card-topline,
.details,
.tags,
.card-footer {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  align-items: center;
}

.status-row {
  color: var(--muted);
  font-size: .92rem;
}

.theme-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .35rem;
  padding: .32rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,0.22);
}

.theme-picker button {
  min-height: 34px;
  padding: .38rem .55rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  font-size: .82rem;
  font-weight: 700;
}

.theme-picker button:hover {
  transform: none;
}

.theme-picker button[aria-pressed="true"] {
  background: var(--surface-strong);
  color: var(--text);
  box-shadow: 0 6px 16px rgba(16, 32, 51, 0.12);
}

.status-dot {
  width: .7rem;
  height: .7rem;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 .28rem rgba(16,185,129,.14);
}

.stamp-label,
.mini-label,
.stat-label,
.score {
  color: var(--muted);
  font-size: .83rem;
}

.stamp-value {
  display: block;
  font-size: 1.05rem;
}

.meta-stack {
  gap: 1.2rem;
}

.meta-stack > div {
  min-width: 96px;
}

.meta-stack strong {
  display: block;
  margin-top: .15rem;
  font-size: 1.25rem;
}

.button,
button,
input,
select {
  font: inherit;
}

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 46px;
  padding: .76rem 1rem;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

.button:hover,
button:hover {
  transform: translateY(-1px);
}

.button.primary,
button.primary,
.filters button {
  background: linear-gradient(180deg, #2b6ef3, #155eef);
  color: white;
  box-shadow: 0 10px 24px rgba(21, 94, 239, .26);
}

.button.ghost {
  background: transparent;
  border-color: var(--line);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .85rem;
  margin: 1rem 0;
}

.stat-card {
  display: block;
  padding: 1rem 1.05rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.stat-card:hover,
.card:hover {
  transform: translateY(-2px);
}

.stat-card strong {
  display: block;
  margin-top: .35rem;
  font-size: 1.6rem;
}

.stat-card.active {
  border-color: rgba(21, 94, 239, 0.38);
  background: linear-gradient(180deg, rgba(21, 94, 239, 0.13), var(--surface));
}

.stat-card.kind-news.active { border-color: color-mix(in srgb, var(--news) 45%, var(--line)); }
.stat-card.kind-event.active { border-color: color-mix(in srgb, var(--event) 45%, var(--line)); }
.stat-card.kind-alert.active { border-color: color-mix(in srgb, var(--alert) 45%, var(--line)); }
.stat-card.kind-civic.active { border-color: color-mix(in srgb, var(--civic) 45%, var(--line)); }

.filters {
  position: sticky;
  top: 0.75rem;
  z-index: 10;
  display: grid;
  grid-template-columns: 1.35fr .55fr auto;
  gap: .85rem;
  padding: .95rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, var(--surface-strong), var(--surface));
  box-shadow: var(--shadow-soft);
}

.filters input,
.filters select {
  width: 100%;
  min-height: 48px;
  padding: .82rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.50);
  color: var(--text);
  outline: none;
}

.filters input:focus,
.filters select:focus {
  border-color: rgba(21, 94, 239, 0.45);
  box-shadow: 0 0 0 .25rem rgba(21, 94, 239, 0.10);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.card {
  display: flex;
  flex-direction: column;
  gap: .8rem;
  min-height: 260px;
  padding: 1.1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface-strong), var(--surface));
  box-shadow: var(--shadow-soft);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.card.kind-news { border-top: 4px solid color-mix(in srgb, var(--news) 72%, transparent); }
.card.kind-event { border-top: 4px solid color-mix(in srgb, var(--event) 72%, transparent); }
.card.kind-alert { border-top: 4px solid color-mix(in srgb, var(--alert) 72%, transparent); }
.card.kind-civic { border-top: 4px solid color-mix(in srgb, var(--civic) 72%, transparent); }

.kind-pill,
.source-pill,
.tags span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: .25rem .65rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: .8rem;
}

.kind-pill.kind-news { color: var(--news); background: color-mix(in srgb, var(--news) 10%, transparent); }
.kind-pill.kind-event { color: var(--event); background: color-mix(in srgb, var(--event) 10%, transparent); }
.kind-pill.kind-alert { color: var(--alert); background: color-mix(in srgb, var(--alert) 10%, transparent); }
.kind-pill.kind-civic { color: var(--civic); background: color-mix(in srgb, var(--civic) 10%, transparent); }

.source-pill { color: var(--muted); }

.card h2 {
  margin: 0;
  font-size: 1.26rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.card h2 a:hover {
  color: var(--accent);
}

.summary {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.details {
  color: var(--muted);
  font-size: .86rem;
}

.details span,
.tags span {
  background: rgba(255,255,255,0.34);
}

.card-footer {
  justify-content: space-between;
  margin-top: auto;
  padding-top: .25rem;
}

.read-more {
  color: var(--accent);
  font-weight: 700;
}

.notice {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface-strong), var(--surface));
}

.warning {
  border-color: rgba(217, 119, 6, 0.35);
}

.empty {
  grid-column: 1 / -1;
}

.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: 1040px) {
  .hero { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .page-shell { width: min(100% - 1rem, 1280px); padding-top: .6rem; }
  .hero, .filters { padding: .9rem; }
  .filters { grid-template-columns: 1fr; top: .4rem; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  h1 { font-size: clamp(2.2rem, 9vw, 3.8rem); }
}

@media (max-width: 520px) {
  .hero-actions { flex-direction: column; }
  .button, button { width: 100%; }
  .stat-grid { grid-template-columns: 1fr; }
}


.theme-picker button {
  width: auto;
}

@media (max-width: 760px) {
  .brand-lockup {
    width: min(100%, 480px);
  }
}

@media (max-width: 520px) {
  .theme-picker button {
    width: auto;
  }
}


/* Brand image theme switching: keep exactly one lockup visible. */
.brand-lockup {
  display: none !important;
  width: min(100%, 560px);
}

html[data-theme="light"] .brand-lockup-light {
  display: block !important;
}

html[data-theme="dark"] .brand-lockup-dark {
  display: block !important;
}

html[data-theme="auto"] .brand-lockup-light {
  display: block !important;
}

html[data-theme="auto"] .brand-lockup-dark {
  display: none !important;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] .brand-lockup-light {
    display: none !important;
  }

  html[data-theme="auto"] .brand-lockup-dark {
    display: block !important;
  }
}

@media (max-width: 760px) {
  .brand-lockup {
    width: min(100%, 430px);
  }
}
