/* ============================================================================
   Seattle Score — styles
   Palette: cream ground, dark navy ink, aqua highlights.
   Type: Helvetica-family Swiss grid, mono for data.
   ============================================================================ */

:root {
  --cream:      #F4EEE1;
  --cream-2:    #EDE5D4;   /* card / panel */
  --navy:       #0B2545;   /* primary ink */
  --navy-2:     #13315C;   /* secondary ink */
  --aqua:       #1CA7B5;   /* highlight */
  --aqua-deep:  #0E7E8A;
  --aqua-soft:  #Bfe3e6;
  --rule:       #D9CEB8;   /* hairline on cream */
  --muted:      #6B7280;
  --good:       #0E8A6A;
  --bad:        #C0492F;

  --mono: "SFMono-Regular", "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --sans: Inter, Helvetica, "Helvetica Neue", Arial, system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--cream);
  color: var(--navy);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 28px; }

/* ---- masthead ---------------------------------------------------------- */
.masthead {
  border-bottom: 1.5px solid var(--navy);
  padding: 22px 0 16px;
}
.masthead .wrap { display: flex; align-items: baseline; justify-content: space-between; }
.brand {
  font-weight: 800; letter-spacing: -0.02em; font-size: 19px;
}
.brand .dot { color: var(--aqua); }
.masthead .date {
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.08em;
}

/* ---- hero gauge -------------------------------------------------------- */
.hero { padding: 56px 0 44px; border-bottom: 1px solid var(--rule); }
.hero .wrap { display: grid; grid-template-columns: 280px 1fr; gap: 56px; align-items: center; }

.gauge { position: relative; width: 280px; height: 280px; }
.gauge svg { transform: rotate(-90deg); }
.gauge .readout {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.gauge .num {
  font-size: 88px; font-weight: 800; line-height: 0.9; letter-spacing: -0.04em;
  color: var(--navy);
}
.gauge .denom { font-family: var(--mono); font-size: 13px; color: var(--muted); margin-top: 6px; }
.gauge .band {
  margin-top: 10px; font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.14em; color: var(--aqua-deep);
}

.hero .lede h1 {
  font-size: 40px; line-height: 1.05; letter-spacing: -0.03em; font-weight: 800;
  margin-bottom: 16px;
}
.hero .lede h1 em { font-style: normal; color: var(--aqua-deep); }
.hero .lede p { font-size: 16px; color: var(--navy-2); max-width: 46ch; margin-bottom: 14px; }
.hero .meta-delta {
  font-family: var(--mono); font-size: 13px; display: inline-flex; gap: 8px; align-items: center;
  background: var(--cream-2); border: 1px solid var(--rule); padding: 7px 12px; border-radius: 999px;
}
.up { color: var(--good); } .down { color: var(--bad); } .flat { color: var(--muted); }

/* ---- category grid ----------------------------------------------------- */
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 38px 0 18px;
}
.section-head h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.16em; font-weight: 800; }
.section-head .hint { font-family: var(--mono); font-size: 12px; color: var(--muted); }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--rule);
        border: 1px solid var(--rule); }

.card {
  background: var(--cream); padding: 22px 24px 20px;
  display: flex; flex-direction: column; gap: 14px;
  transition: background 0.15s ease;
}
.card:hover { background: var(--cream-2); }

