:root {
  --bg: #f4efe7;
  --bg-soft: rgba(255, 255, 255, 0.64);
  --panel: rgba(251, 246, 239, 0.88);
  --panel-strong: rgba(255, 252, 247, 0.96);
  --line: rgba(27, 32, 37, 0.16);
  --text: #182028;
  --muted: #4e5d6b;
  --teal: #0e7c7b;
  --coral: #de6c4b;
  --amber: #d2982c;
  --slate: #375872;
  --shadow: 0 24px 60px rgba(19, 28, 34, 0.08);
  --shadow-soft: 0 10px 30px rgba(19, 28, 34, 0.05);
  --radius-lg: 32px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --container: min(1180px, calc(100vw - 2rem));
}

html[data-theme="dark"] {
  --bg: #11171d;
  --bg-soft: rgba(17, 23, 29, 0.72);
  --panel: rgba(24, 32, 39, 0.86);
  --panel-strong: rgba(20, 27, 34, 0.95);
  --line: rgba(227, 235, 242, 0.14);
  --text: #eef3f7;
  --muted: #b1bfca;
  --shadow: 0 26px 60px rgba(0, 0, 0, 0.28);
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.2);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(222, 108, 75, 0.18), transparent 34%),
    radial-gradient(circle at top right, rgba(14, 124, 123, 0.14), transparent 28%),
    linear-gradient(180deg, #f7f2eb 0%, #f2ece2 45%, #efe6da 100%);
  overflow-x: hidden;
}

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at top left, rgba(222, 108, 75, 0.16), transparent 34%),
    radial-gradient(circle at top right, rgba(14, 124, 123, 0.12), transparent 28%),
    linear-gradient(180deg, #131920 0%, #10161c 45%, #0d1319 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(24, 32, 40, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 32, 40, 0.04) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.7), transparent 90%);
}

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

::selection {
  background: rgba(222, 108, 75, 0.22);
}

img {
  max-width: 100%;
}

button,
input {
  font: inherit;
}

.site-shell {
  position: relative;
  padding-bottom: 4rem;
}

.container {
  width: var(--container);
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 0;
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
  background: linear-gradient(180deg, rgba(247, 242, 235, 0.92), rgba(247, 242, 235, 0.58));
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--coral), #f1b55e);
  color: white;
  font-weight: 700;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
}

.main-nav {
  display: inline-flex;
  gap: 1.2rem;
  padding: 0.45rem 1rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.58);
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
}

.main-nav a {
  color: var(--muted);
  font-size: 0.95rem;
  transition: color 180ms ease;
}

.main-nav a:hover {
  color: var(--text);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.95rem 1.2rem;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--text), #30404d);
  color: white;
  box-shadow: var(--shadow);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease,
    color 180ms ease;
}

.theme-toggle {
  min-width: 7.3rem;
}

.theme-toggle-icon {
  font-size: 1rem;
  line-height: 1;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(19, 28, 34, 0.12);
}

.secondary-button,
.subtle-button {
  background: rgba(255, 255, 255, 0.68);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: none;
}

.secondary-button:hover,
.subtle-button:hover {
  background: rgba(255, 255, 255, 0.84);
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(222, 108, 75, 0.38);
  outline-offset: 3px;
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.92fr;
  gap: 1.5rem;
  padding: 3rem 0 1rem;
}

.hero-copy,
.hero-panel,
.newsletter,
.research-feature,
.story-card,
.rail-card,
.compact-card,
.sidebar-card,
.radar-card,
.story-page,
.empty-state {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  min-width: 0;
}

