:root {
  color-scheme: dark;
  --bg: #020617;
  --surface: rgba(11, 18, 32, 0.88);
  --surface-soft: rgba(15, 23, 42, 0.76);
  --border: rgba(148, 163, 184, 0.18);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --primary: #38bdf8;
  --primary-strong: #0ea5e9;
  --success: #34d399;
  --warning: #f59e0b;
  --shadow: 0 24px 60px rgba(2, 6, 23, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.14), transparent 28%),
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.12), transparent 22%),
    linear-gradient(180deg, #020617 0%, #071124 100%);
  color: var(--text);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.page-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 64px;
}

.site-header,
.hero-card,
.toolbar-card,
.topic-chip,
.story-card,
.dialog-card {
  backdrop-filter: blur(16px);
}

.site-header {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 24px;
  align-items: end;
  margin-bottom: 28px;
}

.site-header h1,
.section-head h2,
.dialog-content h3 {
  margin: 0;
  letter-spacing: -0.03em;
}

.site-header h1 {
  font-size: clamp(2.4rem, 6vw, 4.3rem);
}

.subtitle {
  margin: 14px 0 0;
  max-width: 62ch;
  color: var(--muted);
  line-height: 1.65;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
}

.header-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.meta-card,
.hero-card,
.toolbar-card,
.story-card,
.dialog-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.meta-card {
  padding: 18px;
}

.meta-card span,
.story-meta,
.topic-card p,
.story-card p,
.dialog-content p,
.bookmark-toggle,
.briefing-points,
.story-counter,
.hero-meta,
.briefing-footer {
  color: var(--muted);
}

.meta-card strong {
  display: block;
  margin-top: 10px;
  font-size: 1.2rem;
  color: var(--text);
}

.meta-card.accent {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.14), rgba(15, 23, 42, 0.92));
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

.hero-card {
  padding: 28px;
}

.hero-feature {
  position: relative;
  overflow: hidden;
}

.hero-feature::after {
  content: "";
  position: absolute;
  inset: auto -20% -35% auto;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.22), transparent 70%);
}

.hero-feature h2 {
  margin: 12px 0 14px;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  max-width: 16ch;
}

.hero-feature p {
  max-width: 54ch;
  line-height: 1.7;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  font-size: 0.92rem;
}

.pill,
.filter-pill,
.topic-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.72);
}

.briefing-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.section-head h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.briefing-points {
  margin: 18px 0;
  padding-left: 18px;
  line-height: 1.7;
}

.briefing-points li + li {
  margin-top: 10px;
}

.briefing-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.toolbar-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  margin-bottom: 18px;
}

.toolbar-primary,
.toolbar-secondary {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.search-field {
  flex: 1 1 360px;
}

.search-field input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(2, 6, 23, 0.5);
  color: var(--text);
}

.search-field input::placeholder {
  color: #64748b;
}

.ghost-button,
.filter-pill {
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.72);
  color: var(--text);
  border-radius: 14px;
  padding: 12px 14px;
  transition: 160ms ease;
}

.ghost-button:hover,
.filter-pill:hover,
.filter-pill.active,
.story-card:hover,
.topic-chip:hover {
  border-color: rgba(56, 189, 248, 0.45);
  transform: translateY(-1px);
}

.filter-group,
.topics-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-pill.active {
  background: rgba(56, 189, 248, 0.16);
  color: #d9f3ff;
}

.bookmark-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.topics-strip {
  margin-bottom: 18px;
}

.topic-chip {
  padding: 16px 18px;
  min-width: 170px;
  flex: 1 1 180px;
}

.topic-chip strong {
  display: block;
  color: var(--text);
  margin-bottom: 6px;
}

.stories-section {
  margin-top: 10px;
}

.story-head {
  margin-bottom: 18px;
}

.stories-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.story-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  transition: 180ms ease;
}

.story-card h3 {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.35;
}

.story-card p {
  margin: 0;
  line-height: 1.65;
}

.story-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
}

.story-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.primary-button,
.secondary-button {
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
}

.primary-button {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #071124;
  font-weight: 700;
}

.secondary-button {
  background: rgba(15, 23, 42, 0.72);
  color: var(--text);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.story-dialog {
  width: min(760px, calc(100% - 24px));
  border: 0;
  padding: 0;
  background: transparent;
}

.story-dialog::backdrop {
  background: rgba(2, 6, 23, 0.76);
  backdrop-filter: blur(8px);
}

.dialog-card {
  position: relative;
  padding: 28px;
}

.dialog-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.72);
  color: var(--text);
  font-size: 1.5rem;
}

.dialog-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dialog-content h3 {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
}

.dialog-body {
  display: grid;
  gap: 14px;
}

.dialog-list {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.7;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 28px;
  text-align: center;
  border: 1px dashed rgba(148, 163, 184, 0.22);
  border-radius: 22px;
  color: var(--muted);
  background: rgba(15, 23, 42, 0.52);
}

.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: 960px) {
  .site-header,
  .hero-grid,
  .stories-grid {
    grid-template-columns: 1fr;
  }

  .header-meta {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 20px, 1200px);
    padding-top: 18px;
  }

  .header-meta {
    grid-template-columns: 1fr;
  }

  .hero-card,
  .toolbar-card,
  .story-card,
  .dialog-card {
    border-radius: 20px;
  }

  .briefing-footer,
  .story-actions,
  .story-meta {
    flex-direction: column;
    align-items: flex-start;
  }
}
