:root {
  color-scheme: dark;
  --bg: #0b1322;
  --bg-elevated: #101a2c;
  --panel: #121f35;
  --panel-2: #1a2a46;
  --text: #e9eef8;
  --muted: #9baccc;
  --accent: #e07a3f;
  --accent-strong: #f08b4d;
  --accent-soft: rgba(224, 122, 63, 0.14);
  --border: #243757;
  --chip: #17243b;
  --header-bg: rgba(11, 19, 34, 0.92);
  --skeleton-base: #182742;
  --skeleton-shine: #223652;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  --header-height: 68px;
  --sidebar-width: 286px;
  --content-max: 1440px;
  --radius: 14px;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f3efe7;
  --bg-elevated: #fbf8f2;
  --panel: #fbf8f2;
  --panel-2: #efe9de;
  --text: #302d27;
  --muted: #6f695f;
  --accent: #a9572b;
  --accent-strong: #8f4622;
  --accent-soft: rgba(169, 87, 43, 0.12);
  --border: #ddd4c5;
  --chip: #ece5d8;
  --header-bg: rgba(243, 239, 231, 0.93);
  --skeleton-base: #e5ded1;
  --skeleton-shine: #f4efe6;
  --shadow: 0 18px 50px rgba(76, 61, 41, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  zoom: var(--site-zoom, 1);
}

body.drawer-open {
  overflow: hidden;
}

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

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

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

img {
  max-width: 100%;
}

h1,
h2,
h3 {
  line-height: 1.22;
  letter-spacing: -0.015em;
}

h1 {
  margin: 0 0 14px;
  font-size: clamp(30px, 4.2vw, 46px);
}

h2 {
  margin: 0 0 14px;
  font-size: clamp(21px, 2.4vw, 27px);
}

h3 {
  margin: 0;
}

code {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 0.9em;
}

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

.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;
}

.clipboard-helper {
  position: fixed;
  top: 0;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-height);
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
  backdrop-filter: blur(14px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: var(--content-max);
  height: 100%;
  margin: 0 auto;
  padding: 0 20px;
}