.category-hero {
  padding: clamp(1.7rem, 4vw, 3rem);
  border-radius: 34px;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.category-hero h1 {
  margin: 0;
  font-family: "Fraunces", serif;
  font-size: clamp(2.8rem, 5vw, 5rem);
  line-height: 0.98;
  letter-spacing: -0.065em;
}

.hero-copy {
  padding: clamp(2rem, 4vw, 4rem);
  border-radius: 36px;
}

.hero-copy h1,
.section-heading h2,
.featured-story h2,
.article-header h1 {
  margin: 0;
  font-family: "Fraunces", serif;
  font-weight: 700;
  line-height: 0.98;
}

.hero-copy h1 {
  font-size: clamp(3rem, 5.5vw, 5.4rem);
  letter-spacing: -0.065em;
  max-width: 10ch;
  text-wrap: balance;
}

.hero-text,
.section-heading p,
.story-card p,
.rail-card p,
.research-feature p,
.compact-card p,
.radar-card p,
.article-summary,
.article-body p,
.newsletter p,
.sidebar-card p {
  color: var(--muted);
  line-height: 1.7;
}

.hero-text {
  max-width: 60ch;
  margin: 1.3rem 0 0;
  font-size: 1.08rem;
}

.eyebrow,
.panel-label {
  margin: 0 0 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.77rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1.8rem;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2.2rem;
}

.hero-stats article {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.42);
}

.hero-stats strong {
  display: block;
  font-size: clamp(1.5rem, 2vw, 2rem);
}

.hero-stats span {
  color: var(--muted);
  font-size: 0.9rem;
}

.hero-panel {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 1rem;
  padding: 1.6rem;
  border-radius: 32px;
  overflow: hidden;
}

.featured-story {
  display: grid;
  gap: 1rem;
  padding: 1.55rem;
  border-radius: 28px;
  background:
    linear-gradient(155deg, rgba(55, 88, 114, 0.96), rgba(20, 31, 41, 0.96)),
    linear-gradient(120deg, rgba(255, 255, 255, 0.08), transparent 40%);
  color: white;
  min-height: 260px;
}

.featured-story h2 {
  font-size: clamp(2rem, 2.9vw, 3rem);
  line-height: 1.02;
  text-wrap: balance;
}

.featured-story p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
}

.feature-footer {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-top: auto;
}

.feature-footer span {
  display: block;
  color: rgba(255, 255, 255, 0.66);
  margin-top: 0.25rem;
  font-size: 0.9rem;
}

.mini-stream {
  padding: 1.1rem 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.52);
}

.mini-stream-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.mini-stream-head span {
  font-weight: 700;
}

.mini-stream-head small {
  color: var(--muted);
}

.mini-stream-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.mini-item {
  display: grid;
  gap: 0.35rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.54);
  border: 1px solid var(--line);
  transition: transform 180ms ease, background 180ms ease;
  min-width: 0;
}

.mini-item:hover,
.story-card:hover,
.rail-card:hover,
.compact-card:hover,
.related-card:hover {
  transform: translateY(-3px);
}

.mini-item span,
.story-date {
  color: var(--muted);
  font-size: 0.82rem;
}

.section {
  padding: 1.5rem 0 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.3rem;
}

.section-heading h2 {
  font-size: clamp(2rem, 3vw, 3.2rem);
  letter-spacing: -0.05em;
  text-wrap: balance;
}

.section-heading p {
  max-width: 48ch;
  margin: 0;
}

.top-story-rail,
.story-grid,
.radar-grid,
.category-spotlight {
  display: grid;
  gap: 1rem;
}

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

.rail-card,
.story-card,
.compact-card,
.radar-card,
.sidebar-card,
.empty-state {
  padding: 1.35rem;
  border-radius: 24px;
}

.rail-card h3,
.story-card h3,
.compact-card h3,
.research-feature h3,
.radar-card h3,
.sidebar-card h3 {
  margin: 0 0 0.7rem;
  font-size: 1.25rem;
  line-height: 1.2;
  text-wrap: balance;
}

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

.category-spotlight {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.story-card {
  display: grid;
  gap: 1rem;
  min-height: 100%;
}

.category-card {
  display: grid;
  gap: 0.95rem;
  padding: 1.3rem;
  border-radius: 24px;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow-soft);
}

.category-card h3 {
  margin: 0;
  font-size: 1.2rem;
}

.category-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.category-card-footer {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-top: auto;
}

