/* NeuralPulse — mobile-first editorial system (2026) */

:root {
  --font-ui: "Source Sans 3", ui-sans-serif, system-ui, sans-serif;
  --font-display: "Newsreader", "Iowan Old Style", Georgia, serif;
  --bg: #f4f1ea;
  --bg-elev: #fffcf6;
  --bg-ink: #12141a;
  --fg: #16181d;
  --fg-muted: #5c6158;
  --fg-faint: #8a8f86;
  --line: #ddd6c8;
  --accent: #c45c26;
  --accent-ink: #9a3f12;
  --accent-soft: #f3e3d4;
  --live: #c1121f;
  --ok: #2f6f4e;
  --shadow: 0 10px 30px rgba(22, 24, 29, 0.08);
  --radius: 18px;
  --pad: clamp(16px, 4vw, 28px);
  --max: 72rem;
  --header-h: 3.5rem;
  --step-0: clamp(1rem, 0.95rem + 0.3vw, 1.125rem);
  --step-1: clamp(1.15rem, 1rem + 0.8vw, 1.5rem);
  --step-2: clamp(1.5rem, 1.15rem + 1.6vw, 2.25rem);
  --step-3: clamp(2rem, 1.4rem + 2.8vw, 3.4rem);
}

[data-theme="dark"] {
  --bg: #0e1014;
  --bg-elev: #161a22;
  --bg-ink: #f4f1ea;
  --fg: #eeeae2;
  --fg-muted: #b3b6ae;
  --fg-faint: #7d8278;
  --line: #2a3038;
  --accent: #e0894f;
  --accent-ink: #f0b48a;
  --accent-soft: #2a1d14;
  --live: #ff6b6b;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; color-scheme: light dark; }
body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: var(--step-0);
  line-height: 1.6;
  background: var(--bg);
  color: var(--fg);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.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;
}
.skip-link {
  position: absolute; left: 12px; top: -100px; z-index: 200;
  background: var(--accent); color: #fff; padding: 0.6rem 1rem; border-radius: 8px;
}
.skip-link:focus { top: 12px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 80;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  min-height: var(--header-h);
  padding: 0.55rem var(--pad);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.brand { display: flex; align-items: center; gap: 0.55rem; min-width: 0; }
.brand-mark {
  width: 1.7rem; height: 1.7rem; border-radius: 7px; flex: 0 0 auto;
  background: radial-gradient(circle at 30% 30%, #f3d2b5, var(--accent) 55%, #6b2a10);
}
.brand-text {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  white-space: nowrap;
}
.brand-accent { color: var(--accent); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 0.45rem; }
.live-badge {
  display: none;
  align-items: center; gap: 0.35rem;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--live);
}
.live-dot { width: 0.45rem; height: 0.45rem; border-radius: 50%; background: var(--live); }
.theme-toggle, .nav-toggle {
  width: 2.5rem; height: 2.5rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg-elev); color: var(--fg);
  display: grid; place-items: center; cursor: pointer;
}
.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }
.nav-toggle { z-index: 90; }
.nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after {
  display: block; width: 1.05rem; height: 2px; background: var(--fg); position: relative;
}
.nav-toggle-bar::before, .nav-toggle-bar::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bar::before { top: -5px; }
.nav-toggle-bar::after { top: 5px; }
.nav-list {
  list-style: none; margin: 0; padding: 1.1rem;
  position: fixed; inset: var(--header-h) 0 0 auto;
  width: min(20rem, 88vw);
  background: var(--bg-elev);
  border-left: 1px solid var(--line);
  transform: translateX(110%);
  transition: transform 0.22s ease;
  display: flex; flex-direction: column; gap: 0.2rem;
  overflow-y: auto;
}
.nav-list.open { transform: translateX(0); }
body.nav-open { overflow: hidden; }
.nav-link {
  display: block; padding: 0.85rem 0.9rem; border-radius: 12px;
  color: var(--fg-muted); font-weight: 600;
}
.nav-link.active, .nav-link:hover { background: var(--accent-soft); color: var(--accent-ink); }

