/* Self-hosted variable fonts (latin subset, generated at build). */
@font-face {
  font-family: "Outfit";
  src: url("/fonts/outfit-latin-wght.91157cac.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader-latin-opsz-wght.ce8b3636.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader-latin-opsz-wght-italic.b8226f48.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}

/* Next Epoch News — dark, flashy, futuristic. Fonts injected at build time. */

:root {
  --bg: #05070f;
  --bg-elevated: rgba(16, 22, 42, 0.62);
  --ink: #eef2ff;
  --ink-muted: #c3cadb;
  --line: rgba(148, 176, 255, 0.18);
  --cyan: #22d3ee;
  --violet: #c084fc;
  --sun: #facc15;
  --section-accent: var(--violet);
  --section-accent-2: var(--cyan);
  --section-glow-1: #a78bfa;
  --section-glow-2: #22d3ee;
  --link: #67e8f9;
  --card-radius: var(--radius);
  --font-sans: "Outfit", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, "Times New Roman", serif;
  --radius: 20px;
  --shadow: 0 10px 40px rgb(0 0 0 / 0.45), 0 0 0 1px rgb(160 180 255 / 0.08);
  --content: 72rem;
  --measure: 42rem;
  --pad: clamp(1.15rem, 3vw, 2rem);
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  background: #05070f;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgb(88 40 180 / 0.18), transparent 55%),
    radial-gradient(900px 500px at -10% 0%, rgb(8 80 140 / 0.16), transparent 50%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.55;
  font-optical-sizing: auto;
}

[hidden] { display: none !important; }

img { max-width: 100%; height: auto; display: block; }

a {
  color: var(--link, var(--cyan));
  text-underline-offset: 0.16em;
}

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

:focus-visible {
  outline: 2px solid var(--section-accent, var(--violet));
  outline-offset: 3px;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--section-accent) 35%, transparent);
}

.skip-link {
  position: absolute;
  left: var(--pad);
  top: -4rem;
  z-index: 30;
  background: var(--ink);
  color: #05070f;
  padding: 0.5rem 0.85rem;
  border-radius: 0.5rem;
  text-decoration: none;
  font-weight: 650;
}

.skip-link:focus { top: 0.6rem; }

/* Fixed starfield sits behind all page chrome */
.starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.horizon-bar,
.site-header,
main,
.site-footer {
  position: relative;
  z-index: 1;
}

.horizon-bar {
  height: 3px;
  background: linear-gradient(90deg, #22d3ee 0%, #c084fc 40%, #f472b6 70%, #facc15 100%);
  box-shadow: 0 0 16px rgb(168 85 247 / 0.65), 0 0 28px rgb(34 211 238 / 0.35);
  z-index: 12;
}

.site-header {
  background: rgb(5 7 15 / 0.72);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  max-width: var(--content);
  margin: 0 auto;
  padding: 0.8rem var(--pad) 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--ink);
  min-width: 0;
}

.logo:hover { color: var(--ink); }

.logo-mark {
  width: 2.35rem;
  height: 2.35rem;
  display: block;
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgb(34 211 238 / 0.55));
}

.logo-lockup {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.2rem 0.85rem;
  min-width: 0;
}

.logo-word {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  white-space: nowrap;
  line-height: 1;
}

.logo-name {
  font-weight: 800;
  font-size: 1.08rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.logo-edition {
  font-weight: 650;
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #67e8f9;
  text-shadow: 0 0 12px rgb(34 211 238 / 0.55);
}

.logo-tagline {
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--ink-muted);
  max-width: 18rem;
}

.logo-tagline::before {
  content: "·";
  margin-right: 0.7rem;
  color: rgb(148 176 255 / 0.4);
  font-weight: 700;
}

@media (min-width: 1100px) {
  .logo-tagline {
    max-width: none;
    white-space: nowrap;
  }
}

.section-nav-wrap {
  position: relative;
  min-width: 0;
  max-width: 100%;
}

