/* The window is the reading surface; Toasty sits in the room in front of it. */
:root {
  --window-ink: #2d1701;
  --window-paper: #fffdf7;
}

html { min-width: 280px; }
body { background: var(--window-paper); color: var(--window-ink); }
.page { width: 100%; max-width: 1000px; padding: 0 36px; }
header { height: 74px; }
header .edition { margin-right: auto; font-size: 12px; }
header .icon-button { flex: 0 0 30px; }
.intro { padding: 32px 0 16px; }
.intro .eyebrow { font-size: 14px; letter-spacing: 1.8px; }
.intro h1 {
  margin: 12px 0 0;
  font-size: clamp(43px, 7.2vw, 82px);
  line-height: 1.08;
  letter-spacing: -2.5px;
}

/* Override the previous full-card AQI colors in every live/demo state. */
body .checker,
body[data-tone] .checker,
body[data-level] .checker,
body[data-state] .checker {
  padding: 0 0 22px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  color: var(--window-ink);
}
.region-row { margin: 0 0 22px; gap: 8px; }
.region-row select {
  max-width: 100%;
  padding: 6px 30px 6px 12px;
  border: 0;
  border-bottom: 1px solid #2d170133;
  border-radius: 0;
  background: transparent;
  color: var(--window-ink);
  font-size: 20px;
  line-height: 1.5;
  text-align: center;
}

.air-window {
  --haze-opacity: 0;
  position: relative;
  isolation: isolate;
  min-width: 0;
  min-height: 390px;
  aspect-ratio: 1.74;
  border: 19px solid #fff;
  outline: 1px solid #bcbab5;
  border-radius: 0;
  background: #e7e4d9;
  box-shadow: 0 12px 18px #2d170124, 0 2px 4px #2d17010d;
}
.air-window::before {
  position: absolute;
  z-index: 3;
  top: 22px;
  bottom: 22px;
  left: calc(50% - 1px);
  width: 2px;
  background: #ffffffbd;
  content: "";
  pointer-events: none;
}
.air-window::after {
  position: absolute;
  z-index: 5;
  inset: 0;
  border-top: 4px solid #928f83;
  border-left: 4px solid #a5a194;
  border-right: 1px solid #d3d0c7;
  border-bottom: 1px solid #e8e6df;
  content: "";
  pointer-events: none;
}
.scene-layer,
.haze-layer,
.glass-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.scene-layer {
  z-index: 0;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}
#air-window[data-scene="central"] .scene-layer {
  background-image: url("assets/central-scene-v1.jpg");
  background-size: 100% auto;
  background-position: center 51%;
}
#air-window[data-scene="neutral"] .scene-layer { background-image: none; }
.haze-layer {
  z-index: 1;
  background: #ada595;
  opacity: var(--haze-opacity, 0);
  transition: opacity 450ms ease;
}
.glass-layer { z-index: 2; background: rgb(255 255 255 / 20%); }
.air-window .reading {
  position: relative;
  z-index: 3;
  width: 100%;
  min-height: inherit;
  padding: 38px 0 85px;
  text-align: center;
  color: var(--window-ink);
}
.air-window .metrics-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
  width: 100%;
  max-width: none;
  margin: 0;
  text-align: center;
}
.air-window .metric-panel { min-width: 0; padding: 18px 22px 22px; }
.air-window .metric-panel + .metric-panel { border-left: 0; }
.air-window .metric-label {
  min-height: 26px;
  font-size: clamp(11px, 1.65vw, 17px);
  letter-spacing: 0;
  line-height: 1.5;
}
.air-window .metric-subtitle { margin-top: 2px; font-size: 10px; line-height: 1.5; }
.air-window .info { vertical-align: 1px; }
.air-window .number-line { justify-content: center; margin-top: 15px; gap: 5px; }
.air-window #pm-number,
.air-window #psi-main-number {
  font: 600 clamp(66px, 9.5vw, 112px)/1 Fraunces, Georgia, serif;
  letter-spacing: -4px;
}
.air-window .metric-panel .band {
  max-width: 100%;
  min-height: 0;
  margin-top: 15px;
  padding: 7px 12px;
  border: 0;
  border-radius: 10px;
  font: 600 clamp(13px, 2vw, 22px)/1.25 Fraunces, Georgia, serif;
  overflow-wrap: anywhere;
}
.air-window .metric-panel .psi-badge { border: 0 !important; }
.air-window .metric-panel .timestamp,
.air-window .metric-method,
.air-window .method {
  margin: 13px 0 0;
  color: var(--window-ink);
  font-size: 10px;
  line-height: 1.5;
}
.air-window #scene-note {
  position: absolute;
  z-index: 4;
  right: 12px;
  bottom: 12px;
  left: 12px;
  margin: 0;
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
}

