:root {
  color-scheme: light;
  font: 16px/1.42 system-ui, sans-serif;
  color: #211b16;
  background: #f4ecdd;
  --muted: #504437;
}
* { box-sizing: border-box; }
body, h1, h2, h3, p { margin: 0; }
h2 { font-size: clamp(1.3rem, 2.2vw, 1.75rem); letter-spacing: -.035em; line-height: 1.12; }
h3 { font-size: .95rem; }
a { color: inherit; text-underline-offset: .17em; overflow-wrap: anywhere; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid #165984; outline-offset: 4px; }
.skip { position: absolute; inset: .5rem auto auto .5rem; z-index: 5; padding: .6rem; background: white; transform: translateY(-150%); }
.skip:focus { transform: none; }

.hero {
  color: #fff5e3;
  background: linear-gradient(93deg, #211b14 7%, #262016e8 43%, #26201645 100%),
    url(assets/santa-ynez-valley.jpg) 70% 58% / cover, #312719;
  border-bottom: 4px solid #994021;
}
.hero > div, main, footer { max-width: 72rem; margin: auto; padding-inline: clamp(1rem, 4vw, 3.5rem); }
.hero > div { padding-block: clamp(1.25rem, 3.2vw, 2.55rem); }
.eyebrow { font-size: .73rem; font-weight: 730; letter-spacing: .16em; text-transform: uppercase; color: #f0d3a6; margin-bottom: .52rem; }
h1 { max-width: 60rem; font-size: clamp(2rem, 5.4vw, 4.25rem); font-weight: 830; line-height: .99; letter-spacing: -.062em; }
h1 span { white-space: nowrap; color: #f3cc98; }

main { padding-block: 1rem 2rem; }
.status {
  --signal: #82613f;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .45rem 1.25rem;
  padding: .8rem 1rem;
  margin-bottom: 1rem;
  background: #f2e4ce;
  border-block: 1px solid #876b4880;
  border-left: 8px solid var(--signal);
}
.status[data-state=quiet] { --signal: #49603c; background: #e3ebd7; }
.status[data-state=advisory] { --signal: #875411; background: #f6e7c5; }
.status[data-state=alert] { --signal: #a83119; background: #f9e3d7; }
.status[data-state=alert] [role=status] {
  background: #7f281b;
  color: #fff8ee;
  margin: -.8rem -1rem 0;
  padding: .8rem 1rem;
  grid-column: 1 / -1;
}
.status h2 { font-size: 1.12rem; letter-spacing: -.025em; }
.status > div:first-child p { margin-top: .15rem; white-space: pre-line; }
.status > a { align-self: center; font-weight: 680; font-size: .89rem; }
#alertList:empty { display: none; }
#alertList { grid-column: 1 / -1; }
.alert { border-bottom: 1px solid #9b4e3980; padding-block: .55rem; }
.alert p { margin: .25rem 0; white-space: pre-line; }

.wing { display: grid; gap: .95rem; }
.feather {
  --edge: #994022;
  --paper: #f3d8ba;
  --sweep: #dda578;
  --step: 0%;
  position: relative;
  isolation: isolate;
  width: calc(100% - var(--step));
  margin-left: var(--step);
  padding: 1.2rem clamp(2.8rem, 9vw, 7rem) 1.2rem clamp(1.2rem, 3vw, 2.15rem);
}
.feather::before, .feather::after { content: ''; position: absolute; inset: 0; pointer-events: none; }
.feather::before {
  z-index: -2;
  background: linear-gradient(112deg, var(--paper) 66%, var(--sweep));
  clip-path: polygon(1.4% 0, 91% 0, 100% 50%, 92% 85%, 82% 100%, 0 100%);
}
.feather::after {
  z-index: -1;
  background: var(--edge);
  clip-path: polygon(1.4% 0, 2.2% 0, .7% 98%, 83% 98%, 92% 85%, 100% 50%, 92% 87%, 83% 100%, 0 100%);
}
.forecast { --step: 4%; --edge: #265e67; --paper: #d9e8e7; --sweep: #89b3b5; }
.resources { --step: 8%; --edge: #555632; --paper: #e6e5cb; --sweep: #b3b78e; }

.readings { display: grid; grid-template-columns: 1fr 1fr; gap: 1.15rem; margin: .65rem 0 .7rem; }
.readings > div + div { border-left: 1px solid #a78567; padding-left: 1.15rem; }
.value { font-size: clamp(2.85rem, 7vw, 5rem); line-height: 1; letter-spacing: -.075em; font-weight: 860; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); font-size: .87rem; }
.forecast .muted { color: #294b4c; }
#forecastSummary { margin-top: .25rem; font-weight: 650; }
button { font: inherit; font-weight: 650; cursor: pointer; color: inherit; padding: .38rem .65rem; background: #fff5e7; border: 1px solid #765033; border-radius: .16rem; }
.hours { display: grid; grid-template-columns: repeat(auto-fit, minmax(3.7rem, 1fr)); gap: .3rem; list-style: none; padding: 0; margin: .62rem 0; }
.hours:empty { display: none; }
.hours li { background: #f4fbf6a0; padding: .36rem .16rem; text-align: center; }
.hours strong, .hours time { display: block; }
.hours time { font-size: .78rem; }
.forecast-mark { display: flex; align-items: flex-end; height: 2rem; margin: 0 auto .25rem; width: 65%; border-bottom: 1px solid #456d6f75; }
.forecast-mark::after { content: ''; height: var(--height, 0%); width: 100%; background: var(--temperature-ink, transparent); }
.forecast-peak .forecast-mark::after { outline: 1px solid #243938; outline-offset: 2px; }
.temperature-key { display: flex; flex-wrap: wrap; gap: .2rem .75rem; list-style: none; padding: 0; margin: 0 0 .3rem; font-variant-numeric: tabular-nums; }
.temperature-key li { display: inline-flex; align-items: center; gap: .26rem; }
.temperature-key li::before { content: ''; width: .65rem; height: .65rem; background: var(--temperature-ink); }
.hours:empty + .temperature-key { display: none; }
.resources ul { display: flex; flex-wrap: wrap; gap: .35rem 1.25rem; list-style: none; padding: 0; margin: .5rem 0; }
.resources summary { cursor: pointer; width: fit-content; }
.resources table { width: 100%; margin-top: .6rem; text-align: left; border-collapse: collapse; }
.resources th, .resources td { padding: .25rem; border-bottom: 1px solid #a5a68d; }
.resources caption { text-align: left; }
footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; padding-block: 0 1.5rem; color: var(--muted); font-size: .85rem; }

@media (max-width: 600px) {
  .hero { background-image: linear-gradient(90deg, #211b14fa 5%, #262016bb 100%), url(assets/santa-ynez-valley.jpg); }
  h1 span { display: block; }
  .status { grid-template-columns: 1fr; }
  .feather { padding-right: 1.75rem; }
  .feather::before { clip-path: polygon(1.4% 0, 94% 0, 100% 48%, 96% 91%, 88% 100%, 0 100%); }
  .feather::after { clip-path: polygon(1.4% 0, 2.4% 0, 1% 98%, 88% 98%, 96% 91%, 100% 48%, 97% 92%, 88% 100%, 0 100%); }
  .forecast { --step: 1.5%; }
  .resources { --step: 3%; }
  .readings { gap: .75rem; }
  .readings > div + div { padding-left: .7rem; }
}
@media (max-width: 460px) {
  .readings { grid-template-columns: 1fr; }
  .readings > div + div { border-left: 0; border-top: 1px solid #a78567; padding: .6rem 0 0; }
}

.now-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: .6rem;
  padding-top: .4rem;
  border-top: 1px solid #a78567;
}
.now-actions #listen { grid-column: 2; }
.now-actions .air-source:last-child { grid-column: 3; justify-self: end; }
.air-source {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  align-items: center;
  gap: .5rem;
}
.air-source a { margin: 0; font-weight: 670; }
.air-symbol {
  display: block;
  width: 3rem;
  height: 3rem;
  background: url(assets/santa-ynez-air-symbols.png) left center / 200% 100% no-repeat;
}
.air-smoke { background-position: right center; }
@media (max-width: 520px) {
  .air-source { grid-template-columns: 2.25rem minmax(0, 1fr); gap: .25rem; }
  .air-symbol { width: 2.25rem; height: 2.25rem; }
}

.readings { grid-template-columns: minmax(0, 1fr) minmax(0, 1.23fr) minmax(0, 1fr); }
.readings .north-star { padding-inline: .65rem; border-left: 1px solid #a78567; border-right: 1px solid #a78567; }
.readings .air-reading { border-left: 0; padding-left: 0; }
.air-reading .air-aqi strong { font-size: clamp(1.7rem, 3vw, 2.2rem); }
.air-reading .reading-label { font-size: .76rem; }
.air-reading .muted { font-size: .8rem; }
.north-star { text-align: center; align-self: stretch; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #604b35; }
.star-mark { display: block; width: 1.75rem; aspect-ratio: 1; background: currentColor; margin-bottom: .45rem; clip-path: polygon(50% 0, 62% 37%, 100% 50%, 62% 63%, 50% 100%, 38% 63%, 0 50%, 38% 37%); }
#cueHeadline { font-size: clamp(1rem, 2.1vw, 1.65rem); font-weight: 820; letter-spacing: -.04em; line-height: 1.05; overflow-wrap: anywhere; }
#cueDetail { margin-top: .28rem; }
#cueDetail:empty { display: none; }
.north-star[data-tone=quiet] { color: #405b33; }
.north-star[data-tone=alert], .north-star[data-tone=hot] { color: #8a2f1d; }
.north-star[data-tone=advisory] { color: #825018; }
.north-star[data-tone=wind], .north-star[data-tone=cold] { color: #205761; }
.air-wind-metrics { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: .6rem; }
.air-aqi { line-height: 1.05; margin-top: .12rem; }
.air-aqi strong { font-size: 2.5rem; font-variant-numeric: tabular-nums; letter-spacing: -.055em; }
.air-aqi span, .aqi-category { font-weight: 750; }
.aqi-category { color: var(--aqi-ink, inherit); font-weight: 850; }
.reading-label { text-transform: uppercase; letter-spacing: .04em; }
.north-star[data-tone=quiet] #cueHeadline { text-transform: uppercase; font-size: clamp(1.25rem, 2.45vw, 2rem); font-weight: 900; }
.wind-metric { padding: .2rem .35rem; }
.wind-metric.wind-strong { background: #ffeed5; outline: 2px solid #873e25; }
.wind-strong #windValue, .wind-strong #windDetail { color: #762e1e; font-weight: 820; }
#fineParticles { font-weight: 650; }
@media (max-width: 750px) {
  .readings { grid-template-columns: minmax(0, .8fr) minmax(0, 1.45fr); gap: .55rem .75rem; }
  .readings .air-reading { grid-column: 2; grid-row: 1; border-top: 0; border-left: 1px solid #a78567; padding: 0 0 0 .6rem; }
  .readings .north-star { grid-column: 1 / -1; grid-row: 2; border: 0; border-top: 1px solid #a78567; padding: .42rem 0 0; }
  .north-star .star-mark { width: 1.2rem; margin-bottom: .22rem; }
  .air-wind-metrics { grid-template-columns: minmax(0, .9fr) minmax(0, 1fr); gap: .35rem; }
}

.temperature-display, .wind-display { display: flex; align-items: center; gap: .55rem; }
.temperature-display .value { font-size: clamp(2.15rem, 6vw, 5rem); }
.thermometer { flex: 0 0 1.6rem; height: 3.8rem; margin-block: .35rem; }
.thermometer-track { display: block; position: relative; height: 100%; border: 2px solid #765c45; border-radius: .8rem; overflow: hidden; background: #fff5e7; }
#thermometerLevel { position: absolute; inset: auto 0 0; height: max(.48rem, var(--temperature-level)); background: var(--temperature-ink); }
#thermometerLevel::after { content: ''; position: absolute; inset: -1px 0 auto; height: .5rem; background: var(--temperature-ink); }
.wind-display { gap: .45rem; }
.wind-display .air-aqi { white-space: nowrap; }
.mini-compass { position: relative; flex: 0 0 2.85rem; height: 2.85rem; border: 2px solid #765c45; border-radius: 50%; background: #fff5e7; }
.mini-compass::before { content: ''; position: absolute; top: .18rem; left: calc(50% - 1px); height: .3rem; width: 2px; background: #765c45; }
.mini-needle { position: absolute; inset: 12% 26%; transform: rotate(var(--bearing)); background: #8e3a22; clip-path: polygon(50% 0, 98% 48%, 68% 42%, 68% 92%, 32% 92%, 32% 42%, 2% 48%); }
@media (min-width: 1000px) {
  .thermometer { flex-basis: 1.8rem; height: 4.5rem; }
  .mini-compass { flex-basis: 3.4rem; height: 3.4rem; }
}
@media (max-width: 420px) {
  .temperature-display { gap: .32rem; }
  .temperature-display .value { font-size: clamp(1.65rem, 7.4vw, 2.45rem); }
  .wind-display .air-aqi strong { font-size: 2rem; }
  .wind-display .air-aqi span { font-size: .76rem; }
}


@media (max-width: 600px) {
  .now-actions {
    grid-template-columns: minmax(0, 1fr) minmax(0, .95fr) minmax(0, 1fr);
    gap: .4rem;
    font-size: .82rem;
  }
  .now-actions #listen { padding: .32rem .24rem; line-height: 1.2; }
  .now-actions .air-source { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 0; }
  .now-actions .air-source:last-child { justify-self: stretch; }
  .now-actions .air-symbol { width: 1.65rem; height: 1.65rem; }
  .now-actions #fineParticles { font-size: .75rem; }
}


@media (max-width: 460px) {
  .readings { column-gap: .45rem; }
  .readings .reading-label { font-size: clamp(.65rem, 3.2vw, .74rem); letter-spacing: .025em; }
  .readings .air-reading { padding-left: .45rem; }
  .readings .temperature-display { flex-wrap: wrap; }
  .readings .thermometer { flex-basis: .95rem; height: 2.65rem; }
  .wind-metric { padding-inline: .2rem; }
  .wind-display { flex-wrap: wrap; gap: .1rem .25rem; }
  .wind-display .mini-compass { flex-basis: 1.95rem; height: 1.95rem; }
  .air-reading .muted { font-size: .71rem; }
}