.brand,
.sidebar-brand,
.footer-brand {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.brand {
  font-size: 22px;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-right: 7px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0;
  box-shadow: 0 5px 18px rgba(224, 122, 63, 0.28);
}

.brand-dot,
.sidebar-brand span,
.footer-brand span {
  color: var(--muted);
  font-weight: 500;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.visitor-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 0 14px;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
}

.visitor-pill strong {
  color: var(--text);
  font-weight: 650;
}

.visitor-divider {
  margin: 0 3px;
  color: var(--border);
}

.visitor-pill[hidden],
.side-stats[hidden] {
  display: none;
}

.zoom-control {
  display: inline-flex;
  align-items: center;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  overflow: hidden;
}

.zoom-button,
.zoom-value {
  height: 100%;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
}

.zoom-button {
  width: 30px;
  font-weight: 700;
}

.zoom-value {
  min-width: 42px;
  border-right: 1px solid var(--border);
  border-left: 1px solid var(--border);
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.zoom-button:hover,
.zoom-value:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 40px;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  font-size: 14px;
  line-height: 1;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.icon-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.icon-button[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.control-label {
  font-size: 13px;
  font-weight: 550;
}

.menu-toggle {
  display: inline-flex;
}

/* Layout and sidebar */

.app-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 24px 20px 0;
}

.sidebar {
  display: block;
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand {
  font-size: 21px;
}

.sidebar-close {
  min-width: 38px;
  min-height: 38px;
  padding: 0;
}

.side-nav {
  display: grid;
  gap: 4px;
}

.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 15px;
  transition: background 160ms ease, color 160ms ease;
}

.side-link span {
  width: 18px;
  color: var(--muted);
  text-align: center;
}

.side-link:hover {
  background: var(--panel-2);
  color: var(--text);
}

.side-link.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 650;
}

.side-link.is-active span {
  color: var(--accent);
}

.side-title {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.side-tags,
.side-legal {
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  max-width: 100%;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  font-size: 12px;
  line-height: 1.2;
  text-decoration: none;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.tag-chip:hover,
.tag-chip.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.tag-chip-hash {
  color: var(--muted);
  font-weight: 700;
}

.tag-chip:hover .tag-chip-hash,
.tag-chip.is-active .tag-chip-hash {
  color: var(--accent);
}

.tag-chip-count {
  margin-left: 3px;
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.side-more {
  display: inline-block;
  margin-top: 11px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 650;
}

.side-note {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.side-legal-link {
  display: block;
  padding: 6px 0;
  color: var(--text);
  font-size: 14px;
}

.side-copy {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.side-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 2px 0 0;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.side-stats strong {
  color: var(--text);
  font-weight: 650;
}

.sidebar .filter-panel {
  gap: 18px;
}

.sidebar .filter-group {
  display: block;
}

.sidebar .filter-label {
  display: block;
  margin-bottom: 8px;
}

.sidebar .chips {
  flex-wrap: wrap;
  overflow: visible;
  padding-bottom: 0;
}

.sidebar .chip {
  font-size: 12px;
}

.drawer-backdrop {
  display: none;
}

/* Main content */

.site-main {
  min-width: 0;
  padding-bottom: 44px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.page-head h1 {
  margin-bottom: 5px;
  font-size: clamp(28px, 3.5vw, 38px);
}

.page-head .muted {
  margin: 0;
  font-size: 14px;
}

.page-head--compact {
  margin-bottom: 12px;
}

.page-head--compact .eyebrow {
  margin-bottom: 4px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 26px 0 13px;
}

.section-head h2 {
  margin: 0;
}

.section-head .muted {
  font-size: 14px;
  white-space: nowrap;
}

.hero {
  padding: clamp(22px, 4vw, 44px);
  border: 1px solid var(--border);
  border-radius: 20px;
  background:
    radial-gradient(circle at 92% 8%, var(--accent-soft), transparent 38%),
    var(--panel);
  box-shadow: var(--shadow);
}

.hero h1 {
  max-width: 760px;
  margin-bottom: 14px;
}

.hero-lead {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(16px, 1.8vw, 19px);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.page-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Services portal */

.portal-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(240px, 0.7fr);
  gap: clamp(20px, 4vw, 48px);
  align-items: stretch;
  padding: clamp(22px, 4vw, 44px);
  border: 1px solid var(--border);
  border-radius: 20px;
  background:
    radial-gradient(circle at 92% 8%, var(--accent-soft), transparent 38%),
    var(--panel);
  box-shadow: var(--shadow);
}

.portal-hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.portal-hero h1 {
  max-width: 760px;
  margin-bottom: 14px;
}

.portal-lead {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(16px, 1.8vw, 19px);
}

.portal-hero-note {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel-2, var(--chip));
  color: var(--muted);
  font-size: 13px;
}

.portal-hero-note strong {
  color: var(--text);
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.portal-note-label {
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

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

.service-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 190px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  transition: border-color 180ms ease, transform 180ms ease;
}

.service-card:hover {
  border-color: var(--accent);
  color: var(--text);
  transform: translateY(-2px);
}

.service-card h3 {
  margin: 2px 0 0;
  font-size: 19px;
}

.service-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.service-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--chip);
  color: var(--accent);
  font-size: 19px;
}

.service-link {
  margin-top: auto;
  color: var(--accent);
  font-size: 13px;
  font-weight: 650;
}

.service-card.is-soon {
  opacity: 0.64;
}

.service-card.is-soon:hover {
  border-color: var(--border);
  transform: none;
}

.portal-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 8px;
}

.portal-preview-list {
  display: grid;
  gap: 8px;
}

.portal-preview-item {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
}

.portal-preview-item:hover {
  border-color: var(--accent);
}

.portal-preview-item strong {
  font-size: 15px;
  line-height: 1.4;
}

.portal-preview-item time {
  color: var(--muted);
  font-size: 12px;
}

.button-primary,
.button-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 650;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.button-primary {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
}

.button-primary:hover {
  background: var(--accent-strong);
  color: #fff;
  transform: translateY(-1px);
}

.button-ghost {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
}

.button-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Filters */

.filter-bar {
  margin-bottom: 14px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}

.filter-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.filter-form {
  display: contents;
}

.filter-bar .filter-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 8px;
}

.filter-dropdown {
  position: relative;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
}

.filter-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 7px 11px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.filter-summary::-webkit-details-marker {
  display: none;
}

.filter-summary::after {
  content: "⌄";
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
  transition: transform 150ms ease;
}

.filter-dropdown[open] {
  z-index: 25;
}

.filter-dropdown[open] .filter-summary {
  border-radius: 10px 10px 0 0;
  background: var(--panel-2);
}

.filter-dropdown[open] .filter-summary::after {
  transform: rotate(180deg);
}

.filter-summary .filter-label {
  padding-top: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.filter-current {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  z-index: 30;
  display: grid;
  gap: 2px;
  max-height: min(340px, 62vh);
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 9px;
  border-radius: 7px;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}

.filter-option:hover {
  background: var(--chip);
  color: var(--accent);
}

.filter-option.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 650;
}

.filter-check {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--accent);
}

.filter-option-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-option-count {
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.filter-empty {
  padding: 9px;
  color: var(--muted);
  font-size: 13px;
}

.sidebar .filter-panel {
  gap: 8px;
}

.sidebar .filter-dropdown {
  background: transparent;
}

.sidebar .filter-summary {
  padding: 8px 0;
}

.sidebar .filter-menu {
  padding: 6px;
}

.sidebar .filter-option {
  padding: 7px 8px;
}

.filter-group {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
}

.filter-label {
  padding-top: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chips {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 3px;
  scrollbar-width: thin;
}

.chip {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--chip);
  color: var(--text);
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease;
}

.chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.chip.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.chip.is-active .chip-count {
  color: rgba(255, 255, 255, 0.78);
}

.chip-count {
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.filter-reset {
  padding-left: 110px;
}

.filter-bar .filter-reset {
  grid-column: 1 / -1;
  padding-left: 0;
  margin-top: 1px;
}

.filter-bar .chips {
  flex-wrap: wrap;
  overflow: visible;
}

.filter-reset.is-hidden {
  display: none;
}

.filter-reset-link {
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}

.sidebar .filter-reset {
  padding-left: 0;
}

/* Top stories carousel */

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

.top-stories-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.top-stories-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.top-stories-mark {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.top-stories-controls {
  display: flex;
  align-items: center;
  gap: 7px;
}

.top-stories-counter {
  min-width: 44px;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.top-stories-arrow {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--panel);
  color: var(--text);
  font-size: 16px;
  line-height: 1;
  transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
}

.top-stories-arrow:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.top-stories-arrow:disabled {
  cursor: default;
  opacity: 0.35;
}

.top-stories-viewport {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 92% 0%, var(--accent-soft), transparent 36%),
    var(--panel);
  cursor: grab;
  touch-action: pan-y;
}

.top-stories-viewport.is-dragging {
  cursor: grabbing;
}

.top-stories-track {
  display: flex;
  user-select: none;
  transition: transform 420ms cubic-bezier(0.22, 0.8, 0.25, 1);
  will-change: transform;
  -webkit-user-select: none;
}

.top-stories-track.is-dragging {
  transition: none;
}

.top-story {
  flex: 0 0 100%;
  min-width: 0;
}

.top-story-link {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(12px, 2.4vw, 28px);
  min-height: 116px;
  padding: 16px clamp(16px, 2.5vw, 28px);
  overflow: hidden;
  transition: background-color 180ms ease, box-shadow 180ms ease;
  -webkit-user-drag: none;
}

.top-story-link::before {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--accent) 9%, transparent)
  );
  opacity: 0;
  content: "";
  pointer-events: none;
  transition: opacity 180ms ease;
}

.top-story-link:hover {
  background: var(--panel-2);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 55%, var(--border));
}

