:root {
  color-scheme: light;
  --bg: #f5f7f2;
  --surface: #ffffff;
  --surface-2: #eef3ec;
  --text: #17201a;
  --muted: #667066;
  --line: #d7dfd2;
  --green: #1f6f4a;
  --green-2: #0f4f39;
  --gold: #c9983f;
  --blue: #426d9f;
  --red: #b7433f;
  --ink: #111514;
  --shadow: 0 24px 70px rgba(31, 58, 44, 0.15);
  --radius: 8px;
}

:root.dark {
  color-scheme: dark;
  --bg: #101513;
  --surface: #171f1c;
  --surface-2: #1f2b25;
  --text: #eff6ef;
  --muted: #a9b6a9;
  --line: #314139;
  --green: #57b87f;
  --green-2: #91d0a8;
  --gold: #d7ad56;
  --blue: #86a9d4;
  --red: #e47a70;
  --ink: #f4f7f4;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(31, 111, 74, 0.08), transparent 340px),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 18px;
  align-items: center;
  padding: 14px clamp(16px, 3vw, 42px);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  color: var(--text);
  text-decoration: none;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: var(--radius);
  background: var(--green-2);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
}

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

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.top-nav {
  display: flex;
  gap: 8px;
  align-items: center;
}

.top-nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: var(--radius);
  color: var(--muted);
  text-decoration: none;
}

.top-nav a:hover {
  background: var(--surface-2);
  color: var(--text);
}

.theme-toggle,
.button,
.tab {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
}

.toggle-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: inset 0 0 0 4px color-mix(in srgb, var(--surface) 50%, transparent);
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 56px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1.05fr);
  gap: clamp(24px, 4vw, 54px);
  align-items: center;
  padding: clamp(36px, 8vw, 78px) 0 36px;
}

.hero-copy h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(42px, 6vw, 82px);
  line-height: 0.94;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-lede {
  max-width: 660px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 19px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  text-decoration: none;
  font-weight: 760;
}

.button.primary {
  border-color: var(--green-2);
  background: var(--green-2);
  color: #fff;
}

.meta-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 28px;
}

.meta-strip span,
.stat-card,
.section-summary,
.source-card,
.progress-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}

.meta-strip span {
  padding: 12px;
  color: var(--muted);
}

.meta-strip strong {
  display: block;
  color: var(--text);
  font-size: 22px;
}

.hero-art {
  margin: 0;
}

.hero-art img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 11;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-art figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.intel-band,
.briefing-section,
.sprint-section,
.source-section {
  padding: 42px 0;
}

.section-heading {
  max-width: 720px;
  margin-bottom: 22px;
}

.section-heading.compact {
  margin-bottom: 14px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1;
  letter-spacing: 0;
}

.section-heading p:not(.eyebrow) {
  margin: 12px 0 0;
  color: var(--muted);
}

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

.stat-card {
  padding: 18px;
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.stat-card strong {
  display: block;
  margin: 6px 0;
  font-size: 28px;
}

.stat-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.controls-panel {
  position: sticky;
  top: 71px;
  z-index: 40;
  margin: 12px 0 22px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(18px);
}

.control-row {
  display: grid;
  grid-template-columns: 1fr 220px auto;
  gap: 12px;
  align-items: end;
}

.search-box,
.select-box {
  display: grid;
  gap: 6px;
}

.search-box span,
.select-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

input[type="search"],
select {
  min-height: 44px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  padding: 0 12px;
}

.check-pill {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  white-space: nowrap;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.tab {
  padding: 0 12px;
  font-weight: 760;
}

.tab.active {
  border-color: var(--green-2);
  background: var(--green-2);
  color: #fff;
}

.section-summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
  margin-bottom: 14px;
}

.section-summary h3,
.brief-card h3 {
  margin: 0;
  letter-spacing: 0;
}

.section-summary p {
  margin: 6px 0 0;
  color: var(--muted);
}

.section-summary .button {
  white-space: nowrap;
}

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

.brief-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 14px 38px rgba(10, 22, 15, 0.06);
  overflow: hidden;
}

.card-button {
  width: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: start;
  padding: 18px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.card-button h3 {
  font-size: 21px;
  line-height: 1.12;
}

.card-button p {
  margin: 10px 0 0;
  color: var(--muted);
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.tag.critical {
  border-color: color-mix(in srgb, var(--red) 55%, var(--line));
  color: var(--red);
}

.tag.high {
  border-color: color-mix(in srgb, var(--gold) 55%, var(--line));
  color: var(--gold);
}

.tag.watch {
  border-color: color-mix(in srgb, var(--blue) 55%, var(--line));
  color: var(--blue);
}

.expand-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  flex: 0 0 auto;
}

.brief-card.open .expand-icon {
  color: #fff;
  background: var(--green-2);
  border-color: var(--green-2);
}

.card-detail {
  display: none;
  padding: 0 18px 18px;
}

.brief-card.open .card-detail {
  display: block;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 4px;
}

.detail-box {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.detail-box strong {
  display: block;
  margin-bottom: 6px;
}

.detail-box p {
  margin: 0;
  color: var(--muted);
}

.source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.source-links a,
.source-links span,
.source-card a {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
}

.source-links a:hover,
.source-card a:hover {
  border-color: var(--green);
  color: var(--green);
}

.sprint-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 14px;
  align-items: start;
}

.progress-panel {
  position: sticky;
  top: 160px;
  padding: 18px;
}

.progress-panel span {
  display: block;
  margin-bottom: 12px;
  font-weight: 800;
}

.progress-bar {
  height: 10px;
  margin-bottom: 16px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.progress-bar span {
  width: 0;
  height: 100%;
  margin: 0;
  background: var(--green);
  transition: width 180ms ease;
}

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

.task {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  min-height: 88px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.task input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--green);
}

.task strong {
  display: block;
}

.task span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

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

.source-card {
  padding: 14px;
}

.source-card strong {
  display: block;
}

.source-card small {
  display: block;
  margin: 4px 0 10px;
  color: var(--muted);
}

.source-card p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 14px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  max-width: 320px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--bg);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 940px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .top-nav {
    display: none;
  }

  .hero,
  .sprint-layout {
    grid-template-columns: 1fr;
  }

  .intel-grid,
  .tabs,
  .cards-grid,
  .checklist,
  .source-grid {
    grid-template-columns: 1fr;
  }

  .control-row {
    grid-template-columns: 1fr;
  }

  .controls-panel,
  .progress-panel {
    position: static;
  }

  .detail-grid,
  .section-summary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  main {
    width: min(100% - 24px, 1180px);
  }

  .site-header {
    padding: 10px 12px;
  }

  .brand small {
    display: none;
  }

  .hero-copy h1 {
    font-size: clamp(38px, 12vw, 58px);
  }

  .hero-lede {
    font-size: 17px;
  }

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