/* ==========================================================================
   TrueFlow Arizona — public site
   --------------------------------------------------------------------------
   Design system: "liquid glass on light water"
   A pale canvas with large soft color fields drifting in a fixed layer
   behind the page. Every glass surface blurs that layer with
   backdrop-filter, so glass genuinely refracts moving color.

   Signature moments:
   · hero water surface — a live ripple simulation (canvas, script.js)
   · specular highlight that follows the cursor across glass panels
   · nav pill that morphs open into the menu
   · "clarity lens" on the community map (blurred art, sharp under lens)
   · flowline — scroll progress as a droplet running down a hairline

   Brand: navy #1f2150 · gold #b8932f · grey / white · black text
   Type:  Georgia (serif) display, system sans body
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --navy: #1f2150;
  --navy-soft: #34376e;
  --teal: #2a6f8f;
  --aqua: #7db8c9;
  --gold: #b8932f;
  --gold-deep: #96761f;
  --ink: #16172b;
  --grey: #5c5f6e;
  --hairline: rgba(31, 33, 80, 0.12);
  --canvas: #f3f4f6;
  --error: #b3372a;

  /* per-parameter safety indicators (results readings) */
  --status-green: #3e8a5f;
  --status-amber: #b87d18;
  --status-red: #c0392b;

  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --r-lg: 32px;
  --r-md: 22px;
  --r-pill: 999px;

  --ease: cubic-bezier(0.32, 0.72, 0.25, 1);

  --measure: 1120px;
}

/* ---------- Reset & base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--canvas);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

/* The [hidden] attribute must always win, even over elements that set
   their own display (e.g. .state--loading uses display:flex). */
[hidden] {
  display: none !important;
}

a {
  color: inherit;
}

em {
  font-family: var(--serif);
}

section[id] {
  scroll-margin-top: 96px;
}

/* ==========================================================================
   Ambient backdrop — the color the glass refracts
   ========================================================================== */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    linear-gradient(180deg, #eef1f4 0%, #f4f5f7 30%, #eff2f4 70%, #e9edf1 100%);
}

.backdrop__orb {
  position: absolute;
  border-radius: 50%;
}

/* Page content sits above the fixed backdrop layer */
main,
.footer {
  position: relative;
  z-index: 1;
}

.backdrop__orb--navy {
  width: 62vmax; height: 62vmax;
  top: -24vmax; left: -18vmax;
  background: radial-gradient(circle at 45% 45%, rgba(31, 33, 80, 0.34), rgba(31, 33, 80, 0) 62%);
  animation: orb-a 46s ease-in-out infinite alternate;
}

.backdrop__orb--teal {
  width: 56vmax; height: 56vmax;
  top: 18vmax; right: -22vmax;
  background: radial-gradient(circle at 55% 45%, rgba(42, 111, 143, 0.38), rgba(42, 111, 143, 0) 62%);
  animation: orb-b 54s ease-in-out infinite alternate;
}

.backdrop__orb--gold {
  width: 44vmax; height: 44vmax;
  bottom: -14vmax; left: 8vmax;
  background: radial-gradient(circle at 50% 50%, rgba(184, 147, 47, 0.28), rgba(184, 147, 47, 0) 60%);
  animation: orb-c 60s ease-in-out infinite alternate;
}

.backdrop__orb--aqua {
  width: 36vmax; height: 36vmax;
  top: 46%; left: 32%;
  background: radial-gradient(circle at 50% 50%, rgba(125, 184, 201, 0.32), rgba(125, 184, 201, 0) 62%);
  animation: orb-d 40s ease-in-out infinite alternate;
}

@keyframes orb-a { to { transform: translate(9vmax, 7vmax) scale(1.08); } }
@keyframes orb-b { to { transform: translate(-8vmax, -6vmax) scale(1.12); } }
@keyframes orb-c { to { transform: translate(7vmax, -5vmax) scale(0.94); } }
@keyframes orb-d { to { transform: translate(-6vmax, 8vmax) scale(1.1); } }

/* ==========================================================================
   Glass — the shared material
   Solid translucent fallback first; @supports upgrades to true glass.
   ::before = fixed top-left sheen. ::after = specular highlight that
   follows the cursor (position vars set in script.js).
   ========================================================================== */