.top-story-link:hover::before {
  opacity: 1;
}

.top-story-rank {
  position: relative;
  color: color-mix(in srgb, var(--accent) 58%, var(--muted));
  font-size: clamp(20px, 3vw, 32px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
  line-height: 1;
}

.top-story-copy {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.top-story-source {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.top-story-badge {
  padding: 1px 5px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.06em;
}

.top-story-title {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text);
  font-size: clamp(16px, 2.2vw, 22px);
  font-weight: 720;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  transition: color 150ms ease;
}

.top-story-teaser {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.top-story-meta {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.top-story-open {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 50%;
  transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
}

.top-story-link:hover .top-story-title {
  color: var(--accent);
}

.top-story-link:hover .top-story-open {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.top-stories-progress {
  height: 2px;
  margin: 7px 2px 0;
  overflow: hidden;
  border-radius: 999px;
  background: var(--border);
}

.top-stories-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 350ms ease;
}

/* Feed and cards */

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

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

.card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

@media (hover: hover) {
  .card:hover {
    border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
    transform: translateY(-2px);
    box-shadow: var(--shadow);
  }
}

.card-image-link {
  display: block;
  overflow: hidden;
  background: var(--panel-2);
}

.card-image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform 260ms ease;
}

.card:hover .card-image {
  transform: scale(1.025);
}

.card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 14px 15px 15px;
}

.card-topline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  min-height: 20px;
}

.card-source {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-accent {
  border-color: var(--accent);
  color: var(--accent);
}

.card-title {
  font-size: clamp(16px, 1.65vw, 19px);
  font-weight: 720;
}

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

.card-teaser {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 4px;
}

.card-meta,
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.meta-dot {
  color: var(--border);
}

.share-button {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 15px;
  transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
}

.share-button:hover,
.share-button.is-copied {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.share-button--text {
  width: auto;
  height: 38px;
  padding: 0 13px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 650;
}

/* Ads */

.ad-placeholder {
  display: flex;
  grid-column: 1 / -1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 112px;
  padding: 18px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--panel-2) 45%, transparent);
  color: var(--muted);
  text-align: center;
}

.ad-card {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px 24px;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--border));
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 100% 0, var(--accent-soft), transparent 52%),
    var(--panel);
}