/* Ticker — no horizontal overflow on phones */
.ticker {
  display: flex; align-items: stretch;
  background: var(--bg-ink); color: #f4f1ea;
  font-size: 0.82rem; overflow: hidden;
}
.ticker-label {
  flex: 0 0 auto; padding: 0.55rem 0.8rem;
  background: var(--live); font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase; font-size: 0.68rem;
}
.ticker-track { display: flex; gap: 2rem; padding: 0.55rem 0.9rem; min-width: 0; overflow: hidden; }
.ticker-track span { white-space: nowrap; }
@media (prefers-reduced-motion: no-preference) {
  .ticker-track { animation: marquee 36s linear infinite; width: max-content; }
}
@keyframes marquee { to { transform: translateX(-50%); } }

.masthead, .section, .hero, .article, .search-section { padding: 1.4rem var(--pad); }
.masthead { border-bottom: 1px solid var(--line); }
.masthead-inner, .hero, .section-inner, .article, .search-box { max-width: var(--max); margin: 0 auto; }
.masthead-date {
  margin: 0; text-transform: uppercase; letter-spacing: 0.12em;
  font-size: 0.72rem; color: var(--fg-faint); font-weight: 700;
}
.masthead-title { font-size: var(--step-3); margin: 0.35rem 0 0; }
.accent { color: var(--accent); }

.hero {
  display: grid; gap: 1.1rem;
  padding-top: 1.6rem; padding-bottom: 0.4rem;
}
.hero-visual { border-radius: var(--radius); overflow: hidden; min-height: 12rem; }
.hero-graphic {
  min-height: 12rem; height: 100%;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.28), transparent 40%),
    linear-gradient(135deg, #c45c26, #6b2a10 55%, #1d1a16);
  display: grid; place-items: center;
  font-family: var(--font-display); font-size: clamp(4rem, 18vw, 8rem);
  font-weight: 700; color: rgba(255,255,255,0.14);
}
.eyebrow {
  display: inline-block; margin: 0 0 0.7rem;
  padding: 0.2rem 0.6rem; border-radius: 999px;
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  background: var(--accent-soft); color: var(--accent-ink);
}
.hero-title { font-size: var(--step-2); margin: 0 0 0.7rem; }
.hero-lede { color: var(--fg-muted); margin: 0 0 1rem; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 0.7rem; align-items: center; }
.read-more { color: var(--accent-ink); font-weight: 700; }
.source-tag, .story-source, .story-cat {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--accent-ink);
}

.section-head {
  max-width: var(--max); margin: 0 auto 1rem;
  display: flex; justify-content: space-between; gap: 1rem; align-items: baseline;
  border-bottom: 1px solid var(--line); padding-bottom: 0.55rem;
}
.section-title { margin: 0; font-size: var(--step-1); }
.link-underline { font-weight: 700; color: var(--accent-ink); white-space: nowrap; }

.stories-grid {
  max-width: var(--max); margin: 0 auto;
  display: grid; gap: 0.9rem;
}
.story-card {
  display: grid; grid-template-columns: 4.6rem 1fr; gap: 0.85rem;
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 0.85rem;
}
.story-thumb {
  border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink);
  display: grid; place-items: center;
}
.story-thumb svg { width: 1.7rem; height: 1.7rem; }
.story-title { font-size: 1.05rem; margin: 0.15rem 0 0.35rem; }
.story-lede {
  margin: 0 0 0.55rem; color: var(--fg-muted); font-size: 0.92rem;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.story-foot {
  display: flex; flex-wrap: wrap; gap: 0.5rem 0.9rem;
  color: var(--fg-faint); font-size: 0.8rem;
}
.story-time { display: inline-flex; align-items: center; gap: 0.3rem; }
.story-time svg { width: 0.9rem; height: 0.9rem; }

.section-split { display: grid; gap: 1.4rem; padding: 0 var(--pad) 1.4rem; max-width: var(--max); margin: 0 auto; }
.sources-grid {
  max-width: var(--max); margin: 0 auto; display: grid; gap: 0.7rem;
}
.source-card {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem;
}
.source-name { font-family: var(--font-display); font-weight: 700; }
.source-note { color: var(--fg-muted); font-size: 0.9rem; }

.newsletter {
  margin: 1rem var(--pad) 0; padding: 1.4rem;
  border-radius: var(--radius);
  background: var(--bg-ink); color: #f4f1ea;
}
.newsletter-inner { max-width: var(--max); margin: 0 auto; display: grid; gap: 1rem; }
.newsletter .section-title, .newsletter p { color: inherit; }
.newsletter-form { display: grid; gap: 0.6rem; }
.newsletter-form input, .search-input, .form-input {
  width: 100%; padding: 0.85rem 0.95rem; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg-elev); color: var(--fg); font: inherit;
}
.btn {
  border: 0; border-radius: 12px; padding: 0.85rem 1.1rem; font: inherit; font-weight: 700;
  cursor: pointer;
}
.btn--primary { background: var(--accent); color: #fff; }
.newsletter-msg { min-height: 1.2rem; margin: 0; font-size: 0.9rem; }

.site-footer { padding: 2rem var(--pad) 3rem; border-top: 1px solid var(--line); margin-top: 1rem; }
.footer-inner { max-width: var(--max); margin: 0 auto; display: grid; gap: 1.4rem; }
.footer-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.footer-nav h3 { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-faint); }
.footer-nav a { display: block; padding: 0.25rem 0; color: var(--fg-muted); }
.footer-copy { color: var(--fg-faint); font-size: 0.85rem; }