.glass {
  position: relative;
  background: rgba(255, 255, 255, 0.82);
  border-radius: var(--r-lg);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 24px 60px -20px rgba(31, 33, 80, 0.22),
    0 4px 14px rgba(31, 33, 80, 0.06);
}

.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(125deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 38%);
  pointer-events: none;
}

/* Cursor-following specular light (only shown on hover-capable devices) */
.glass::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s var(--ease);
  background: radial-gradient(
    260px circle at var(--gx, 50%) var(--gy, 20%),
    rgba(255, 255, 255, 0.55),
    rgba(255, 255, 255, 0) 62%
  );
}

@media (hover: hover) and (pointer: fine) {
  .glass:hover::after {
    opacity: 1;
  }
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass {
    /* more see-through: lower tint, a touch more blur + saturation so
       the moving color behind still reads as refracted glass */
    background: rgba(255, 255, 255, 0.28);
    -webkit-backdrop-filter: blur(30px) saturate(1.9);
    backdrop-filter: blur(30px) saturate(1.9);
  }
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.button {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  border: none;
  cursor: pointer;
  border-radius: var(--r-pill);
  padding: 0.85rem 1.9rem;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background-color 0.3s var(--ease);
}

.button:hover {
  transform: translateY(-1px) scale(1.015);
}

.button:active {
  transform: scale(0.98);
}

.button--solid {
  background: var(--navy);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 10px 24px -8px rgba(31, 33, 80, 0.5);
}

.button--solid:hover {
  background: var(--navy-soft);
}

.button--glass {
  color: var(--navy);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 8px 20px -8px rgba(31, 33, 80, 0.25);
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .button--glass {
    background: rgba(255, 255, 255, 0.28);
    -webkit-backdrop-filter: blur(16px) saturate(1.7);
    backdrop-filter: blur(16px) saturate(1.7);
  }
}

.button--big {
  font-size: 1.05rem;
  padding: 1rem 2.4rem;
}

.button--sm {
  font-size: 0.85rem;
  padding: 0.58rem 1.15rem;
}

/* ==========================================================================
   Flowline — scroll progress droplet (desktop only)
   --p (0..1) is set by script.js on scroll.
   ========================================================================== */
.flowline {
  position: fixed;
  top: 110px;
  bottom: 60px;
  right: 26px;
  width: 12px;
  z-index: 50;
  --p: 0;
}

.flowline__track {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: var(--hairline);
}

/* the part of the line the drop has already travelled */
.flowline__fill {
  position: absolute;
  top: 0;
  left: 50%;
  width: 1px;
  height: calc(var(--p) * 100%);
  background: linear-gradient(180deg, rgba(184, 147, 47, 0.15), var(--gold));
}

.flowline__drop {
  position: absolute;
  left: 50%;
  top: calc(var(--p) * (100% - 14px));
  width: 9px;
  height: 13px;
  margin-left: -4.5px;
  background: var(--gold);
  border-radius: 50% 50% 50% 50% / 38% 38% 62% 62%;
  box-shadow: 0 2px 6px rgba(150, 118, 31, 0.5);
}

@media (max-width: 999px) {
  .flowline {
    display: none;
  }
}

/* ==========================================================================
   Navigation — one glass pill that morphs open
   ========================================================================== */
.nav {
  position: fixed;
  top: 14px;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.nav__pill {
  pointer-events: auto;
  width: min(400px, calc(100vw - 28px));
  padding: 0.45rem 0.55rem;
  border-radius: 28px;
  overflow: hidden;
  /* glass material (fallback first) */
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 12px 32px -10px rgba(31, 33, 80, 0.3);
  transition: box-shadow 0.4s var(--ease);
}

.nav__pill.is-open {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 24px 56px -12px rgba(31, 33, 80, 0.42);
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .nav__pill {
    background: rgba(255, 255, 255, 0.38);
    -webkit-backdrop-filter: blur(24px) saturate(1.9);
    backdrop-filter: blur(24px) saturate(1.9);
  }
}

.nav__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  padding-left: 0.45rem;
}

.nav__mark {
  height: 26px;
  width: auto;
}

.nav__wordmark {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  color: var(--navy);
  white-space: nowrap;
}

.nav__wordmark em {
  font-style: italic;
  font-weight: 400;
  color: var(--gold-deep);
}

/* Hamburger */
.nav__toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4.5px;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(31, 33, 80, 0.06);
  cursor: pointer;
  transition: background-color 0.25s var(--ease);
}