.ad-card-copy {
  min-width: 0;
}

.ad-card-topline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.ad-card-title {
  margin: 0 0 4px;
  font-size: clamp(16px, 1.7vw, 19px);
  font-weight: 720;
}

.ad-card-description {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.ad-card-disclaimer {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10.5px;
  opacity: 0.8;
}

.ad-card-action {
  align-self: center;
}

.ad-card-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}

.ad-card-button:hover {
  background: var(--accent-strong);
  color: #fff;
}

@media (max-width: 640px) {
  .ad-card {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
  }

  .ad-card-action {
    justify-self: start;
  }
}

.ad-label {
  margin-bottom: 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ad-title {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.ad-note {
  margin-top: 3px;
  font-size: 12px;
}

/* Skeleton and feed states */

.feed-sentinel {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.skeleton-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}

.skeleton-image {
  aspect-ratio: 16 / 9;
  background: linear-gradient(100deg, var(--skeleton-base) 30%, var(--skeleton-shine) 50%, var(--skeleton-base) 70%);
  background-size: 220% 100%;
  animation: shimmer 1.5s linear infinite;
}

.skeleton-body {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.skeleton-line {
  height: 11px;
  border-radius: 6px;
  background: linear-gradient(100deg, var(--skeleton-base) 30%, var(--skeleton-shine) 50%, var(--skeleton-base) 70%);
  background-size: 220% 100%;
  animation: shimmer 1.5s linear infinite;
}

.skeleton-line-short {
  width: 32%;
}

.skeleton-line-title {
  width: 86%;
  height: 19px;
}

.skeleton-line-meta {
  width: 46%;
}

@keyframes shimmer {
  to {
    background-position: -220% 0;
  }
}

.feed-end {
  grid-column: 1 / -1;
  padding: 18px 0 4px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.feed-end a {
  color: var(--accent);
}

.empty {
  grid-column: 1 / -1;
  padding: 28px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--muted);
  text-align: center;
}

/* Article */

.article {
  max-width: 880px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 42px);
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel);
}

.article-head {
  margin-bottom: 22px;
}

.article-head h1 {
  max-width: 760px;
  margin: 12px 0 16px;
}

.article-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.article-figure {
  margin: 0 0 24px;
}

.article-image,
.article-content img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
}

.article-content {
  max-width: 74ch;
  font-size: 17px;
  line-height: 1.72;
}

.article-content h2 {
  margin-top: 32px;
}

.article-content h3 {
  margin-top: 24px;
}

