/* El Niño Track — homepage v3 tokens from Figma Home / Mobile|Desktop v3 */
:root {
  --bg: #f3efe6;
  --card: #ffffff;
  --text: #141414;
  --muted: #5c5c5c;
  --border: #d2ccc0;
  --ad-label: #8a8478;
  --ad-well: #f0ede6;
  --ad-border: #e0dbd2;
  --ad-mock: #e5e0d6;
  --where-bg: #eae4da;
  --chart-bg: #faf7f2;
  --accent-nino: #c24e32;
  --accent-nino-soft: #ebc4b8;
  --accent-nino-sub: #f6e4de;
  --accent-nina: #2f6f9a;
  --accent-nina-soft: #b8d4eb;
  --accent-nina-sub: #dde8f2;
  --accent-neutral: #5a6068;
  --accent-neutral-soft: #c8cbcf;
  --accent-neutral-sub: #e8e9eb;
  --content-max: 720px;
  --pad: 14px;
  --radius-card: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 16px;
}

a {
  color: var(--accent-nino);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

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

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

.wrap {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--pad) 2.5rem;
}

/* Header */
.site-header {
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header .inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 10px var(--pad) 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.logo {
  font-weight: 500;
  font-size: 0.75rem;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

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

.nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px 10px;
  font-size: 0.75rem;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
}

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

/* ========== STORY BAND ========== */
.story-band {
  margin-top: 0.25rem;
  padding: 16px 14px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--card);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.story-h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--text);
}