.nav__toggle:hover {
  background: rgba(31, 33, 80, 0.12);
}

.nav__toggle-line {
  display: block;
  width: 16px;
  height: 1.8px;
  border-radius: 2px;
  background: var(--navy);
  transition: transform 0.32s var(--ease), opacity 0.32s var(--ease);
}

.nav__toggle[aria-expanded="true"] .nav__toggle-line:nth-child(1) {
  transform: translateY(6.3px) rotate(45deg);
}
.nav__toggle[aria-expanded="true"] .nav__toggle-line:nth-child(2) {
  opacity: 0;
}
.nav__toggle[aria-expanded="true"] .nav__toggle-line:nth-child(3) {
  transform: translateY(-6.3px) rotate(-45deg);
}

/* Menu — lives inside the pill; opening expands the pill itself */
.nav__menu {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-4px);
  transition:
    max-height 0.45s var(--ease),
    opacity 0.35s var(--ease),
    transform 0.45s var(--ease);
}

.nav__pill.is-open .nav__menu {
  max-height: 320px;
  opacity: 1;
  transform: translateY(0);
}

.nav__link {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  font-family: var(--serif);
  font-size: 1.08rem;
  color: var(--navy);
  text-decoration: none;
  padding: 0.72rem 0.9rem;
  border-radius: 16px;
  transition: background-color 0.2s var(--ease);
}

.nav__link:first-child {
  margin-top: 0.5rem;
}

.nav__link:hover {
  background: rgba(31, 33, 80, 0.07);
}

.nav__link-n {
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--gold-deep);
}

/* ==========================================================================
   Shared: section index label — "01 ——— About"
   ========================================================================== */
.index {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--grey);
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.index__n {
  color: var(--gold-deep);
}

.index__rule {
  width: 44px;
  height: 1px;
  background: var(--hairline);
}

/* ==========================================================================
   Layout shells
   ========================================================================== */
.about,
.results,
.map,
.schedule {
  width: min(var(--measure), 90%);
  margin-inline: auto;
  padding: clamp(4rem, 9vw, 7rem) 0;
}

/* ==========================================================================
   Hero — full-bleed so the water surface spans the whole viewport
   ========================================================================== */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 90px;
  overflow: hidden;
}

/* The living water surface (ripple simulation, script.js) */
.hero__water {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  filter: blur(1.2px); /* soften the low-res simulation grid */
}

.hero__inner {
  position: relative;
  width: min(var(--measure), 90%);
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
}

.hero__kicker {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 1.4rem;
}

.hero__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3rem, 7.5vw, 5.4rem);
  line-height: 1.04;
  letter-spacing: -0.015em;
  color: var(--navy);
  margin-bottom: 1.5rem;
}

.hero__title em {
  font-style: italic;
  color: var(--gold-deep);
}

/* "water." — light moving through it, like sun through a glass */
.shimmer {
  background: linear-gradient(
    100deg,
    var(--navy) 30%,
    var(--teal) 46%,
    #5d9cb8 50%,
    var(--teal) 54%,
    var(--navy) 70%
  );
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: shimmer-sweep 9s linear infinite;
}

@keyframes shimmer-sweep {
  from { background-position: 120% 0; }
  to   { background-position: -180% 0; }
}