.section-nav {
  display: flex;
  align-items: center;
  gap: 0.15rem 0.85rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.section-nav a {
  color: var(--ink-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.2rem 0;
  border-bottom: 2px solid transparent;
}

.section-nav a:hover,
.section-nav a[aria-current="page"] {
  color: #fff;
  border-bottom-color: var(--section-accent, var(--violet));
  text-shadow: 0 0 12px color-mix(in srgb, var(--section-accent) 60%, transparent);
}

.wrap {
  width: 100%;
  max-width: var(--content);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

main { flex: 1 0 auto; }

/* Gradient display type */
.gradient-text {
  background: linear-gradient(105deg, #67e8f9 0%, #c084fc 40%, #f472b6 70%, #facc15 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradient-shift 10s linear infinite;
  filter: drop-shadow(0 0 18px rgb(168 85 247 / 0.28));
}

.gradient-underline {
  position: relative;
  display: inline-block;
}

.gradient-underline::after {
  content: "";
  position: absolute;
  left: 0;
  right: 12%;
  bottom: -0.18em;
  height: 3px;
  border-radius: 99px;
  background: linear-gradient(90deg, #22d3ee, #c084fc, #facc15);
  box-shadow: 0 0 16px rgb(168 85 247 / 0.7);
  animation: gradient-shift 10s linear infinite;
  background-size: 200% auto;
}

@keyframes gradient-shift {
  to { background-position: 200% center; }
}

/* Intro (used when there is no lead story) */
.hero-intro {
  position: relative;
  padding: clamp(2.6rem, 7vw, 5rem) 0 clamp(2rem, 4vw, 3rem);
  overflow: hidden;
}

.hero-intro h1 {
  margin: 0 0 0.9rem;
  font-size: clamp(2.2rem, 6.2vw, 4.4rem);
  line-height: 1.04;
  letter-spacing: -0.045em;
  font-weight: 800;
  max-width: 16ch;
}

.eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #67e8f9;
  text-shadow: 0 0 12px rgb(34 211 238 / 0.45);
}

.lede {
  margin: 0;
  max-width: 38rem;
  font-family: var(--font-serif);
  font-size: clamp(1.15rem, 2vw, 1.35rem);
  font-weight: 400;
  font-variation-settings: "opsz" 18;
  color: var(--ink-muted);
  line-height: 1.45;
}

/* Full-bleed lead story */
.lead-hero {
  position: relative;
  min-height: min(86vh, 46rem);
  display: grid;
  align-items: end;
  overflow: hidden;
  isolation: isolate;
}

.lead-hero-link {
  display: block;
  color: inherit;
  text-decoration: none;
  position: relative;
  min-height: min(86vh, 46rem);
  display: flex;
  align-items: flex-end;
}

.lead-hero-media,
.lead-hero-scrim {
  position: absolute;
  inset: 0;
}

.lead-hero-media img,
.lead-hero-generated {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lead-hero-generated {
  background:
    radial-gradient(ellipse at 70% 30%, rgb(192 132 252 / 0.45), transparent 50%),
    radial-gradient(ellipse at 20% 80%, rgb(34 211 238 / 0.28), transparent 45%),
    radial-gradient(ellipse at 90% 90%, rgb(250 204 21 / 0.22), transparent 40%),
    linear-gradient(180deg, #0b1020, #05070f);
}

.lead-hero-scrim {
  background:
    linear-gradient(180deg, rgb(5 7 15 / 0.15) 0%, rgb(5 7 15 / 0.35) 38%, rgb(5 7 15 / 0.92) 100%),
    linear-gradient(90deg, rgb(5 7 15 / 0.55) 0%, rgb(5 7 15 / 0.15) 55%, transparent 80%);
  pointer-events: none;
}

.lead-hero-copy {
  position: relative;
  z-index: 1;
  padding-top: 8rem;
  padding-bottom: clamp(2.2rem, 5vw, 3.6rem);
  max-width: 52rem;
}

.lead-hero-copy .kicker { color: #67e8f9; }

.lead-hero-copy h1 {
  margin: 0 0 0.8rem;
  font-size: clamp(2.3rem, 6.5vw, 4.8rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
  font-weight: 800;
}

.lead-hero-copy .dek {
  margin: 0 0 1rem;
  font-family: var(--font-serif);
  font-size: clamp(1.15rem, 2.2vw, 1.4rem);
  color: #d7dcee;
  max-width: 38rem;
}

.lead-hero-copy .meta {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.92rem;
}

.lead-hero-link:hover h1 {
  filter: drop-shadow(0 0 22px rgb(168 85 247 / 0.45));
}

/* Page sections */
.band {
  padding: 0 0 3.25rem;
}

.band h2,
.band .band-label {
  margin: 0 0 1.15rem;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* Glass cards */
.story-card,
.section-tile {
  background: var(--bg-elevated);
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  border: 1px solid var(--line);
  box-shadow: var(--shadow), 0 0 24px color-mix(in srgb, var(--section-glow-1, #a78bfa) 10%, transparent);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.45s, border-color 0.45s;
}

.section-grid,
.story-list,
.latest {
  perspective: 1400px;
}

.story-card {
  display: grid;
  gap: 1.25rem;
  border-radius: var(--card-radius, var(--radius));
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  position: relative;
}

.story-card.featured {
  grid-template-columns: 1.15fr 1fr;
  align-items: stretch;
}

.story-card .thumb {
  background: #10162a;
  min-height: 12rem;
}

.story-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 40% 42%;
}

.story-card .body {
  padding: 1.35rem 1.4rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.kicker {
  margin: 0 0 0.45rem;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--section-accent);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.kicker .icon { width: 1.05rem; height: 1.05rem; }

.story-card h3 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  letter-spacing: -0.03em;
  line-height: 1.2;
  font-weight: 700;
}

.story-card p {
  margin: 0;
  color: var(--ink-muted);
  font-family: var(--font-serif);
  font-size: 1.12rem;
  font-variation-settings: "opsz" 18;
}

.story-card .meta {
  margin-top: 0.9rem;
  font-size: 0.85rem;
  color: var(--ink-muted);
  font-family: var(--font-sans);
}

a.story-card:hover,
a.section-tile:hover {
  transform: translateY(-8px) rotateX(3deg);
  border-color: color-mix(in srgb, var(--section-accent) 65%, transparent);
  box-shadow:
    0 22px 50px rgb(0 0 0 / 0.5),
    0 0 36px color-mix(in srgb, var(--section-glow-1) 32%, transparent);
  color: inherit;
}

a.story-card:hover h3 { color: #fff; }

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

.story-list a.story-card { grid-template-columns: 1fr; }

.story-list a.story-card .body { padding: 1.15rem 1.2rem 1.25rem; }

.story-list a.story-card h3 { font-size: 1.25rem; }

.story-list .thumb { max-height: 14rem; }

.story-list .thumb img {
  width: 100%;
  height: 14rem;
  object-fit: cover;
}

@media (min-width: 720px) {
  .story-list a.story-card:has(.thumb) {
    grid-template-columns: 16.5rem 1fr;
    align-items: stretch;
  }

  .story-list .thumb,
  .story-list .thumb img {
    max-height: none;
    height: 100%;
    min-height: 10rem;
  }
}

/* Section directory */
.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14.5rem, 1fr));
  gap: 0.9rem;
}

.section-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 1.2rem 1.15rem 1.3rem;
  border-radius: var(--card-radius, 16px);
  text-decoration: none;
  color: inherit;
  border-top: 3px solid var(--section-accent);
  min-height: 9rem;
  overflow: hidden;
}

.section-tile:hover { color: inherit; }

.section-tile h3 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.section-tile p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.section-tile .count {
  margin-top: auto;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--section-accent);
  text-shadow: 0 0 10px color-mix(in srgb, var(--section-accent) 50%, transparent);
}

.page-intro {
  padding: clamp(1.8rem, 4vw, 2.8rem) 0 1.5rem;
}

.page-intro h1 {
  margin: 0 0 0.6rem;
  font-size: clamp(2rem, 4.5vw, 3rem);
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.page-intro p {
  margin: 0;
  max-width: 38rem;
  color: var(--ink-muted);
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-variation-settings: "opsz" 18;
}

.empty-state {
  background: rgb(16 22 42 / 0.5);
  backdrop-filter: blur(12px);
  border: 1px dashed color-mix(in srgb, var(--section-accent) 35%, var(--line));
  border-radius: var(--radius);
  padding: 2rem 1.4rem;
  color: var(--ink-muted);
}

.empty-state p { margin: 0; }

/* Article */
.article-wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2rem var(--pad) 4rem;
}

.breadcrumb { margin: 0 0 1.15rem; font-size: 0.88rem; }

.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  color: var(--ink-muted);
}

.breadcrumb li:not(:last-child)::after {
  content: "/";
  margin-left: 0.35rem;
  color: rgb(148 176 255 / 0.35);
}

.article-header .kicker { margin-bottom: 0.7rem; }

.article-header h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 5vw, 3.15rem);
  letter-spacing: -0.035em;
  line-height: 1.12;
}

.dek {
  margin: 0 0 1rem;
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 2.2vw, 1.4rem);
  font-variation-settings: "opsz" 20;
  color: var(--ink-muted);
  line-height: 1.4;
}

.article-meta {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ink-muted);
}

.hero-figure { margin: 1.6rem 0 1.8rem; }

.hero-figure img {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #10162a;
  box-shadow: 0 0 32px rgb(124 58 237 / 0.18);
}

.hero-figure figcaption {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.prose {
  font-family: var(--font-serif);
  font-size: 1.22rem;
  line-height: 1.65;
  font-variation-settings: "opsz" 19;
  font-weight: 400;
}

.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 1.1em; }

.prose h2 {
  font-family: var(--font-sans);
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  margin: 2rem 0 0.7rem;
  line-height: 1.25;
}

.prose a { color: var(--link, var(--cyan)); }
.prose strong { font-weight: 650; }
.prose em { font-style: italic; }
.prose ul, .prose ol { padding-left: 1.2em; }

.prose code {
  font-family: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.86em;
  background: rgb(16 22 42 / 0.85);
  border: 1px solid var(--line);
  padding: 0.12em 0.35em;
  border-radius: 4px;
}

.sources {
  margin-top: 2.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.sources h2 {
  margin: 0 0 0.85rem;
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.sources ol { margin: 0; padding-left: 1.2rem; }
.sources li { margin: 0 0 0.55rem; }
.sources a { overflow-wrap: anywhere; }

.prose-page {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2rem var(--pad) 4rem;
}

.prose-page h1 {
  margin: 0 0 0.8rem;
  font-size: clamp(2rem, 4.5vw, 3rem);
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.sorry {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--ink-muted);
}

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  background: rgb(5 7 15 / 0.86);
  backdrop-filter: blur(16px);
  padding: 2rem 0 2.4rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 3rem;
  justify-content: space-between;
  align-items: flex-start;
}

.footer-brand { max-width: 26rem; }

.footer-brand strong {
  display: block;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.footer-brand p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1.25rem;
}

.footer-nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 550;
  font-size: 0.95rem;
}

.footer-nav a:hover {
  color: var(--section-accent, var(--violet));
  text-decoration: underline;
}

.footer-note {
  flex-basis: 100%;
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  color: var(--ink-muted);
}

/* Section theme heroes */
body[data-section] .horizon-bar {
  background: linear-gradient(90deg, var(--section-accent-2), var(--section-accent), var(--section-glow-1, var(--section-accent)));
  box-shadow: 0 0 18px color-mix(in srgb, var(--section-accent) 55%, transparent);
}

.icon {
  display: block;
  flex-shrink: 0;
  width: 1.15rem;
  height: 1.15rem;
  color: currentColor;
}

.icon svg { width: 100%; height: 100%; display: block; }

.theme-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: clamp(2.4rem, 6vw, 4.2rem) 0 clamp(2.2rem, 4vw, 3.4rem);
  min-height: 24rem;
  border-bottom: 1px solid var(--line);
}