.card .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.card .name { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.card .blurb { font-size: 12.5px; color: var(--muted); margin-top: 3px; max-width: 34ch; }

.card .score { text-align: right; flex-shrink: 0; }
.card .score .v { font-size: 38px; font-weight: 800; letter-spacing: -0.03em; line-height: 0.9; }
.card .score .d { font-family: var(--mono); font-size: 12px; margin-top: 4px; }

.card .mid { display: flex; align-items: center; gap: 14px; }
.spark { flex: 1; height: 38px; }
.weightpill {
  font-family: var(--mono); font-size: 10.5px; color: var(--muted);
  border: 1px solid var(--rule); border-radius: 4px; padding: 2px 6px; white-space: nowrap;
}

.card .foot {
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid var(--rule); padding-top: 12px; gap: 12px;
}
.card .why { font-family: var(--mono); font-size: 11px; color: var(--navy-2); line-height: 1.5; }
.card .why b { color: var(--navy); }
.card .src { font-family: var(--mono); font-size: 10.5px; }
.card .src a { color: var(--aqua-deep); text-decoration: none; border-bottom: 1px solid var(--aqua-soft); }
.card .src a:hover { color: var(--aqua); }

.conf {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px;
  vertical-align: middle;
}
.conf.live { background: var(--aqua); }
.conf.annual { background: #C9A24B; }

/* ---- score history ----------------------------------------------------- */
.history { padding: 30px 0 36px; border-bottom: 1px solid var(--rule); }
.history .chartwrap { position: relative; margin-top: 14px; }
.history svg { width: 100%; height: 220px; display: block; overflow: visible; }
.history .gridline { stroke: var(--rule); stroke-width: 1; }
.history .gridlabel { font-family: var(--mono); font-size: 10px; fill: var(--muted); }
.history .yearlabel { font-family: var(--mono); font-size: 11px; fill: var(--muted); }
.history .scoreline { fill: none; stroke: var(--aqua); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.history .scorearea { fill: var(--aqua); opacity: 0.08; }
.history .dot { fill: var(--cream); stroke: var(--aqua); stroke-width: 2; }
.history .dot.now { fill: var(--navy); stroke: var(--navy); }
.history .ptlabel { font-family: var(--mono); font-size: 10.5px; fill: var(--navy-2); font-weight: 500; }
.history .ptlabel.now { fill: var(--navy); font-weight: 700; }
.history .dot.hi { fill: var(--good); stroke: var(--good); }
.history .dot.lo { fill: var(--bad); stroke: var(--bad); }
.history .ptlabel.hi { fill: var(--good); font-weight: 700; }
.history .ptlabel.lo { fill: var(--bad); font-weight: 700; }
.history .halo.hi { fill: var(--good); opacity: 0.14; }
.history .halo.lo { fill: var(--bad); opacity: 0.14; }
.history .pttag { font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em; font-weight: 700; }
.history .pttag.hi { fill: var(--good); }
.history .pttag.lo { fill: var(--bad); }

.history .hint .hl-hi, .history .hint .hl-lo { font-weight: 700; }
.history .hint .hl-hi { color: var(--good); }
.history .hint .hl-lo { color: var(--bad); margin-left: 14px; }
.history .hint .hl-note { color: var(--muted); margin-left: 14px; }

/* ---- news wall --------------------------------------------------------- */
.news { padding: 14px 0 8px; border-bottom: 1px solid var(--rule); }
.newsgrid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 1px; background: var(--rule);
            border: 1px solid var(--rule); }
.story {
  background: var(--cream); padding: 20px 22px; display: flex; flex-direction: column; gap: 10px;
  transition: background 0.15s ease; text-decoration: none; color: inherit;
}
.story:hover { background: var(--cream-2); }
.story.lead { grid-row: span 2; }
.story .tagrow { display: flex; align-items: center; gap: 8px; }
.tag {
  font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em;
  font-weight: 500; padding: 3px 7px; border-radius: 4px;
  background: var(--aqua-soft); color: var(--aqua-deep);
}
.tag.city { background: var(--cream-2); color: var(--muted); border: 1px solid var(--rule); }
.sigmeter { display: inline-flex; gap: 2px; margin-left: auto; }
.sigmeter i { width: 4px; height: 11px; border-radius: 1px; background: var(--rule); }
.sigmeter i.on { background: var(--aqua); }
.story h3 { font-size: 17px; font-weight: 700; line-height: 1.18; letter-spacing: -0.01em; }
.story.lead h3 { font-size: 26px; line-height: 1.1; }
.story .why { font-size: 13px; color: var(--navy-2); line-height: 1.45; }
.story .dateline { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: auto; }
.story .dateline b { color: var(--navy); font-weight: 500; }

/* "news behind this number" link on category cards */
.card .signal {
  font-family: var(--mono); font-size: 11px; color: var(--aqua-deep);
  text-decoration: none; display: block; line-height: 1.4;
}
.card .signal:hover { color: var(--aqua); }
.card .signal b { color: var(--navy); font-weight: 500; }

@media (max-width: 760px) {
  .newsgrid { grid-template-columns: 1fr; }
  .story.lead { grid-row: auto; }
  .story.lead h3 { font-size: 22px; }
}

/* ---- coverage line under hero ----------------------------------------- */
.coverage {
  margin-top: 14px; font-family: var(--mono); font-size: 12px; color: var(--muted);
  letter-spacing: 0.02em;
}

/* ---- upcoming measures ------------------------------------------------- */
.upcoming { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--rule);
            border: 1px solid var(--rule); margin-bottom: 10px; }
.up-card { background: var(--cream); padding: 16px 20px; opacity: 0.72; }
.up-name { font-size: 15px; font-weight: 700; color: var(--navy-2); }
.up-name::before {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: #C9A24B; margin-right: 8px; vertical-align: middle;
}
.up-note { font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin-top: 5px; }

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

/* live "right now" AQI badge on the Environment card */
.nowbadge {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 9px;
  font-family: var(--mono); font-size: 11px; color: var(--aqua-deep);
  background: var(--cream-2); border: 1px solid var(--aqua-soft);
  padding: 3px 9px; border-radius: 999px;
}
.nowdot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--aqua);
  box-shadow: 0 0 0 0 rgba(28,167,181,0.6); animation: nowpulse 2.2s infinite;
}
@keyframes nowpulse {
  0% { box-shadow: 0 0 0 0 rgba(28,167,181,0.5); }
  70% { box-shadow: 0 0 0 7px rgba(28,167,181,0); }
  100% { box-shadow: 0 0 0 0 rgba(28,167,181,0); }
}
.method .stamp { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 22px; }

@media (max-width: 760px) { .upcoming { grid-template-columns: 1fr; } }

/* ---- methodology ------------------------------------------------------- */
.method { padding: 60px 0 80px; border-top: 1.5px solid var(--navy); margin-top: 56px; }
.method h2 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 12px; }
.method p { max-width: 62ch; color: var(--navy-2); margin-bottom: 14px; font-size: 15px; }
.method code { font-family: var(--mono); background: var(--cream-2); padding: 2px 6px; border-radius: 4px;
               font-size: 13px; color: var(--aqua-deep); border: 1px solid var(--rule); }
.method .formula {
  font-family: var(--mono); font-size: 15px; background: var(--navy); color: var(--cream);
  padding: 18px 22px; border-radius: 8px; margin: 18px 0 24px; display: inline-block;
}
.method .formula em { color: var(--aqua-soft); font-style: normal; }

.legend { display: flex; gap: 24px; flex-wrap: wrap; margin-top: 18px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; }

footer { border-top: 1px solid var(--rule); padding: 26px 0 50px; }
footer .wrap { font-family: var(--mono); font-size: 11.5px; color: var(--muted); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

@media (max-width: 760px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 32px; justify-items: center; text-align: center; }
  .hero .lede h1 { font-size: 30px; }
  .hero .lede p { margin-left: auto; margin-right: auto; }
  .grid { grid-template-columns: 1fr; }
}