.hero__line {
  font-size: clamp(1.02rem, 1.9vw, 1.16rem);
  color: var(--grey);
  max-width: 30rem;
  margin-bottom: 2.2rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

/* Entrance: the hero condenses into focus, once, on load */
.hero__kicker  { animation: rise-in 0.9s var(--ease) 0.10s both; }
.hero__title   { animation: rise-in 0.9s var(--ease) 0.22s both; }
.hero__line    { animation: rise-in 0.9s var(--ease) 0.36s both; }
.hero__actions { animation: rise-in 0.9s var(--ease) 0.50s both; }

@keyframes rise-in {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* The lens: a glass circle the droplet floats in */
.hero__lens-wrap {
  display: flex;
  justify-content: center;
}

.hero__lens {
  width: clamp(240px, 30vw, 360px);
  aspect-ratio: 1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation:
    condense 1.4s var(--ease) both,
    lens-float 9s ease-in-out 1.4s infinite alternate;
}

@keyframes condense {
  from { opacity: 0; transform: scale(1.06); filter: blur(10px); }
  to   { opacity: 1; transform: scale(1); filter: blur(0); }
}

@keyframes lens-float {
  from { transform: translateY(-8px); }
  to   { transform: translateY(10px); }
}

.hero__mark {
  width: 42%;
  height: auto;
  filter: drop-shadow(0 14px 22px rgba(31, 33, 80, 0.25));
}

/* Whisper under the water: invite people to touch it */
.hero__hint {
  position: absolute;
  bottom: 30px;
  left: 5vw;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.88rem;
  color: rgba(31, 33, 80, 0.4);
  animation: rise-in 1.2s var(--ease) 1.6s both;
}

/* Scroll cue: droplet slides down a hairline */
.hero__cue {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 16px;
}

.hero__cue-track {
  display: block;
  width: 1px;
  height: 52px;
  background: var(--hairline);
  position: relative;
  overflow: hidden;
}

.hero__cue-drop {
  position: absolute;
  left: -2.5px;
  top: -8px;
  width: 6px;
  height: 8px;
  border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
  background: var(--gold);
  animation: cue-fall 2.6s var(--ease) infinite;
}

@keyframes cue-fall {
  0%   { transform: translateY(0);    opacity: 0; }
  15%  { opacity: 1; }
  75%  { opacity: 1; }
  100% { transform: translateY(62px); opacity: 0; }
}

/* ==========================================================================
   01 · About
   ========================================================================== */
.about__split {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
  margin-bottom: clamp(3rem, 6vw, 4.5rem);
}

.about__manifesto p {
  font-family: var(--serif);
  font-size: clamp(1.45rem, 3vw, 2.05rem);
  line-height: 1.42;
  color: var(--ink);
}

.about__manifesto em {
  font-style: italic;
  color: var(--gold-deep);
}

.about__facts {
  padding: 1.9rem 1.8rem;
  display: flex;
  flex-direction: column;
}

.fact {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 1.05rem 0;
}

.fact + .fact {
  border-top: 1px solid var(--hairline);
}

.fact__figure {
  font-family: var(--serif);
  font-size: 2rem;
  line-height: 1.1;
  color: var(--navy);
}

.fact__unit {
  font-size: 1.1rem;
  margin-left: 0.2rem;
  color: var(--grey);
}

.fact__caption {
  font-size: 0.88rem;
  color: var(--grey);
}

/* How it works: one glass strip divided by hairlines */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 0;
  overflow: hidden;
}

.steps__item {
  padding: clamp(1.6rem, 3vw, 2.4rem);
  position: relative;
}

.steps__item + .steps__item {
  border-left: 1px solid var(--hairline);
}

.steps__n {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--gold-deep);
}

.steps__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.35rem;
  color: var(--navy);
  margin: 0.5rem 0 0.55rem;
}

.steps__text {
  font-size: 0.94rem;
  color: var(--grey);
}

/* ==========================================================================
   02 · Results
   ========================================================================== */
.results__panel {
  padding: clamp(1.8rem, 4.5vw, 3.2rem);
}

.results__head {
  margin-bottom: 2rem;
  max-width: 34rem;
}

.results__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  color: var(--navy);
  margin-bottom: 0.7rem;
}

.results__sub {
  color: var(--grey);
}

.code-sample {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.92em;
  letter-spacing: 0.06em;
  color: var(--navy);
  background: rgba(31, 33, 80, 0.07);
  border-radius: 6px;
  padding: 0.1em 0.45em;
  white-space: nowrap;
}

.lookup__label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--grey);
  margin-bottom: 0.6rem;
}

.lookup__row {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.lookup__input {
  flex: 1 1 220px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 1.2rem;
  letter-spacing: 0.14em;
  color: var(--ink);
  padding: 0.82rem 1.1rem;
  border-radius: 16px;
  border: 1px solid rgba(31, 33, 80, 0.18);
  background: rgba(255, 255, 255, 0.75);
  box-shadow: inset 0 1px 3px rgba(31, 33, 80, 0.06);
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.lookup__input::placeholder {
  color: rgba(31, 33, 80, 0.3);
}

.lookup__input:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 4px rgba(31, 33, 80, 0.12);
}

.lookup__input.is-invalid {
  border-color: var(--error);
}

.lookup__error {
  color: var(--error);
  font-size: 0.93rem;
  margin-top: 0.8rem;
}

/* Result states */
.state {
  margin-top: 2.2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--hairline);
  animation: state-in 0.5s var(--ease) both;
}