.back-to-top {
  position: fixed; right: 1rem; bottom: 1rem; width: 2.7rem; height: 2.7rem;
  border: 0; border-radius: 999px; background: var(--accent); color: #fff;
  opacity: 0; pointer-events: none; cursor: pointer;
}
.back-to-top.show { opacity: 1; pointer-events: auto; }

/* Article */
.article { max-width: 46rem; }
.article-breadcrumb { color: var(--fg-faint); font-size: 0.85rem; margin-bottom: 0.8rem; }
.article-title { font-size: var(--step-2); margin: 0.3rem 0 0.8rem; }
.article-meta { color: var(--fg-muted); font-size: 0.92rem; }
.takeaway {
  background: var(--accent-soft); border-left: 4px solid var(--accent);
  padding: 0.9rem 1rem; border-radius: 0 14px 14px 0; margin: 1rem 0 1.3rem;
}
.takeaway strong { display: block; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 0.3rem; }
.article-body p { font-size: 1.05rem; }
.source-box {
  margin-top: 1.6rem; padding: 1rem; border: 1px dashed var(--line); border-radius: 14px;
  color: var(--fg-muted);
}
.article-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1.2rem; }
.tag { padding: 0.2rem 0.55rem; border-radius: 999px; background: var(--bg-elev); border: 1px solid var(--line); font-size: 0.78rem; }

.search-input-wrap { display: grid; grid-template-columns: 1fr auto; gap: 0.5rem; }
.search-suggestions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.7rem; }
.suggestion, .search-btn {
  border: 1px solid var(--line); background: var(--bg-elev); border-radius: 999px;
  padding: 0.4rem 0.75rem; cursor: pointer; font: inherit;
}
.search-btn { background: var(--accent); color: #fff; border: 0; font-weight: 700; }
.contact-form { display: grid; gap: 0.8rem; }
.form-label { font-weight: 700; font-size: 0.9rem; }
.form-status { color: var(--fg-muted); }

@media (min-width: 720px) {
  .live-badge { display: inline-flex; }
  .nav-toggle { display: none; }
  .nav-list {
    position: static; transform: none; width: auto; flex-direction: row;
    background: transparent; border: 0; padding: 0; overflow: visible;
  }
  .nav-link { padding: 0.4rem 0.7rem; font-size: 0.92rem; }
  .hero { grid-template-columns: 1.3fr 0.9fr; align-items: center; }
  .stories-grid { grid-template-columns: 1fr 1fr; }
  .story-card { grid-template-columns: 1fr; }
  .story-thumb { min-height: 7rem; }
  .section-split { grid-template-columns: 1fr 1fr; padding-left: 0; padding-right: 0; }
  .sources-grid { grid-template-columns: 1fr 1fr; }
  .newsletter-inner, .newsletter-form { grid-template-columns: 1.2fr 1fr; align-items: center; }
  .footer-inner { grid-template-columns: 1.4fr 2fr; }
  .footer-nav { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
  .stories-grid { grid-template-columns: repeat(3, 1fr); }
  .stories-grid--compact { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

.section--flush { padding-left: 0; padding-right: 0; }
