/* The business page (monitoring/site.py, templates/site/home.html), on top of app.css. A softened Sonoran dusk:
   the banded Interlude sun setting behind saguaros at the top (site/_horizon.html), the page itself the desert floor
   after dusk, and the moon over the saguaros at the end (site/_night.html). The samples and the form are warm, lit
   "paper" in the portal's real light colors (.paper). No glass: every surface is solid or a faint tint, so nothing
   has to be blurred while scrolling.

   Text always sits on the dark part of the sky or on paper; the warm horizon only ever sits behind artwork.
   Motion is CSS only, and only transform and opacity, so it runs on the compositor: the hero copy rises in, the scene
   drifts as the page scrolls (parallax), sections rise into place as they arrive, the week's check-ins light up one
   by one, and the moon rises. The scroll-driven parts only run where the browser supports them; anywhere else
   everything is simply there. Reduce Motion turns all of it off. */

/* --- Palette -------------------------------------------------------------------------------------------------------- */
html:has(body.site) { background: #191430; scroll-padding-top: 84px; }
/* In-page links glide to their section. Arriving at /#bring (the form posting back, the thank-you, the sign-in page's
   "Ask for one") lands there at once instead of gliding through the whole page; the page's own buttons go to
   #request, an anchor at the same spot, so they still glide. */
@media (prefers-reduced-motion: no-preference) { html:has(body.site) { scroll-behavior: smooth; } }
html:has(#bring:target) { scroll-behavior: auto; }
.site .anchor { position: absolute; top: 0; }
body.site {
  color-scheme: dark;
  /* The dusk, from the top of the sky to the horizon */
  --sky-0: #191430; --sky-1: #211a3c; --sky-2: #2c2149; --sky-3: #3e2955; --sky-4: #5a3159; --sky-5: #823f58;
  --sky-6: #ad584f; --sky-7: #d77d53; --sky-8: #eea866;
  --ground: #1f1836;            /* the page: the desert floor after dusk */
  --ground-2: #261d41;          /* the band behind "What changes between visits" */
  --foot: #15102a;              /* the footer: the ground at night */
  --panel: rgba(255, 255, 255, 0.045);
  --panel-line: rgba(255, 255, 255, 0.1);
  --on-sky: #ffffff; --on-sky-2: #e2daee; --on-sky-3: #bab0cd;
  --gold: #ffd98f; --sun-ink: #f6c27a;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --bar-h: 68px;
  --scene-h: max(240px, 25vw); /* the hero's horizon (viewBox 1600 x 400, so its scale is always --scene-h / 400) */
  --night-h: max(170px, 15vw);  /* the closing ridge (viewBox 1600 x 200; always cropped at the sides, so its scale
                                   is --night-h / 200) */

  /* The portal's dark colors, for its pieces that sit on the dusk (icon tiles, tags) */
  --page: var(--ground); --surface: #2a2244; --surface-2: #322950;
  --ink: #ffffff; --ink-2: var(--on-sky-2); --muted: var(--on-sky-3);
  --line: rgba(255, 255, 255, 0.12); --line-2: rgba(255, 255, 255, 0.2); --field: rgba(255, 255, 255, 0.35);
  --accent: #ee9a74; --accent-hover: #f5b394; --on-accent: #1d1838; --accent-ink: #f6b08f;
  --accent-tint: rgba(238, 154, 116, 0.16);
  --green: #5fbf80; --green-ink: #8fd3a4; --green-tint: rgba(95, 191, 128, 0.18);
  --teal: #3fbab5; --teal-ink: #72d4cf; --teal-tint: rgba(63, 186, 181, 0.18);
  --amber: #f2b84b; --amber-ink: #f2c26b; --amber-tint: rgba(242, 184, 75, 0.16);
  --red: #ff9a9a; --red-tint: rgba(255, 138, 138, 0.16);
  --navy-tint: rgba(169, 156, 240, 0.18); --dusk-ink: #c6bcf5; --focus: var(--gold);

  background: var(--ground);
  color: var(--on-sky);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
}

/* Paper: the samples and the form, in the portal's own light colors (its pieces read these tokens). */
.site .paper {
  color-scheme: light;
  --surface: #ffffff; --surface-2: #f6f1ea; --page: #faf7f2;
  --ink: #231c30; --ink-2: #4f4558; --muted: #6b6070;
  --line: #ece5da; --line-2: #ddd3c4; --field: #8f7f6c;
  --accent: #9c5641; --accent-hover: #864834; --on-accent: #ffffff; --accent-ink: #8f4a33; --accent-tint: #f6ebe5;
  --green: #3f8a5c; --green-ink: #2d6a45; --green-tint: #edf5ee;
  --teal: #1a8f97; --teal-ink: #11706f; --teal-tint: #e8f3f1;
  --amber: #b86e00; --amber-ink: #8a5300; --amber-tint: #fcf4e3;
  --red: #b3243a; --red-tint: #fcefef;
  --navy-tint: #f0edf7; --dusk-ink: #4d3f8f; --focus: #4b3fa0;
  background: var(--surface);
  color: var(--ink);
}

/* --- Type ----------------------------------------------------------------------------------------------------------- */
.site h1, .site h2, .site h3 { color: var(--ink); text-wrap: balance; }
.site h2 { display: block; }
.site p { text-wrap: pretty; }
.site-wrap { max-width: 1160px; margin: 0 auto; }
.site main { overflow-x: clip; } /* the samples' glow may reach past the edge; nothing scrolls sideways */
.site figcaption { margin: 1rem 0 0; color: var(--on-sky-3); font-size: 0.85rem; text-align: center; }
.site :where(a:not(.cta-btn, .ghost-btn, .site-brand, .skip-link)) { color: #ffd2a8; }
.site .paper a { color: var(--accent-ink); }
.site :focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 8px; }

.site-eyebrow, .section-eyebrow { display: flex; align-items: center; gap: 0.6rem; margin: 0 0 1rem; color: var(--sun-ink);
  font-weight: 600; font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; }
.site-eyebrow::before, .section-eyebrow::before { /* a tiny banded sun, as in the mark */
  content: ""; width: 18px; height: 10px; border-radius: 18px 18px 0 0; flex: none;
  background: linear-gradient(180deg, #ffd98f 0 56%, transparent 56% 70%, #f4a254 70%); }

.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 40; padding: 0.7rem 1.1rem; border-radius: 999px;
  background: var(--gold); color: #1d1838; font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 0.6rem; }

/* --- Buttons: the sun's gold for the main action, a quiet outline for the other ------------------------------------ */
.cta-btn, .ghost-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 50px; padding: 0.8rem 1.45rem; border-radius: 999px; border: 1px solid transparent; cursor: pointer;
  font: 650 1rem/1.15 var(--font-ui); text-decoration: none; white-space: nowrap; touch-action: manipulation;
  transition: transform 0.16s cubic-bezier(0.2, 0.7, 0.2, 1); }
.cta-btn::after, .ghost-btn::after { /* hover and press light, faded with opacity only */
  content: ""; position: absolute; inset: 0; border-radius: inherit; background: #ffffff; opacity: 0; pointer-events: none;
  transition: opacity 0.16s; }
.site .cta-btn { color: #1d1838; background: linear-gradient(180deg, #ffe4ab, #ffd98f 45%, #f5ae63);
  box-shadow: 0 10px 26px -12px rgba(240, 136, 63, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.6); }
.site .ghost-btn { color: var(--on-sky); border-color: rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.04); }
.cta-btn .icon { width: 18px; height: 18px; }
@media (hover: hover) {
  .cta-btn:hover, .ghost-btn:hover { transform: translateY(-1px); }
  .cta-btn:hover::after { opacity: 0.16; }
  .ghost-btn:hover::after { opacity: 0.08; }
}
.cta-btn:active, .ghost-btn:active { transform: scale(0.97); transition-duration: 0.05s; }
.cta-btn:active::after, .ghost-btn:active::after { opacity: 0.1; transition-duration: 0.05s; }
.cta-btn.small { min-height: 44px; padding: 0.55rem 1.1rem; font-size: 0.92rem; }

/* --- The top bar: the top of the sky, so at the top of the page it's one with the hero ------------------------------ */
.site-top { position: sticky; top: 0; z-index: 30; background: var(--sky-0); }
.site-top::before, .site-top::after { content: ""; position: absolute; left: 0; right: 0; pointer-events: none; }
.site-top::before { top: 100%; height: 18px; background: linear-gradient(180deg, rgba(8, 5, 20, 0.35), transparent); }
.site-top::after { bottom: 0; height: 1px; /* the mark's sunset, as a hairline */
  background: linear-gradient(90deg, transparent, rgba(255, 217, 143, 0.4) 25%, rgba(240, 136, 63, 0.4) 75%, transparent); }
.site-bar { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; max-width: 1240px;
  height: var(--bar-h); margin: 0 auto; padding: 0 var(--gutter); }
.site-brand { display: inline-flex; align-items: center; gap: 0.6rem; min-height: 44px; color: #ffffff;
  text-decoration: none; font: 700 1.2rem/1 var(--font-display); letter-spacing: 0.005em; }
.site-brand img { display: block; border-radius: 9px; box-shadow: 0 0 20px rgba(240, 136, 63, 0.3); }
.site-nav { display: flex; align-items: center; gap: 0.15rem; white-space: nowrap; }
.site .site-nav a:not(.cta-btn) { display: inline-flex; align-items: center; min-height: 44px; padding: 0 0.85rem;
  border-radius: 999px; color: var(--on-sky-2); text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.site .site-nav a:not(.cta-btn):hover { background: rgba(255, 255, 255, 0.08); color: #ffffff; }
.site-nav .cta-btn { margin-left: 0.45rem; }
.label-short { display: none; }

/* --- Hero: the dusk sky, then the horizon --------------------------------------------------------------------------- */
/* The sky warms toward the horizon, which is always 25% of --scene-h above the bottom; the copy ends higher up, on
   the dark part (the lightest color any text sits on is --sky-4, where white is 9.7:1 and --on-sky-2 7.6:1). */
.site-hero { position: relative; isolation: isolate; overflow: hidden;
  background: linear-gradient(180deg, var(--sky-0) 0, var(--sky-1) calc(100% - var(--scene-h) * 1.9),
    var(--sky-2) calc(100% - var(--scene-h) * 1.3), var(--sky-3) calc(100% - var(--scene-h) * 0.95),
    var(--sky-4) calc(100% - var(--scene-h) * 0.74), var(--sky-5) calc(100% - var(--scene-h) * 0.58),
    var(--sky-6) calc(100% - var(--scene-h) * 0.45), var(--sky-7) calc(100% - var(--scene-h) * 0.35),
    var(--sky-8) calc(100% - var(--scene-h) * 0.26)); }
/* Stars only where no text is: right of the copy on wide screens, between the copy and the sun on narrow ones. */
.hero-stars { position: absolute; z-index: 0; top: 0; left: calc(50% + 120px); right: 0; height: calc(100% - var(--scene-h) * 0.6);
  background: url("art/stars.8cebdd25e3cd.svg") center / 100% 100% no-repeat; opacity: 0.85; pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000 45%, transparent); mask-image: linear-gradient(180deg, #000 45%, transparent); }
.hero-copy { position: relative; z-index: 2; padding: clamp(2.25rem, 5.5vw, 4.6rem) var(--gutter) clamp(0.5rem, 2vw, 1.5rem); }
.site-hero h1 { max-width: 11ch; margin: 0; color: #ffffff; font-size: clamp(2.9rem, 6.2vw + 0.4rem, 5.6rem);
  font-weight: 700; line-height: 0.98; letter-spacing: -0.042em; }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .site-hero h1 { background: linear-gradient(180deg, #ffffff 30%, #ffeccc 62%, #ffc98c 100%); -webkit-background-clip: text;
    background-clip: text; color: transparent; padding-bottom: 0.07em; }
}
.hero-lead { max-width: 33rem; margin: 1.35rem 0 2rem; color: var(--on-sky-2); font-size: clamp(1.1rem, 1.1vw + 0.8rem, 1.32rem);
  line-height: 1.5; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.hero-note { display: flex; align-items: flex-start; gap: 0.55rem; max-width: 33rem; margin: 1.4rem 0 0; color: var(--on-sky-2);
  font-size: 0.92rem; line-height: 1.45; }
.hero-note .icon { flex: none; width: 18px; height: 18px; margin-top: 1px; color: var(--gold); }

/* The horizon's layers share one viewBox and crop alike, so they line up at any width. Its empty sky overlaps the
   bottom of the copy a little (beside it on wide screens, below it on phones). */
.horizon { position: relative; z-index: 1; height: var(--scene-h); margin-top: calc(var(--scene-h) * -0.24);
  overflow: hidden; pointer-events: none; }
.horizon .layer { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.horizon .ground, .night-ridge .ground { fill: var(--ground); }
.horizon .cacti, .night-ridge .cacti { stroke: var(--ground); }

/* --- Sections ------------------------------------------------------------------------------------------------------- */
.site-section { position: relative; padding: clamp(3.75rem, 8vw, 6.25rem) var(--gutter); }
.section-head { max-width: 46rem; margin-bottom: clamp(2.25rem, 4.5vw, 3.5rem); }
.site-section h2 { max-width: 20ch; margin: 0; color: #ffffff; font-size: clamp(2rem, 3.2vw + 0.9rem, 3.1rem); font-weight: 700;
  line-height: 1.06; letter-spacing: -0.032em; }
.section-lead { max-width: 38rem; margin: 1.1rem 0 0; color: var(--on-sky-2); font-size: clamp(1.08rem, 0.6vw + 0.95rem, 1.24rem);
  line-height: 1.55; }
.section-lead strong { color: var(--gold); font-weight: 650; }
.site h3 { margin: 0; color: #ffffff; font-weight: 650; letter-spacing: -0.012em; }

/* How it works: three suns on a dotted path */
.path { --gap: clamp(1.5rem, 3vw, 2.75rem); position: relative; list-style: none; margin: 0; padding: 0; display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem var(--gap); }
.path::before { content: ""; position: absolute; top: 24px; left: 24px; right: calc((100% - 2 * var(--gap)) / 3 - 24px);
  height: 2px; background: repeating-linear-gradient(90deg, rgba(255, 217, 143, 0.5) 0 7px, transparent 7px 15px); }
.path li { position: relative; }
.path-num { position: relative; display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 1.2rem;
  border-radius: 50%; color: #1d1838; font: 750 1.15rem/1 var(--font-display);
  background: linear-gradient(180deg, #ffe4ab, #ffd98f 45%, #f3a35b);
  box-shadow: 0 0 0 7px var(--ground), 0 10px 24px -8px rgba(240, 136, 63, 0.75); }
.path h3 { font-size: 1.28rem; margin-bottom: 0.35rem; }
.path p { max-width: 28ch; margin: 0; color: var(--on-sky-2); }
.sources { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; margin-top: clamp(2.5rem, 5vw, 3.5rem);
  padding-top: 1.6rem; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.sources > p { margin: 0; color: var(--on-sky-3); font-size: 0.9rem; }
.sources ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; padding: 0; }
.sources li { padding: 0.38rem 0.85rem; border-radius: 999px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--panel-line);
  color: var(--on-sky-2); font-size: 0.88rem; }

/* For clinics, for patients: the heading and the points beside a sample */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto 1fr;
  grid-template-areas: "head sample" "list sample"; column-gap: clamp(2.5rem, 6vw, 5.5rem); align-items: start; }
.split.reverse { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr); grid-template-areas: "sample head" "sample list"; }
.split-head { grid-area: head; }
.split > .sample { grid-area: sample; align-self: center; }
.split > .features { grid-area: list; }
.features { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.7rem 1.75rem; }
.feature { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 0.9rem; align-content: start; }
.feature > .tile-icon { grid-row: 1 / span 2; width: 40px; height: 40px; border-radius: 12px; }
.feature > .tile-icon .icon { width: 19px; height: 19px; }
.feature h3 { margin: 0.12rem 0 0.25rem; font-size: 1.06rem; }
.feature p { margin: 0; color: var(--on-sky-2); font-size: 0.96rem; line-height: 1.5; }

/* The samples: the portal's own pieces (avatars, day dots, chips, check-in message, tags), on lit paper */
.sample { position: relative; z-index: 0; margin: 0; }
.sample::before { /* warm light from the sun, behind the screen */
  content: ""; position: absolute; z-index: -1; inset: 6% -8% 14%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(240, 136, 63, 0.2), rgba(240, 136, 63, 0.06) 60%, transparent); }
.vignette { display: grid; gap: 0.7rem; max-width: 500px; margin: 0 auto; padding: 1.2rem 1.25rem 1.35rem; border-radius: 22px;
  font-size: 0.9rem; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 2px 6px rgba(5, 3, 18, 0.25),
    0 36px 70px -30px rgba(5, 3, 18, 0.9); }
.vignette-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--line); color: var(--ink); font: 700 1.15rem/1.2 var(--font-display); }
.vignette-head .tag { margin: 0; font-family: var(--font-ui); }
.vignette-group { display: flex; align-items: center; gap: 0.5rem; margin: 0.35rem 0 0; color: var(--ink);
  font: 650 0.95rem var(--font-display); }
.vignette-group .tile-icon { width: 26px; height: 26px; border-radius: 8px; }
.vignette-group .tile-icon .icon { width: 15px; height: 15px; }
.vignette-row { display: grid; gap: 0.55rem; padding: 0.85rem 0.95rem; border: 1px solid var(--line); border-radius: 14px; }
.vignette-row p, .vignette .why { margin: 0; }
.vignette-row .chip { margin: 0; }
.vignette .dot { width: 22px; height: 22px; font-size: 0.68rem; }
.vignette .why { font-size: 0.85rem; color: var(--ink-2); }
.vignette-approve { justify-self: start; }
.vignette-approve .icon { width: 16px; height: 16px; color: var(--green-ink); }
.vignette.phone { max-width: 340px; padding: 1.35rem 1.15rem 1.45rem; border-radius: 38px;
  box-shadow: 0 0 0 8px #120d24, 0 0 0 9px rgba(255, 255, 255, 0.16), 0 36px 70px -26px rgba(5, 3, 18, 0.95); }
.vignette-label { display: flex; align-items: center; gap: 0.4rem; margin: 0.2rem 0 0; font-weight: 650; color: var(--ink); }
.vignette-label .icon { width: 17px; height: 17px; color: var(--accent-ink); }
.vignette .checkin-message { font-size: 0.9rem; }
.vignette .focus-line { display: flex; align-items: flex-start; gap: 0.45rem; margin: 0; padding: 0.55rem 0.75rem;
  border-radius: 12px; background: var(--navy-tint); color: var(--ink); font-size: 0.88rem; }
.vignette .focus-line .icon { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--dusk-ink); }
.vignette-targets { list-style: none; padding: 0; margin: 0; }
.vignette-targets li { display: grid; grid-template-columns: minmax(0, 1fr) auto 4.9rem; gap: 0.75rem; align-items: center;
  padding: 0.55rem 0; border-top: 1px solid var(--line); color: var(--ink); font-variant-numeric: tabular-nums; }
.vignette-targets li:first-child { border-top: 0; }
.vignette-targets .tag { justify-self: start; margin: 0; white-space: nowrap; }

/* --- What changes between visits: the heart of the page, in the afterglow ------------------------------------------ */
.site-section.between { background:
    radial-gradient(ellipse 70% 30% at 50% 74%, rgba(173, 88, 79, 0.2), transparent 70%),
    linear-gradient(180deg, var(--ground), var(--ground-2) 16%, var(--ground-2) 84%, var(--ground)); }
.between .section-head { margin-inline: auto; text-align: center; }
.between .section-eyebrow { justify-content: center; }
.between h2, .between .section-lead { margin-inline: auto; }
.timeline { display: grid; gap: 1.4rem; padding: clamp(1.25rem, 3vw, 1.9rem) clamp(1.15rem, 3vw, 2.25rem); border-radius: 24px;
  background: var(--panel); box-shadow: inset 0 0 0 1px var(--panel-line); }
.timeline-row { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr) 15.5rem; gap: 1.5rem; align-items: center; }
.timeline-label { color: var(--sun-ink); font-weight: 600; font-size: 0.92rem; }
.timeline-track { display: flex; align-items: center; gap: 0.6rem; min-width: 0; }
.visit { flex: none; padding: 0.22rem 0.7rem; border-radius: 999px; background: var(--gold); color: #1d1838;
  font-size: 0.78rem; font-weight: 700; }
.timeline-track.quiet .visit { background: rgba(255, 255, 255, 0.13); color: #ffffff; }
.gap { flex: 1; height: 2px; background: repeating-linear-gradient(90deg, rgba(216, 207, 230, 0.45) 0 6px, transparent 6px 13px); }
.beats { position: relative; flex: 1; display: flex; align-items: center; justify-content: space-evenly; height: 18px; }
.beats::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 3px; margin-top: -1.5px;
  border-radius: 2px; background: linear-gradient(90deg, #ffd98f, #f0883f); transform-origin: 0 50%; }
.beats span { position: relative; width: 14px; height: 14px; border-radius: 50%; background: #ffd98f;
  box-shadow: 0 0 0 3px #302749, 0 0 14px rgba(255, 217, 143, 0.6); }
.timeline-caption { color: var(--on-sky-2); font-size: 0.92rem; line-height: 1.45; }
.outcomes { list-style: none; margin: clamp(2.5rem, 5vw, 3.5rem) 0 0; padding: 0; display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.75rem clamp(1.5rem, 3vw, 2.5rem); }
.outcomes li { padding-top: 1.15rem; border-top: 1px solid rgba(255, 217, 143, 0.3); }
.outcomes h3 { margin-bottom: 0.4rem; font-size: 1.2rem; }
.outcomes p { margin: 0; color: var(--on-sky-2); }
.between-close { max-width: 44rem; margin: clamp(3.5rem, 8vw, 6rem) auto 0; text-align: center; }
.between-close .less { display: block; color: var(--on-sky-3); font: 500 clamp(1.08rem, 1vw + 0.85rem, 1.35rem)/1.4 var(--font-display); }
.between-close .more { display: block; margin-top: 0.55rem; color: #ffe3b8; text-wrap: balance;
  font: 700 clamp(1.7rem, 2.8vw + 0.9rem, 2.85rem)/1.15 var(--font-display); letter-spacing: -0.026em; }

/* --- Privacy and trust ---------------------------------------------------------------------------------------------- */
.trust { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.trust-col { padding: clamp(1.35rem, 3vw, 2rem); border-radius: 22px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--panel-line); }
.trust-col h3 { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 1.15rem; font-size: 1.2rem; }
.trust-col h3 .icon { color: var(--gold); }
.trust-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.85rem; }
.trust-list li { display: flex; gap: 0.75rem; align-items: flex-start; color: var(--on-sky-2); }
.trust-list li::before { /* a tick in a soft green circle; a cross in a neutral one for "won't" */
  content: ""; flex: none; width: 22px; height: 22px; margin-top: 2px; border-radius: 50%;
  background: var(--green-tint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m3.5 8.5 3 3 6-7' fill='none' stroke='%238fd3a4' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px 14px no-repeat;
  box-shadow: inset 0 0 0 1px rgba(95, 191, 128, 0.45); }
.trust-list.no li::before { background-color: rgba(255, 255, 255, 0.07); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 4.5l7 7M11.5 4.5l-7 7' fill='none' stroke='%23cfc6de' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); }
.trust-more { margin: 1.5rem 0 0; color: var(--on-sky-2); }

/* --- Stories (only when the owner has published some) ------------------------------------------------------------- */
.stories { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.story { display: flex; flex-direction: column; justify-content: space-between; gap: 1rem; margin: 0; padding: 1.6rem 1.5rem 1.4rem;
  border-radius: 22px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--panel-line); }
.story blockquote { margin: 0; }
.story blockquote p { margin: 0; color: #ffffff; font: 500 1.12rem/1.55 var(--font-display); }
.site .story figcaption { margin: 0; text-align: left; color: var(--on-sky-2); font-weight: 600; font-size: 0.9rem; }

/* --- Founding clinics: the form under the night sky, the moon over the saguaros ----------------------------------- */
.site-section.night { padding-bottom: calc(var(--night-h) + clamp(1.5rem, 4vw, 3rem));
  background: linear-gradient(180deg, var(--ground) 0, #1c1635 38%, #221b42 72%, #372c5f 100%); overflow: hidden; }
.bring { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
.bring .section-lead { margin-bottom: 1.75rem; }
.bring-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.85rem; }
.bring-points li { display: flex; gap: 0.6rem; align-items: flex-start; color: var(--on-sky-2); }
.bring-points .icon { flex: none; margin-top: 3px; color: var(--green-ink); }
.bring-card { padding: clamp(1.35rem, 3vw, 2rem); border-radius: 24px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 40px 80px -30px rgba(4, 2, 14, 0.95); }
.inquiry h3, .sent h3 { margin: 0 0 0.8rem; color: var(--ink); font-size: 1.3rem; }
.no-phi { display: flex; align-items: flex-start; gap: 0.55rem; margin: 0 0 1.25rem; padding: 0.65rem 0.85rem; border-radius: 12px;
  background: var(--amber-tint); box-shadow: inset 0 0 0 1px rgba(184, 110, 0, 0.3); color: var(--ink); font-weight: 500;
  font-size: 0.93rem; }
.no-phi .icon { flex: none; width: 18px; height: 18px; margin-top: 2px; color: var(--amber-ink); }
.inquiry-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem 1.1rem; }
.inquiry-grid .field { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.inquiry-grid .field.wide { grid-column: 1 / -1; }
.inquiry label { color: var(--ink); font-size: 0.92rem; font-weight: 600; }
/* Label, hint, error, then the field (as GOV.UK does); the field points at its hint and error (aria-describedby). */
.inquiry .helptext { margin-top: -0.2rem; color: var(--muted); font-size: 0.84rem; }
.inquiry .field > ul.errorlist { padding-left: 0; list-style: none; font-weight: 500; color: var(--red); }
/* 16px text, so iPhones don't zoom in on focus; 48px tall, for thumbs. */
.inquiry :is(input[type=text], input[type=email], select, textarea) { width: 100%; min-height: 48px; padding: 0.7rem 0.9rem;
  border: 1px solid var(--field); border-radius: 12px; background: #ffffff; color: var(--ink); font: 400 1rem/1.4 var(--font-ui); }
.site .inquiry select { appearance: none; padding-right: 2.6rem;
  background: #ffffff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%234f4558' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 0.9rem center / 16px no-repeat; }
.inquiry textarea { min-height: 7.5rem; resize: vertical; }
.inquiry :is(input, select, textarea)::placeholder { color: var(--muted); }
.inquiry :is(input, select, textarea):hover { border-color: var(--ink-2); }
.inquiry :is(input, select, textarea):focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }
.inquiry [aria-invalid="true"] { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.inquiry .actions { margin-top: 1.4rem; }
.inquiry .actions .cta-btn { min-width: 9rem; }
.form-fine { margin: 0.9rem 0 0; color: var(--muted); font-size: 0.86rem; }
.form-problems { margin: 0 0 1.15rem; padding: 0.75rem 1rem; border-radius: 12px; background: var(--red-tint);
  box-shadow: inset 0 0 0 1px rgba(179, 36, 58, 0.45); color: var(--ink); font-size: 0.93rem; }
.form-problems p { margin: 0 0 0.3rem; }
.form-problems ul { margin: 0; padding-left: 1.1rem; }
.site .form-problems a { color: var(--ink); font-weight: 600; }
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.sent { display: flex; gap: 1rem; align-items: flex-start; }
.sent h3 { margin: 0.3rem 0 0.35rem; }
.sent p { margin: 0; color: var(--ink-2); overflow-wrap: anywhere; }

.night-scene { position: absolute; left: 0; right: 0; bottom: 0; height: var(--night-h); pointer-events: none; }
.night-scene::before { /* the first stars, over the ridge (never behind text) */
  content: ""; position: absolute; left: 0; right: 0; bottom: 35%; height: calc(var(--night-h) * 1.7);
  background: url("art/stars.8cebdd25e3cd.svg") center bottom / 1000px 300px repeat-x; opacity: 0.75;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 45%); mask-image: linear-gradient(180deg, transparent, #000 45%); }
.night-ridge { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.night-ridge .ridge { fill: #2a2147; }
.night-ridge .ground { fill: var(--foot); }
.night-ridge .cacti { stroke: var(--foot); }
/* A desert moon, placed in the ridge's viewBox units so its saguaro always stands in front of it: centered on
   (410, 82) on wide screens and (968, 82) on narrow ones, 78 across. */
.moon { --m: calc(var(--night-h) * 0.39); position: absolute; width: var(--m); height: var(--m);
  left: calc(50% - var(--night-h) * 1.95 - var(--m) / 2); bottom: calc(var(--night-h) * 0.59 - var(--m) / 2);
  border-radius: 50%; background: radial-gradient(circle at 38% 34%, #fff8e8, #f3e6cb 58%, #e4d3b4);
  box-shadow: 0 0 0 1px rgba(255, 246, 226, 0.12); }
.moon::before { content: ""; position: absolute; inset: -140%; border-radius: 50%;
  background: radial-gradient(circle, rgba(243, 230, 203, 0.2), rgba(243, 230, 203, 0.06) 34%, transparent 60%); }

/* --- Footer: the ground at night ------------------------------------------------------------------------------------ */
.site-foot { padding: 1.75rem var(--gutter) 2.5rem; background: var(--foot); color: var(--on-sky-3); font-size: 0.9rem; }
.foot-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 2rem; }
.foot-brand { display: flex; align-items: center; gap: 0.7rem; }
.foot-brand img { display: block; border-radius: 8px; }
.foot-brand strong { display: block; color: #ffffff; font-family: var(--font-display); }
.foot-brand span { display: block; color: var(--on-sky-3); font-size: 0.85rem; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 0 1.25rem; }
.site .site-foot nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--on-sky-2); text-decoration: none; }
.site .site-foot nav a:hover { color: #ffffff; text-decoration: underline; }
.foot-copy { margin: 0; }
.foot-marks { flex-basis: 100%; margin: 0.25rem 0 0; color: var(--on-sky-3); font-size: 0.78rem; line-height: 1.5; }

/* --- Motion (transform and opacity only) ----------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  /* On arrival: the copy rises in, the sun fades up through the haze */
  .hero-copy > * { animation: rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .hero-copy > :nth-child(2) { animation-delay: 0.06s; }
  .hero-copy > :nth-child(3) { animation-delay: 0.12s; }
  .hero-copy > :nth-child(4) { animation-delay: 0.18s; }
  .hero-copy > :nth-child(5) { animation-delay: 0.24s; }
  .horizon .sun { animation: sun-in 1.8s ease-out both; }
}
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes sun-in { from { opacity: 0; } to { opacity: 1; } }

@supports (animation-timeline: scroll()) {
  /* The bar's hairline and shadow appear once the page moves under it */
  .site-top::before, .site-top::after { animation: fade-in linear both; animation-timeline: scroll(root);
    animation-range: 0 96px; }
  @media (prefers-reduced-motion: no-preference) {
    /* Parallax: as the page scrolls, the far layers sink a little, and the sun sets behind the mesas */
    .horizon .far, .horizon .mid { animation: linear both; animation-timeline: scroll(root); animation-range: 0 100vh;
      will-change: transform; }
    .horizon .far { animation-name: drift-far; }
    .horizon .mid { animation-name: drift-mid; }
    .horizon .sun { animation: sun-in 1.8s ease-out both, drift-sun linear both; animation-timeline: auto, scroll(root);
      animation-range: normal, 0 100vh; will-change: transform, opacity; }
  }
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes drift-sun { to { transform: translateY(13%); } }
@keyframes drift-far { to { transform: translateY(6%); } }
@keyframes drift-mid { to { transform: translateY(2.5%); } }

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    /* Sections rise into place as they arrive, on computers (mouse or trackpad). Each is done once its top is 200px
       into view, a point every element on the page reaches, so nothing is ever left part-way. Phones and tablets skip
       it: measured with a 4x slower CPU, these view timelines were what made scrolling drop frames there. */
    @media (hover: hover) and (pointer: fine) {
      .reveal { animation: reveal cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-timeline: view(); animation-range: entry 0% entry 200px; }
    }
    /* The week's check-ins light up one by one along the line */
    .timeline { view-timeline: --week block; }
    .beats::before { animation: grow linear both; animation-timeline: --week; animation-range: cover 14% cover 42%; }
    .beats span { animation: beat-on cubic-bezier(0.3, 1.4, 0.5, 1) both; animation-timeline: --week; }
    .beats span:nth-child(1) { animation-range: cover 16% cover 24%; }
    .beats span:nth-child(2) { animation-range: cover 20% cover 28%; }
    .beats span:nth-child(3) { animation-range: cover 24% cover 32%; }
    .beats span:nth-child(4) { animation-range: cover 28% cover 36%; }
    .beats span:nth-child(5) { animation-range: cover 32% cover 40%; }
    .beats span:nth-child(6) { animation-range: cover 36% cover 44%; }
    /* Moonrise, as the ridge comes into view (done once the ridge is fully in view, which it always can be) */
    .night-scene { view-timeline: --ridge block; }
    .moon { animation: moonrise ease-out both; animation-timeline: --ridge; animation-range: entry 0% entry 100%; }
  }
}
/* It starts at 80% opacity, where every text color on the page still meets WCAG AA, so text passes at every scroll
   position; the rise carries the motion. */
@keyframes reveal { from { opacity: 0.8; transform: translateY(34px); } to { opacity: 1; transform: none; } }
@keyframes grow { from { transform: scaleX(0); } to { transform: none; } }
@keyframes beat-on { from { opacity: 0; transform: scale(0.3); } to { opacity: 1; transform: none; } }
@keyframes moonrise { from { opacity: 0.5; transform: translateY(35%); } to { opacity: 1; transform: none; } }

/* --- Smaller screens ------------------------------------------------------------------------------------------------ */
@media (max-width: 1000px) {
  .site .site-nav a.wide-only:not(.cta-btn) { display: none; }
  .hero-stars { left: 0; right: 0; top: auto; bottom: calc(var(--scene-h) * 0.6); height: calc(var(--scene-h) * 0.24);
    opacity: 0.7; -webkit-mask-image: none; mask-image: none; }
  .horizon { margin-top: calc(var(--scene-h) * -0.1); }
  .split, .split.reverse { grid-template-columns: minmax(0, 1fr); grid-template-rows: none;
    grid-template-areas: "head" "sample" "list"; }
  .split > .sample { margin-bottom: clamp(2.5rem, 7vw, 3.5rem); }
  .bring { grid-template-columns: minmax(0, 1fr); }
  .timeline-row { grid-template-columns: minmax(0, 1fr); gap: 0.5rem; }
  .moon { left: calc(50% + var(--night-h) * 0.84 - var(--m) / 2); }
}
@media (min-width: 1001px) and (max-width: 1180px) {
  /* beside the sample, the points read better one under another than in two narrow columns */
  .split > .features { grid-template-columns: minmax(0, 1fr); gap: 1.35rem; }
}
@media (max-width: 760px) {
  .path { grid-template-columns: minmax(0, 1fr); gap: 1.6rem; }
  .path::before { top: 24px; bottom: 24px; left: 23px; right: auto; width: 2px; height: auto;
    background: repeating-linear-gradient(180deg, rgba(255, 217, 143, 0.5) 0 7px, transparent 7px 15px); }
  .path li { min-height: 48px; padding-left: 66px; }
  .path-num { position: absolute; left: 0; top: -2px; margin: 0; }
  .path p { max-width: none; }
  .outcomes, .trust { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  body.site { --bar-h: 60px; }
  html:has(body.site) { scroll-padding-top: 72px; }
  .site-brand { gap: 0.5rem; font-size: 1.08rem; }
  .site-brand img { width: 28px; height: 28px; }
  .site .site-nav a:not(.cta-btn) { padding: 0 0.65rem; font-size: 0.92rem; }
  .site-nav .cta-btn { margin-left: 0.2rem; padding: 0.5rem 0.9rem; font-size: 0.88rem; }
  .label-long { display: none; }
  .label-short { display: inline; }
  .hero-cta { flex-direction: column; gap: 0.4rem; }
  .hero-cta > a { width: 100%; }
  .site .hero-cta .ghost-btn { min-height: 46px; border-color: transparent; background: none; color: var(--on-sky-2); }
  .features, .inquiry-grid { grid-template-columns: minmax(0, 1fr); }
      .vignette { padding: 1rem 1rem 1.15rem; }
  .sources { gap: 0.65rem; }
  .bring-card { padding: 1.25rem 1.1rem 1.35rem; border-radius: 20px; }
}
@media (max-width: 380px) {
  .site-bar { gap: 0.4rem; }
  .site-brand { gap: 0.4rem; font-size: 1rem; }
  .site-brand img { width: 26px; height: 26px; }
  .site .site-nav a:not(.cta-btn) { padding: 0 0.5rem; }
  .site-nav .cta-btn { padding: 0.5rem 0.75rem; font-size: 0.85rem; }
}

/* --- When the device asks for less, and print ----------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .cta-btn, .ghost-btn, .cta-btn::after, .ghost-btn::after { transition: none; }
  .cta-btn:hover, .ghost-btn:hover, .cta-btn:active, .ghost-btn:active { transform: none; }
}
@media (prefers-reduced-transparency: reduce) {
  body.site { --panel: #2a2343; --panel-line: #3e355e; }
  .site .ghost-btn { background: #2a2343; }
}
@media (forced-colors: active) {
  .site-hero h1 { background: none; color: CanvasText; }
  .horizon, .hero-stars, .night-scene, .sample::before { display: none; }
  .site-section.night { padding-bottom: clamp(2.5rem, 6vw, 4rem); }
  .cta-btn, .ghost-btn { border-color: ButtonText; }
}
@media print {
  .site-top { position: static; }
  .horizon, .hero-stars, .night-scene, .sample::before { display: none; }
  .reveal, .hero-copy > * { animation: none !important; }
}