@keyframes state-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.state__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.45rem;
  color: var(--navy);
  margin-bottom: 0.5rem;
}

.state__text {
  color: var(--grey);
  max-width: 36rem;
}

.state__meta-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.4rem;
}

.state__meta {
  font-size: 0.85rem;
  color: var(--grey);
  font-variant-numeric: tabular-nums;
}

/* Readings table */
.readings {
  list-style: none;
  margin-bottom: 2rem;
}

.readings__row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 0.2rem;
  /* rows cascade in one after another (delay set inline by JS) */
  animation: state-in 0.5s var(--ease) both;
}

.readings__row + .readings__row {
  border-top: 1px solid var(--hairline);
}

/* Colored safety indicator, set per-parameter from the API status.
   green → Normal · yellow → Elevated · red → Action recommended ·
   neutral → informational (blank status, no threshold). */
.readings__dot {
  flex: 0 0 10px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  align-self: center;
  background: rgba(31, 33, 80, 0.12);
  border: 1px solid rgba(31, 33, 80, 0.18);
}

.readings__dot--green {
  background: var(--status-green);
  border-color: rgba(62, 138, 95, 0.55);
  box-shadow: 0 0 0 3px rgba(62, 138, 95, 0.14);
}

.readings__dot--yellow {
  background: var(--status-amber);
  border-color: rgba(184, 125, 24, 0.55);
  box-shadow: 0 0 0 3px rgba(184, 125, 24, 0.14);
}

.readings__dot--red {
  background: var(--status-red);
  border-color: rgba(192, 57, 43, 0.55);
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.14);
}

.readings__dot--neutral {
  background: rgba(31, 33, 80, 0.12);
  border-color: rgba(31, 33, 80, 0.18);
}

.readings__name {
  flex: 1;
  font-family: var(--serif);
  font-size: 1.06rem;
  color: var(--ink);
}

.readings__dots {
  flex: 1 1 40px;
  align-self: center;
  border-bottom: 1px dotted rgba(31, 33, 80, 0.25);
}

/* right column: value on top, status label beneath */
.readings__reading {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  text-align: right;
}

.readings__value {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--navy);
  white-space: nowrap;
}

.readings__status {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.25;
  color: var(--grey);
  max-width: 13rem;
}

.readings__status--green  { color: var(--status-green); }
.readings__status--yellow { color: var(--status-amber); }
.readings__status--red    { color: var(--status-red); }
.readings__status--neutral { color: var(--grey); }

/* Loading state — spinner + text while the lookup is in flight */
.state--loading {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.state--loading .state__text {
  margin: 0;
}

.spinner {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2.5px solid rgba(31, 33, 80, 0.15);
  border-top-color: var(--gold);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* the submit button is disabled while loading */
.lookup__submit:disabled {
  opacity: 0.6;
  cursor: progress;
  transform: none;
}

/* email link inside the error state */
.state__link {
  color: var(--navy);
  text-decoration: none;
  border-bottom: 1px solid rgba(31, 33, 80, 0.3);
}

.state__link:hover {
  border-bottom-color: var(--gold);
}

/* Disclosure */
.disclosure {
  border-radius: var(--r-md);
  border: 1px solid rgba(184, 147, 47, 0.35);
  background: rgba(184, 147, 47, 0.07);
  padding: 1.3rem 1.5rem;
}

.disclosure__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.08rem;
  color: var(--gold-deep);
  margin-bottom: 0.45rem;
}

.disclosure__text {
  font-size: 0.92rem;
  color: var(--grey);
}

/* ==========================================================================
   Recommendations — derived from flagged results (sits above disclosure)
   ========================================================================== */
.recs {
  margin-top: 2.2rem;
  /* clear breathing room below the cards before the disclosure block */
  margin-bottom: 2.6rem;
  padding-top: 2rem;
  border-top: 1px solid var(--hairline);
}

.recs__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.45rem;
  color: var(--navy);
  margin-bottom: 1rem;
}

/* Framing / disclaimer — clearly set off with a gold rule */
.recs__framing {
  font-size: 0.9rem;
  color: var(--grey);
  background: rgba(31, 33, 80, 0.04);
  border-left: 3px solid var(--gold);
  border-radius: 0 12px 12px 0;
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.4rem;
  max-width: 48rem;
}