.theme-hero .motif-hero {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0 28%, #000 55%);
  mask-image: linear-gradient(90deg, transparent 0 28%, #000 55%);
  opacity: 0.95;
  filter: drop-shadow(0 0 18px color-mix(in srgb, var(--section-glow-1) 45%, transparent));
}

.theme-hero .motif-hero svg,
.theme-banner .motif svg,
.card-motif svg,
.tile-motif svg {
  width: 100%;
  height: 100%;
  display: block;
}

.theme-hero-copy {
  position: relative;
  z-index: 1;
  max-width: 36rem;
  padding-right: 4rem;
  background: linear-gradient(90deg, var(--bg) 0 70%, color-mix(in srgb, var(--bg) 0%, transparent) 100%);
}

.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.85rem;
  color: var(--section-accent);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-shadow: 0 0 12px color-mix(in srgb, var(--section-accent) 50%, transparent);
}

.section-badge .icon { width: 1.75rem; height: 1.75rem; }

.theme-hero h1 {
  margin: 0 0 0.65rem;
  font-size: clamp(2.3rem, 6vw, 3.8rem);
  letter-spacing: -0.045em;
  line-height: 1.05;
  font-weight: 800;
}

.theme-hero .lede-like,
.theme-hero > .wrap > p:not(.theme-rss):not(.section-badge) {
  margin: 0;
  color: var(--ink-muted);
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-variation-settings: "opsz" 18;
}