.article-content p,
.article-content ul,
.article-content ol {
  margin: 0 0 16px;
}

.article-content blockquote {
  margin: 22px 0;
  padding: 4px 0 4px 18px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}

.article-lead {
  color: var(--text);
  font-size: 19px;
}

.article .ad-placeholder {
  margin-top: 26px;
}

.legal-page {
  max-width: 860px;
}

.legal-page .article-content h2 {
  margin-top: 28px;
  font-size: 21px;
}

.legal-page .article-content ul {
  padding-left: 22px;
}

/* Reactions */

.reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 24px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.reaction-button {
  padding: 8px 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 14px;
  transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
}

.reaction-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.reaction-button.is-voted,
.reaction-button:disabled {
  cursor: default;
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  opacity: 0.85;
}

/* Search and pagination */

.search-form {
  display: flex;
  gap: 8px;
  margin: 0 0 22px;
}

.search-form input,
.search-dialog input {
  flex: 1;
  min-width: 0;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  font-size: 16px;
}

.search-form button {
  padding: 10px 17px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 650;
}

.search-summary {
  margin: 0 0 16px;
  font-size: 14px;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 26px;
  color: var(--muted);
  font-size: 14px;
}

.pagination a {
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel);
}

.pagination a:hover {
  border-color: var(--accent);
}

/* Search dialog */

.search-dialog {
  width: min(92vw, 560px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
}

.search-dialog::backdrop {
  background: rgba(3, 8, 16, 0.62);
  backdrop-filter: blur(3px);
}

.search-dialog-form {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.search-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.search-dialog-head h2 {
  margin: 0;
  font-size: 22px;
}

.search-dialog-facets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding-top: 2px;
}

.search-dialog-facet h3 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.search-facet-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.search-facet {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--chip);
  color: var(--text);
  font-size: 12px;
}

.search-facet:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.search-facet span {
  color: var(--muted);
  font-size: 10px;
}

.search-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Footer */

.site-footer {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 34px 20px 46px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
}

.footer-brand {
  color: var(--text);
  font-size: 20px;
}

.footer-note {
  max-width: 540px;
  margin: 9px 0 12px;
  line-height: 1.55;
}

.footer-copy {
  margin: 0;
  font-size: 12px;
}

.footer-title {
  margin: 0 0 11px;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.site-footer a {
  display: block;
  padding: 4px 0;
  color: var(--muted);
}

.site-footer a:hover {
  color: var(--accent);
}

.footer-legal {
  margin: 28px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  line-height: 1.6;
}

/* Back to top */

.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Text mode: no images anywhere. */

html.text-mode img,
html.text-mode picture,
html.text-mode video,
html.text-mode .card-image-link,
html.text-mode .article-figure,
html.text-mode .skeleton-image {
  display: none !important;
}

html.text-mode .card,
html.text-mode .article {
  background: var(--panel);
}

/* Desktop and horizontal tablet: fixed sidebar. */

@media (min-width: 1024px) {
  .app-layout {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    align-items: start;
    gap: 30px;
    padding-top: 28px;
  }

  .sidebar {
    position: sticky;
    top: calc(var(--header-height) + 24px);
    max-height: calc(100dvh - var(--header-height) - 48px);
    overflow: auto;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--panel);
    scrollbar-width: thin;
  }

  .sidebar-head,
  .menu-toggle {
    display: none;
  }

  .site-footer {
    padding-top: 38px;
  }
}

/* Mobile and vertical tablet: drawer sidebar. */

@media (max-width: 1023.98px) {
  .app-layout {
    padding-top: 18px;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 80;
    width: min(88vw, 350px);
    height: 100dvh;
    padding: 20px;
    overflow-y: auto;
    border-right: 1px solid var(--border);
    border-radius: 0 18px 18px 0;
    background: var(--panel);
    box-shadow: var(--shadow);
    transform: translateX(-105%);
    transition: transform 220ms ease;
  }

  body.drawer-open .sidebar {
    transform: translateX(0);
  }

  .drawer-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(3, 8, 16, 0.58);
    opacity: 0;
    visibility: hidden;
    transition: opacity 180ms ease, visibility 180ms ease;
  }

  body.drawer-open .drawer-backdrop {
    opacity: 1;
    visibility: visible;
  }

  .sidebar .chips {
    flex-wrap: wrap;
  }
}