.category-card-footer small {
  color: var(--muted);
  max-width: 24ch;
  line-height: 1.5;
}

.category-card-footer a {
  font-weight: 700;
}

.story-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.pill,
.chip,
.tag-row span,
.related-card span,
.radar-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  font-size: 0.78rem;
}

.pill {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.9);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.chip {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.5);
  color: var(--muted);
  cursor: pointer;
}

.chip.active {
  background: linear-gradient(135deg, var(--text), #2f4250);
  color: white;
  border-color: transparent;
}

.search-field {
  flex: 0 0 clamp(240px, 28vw, 340px);
}

.search-field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.95rem 1.15rem;
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  box-shadow: var(--shadow-soft);
}

.story-meta,
.story-links,
.tag-row,
.share-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.story-meta {
  justify-content: space-between;
  margin-top: auto;
}

.story-links a,
.compact-card a,
.sidebar-card a,
.related-card strong {
  font-weight: 700;
}

.story-links a:hover,
.compact-card a:hover,
.sidebar-card a:hover,
.related-card:hover strong {
  color: var(--slate);
}

.tag-row span,
.related-card span {
  background: rgba(24, 32, 40, 0.06);
  color: var(--muted);
}

html[data-theme="dark"] .tag-row span,
html[data-theme="dark"] .related-card span,
html[data-theme="dark"] .pill {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

.split-section .desk-layout {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 1rem;
}

.research-feature {
  padding: 1.6rem;
  border-radius: 30px;
  min-height: 100%;
}

.research-list {
  display: grid;
  gap: 1rem;
}

.takeaway-list {
  margin: 1rem 0 0;
  padding-left: 1.2rem;
  color: var(--muted);
  line-height: 1.6;
}

.takeaway-list li + li {
  margin-top: 0.55rem;
}

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

.radar-index {
  width: max-content;
  margin-bottom: 1rem;
  background: rgba(24, 32, 40, 0.08);
}

.newsletter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 2rem;
  border-radius: 32px;
  margin-bottom: 3rem;
}

.newsletter h2 {
  margin: 0;
  font-family: "Fraunces", serif;
  font-size: clamp(2rem, 3.2vw, 3.4rem);
  letter-spacing: -0.05em;
}

.newsletter-form {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.newsletter-form input {
  min-width: min(100%, 280px);
  padding: 0.95rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.76);
}

.story-page {
  border-radius: 32px;
  padding: clamp(1.5rem, 3vw, 2.25rem);
}

.story-page-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.72fr;
  gap: 1.5rem;
}

.article-header,
.article-body-wrap {
  min-width: 0;
}

.article-header h1 {
  font-size: clamp(2.8rem, 5vw, 5.2rem);
  letter-spacing: -0.07em;
}

.article-summary {
  font-size: 1.16rem;
  margin-top: 1rem;
  max-width: 58ch;
}

.article-meta {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.author-block {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
}

.author-avatar {
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 700;
  background: linear-gradient(135deg, rgba(222, 108, 75, 0.18), rgba(55, 88, 114, 0.18));
  color: var(--text);
  border: 1px solid var(--line);
}

.share-chip {
  text-decoration: none;
  cursor: pointer;
}

.article-meta strong,
.feature-footer strong {
  font-size: 1.02rem;
}

.article-meta span {
  display: block;
  color: var(--muted);
  margin-top: 0.25rem;
}

.article-sidebar {
  display: grid;
  gap: 1rem;
  align-content: start;
  position: sticky;
  top: 6rem;
  height: fit-content;
}

.article-body-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.2rem;
  margin-top: 1.6rem;
}