/* Positive "nothing flagged" message */
.recs__none {
  font-size: 1rem;
  color: var(--ink);
  background: rgba(62, 138, 95, 0.08);
  border: 1px solid rgba(62, 138, 95, 0.32);
  border-radius: var(--r-md);
  padding: 1.15rem 1.35rem;
}

/* ZIP entry */
.recs__zip {
  margin-bottom: 1.4rem;
}

.recs__zip-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--grey);
  margin-bottom: 0.5rem;
}

.recs__zip-input {
  width: 100%;
  max-width: 200px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 1.05rem;
  letter-spacing: 0.14em;
  color: var(--ink);
  padding: 0.6rem 0.9rem;
  border-radius: 12px;
  border: 1px solid rgba(31, 33, 80, 0.18);
  background: rgba(255, 255, 255, 0.75);
  box-shadow: inset 0 1px 3px rgba(31, 33, 80, 0.06);
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.recs__zip-input::placeholder {
  color: rgba(31, 33, 80, 0.3);
}

.recs__zip-input:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 4px rgba(31, 33, 80, 0.12);
}

/* Multi-system note */
.recs__multi {
  font-size: 0.88rem;
  color: var(--grey);
  font-style: italic;
  margin-bottom: 1.4rem;
  max-width: 46rem;
}

/* Cards grid */
.recs__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr));
  gap: 1rem;
}

/* One card per recommended technology — a nested glass surface.
   Fallback tint is kept legible; @supports makes it more see-through
   with its own light blur for a layered-glass look. */
.rec-card {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--r-md);
  padding: 1.4rem 1.5rem;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 12px 30px -18px rgba(31, 33, 80, 0.3);
  /* gentle cascade in; delay set inline by JS */
  animation: state-in 0.5s var(--ease) both;
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .rec-card {
    background: rgba(255, 255, 255, 0.34);
    -webkit-backdrop-filter: blur(14px) saturate(1.7);
    backdrop-filter: blur(14px) saturate(1.7);
  }
}

.rec-card__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.25rem;
  color: var(--navy);
  margin-bottom: 0.5rem;
}

.rec-card__addresses {
  font-size: 0.9rem;
  color: var(--ink);
  margin-bottom: 0.7rem;
}

.rec-card__addresses-label {
  font-weight: 600;
  color: var(--gold-deep);
}

.rec-card__text {
  font-size: 0.92rem;
  color: var(--grey);
  margin-bottom: 1.3rem;
  /* push the buttons to the bottom so cards align in the grid */
  flex: 1 1 auto;
}

.rec-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.rec-card__btn {
  text-align: center;
}

/* ==========================================================================
   03 · Community map — with the clarity lens
   The art has two layers: a frosted faint one (always visible) and a
   sharp colored one revealed only inside a masked circle that follows
   --lx / --ly (set by script.js).
   ========================================================================== */
.map__panel {
  overflow: hidden;
  padding: clamp(2.2rem, 5vw, 3.6rem);
  /* default lens position (script.js animates/overrides these) */
  --lx: 70%;
  --ly: 40%;
  --lens-r: 92px;
}

.map__art {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.map__layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.map__layer--blur {
  color: var(--teal);
  opacity: 0.2;
  filter: blur(1.5px);
}

/* Sharp layer, clipped to the lens circle */
.map__sharp {
  position: absolute;
  inset: 0;
  -webkit-mask-image: radial-gradient(
    circle var(--lens-r) at var(--lx) var(--ly),
    #000 97%,
    transparent 100%
  );
  mask-image: radial-gradient(
    circle var(--lens-r) at var(--lx) var(--ly),
    #000 97%,
    transparent 100%
  );
}

/* The lens ring itself — a rim of glass */
.map__lens {
  position: absolute;
  left: var(--lx);
  top: var(--ly);
  width: calc(var(--lens-r) * 2);
  height: calc(var(--lens-r) * 2);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    inset 0 0 24px rgba(255, 255, 255, 0.35),
    0 14px 34px -12px rgba(31, 33, 80, 0.35);
}

.map__content {
  position: relative;
  max-width: 30rem;
  /* keep text readable over the art */
  pointer-events: none;
}

.map__content a,
.map__content button {
  pointer-events: auto;
}

.map__soon {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 1rem;
}

.map__soon-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  animation: soon-pulse 2.4s ease-in-out infinite;
}

@keyframes soon-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(0.75); }
}

.map__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.8rem, 3.6vw, 2.4rem);
  color: var(--navy);
  margin-bottom: 0.8rem;
}