@media (max-width: 860px) {
  .grid--compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-grid > div:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  :root {
    --header-height: 62px;
  }

  .visitor-pill,
  .zoom-control {
    display: none;
  }

  .header-inner {
    padding: 0 12px;
  }

  .brand {
    font-size: 20px;
  }

  .brand-mark {
    width: 28px;
    height: 28px;
    font-size: 16px;
  }

  .control-label {
    display: none;
  }

  .icon-button {
    min-width: 38px;
    min-height: 38px;
    padding: 0 8px;
  }

  .app-layout {
    padding: 16px 14px 0;
  }

  .feed,
  .grid,
  .feed-sentinel {
    grid-template-columns: minmax(0, 1fr);
  }

  .grid--compact {
    grid-template-columns: minmax(0, 1fr);
  }

  .filter-bar {
    margin-right: -14px;
    margin-left: -14px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    padding: 12px 14px;
  }

  .filter-bar .filter-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  .filter-bar .chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: visible;
  }

  .filter-group {
    display: block;
  }

  .portal-hero,
  .service-grid,
  .portal-preview-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .portal-hero {
    border-radius: 16px;
  }

  .search-dialog-facets {
    grid-template-columns: minmax(0, 1fr);
  }

  .filter-label {
    display: block;
    margin-bottom: 7px;
    padding-top: 0;
  }

  .filter-reset {
    padding-left: 0;
  }

  .page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-story-link {
    grid-template-columns: auto minmax(0, 1fr);
    min-height: 104px;
    padding: 14px;
  }

  .top-story-meta {
    grid-column: 2;
    justify-content: flex-start;
  }

  .top-story-rank {
    font-size: 22px;
  }

  .top-story-teaser {
    -webkit-line-clamp: 2;
  }

  .page-head .button-ghost {
    align-self: flex-start;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .hero {
    border-radius: 16px;
  }

  .article {
    margin-right: -14px;
    margin-left: -14px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .search-form {
    flex-wrap: wrap;
  }

  .search-form button {
    width: 100%;
  }

  .site-footer {
    padding: 28px 14px 38px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .footer-grid > div:first-child {
    grid-column: auto;
  }

  .back-to-top {
    right: 14px;
    bottom: 14px;
  }
}

@media (max-width: 420px) {
  .header-actions {
    gap: 4px;
  }

  .brand-text {
    display: none;
  }

  .brand-dot {
    display: none;
  }

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Images off: same behaviour as the text mode image switch. */
html.no-images img,
html.no-images picture,
html.no-images video,
html.no-images .card-image-link,
html.no-images .article-figure,
html.no-images .skeleton-image {
  display: none !important;
}

/* Anonymous visitor counter in the footer. */
.footer-stats {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px;
  margin: 9px 0 0;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.footer-stats[hidden] {
  display: none;
}

.footer-stats-icon {
  color: var(--accent);
}

.footer-stats-count {
  display: inline-flex;
  align-items: baseline;
  color: var(--text);
}

.footer-stats-slash {
  color: var(--muted);
}

.footer-stats-label {
  margin-left: 3px;
}

.footer-stats strong {
  color: var(--text);
  font-weight: 650;
}

/* Non-intrusive cookie notice: a small bottom panel, never a full-screen modal. */
.cookie-banner {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 90;
  display: flex;
  gap: 18px;
  align-items: center;
  width: min(720px, calc(100vw - 36px));
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.cookie-banner[hidden] {
  display: none;
}

.cookie-banner-copy {
  min-width: 0;
}

.cookie-banner h2 {
  margin: 0 0 5px;
  font-size: 0.98rem;
}

.cookie-banner p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.cookie-banner a {
  color: var(--accent);
  text-decoration: underline;
}

.cookie-banner-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

@media (max-width: 720px) {
  .cookie-banner {
    right: 10px;
    bottom: 10px;
    left: 10px;
    width: auto;
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
  }

  .cookie-banner-actions {
    justify-content: flex-end;
  }
}

.search-semantic {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}

.search-semantic input {
  width: auto;
  accent-color: var(--accent);
}