.status-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Phase color band (hero) */
.phase-band {
  border-radius: 10px;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.phase-band__hero {
  margin: 0;
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #fff;
}

.phase-band__sub {
  margin: 0;
  font-size: 0.75rem;
  color: var(--accent-nino-sub);
}

.phase-band--nino {
  background: var(--accent-nino);
}
.phase-band--nino .phase-band__sub {
  color: var(--accent-nino-sub);
}

.phase-band--nina {
  background: var(--accent-nina);
}
.phase-band--nina .phase-band__sub {
  color: var(--accent-nina-sub);
}

.phase-band--neutral {
  background: var(--accent-neutral);
}
.phase-band--neutral .phase-band__sub {
  color: var(--accent-neutral-sub);
}

/* Pacific index (secondary) */
.index-secondary__label {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
}

.index-secondary__value {
  margin: 4px 0 0;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.index-secondary__source {
  margin: 4px 0 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
}

.updated-when {
  margin: 0;
  font-size: 0.8125rem;
}

.story-divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 0;
}

/* Skim graph */
.skim-graph {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skim-graph__title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
}

.chart-plot {
  background: var(--chart-bg);
  border-radius: 8px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 168px;
}

.chart-axis-label {
  margin: 0;
  font-size: 0.625rem;
  color: var(--muted);
}

.chart-bars {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 3px;
  height: 110px;
  width: 100%;
  position: relative;
}

.chart-col {
  flex: 1 1 0;
  max-width: 28px;
  min-width: 12px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.chart-col__pos,
.chart-col__neg {
  flex: 1 1 50%;
  display: flex;
  min-height: 0;
}

.chart-col__pos {
  align-items: flex-end;
}

.chart-col__neg {
  align-items: flex-start;
}

.chart-bar {
  width: 100%;
  border-radius: 2px;
  background: var(--accent-nino-soft);
  min-height: 0;
}

.chart-bar--current {
  background: var(--accent-nino);
  outline: 2px solid var(--text);
  outline-offset: 1px;
  opacity: 1;
}

.story-band.phase--nina .chart-bar {
  background: var(--accent-nina-soft);
}
.story-band.phase--nina .chart-bar--current {
  background: var(--accent-nina);
}
.story-band.phase--neutral .chart-bar {
  background: var(--accent-neutral-soft);
}
.story-band.phase--neutral .chart-bar--current {
  background: var(--accent-neutral);
}

.chart-zero {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.chart-zero__line {
  flex: 1;
  height: 1px;
  background: #9a9388;
}

.chart-zero__label {
  font-size: 0.5625rem;
  color: var(--muted);
  white-space: nowrap;
}

.chart-footer {
  margin: 0;
  font-size: 0.6875rem;
}

.chart-fail {
  margin: 0;
}

.chart-fail[hidden] {
  display: none;
}

/* Where I am */
.where-i-am {
  background: var(--where-bg);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.where-i-am__label {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.where-i-am__place {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
}

.where-i-am__analog {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text);
}

.where-i-am__disclaimer {
  margin: 0;
  font-size: 0.6875rem;
}

.where-i-am__change {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent-nino);
  text-decoration: none;
}

.where-i-am__change:hover {
  text-decoration: underline;
}

/* Actions */
.actions {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
}

.btn-primary {
  background: var(--accent-nino);
  color: #fff;
  border-color: var(--accent-nino);
}

.btn-primary:hover {
  color: #fff;
  opacity: 0.92;
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--text);
  font-weight: 500;
  font-size: 0.875rem;
  padding: 12px 16px;
}

.btn-secondary:hover {
  background: #efebe3;
  color: var(--text);
}

/* Hard gap before Ad A */
.ad-gap {
  height: 56px;
}

/* Banners */
.banner-fail {
  display: none;
  padding: 8px 12px;
  border-radius: 8px;
  background: #f8e8e2;
  color: var(--accent-nino);
  font-size: 0.85rem;
}

.banner-fail.is-visible {
  display: block;
}

.banner-empty {
  display: none;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--accent-neutral-sub);
  color: var(--accent-neutral);
  font-size: 0.85rem;
}

.banner-empty.is-visible {
  display: block;
}

/* Skeleton */
.skeleton {
  display: inline-block;
  height: 1em;
  width: 4.5rem;
  border-radius: 6px;
  background: linear-gradient(90deg, #ebe6dc 25%, #f3efe6 50%, #ebe6dc 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
  vertical-align: middle;
}

.skeleton--lg {
  height: 1.75rem;
  width: 8rem;
  border-radius: 8px;
}

.skeleton--text {
  height: 0.85rem;
  width: 12rem;
  max-width: 80%;
}

.skeleton--bar {
  flex: 1 1 0;
  max-width: 28px;
  height: 40%;
  border-radius: 2px;
  align-self: flex-end;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Panels below story */
.panel {
  margin-top: 1.25rem;
  padding: 0;
  border: none;
  background: transparent;
}

.panel--plain h2 {
  margin: 0 0 0.5rem;
  font-size: 1.0625rem;
  font-weight: 600;
}

.panel p {
  margin: 0 0 0.6rem;
}

.panel p:last-child {
  margin-bottom: 0;
}

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

.small {
  font-size: 0.875rem;
}

/* Places grid */
.places-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 0.75rem;
}

.place-card {
  display: block;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  text-decoration: none;
  color: var(--text);
}

.place-card:hover {
  border-color: #b8b0a0;
  color: var(--text);
}

.place-card h3 {
  margin: 0 0 6px;
  font-size: 0.9375rem;
  font-weight: 600;
}

.place-card p {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
}

/* Ad slots — light treatment; never above story band */
.ad-slot {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ad-slot + .panel,
.panel + .ad-slot,
.ad-slot + .ad-slot {
  margin-top: 1.25rem;
}

.ad-slot__label {
  margin: 0;
  font-size: 0.625rem;
  color: var(--ad-label);
}

.ad-slot__well {
  background: var(--ad-well);
  border: 1px solid var(--ad-border);
  border-radius: 4px;
  min-height: 48px;
  max-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px;
}

.ad-slot__well--tall {
  min-height: 90px;
}

.ad-slot__mock-text {
  font-size: 0.6875rem;
  color: var(--ad-label);
}

.ad-slot__mock-bar {
  display: block;
  width: 120px;
  height: 24px;
  background: var(--ad-mock);
  border-radius: 2px;
}

/* Ad C: hide on mobile */
.ad-slot--footer {
  display: none;
  margin-top: 1.25rem;
  opacity: 0.72;
}
.ad-slot--footer .ad-slot__well {
  min-height: 56px;
  padding: 8px;
}
.ad-slot--footer .ad-slot__mock-bar {
  height: 16px;
  width: 96px;
}

.further-reading {
  list-style: none;
  padding: 0;
  margin: 0.35rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  font-size: 0.875rem;
}

.further-reading a {
  color: var(--muted);
  text-decoration: none;
}

.further-reading a:hover {
  color: var(--text);
}

/* Footer */
.site-footer {
  margin-top: 1rem;
  padding: 1rem var(--pad) 2rem;
  border-top: 1px solid var(--border);
  font-size: 0.6875rem;
  color: var(--muted);
}

.site-footer .inner {
  max-width: var(--content-max);
  margin: 0 auto;
}

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

.legal {
  margin-top: 0.35rem;
}

/* Inner pages still use older status-block patterns */
.status-block .status-row,
.chip {
  /* place pages may still use chips */
}
.chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}
.chip--nino {
  background: #f8e8e2;
  color: var(--accent-nino);
}
.chip--nina {
  background: #e2eef8;
  color: var(--accent-nina);
}
.chip--neutral {
  background: var(--accent-neutral-sub);
  color: var(--accent-neutral);
}

.index-area .index-value {
  font-size: 2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.page-title {
  margin: 1.5rem 0 0.75rem;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

.source-list {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
}

.source-list li {
  margin-bottom: 0.35rem;
}

code,
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
}

.prose h2 {
  margin-top: 1.5rem;
  font-size: 1.15rem;
}

.prose p {
  margin: 0.6rem 0;
}

.prose ul {
  margin: 0.5rem 0;
  padding-left: 1.25rem;
}

/* Desktop */
@media (min-width: 768px) {
  :root {
    --pad: 20px;
  }

  .story-band {
    padding: 24px 28px 28px;
    border-radius: 16px;
    gap: 18px;
  }

  .story-h1 {
    font-size: 1.5rem;
  }

  .phase-band {
    padding: 22px 24px;
  }

  .phase-band__hero {
    font-size: 2.25rem;
  }

  .index-secondary__value {
    font-size: 1.15rem;
  }

  .chart-plot {
    min-height: 200px;
    padding: 14px 12px;
  }

  .chart-bars {
    height: 140px;
    gap: 5px;
  }

  .chart-col {
    max-width: 36px;
  }

  .where-i-am {
    padding: 18px 20px;
  }

  .where-i-am__place {
    font-size: 1.35rem;
  }

  .actions {
    flex-direction: row;
    align-items: stretch;
  }

  .btn-primary {
    flex: 0 0 auto;
    min-width: 143px;
  }

  .btn-secondary {
    flex: 0 0 auto;
  }

  .ad-gap {
    height: 72px;
  }

  .site-header .inner {
    padding: 18px var(--pad) 12px;
  }

  .logo {
    font-size: 0.875rem;
  }

  .nav {
    gap: 12px 16px;
    font-size: 0.8125rem;
  }

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

  .ad-slot--footer {
    display: flex;
  }

  .panel--plain h2 {
    font-size: 1.15rem;
  }
}

/* ========== City impact chips (v1 A1) ========== */
.impact-chips {
  margin: 1.25rem 0 0;
}
.impact-chips__title {
  margin: 0 0 0.35rem;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.impact-chips__honesty {
  margin: 0 0 0.85rem;
  font-size: 0.8125rem;
  color: var(--muted);
}
.impact-chips__grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.impact-chip {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 14px 12px;
  border-left: 3px solid var(--accent-nino-soft);
  box-shadow: 0 1px 0 rgba(20, 20, 20, 0.03);
}
.impact-chip__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.impact-chip__metric {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.01em;
}
.impact-chip__badge {
  flex-shrink: 0;
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1.2;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.impact-chip__badge--high {
  background: #eceae6;
  color: #3a3a3a;
  border: 1px solid transparent;
}
.impact-chip__badge--med {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}
.impact-chip__direction {
  margin: 0 0 6px;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--text);
}
.impact-chip__region {
  margin: 0 0 6px;
  font-size: 0.75rem;
  color: var(--muted);
}
.impact-chip__caveat {
  margin: 0 0 8px;
  font-size: 0.75rem;
  color: var(--muted);
}
.impact-chip__footer {
  margin: 0;
  font-size: 0.6875rem;
  color: var(--ad-label);
}
@media (min-width: 768px) {
  .impact-chips__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }
  .impact-chips__grid--seattle .impact-chip:last-child:nth-child(3) {
    grid-column: 1 / -1;
  }
  .impact-chip__direction {
    font-size: 1.2rem;
  }
}

/* ========== Email capture ========== */
.email-capture {
  margin: 1.25rem 0 0;
  padding: 14px;
  background: var(--where-bg);
  border-radius: 12px;
  border: 1px solid var(--border);
}
.email-capture__title {
  margin: 0 0 4px;
  font-size: 0.9375rem;
  font-weight: 600;
}
.email-capture__hint {
  margin: 0 0 10px;
  font-size: 0.75rem;
  color: var(--muted);
}
.email-capture__form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.email-capture__row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.email-capture__input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  background: #fff;
  color: var(--text);
}
.email-capture__btn {
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  background: var(--accent-nino);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.email-capture__btn:hover {
  filter: brightness(0.95);
}
.email-capture__note {
  margin: 8px 0 0;
  font-size: 0.6875rem;
  color: var(--ad-label);
}
@media (min-width: 560px) {
  .email-capture__row {
    flex-direction: row;
    align-items: stretch;
  }
  .email-capture__input {
    flex: 1;
  }
  .email-capture__btn {
    white-space: nowrap;
  }
}

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

.code-block {
  background: #1c1a18;
  color: #f5f2ec;
  padding: 12px 14px;
  border-radius: 10px;
  overflow-x: auto;
  font-size: 0.75rem;
  line-height: 1.45;
}
.code-block code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