/* The character can overlap the bottom frame, never the readings. */
.interior {
  position: relative;
  z-index: 6;
  display: grid;
  grid-template-columns: minmax(0, 46%) minmax(0, 54%);
  grid-template-rows: auto 1fr;
  min-height: 360px;
  margin-bottom: 6px;
}
.interior .character-scene {
  grid-column: 1;
  grid-row: 1 / 3;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  align-self: start;
  min-width: 0;
  min-height: 0;
  margin: -100px -20px 0 -17px;
  pointer-events: none;
}
.interior .character-scene img {
  display: block;
  width: 100%;
  max-width: 470px;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  animation: none;
  transform: none;
  filter: none;
}
.interior .shadow { display: none; }
.window-notes {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  padding: 12px 1px 0 10px;
  color: var(--window-ink);
  font-size: 11px;
  line-height: 1.7;
  text-align: right;
  overflow-wrap: anywhere;
}
.window-notes p,
.window-notes .timestamp { margin: 0; color: inherit; font-size: inherit; line-height: inherit; }
.window-notes #shared-time { white-space: pre-line; }
.window-notes #scene-note { margin-top: 5px; font-size: 10px; }
.brand-signoff {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  min-width: 0;
  padding: 25px 1px 14px 10px;
  font-size: 16px;
  line-height: 1.8;
  text-align: right;
}
.brand-signoff .brand-logo { margin: 0 0 24px; }
.brand-signoff #brand-logo {
  display: block;
  width: 125px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}
.brand-signoff > #brand-logo { margin-bottom: 24px; }
.brand-signoff p { margin: 0; font-size: inherit; line-height: inherit; }
.brand-signoff a { max-width: 100%; text-decoration-thickness: 1px; }
.brand-signoff .signoff-lines { margin: 0; }
.checker > .notice { position: relative; margin-top: 18px; }
.checker > .actions { position: relative; margin-top: 20px; flex-wrap: wrap; }
.checker > .action-status { overflow-wrap: anywhere; }
.checker .primary { color: var(--window-paper); }
.checker .secondary { color: var(--window-ink); border-color: var(--window-ink); }
footer { padding-top: 8px; }

@media (max-width: 750px) {
  .page { padding: 0 24px; }
  .intro h1 { font-size: clamp(43px, 8.7vw, 68px); }
  .air-window { min-height: 330px; border-width: 14px; }
  .air-window .reading { padding-top: 28px; padding-bottom: 73px; }
  .air-window .metric-panel { padding: 12px 15px 18px; }
  .air-window .metric-label { font-size: 12px; }
  .air-window #pm-number,
  .air-window #psi-main-number { font-size: clamp(64px, 11.5vw, 88px); }
  .interior { min-height: 300px; }
  .interior .character-scene { margin: -75px -12px 0 -12px; }
  .window-notes { font-size: 10px; }
  .brand-signoff { font-size: 13px; padding-top: 20px; }
  .brand-signoff #brand-logo { width: 103px; }
  .brand-signoff .brand-logo,
  .brand-signoff > #brand-logo { margin-bottom: 18px; }
}

@media (max-width: 480px) {
  .page { padding: 0 16px; }
  header { height: 59px; }
  header .edition { font-size: 11px; }
  .intro { padding: 24px 0 13px; }
  .intro .eyebrow { font-size: 12px; letter-spacing: 1.3px; }
  .intro h1 { margin-top: 9px; font-size: clamp(35px, 10.7vw, 49px); letter-spacing: -1.6px; }
  .region-row { margin-bottom: 17px; }
  .region-row select { font-size: 16px; padding-top: 3px; padding-bottom: 4px; }
  .air-window { min-height: 265px; aspect-ratio: auto; border-width: 10px; }
  .air-window::before { top: 16px; bottom: 18px; }
  .air-window::after { border-top-width: 3px; border-left-width: 3px; }
  .air-window .reading { min-height: 245px; padding: 24px 0 58px; }
  .air-window .metric-panel { padding: 3px 9px 12px; }
  .air-window .metric-label { min-height: 32px; font-size: 10px; line-height: 1.45; }
  .air-window .metric-subtitle { font-size: 9px; }
  .air-window .info { width: 15px; height: 15px; margin-left: 2px; font-size: 10px; }
  .air-window .number-line { margin-top: 11px; }
  .air-window #pm-number,
  .air-window #psi-main-number { font-size: clamp(51px, 15vw, 67px); letter-spacing: -2.5px; }
  .air-window .metric-panel .band { margin-top: 10px; padding: 6px 8px; border-radius: 7px; font-size: 13px; }
  .air-window .metric-panel .timestamp,
  .air-window .metric-method,
  .air-window .method { margin-top: 10px; font-size: 9px; }
  .air-window #scene-note { right: 8px; bottom: 9px; left: 8px; font-size: 9px; }
  .interior { grid-template-columns: minmax(0, 45%) minmax(0, 55%); min-height: 285px; }
  .interior .character-scene { margin: -50px -7px 0 -10px; }
  .window-notes { padding: 10px 0 0 5px; font-size: 10px; line-height: 1.65; }
  .window-notes #scene-note { font-size: 9px; }
  .brand-signoff { padding: 15px 0 5px 5px; font-size: 10.5px; line-height: 1.85; }
  .brand-signoff #brand-logo { width: 84px; }
  .brand-signoff .brand-logo,
  .brand-signoff > #brand-logo { margin-bottom: 14px; }
  .checker > .actions { margin-top: 22px; gap: 8px; }
  .primary,
  .secondary { min-height: 44px; padding: 10px 15px; font-size: 10px; }
  .all-regions > div:first-child { align-items: flex-end; }
  .all-regions > div > span { max-width: 120px; text-align: right; }
  .all-regions h2 { font-size: 20px; }
  .region-cards { gap: 5px; }
  .region-card { min-width: 0; }
  .region-card small { overflow-wrap: anywhere; }
}