.theme-rss {
  margin: 0.95rem 0 0;
  font-family: var(--font-sans);
  font-size: 0.95rem;
}

.theme-hero + .band { padding-top: 2rem; }

.theme-banner {
  position: relative;
  height: 8.25rem;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  pointer-events: none;
  filter: drop-shadow(0 0 16px color-mix(in srgb, var(--section-glow-1) 30%, transparent));
}

.card-motif,
.tile-motif {
  position: absolute;
  pointer-events: none;
  z-index: 0;
}

.card-motif { inset: 0; opacity: 0.28; }

.story-card .body,
.story-card .thumb,
.section-tile h3,
.section-tile p,
.section-tile .count,
.section-tile .tile-icon { position: relative; z-index: 1; }

.tile-motif {
  inset: -10% -30% -20% 20%;
  opacity: 0.4;
}

.tile-icon {
  width: 1.75rem;
  height: 1.75rem;
  color: var(--section-accent);
  margin-bottom: 0.15rem;
  filter: drop-shadow(0 0 8px color-mix(in srgb, var(--section-accent) 55%, transparent));
}

.tile-icon .icon { width: 100%; height: 100%; }

/* Motif motion — off under prefers-reduced-motion */
@keyframes motif-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

@keyframes motif-dash {
  to { stroke-dashoffset: -64; }
}

