/* Use-cases page: only what sits inside this page's own visuals. */

/* a phone and a tablet: the kit sets the words in the page's own colours under the photograph, but its
   data-box="none" data-tone="dark" rule is more specific and keeps them white; restate the kit's own values */
@media (max-width: 1023px) {
  .hero--photo[data-box="none"][data-tone="dark"] { --ink: var(--p-ink); --muted: var(--p-muted); --line: color-mix(in oklab, var(--p-ink) 11%, transparent); --line-strong: color-mix(in oklab, var(--p-ink) 20%, transparent); color: var(--p-ink); }
}

/* deployments: the six kinds of site as rows, the sensor and its sites as a diagram beside them */
#deployments .rows, #levers .rows { align-self: start; }
#deployments .rows > li, #levers .rows > li { padding-block: var(--s-3); }
#deployments .rows > li:first-child, #levers .rows > li:first-child { padding-top: 0; }
#deployments .rows > li > p, #levers .rows > li > p { grid-row: 2; }
.dep__panel { --p-h: 440px; padding: 0; overflow: hidden; border-radius: var(--r-lg); }
.dep__panel .dg { width: 100%; height: 100%; min-height: var(--p-h); }

/* examples: the five types of water, one photograph each (the kit's peek list); the frame keeps to the photograph's own proportions */
@media (min-width: 1280px) { #examples .frame--photo { height: 440px; align-self: start; } }
@media (max-width: 1279px) {
  #examples .grid.fill { display: flex; flex-direction: column; gap: var(--s-6); }
  #examples .frame--photo { flex: none; width: 100%; height: auto; aspect-ratio: 16 / 10; min-height: 0; }
}

/* value levers: a reading that drifts, drawn as a small monitoring card on a panel */
.drift__panel { --p-h: 440px; display: grid; place-items: center; padding: var(--s-6); border-radius: var(--r-lg); }
.drift { width: 100%; padding: var(--s-5); display: grid; gap: var(--s-4); color: var(--u-ink); font-size: var(--t-body); }
.drift__axis { margin: 0; font-weight: 500; }
.drift__plot { position: relative; aspect-ratio: 560 / 280; }
.drift__plot svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; }
.drift__limit { stroke: var(--alert); stroke-width: 1.5; stroke-dasharray: 5 6; }
.drift__line { fill: none; stroke: var(--u-ink); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.drift__sample { fill: var(--u-bg); stroke: var(--u-ink); stroke-width: 2; }
.drift__flagline { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 3 4; }
.drift__flagring { fill: none; stroke: var(--accent); stroke-width: 1.5; }
.drift__flagdot { fill: var(--accent); }
.drift__tag { position: absolute; padding: 2px var(--s-2); background: var(--u-bg); border-radius: var(--r-sm); font-size: var(--t-small); line-height: 1.4; white-space: nowrap; }
.drift__tag--limit { right: 0; top: 25%; transform: translateY(calc(-100% - 6px)); }
.drift__tag--flag { transform: translate(-50%, calc(-100% - 22px)); font-weight: 500; }
.drift__legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); }
.drift__legend li { display: inline-flex; align-items: center; gap: var(--s-2); }
.drift__k { display: inline-block; flex: none; }
.drift__k--line { width: 20px; height: 0; border-top: 2.5px solid var(--u-ink); }
.drift__k--sample { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--u-ink); background: var(--u-bg); }

/* the method: one link under the four steps */
.method__link { margin-top: var(--s-6); }

/* a tablet: the sections that grow past one screen when stacked take two */
@media (min-width: 640px) and (max-width: 1023px) {
  #deployments, #examples, #levers, #method { --h: 2; }
  .problem__photo { aspect-ratio: 16 / 9; }
}

@media (max-width: 639px) {
  .hero--photo { --photo: 36svh; }
  .dep__panel { --p-h: 190px; }
  .problem__photo { aspect-ratio: 16 / 6; }
  .drift__panel { --p-h: 0px; padding: var(--s-3); }
  .drift { padding: var(--s-4); }
  /* the names alone, two across, so a short word never leaves a hole beside it */
  #deployments .rows, #levers .rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--s-5); }
  #deployments .rows > li:nth-child(2), #levers .rows > li:nth-child(2) { padding-top: 0; }
  #deployments .rows > li:nth-last-child(-n+2), #levers .rows > li:nth-last-child(-n+2) { border-bottom: 0; }
}

#method { --padt: 80px; }