.map__text {
  color: var(--grey);
}

.map__hint {
  margin-top: 1.4rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.88rem;
  color: rgba(31, 33, 80, 0.45);
}

/* ==========================================================================
   04 · Schedule
   ========================================================================== */
.schedule__inner {
  text-align: center;
  padding: clamp(1rem, 3vw, 2rem) 0 1rem;
}

.schedule__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.15;
  color: var(--navy);
  margin-bottom: 1.1rem;
}

.schedule__title em {
  font-style: italic;
  color: var(--gold-deep);
}

.schedule__text {
  color: var(--grey);
  max-width: 28rem;
  margin: 0 auto 2rem;
}

.schedule__mail {
  margin-top: 1rem;
  font-size: 0.88rem;
  color: var(--grey);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  border-top: 1px solid var(--hairline);
  padding: 2.6rem 0 3rem;
  background: rgba(255, 255, 255, 0.35);
}

.footer__inner {
  width: min(var(--measure), 90%);
  margin-inline: auto;
  display: flex;
  align-items: flex-start;
  gap: 1.4rem;
  flex-wrap: wrap;
}

.footer__mark {
  height: 44px;
  width: auto;
}

.footer__text {
  flex: 1 1 240px;
}

.footer__name {
  font-family: var(--sans);
  font-weight: 700;
  color: var(--navy);
}

.footer__name em {
  font-style: italic;
  font-weight: 400;
  color: var(--gold-deep);
}

.footer__mission {
  font-size: 0.9rem;
  color: var(--grey);
  max-width: 26rem;
}

.footer__side {
  text-align: right;
  margin-left: auto;
}

.footer__contact {
  font-size: 0.92rem;
  color: var(--navy);
  text-decoration: none;
  border-bottom: 1px solid rgba(31, 33, 80, 0.25);
}

.footer__contact:hover {
  border-bottom-color: var(--gold);
}

.footer__privacy {
  font-size: 0.82rem;
  color: var(--grey);
  margin-top: 0.5rem;
}

.footer__copyright {
  font-size: 0.78rem;
  color: rgba(31, 33, 80, 0.4);
  margin-top: 0.9rem;
}

/* ==========================================================================
   Scroll reveal — fade & rise. Hidden initial state only applies once JS
   adds .js-reveal to <html>, so content survives without JavaScript.
   ========================================================================== */
.js-reveal .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.js-reveal .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Reduced motion — quiet everything
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .backdrop__orb,
  .hero__cue-drop,
  .map__soon-dot,
  .shimmer {
    animation: none;
  }

  .hero__lens {
    animation: none;
  }

  .hero__kicker,
  .hero__title,
  .hero__line,
  .hero__actions,
  .hero__hint {
    animation: none;
  }

  /* the water simulation and flowline are also disabled in script.js */
  .hero__water,
  .hero__hint {
    display: none;
  }

  .js-reveal .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .state,
  .readings__row,
  .rec-card {
    animation: none;
  }

  /* keep a loading cue, but pulse instead of spin */
  .spinner {
    animation: soon-pulse 1.4s ease-in-out infinite;
    border-top-color: rgba(31, 33, 80, 0.15);
  }

  .button {
    transition: none;
  }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
  .hero__inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .hero__lens-wrap {
    order: -1;
    margin-top: 0.5rem;
  }

  .hero__lens {
    width: clamp(170px, 40vw, 230px);
  }

  .hero {
    text-align: center;
    padding-top: 110px;
    padding-bottom: 130px; /* keep the scroll cue clear of the buttons */
  }

  .hero__line {
    margin-inline: auto;
  }

  .hero__actions {
    justify-content: center;
  }

  .hero__hint {
    left: 0;
    right: 0;
    text-align: center;
    bottom: 96px;
  }

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

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

  .steps__item + .steps__item {
    border-left: none;
    border-top: 1px solid var(--hairline);
  }

  .map__panel {
    --lens-r: 70px;
  }

  .footer__side {
    text-align: left;
    margin-left: 0;
  }
}

@media (max-width: 480px) {
  .nav {
    top: 10px;
  }

  .nav__wordmark {
    font-size: 0.88rem;
  }

  .lookup__row {
    flex-direction: column;
  }

  .lookup__submit {
    width: 100%;
  }

  .readings__dots {
    display: none;
  }
}