@keyframes motif-twinkle {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.12; }
}

@keyframes motif-breathe {
  0%, 100% { transform: scale(1) translate(0, 0); }
  50% { transform: scale(1.06) translate(6px, -4px); }
}

@keyframes motif-spin {
  to { transform: rotate(360deg); }
}

@keyframes motif-drift {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-16px, 10px); }
}

@keyframes motif-wave-shift {
  0% { transform: translateX(0); }
  50% { transform: translateX(-28px); }
  100% { transform: translateX(0); }
}

@keyframes motif-flare {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.06); }
}

[data-motif="neural"] .motif-node {
  animation: motif-pulse 2.6s ease-in-out infinite;
  filter: drop-shadow(0 0 6px var(--section-glow-1));
}

[data-motif="neural"] .motif-line,
[data-motif="circuit"] .motif-line,
[data-motif="helix"] .motif-line {
  stroke-dasharray: 7 11;
  animation: motif-dash 6s linear infinite;
}

[data-motif="cellular"] .motif-cell {
  transform-box: fill-box;
  transform-origin: center;
  animation: motif-breathe 7s ease-in-out infinite;
}

[data-motif="wave"] .motif-wave {
  animation: motif-wave-shift 8s ease-in-out infinite;
}

[data-motif="wave"] .motif-particle,
[data-motif="starfield"] .motif-star {
  animation: motif-twinkle 3s ease-in-out infinite;
  filter: drop-shadow(0 0 5px var(--section-glow-1));
}