.article-body {
  max-width: 76ch;
  padding: 1.9rem 2rem;
  border-radius: 26px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.article-body p {
  margin: 0;
  font-size: 1.09rem;
  line-height: 1.9;
  max-width: 66ch;
}

.article-body p + p {
  margin-top: 1.15rem;
}

.article-body p:first-child {
  font-size: 1.18rem;
  color: #31404d;
}

.related-grid {
  display: grid;
  gap: 0.8rem;
  margin-top: 1rem;
}

.article-footer {
  max-width: 76ch;
  display: grid;
  gap: 1rem;
}

.deployment-note {
  margin-top: 0.6rem;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #7b5b3e;
}

.author-note h3 {
  margin-bottom: 0.45rem;
}

.pagination {
  display: grid;
  place-items: center;
  gap: 1rem;
  padding: 1.5rem 0 0.25rem;
}

.pagination-summary {
  margin: 0;
  color: var(--muted);
}

.pagination-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.pagination .chip[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.related-card {
  display: grid;
  gap: 0.35rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid var(--line);
}

.tone-teal {
  border-color: rgba(14, 124, 123, 0.14);
}

.tone-coral {
  border-color: rgba(222, 108, 75, 0.16);
}

.tone-amber {
  border-color: rgba(210, 152, 44, 0.16);
}

.tone-slate {
  border-color: rgba(55, 88, 114, 0.16);
}

.tone-teal .pill,
.tone-teal .radar-index {
  background: rgba(14, 124, 123, 0.12);
}

.tone-coral .pill,
.tone-coral .radar-index {
  background: rgba(222, 108, 75, 0.12);
}

.tone-amber .pill,
.tone-amber .radar-index {
  background: rgba(210, 152, 44, 0.14);
}

.tone-slate .pill,
.tone-slate .radar-index {
  background: rgba(55, 88, 114, 0.12);
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 500ms ease,
    transform 500ms ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.visually-hidden {
  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,
  .split-section .desk-layout,
  .story-page-grid,
  .newsletter,
  .section-heading {
    grid-template-columns: 1fr;
    display: grid;
  }

  .top-story-rail,
  .story-grid,
  .radar-grid,
  .category-spotlight {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .newsletter {
    align-items: start;
  }

  .article-sidebar {
    position: static;
  }
}

@media (max-width: 760px) {
  .topbar,
  .toolbar,
  .story-card-top,
  .story-meta,
  .feature-footer,
  .category-card-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
    padding-top: 0.9rem;
    padding-bottom: 0.9rem;
  }

  .brand {
    flex: 1 1 auto;
    min-width: 0;
  }

  .header-actions {
    margin-left: auto;
    flex: 0 0 auto;
    gap: 0.55rem;
  }

  .header-actions .button {
    min-height: 2.9rem;
    padding: 0.8rem 1rem;
    white-space: nowrap;
  }

  .theme-toggle {
    min-width: 2.9rem;
    width: 2.9rem;
    padding-inline: 0.8rem;
  }

  .theme-toggle span:last-child {
    display: none;
  }

  .main-nav {
    display: none;
  }

  .hero-copy h1,
  .article-header h1 {
    max-width: none;
  }

  .hero-copy h1 {
    font-size: clamp(2.7rem, 13vw, 4rem);
    line-height: 0.95;
    letter-spacing: -0.06em;
  }

  .article-header h1 {
    font-size: clamp(2.4rem, 12vw, 3.6rem);
    line-height: 0.96;
  }

  .featured-story h2 {
    font-size: clamp(1.8rem, 9vw, 2.6rem);
  }

  .hero-text,
  .article-summary,
  .article-body p {
    font-size: 1rem;
  }

  .article-body {
    padding: 1.35rem;
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions .button,
  .newsletter-form .button,
  .newsletter-form input {
    width: 100%;
  }

  .mini-stream-head {
    align-items: flex-start;
  }

  .mini-stream-head small {
    max-width: 10rem;
    text-align: right;
  }

  .hero-stats,
  .top-story-rail,
  .story-grid,
  .radar-grid,
  .category-spotlight {
    grid-template-columns: 1fr;
  }

  .container {
    width: calc(100% - 1.25rem);
    max-width: none;
  }

  .hero {
    padding-top: 1.5rem;
  }

  .hero-copy,
  .hero-panel,
  .newsletter,
  .story-page {
    border-radius: 24px;
  }
}