@media (max-width: 350px) {
  .page { padding: 0 12px; }
  .intro h1 { font-size: 34px; letter-spacing: -1.5px; }
  .air-window { border-width: 8px; }
  .air-window .metric-panel { padding-right: 6px; padding-left: 6px; }
  .air-window .metric-label { font-size: 9px; }
  .air-window .metric-panel .band { padding-right: 6px; padding-left: 6px; font-size: 12px; }
  .interior { min-height: 300px; }
  .window-notes { font-size: 9px; }
  .brand-signoff { font-size: 9.5px; }
  .brand-signoff #brand-logo { width: 75px; }
  .primary,
  .secondary { padding-right: 12px; padding-left: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .haze-layer { transition: none; }
}

/* Combined location/date, with a readable wrap on small screens. */
.region-row { display:flex; justify-content:center; flex-wrap:wrap; align-items:baseline; gap:0 6px; }
.region-row select { font-size:clamp(22px,3.1vw,30px); padding-left:0; }
#region-time { font-size:clamp(18px,2.6vw,25px); line-height:1.5; }
.brand-signoff > #brand-logo { margin-bottom:8px; }
@media(max-width:480px){.region-row select{font-size:22px}.region-row{row-gap:2px}#region-time{font-size:18px}}

/* Balance the room and centre the entire pair of reading groups. */
.air-window .reading { display:flex; align-items:center; padding:24px 0; }
.air-window .metrics-pair { align-items:center; }
.air-window .metric-panel { padding-top:0; padding-bottom:0; }
.brand-signoff > #brand-logo { margin-bottom:12px; }
.brand-signoff { padding-bottom:0; }
.intro { padding-top:40px; }
@media(max-width:480px){.intro{padding-top:24px}.air-window .reading{padding:20px 0}.brand-signoff > #brand-logo{margin-bottom:10px}}

/* All approved regional views share the same crop and artistic haze treatment. */
#air-window[data-scene] .scene-layer { background-size:100% auto; background-position:center 51%; }
#air-window[data-scene="north"] .scene-layer { background-image:url("assets/north-scene-v1.jpg"); background-position:center 45%; }
#air-window[data-scene="south"] .scene-layer { background-image:url("assets/south-scene-v1.jpg"); }
#air-window[data-scene="east"] .scene-layer { background-image:url("assets/east-scene-v1.jpg"); }
#air-window[data-scene="west"] .scene-layer { background-image:url("assets/west-scene-v1.jpg"); }
@media(prefers-reduced-motion:reduce){.haze-layer{transition:none}}

#pm-band { white-space:pre-line; }

/* Landscape North reference fills tall phone windows without stretching. */
#air-window[data-scene="north"] .scene-layer { background-size:cover; }

/* Supplied looking-out pose: preserve transparent source pixels and visible anchor. */
body[data-character-pose="window-centred"] .interior { grid-template-columns:minmax(0,60%) minmax(0,40%); }
body[data-character-pose="window-centred"] .interior .character-scene { position:relative;grid-column:1/-1;grid-row:1;width:55%;max-width:500px;aspect-ratio:445/416;margin:clamp(-190px,-18vw,-100px) auto 0;overflow:hidden; }
body[data-character-pose="window-centred"] .interior .character-scene img { position:absolute;width:230.112%;max-width:none;left:-68.315%;top:-114.904%;height:auto; }
body[data-character-pose="window-centred"] .window-notes { grid-column:1;grid-row:2;text-align:left;padding:18px 8px 0 0; }
body[data-character-pose="window-centred"] .brand-signoff {grid-column:2;grid-row:2;}
@media(max-width:480px){body[data-character-pose="window-centred"] .window-notes{font-size:9px}body[data-character-pose="window-centred"] .brand-signoff{font-size:10px}}
/* Phone/tablet reading badges remain entirely above the foreground pose. */
@media(max-width:750px){body[data-character-pose="window-centred"] .interior .character-scene{margin-top:-50px;}}

/* Original APNG moves across its canvas: reserve its entire motion bounds. */
body[data-character-motion="animated"] .interior .character-scene {width:79.2%;max-width:720px;aspect-ratio:641/568;margin-top:-170px;}
body[data-character-motion="animated"] .interior .character-scene img {width:159.751%;left:-18.253%;top:-75%;}
@media(max-width:750px){body[data-character-motion="animated"] .interior .character-scene{margin-top:-50px;}}