[data-motif="starfield"] .motif-nebula {
  animation: motif-drift 16s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

[data-motif="flare"] .motif-rays {
  transform-box: view-box;
  transform-origin: 81.67% 45.24%;
  animation: motif-spin 48s linear infinite;
}

[data-motif="flare"] .motif-sun {
  transform-box: fill-box;
  transform-origin: center;
  animation: motif-flare 5s ease-in-out infinite;
}

[data-motif="helix"] .motif-helix-spin {
  transform-box: view-box;
  transform-origin: 81.7% 50%;
  animation: motif-spin 22s linear infinite;
}

/* Scroll reveal */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* Mobile */
@media (max-width: 860px) {
  .header-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    padding-bottom: 0.7rem;
  }

  .logo-tagline { max-width: none; flex-basis: 100%; font-size: 0.75rem; }
  .logo-tagline::before { content: none; margin: 0; }

  .section-nav-wrap { width: 100%; }

  .section-nav-wrap::after {
    content: "";
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 2.8rem;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgb(5 7 15 / 0.95));
    z-index: 1;
  }

  .section-nav {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0.15rem 2rem 0.45rem 0;
    max-width: 100%;
    min-width: 0;
  }

  .section-nav::-webkit-scrollbar { display: none; }
  .section-nav a { white-space: nowrap; flex-shrink: 0; }

  .header-inner,
  .logo,
  .logo-lockup { min-width: 0; max-width: 100%; }

  .story-card.featured { grid-template-columns: 1fr; }

  .story-card.featured .thumb {
    min-height: 10.5rem;
    max-height: 14rem;
  }

  .hero-intro h1,
  .lead-hero-copy h1 { max-width: none; }

  .lead-hero,
  .lead-hero-link { min-height: min(78vh, 36rem); }

  .theme-hero { min-height: 16.5rem; }
  .theme-hero .motif-hero { opacity: 0.55; }
  .theme-hero-copy {
    background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 78%, transparent) 40%, transparent);
  }
  .theme-banner { height: 6.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-contrast: more) {
  :root {
    --ink: #ffffff;
    --ink-muted: #e6eaf5;
    --line: rgb(200 210 255 / 0.4);
  }
}


/* Generated from site.config.js theme palettes */
[data-section="ai"] {
  --bg: #07051a;
  --bg-elevated: #12102a;
  --ink: #f3f0ff;
  --ink-muted: #c5bedd;
  --line: #3a2f6b;
  --section-accent: #c084fc;
  --section-accent-2: #22d3ee;
  --section-glow-1: #a78bfa;
  --section-glow-2: #22d3ee;
  --link: #67e8f9;
  --card-radius: 22px;
}

[data-section="robotics"] {
  --bg: #07090f;
  --bg-elevated: #121722;
  --ink: #eef4ff;
  --ink-muted: #b8c3d4;
  --line: #2a3a4d;
  --section-accent: #fb923c;
  --section-accent-2: #38bdf8;
  --section-glow-1: #fb923c;
  --section-glow-2: #7dd3fc;
  --link: #fdba74;
  --card-radius: 8px;
}

[data-section="longevity"] {
  --bg: #04140f;
  --bg-elevated: #0c1f18;
  --ink: #ecfdf5;
  --ink-muted: #b5d4c6;
  --line: #194e3a;
  --section-accent: #34d399;
  --section-accent-2: #fbbf24;
  --section-glow-1: #34d399;
  --section-glow-2: #fbbf24;
  --link: #6ee7b7;
  --card-radius: 28px;
}

[data-section="quantum"] {
  --bg: #0c0618;
  --bg-elevated: #1a1028;
  --ink: #faf5ff;
  --ink-muted: #d0b8dc;
  --line: #4a2a62;
  --section-accent: #e879f9;
  --section-accent-2: #a78bfa;
  --section-glow-1: #e879f9;
  --section-glow-2: #c084fc;
  --link: #f0abfc;
  --card-radius: 16px;
}

[data-section="energy"] {
  --bg: #100c06;
  --bg-elevated: #1c160c;
  --ink: #fffbeb;
  --ink-muted: #e0c9a0;
  --line: #5a4318;
  --section-accent: #fbbf24;
  --section-accent-2: #fb923c;
  --section-glow-1: #fbbf24;
  --section-glow-2: #fdba74;
  --link: #fcd34d;
  --card-radius: 18px;
}

[data-section="space"] {
  --bg: #050814;
  --bg-elevated: #0d1428;
  --ink: #eef4ff;
  --ink-muted: #b4c2dd;
  --line: #243056;
  --section-accent: #60a5fa;
  --section-accent-2: #a78bfa;
  --section-glow-1: #60a5fa;
  --section-glow-2: #c4b5fd;
  --link: #93c5fd;
  --card-radius: 16px;
}

[data-section="genetics-medicine"] {
  --bg: #041110;
  --bg-elevated: #0b1f1e;
  --ink: #ecfdfc;
  --ink-muted: #a9d4d0;
  --line: #155e59;
  --section-accent: #2dd4bf;
  --section-accent-2: #38bdf8;
  --section-glow-1: #2dd4bf;
  --section-glow-2: #67e8f9;
  --link: #5eead4;
  --card-radius: 14px;
}
