/* Ingrain landing page. Tokens follow Groundwork's docs/DESIGN.md and the brand sheet. */

@font-face {
  font-family: "M PLUS Rounded 1c";
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/m-plus-rounded-1c-700.woff2") format("woff2");
}
/* Source Sans 3 is a variable font; one Latin file covers 400 and 600. */
@font-face {
  font-family: "Source Sans 3";
  font-weight: 400 600;
  font-display: swap;
  src: url("/assets/fonts/source-sans-3.woff2") format("woff2");
}

:root {
  --cloud: #f6fafd;
  --sky: #ddeffa;
  --blue: #34beed;
  --aqua: #4fd1c5;
  --leaf: #74c25b;
  --ink: #22344a;
  --ink-soft: #5b6b7d;
  --silver: #e4eaf0;
  --link: #0a6a8f;

  --contradicted: #ee6b57;
  --verified: #3e9e52;

  --font-display: "M PLUS Rounded 1c", ui-rounded, system-ui, sans-serif;
  --font-body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;

  --r-chip: 10px;
  --r-card: 16px;
  --r-panel: 28px;

  --gutter: 16px;
  --max: 1120px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--cloud);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.6;
  overflow-x: hidden;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 {
  font-size: clamp(2.5rem, 1.6rem + 4.2vw, 4.25rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
}
h2 {
  font-size: clamp(1.75rem, 1.3rem + 2vw, 2.5rem);
}
h3 {
  font-size: 1.25rem;
}
p {
  margin: 0 0 1em;
}

a {
  color: var(--link);
  text-underline-offset: 0.18em;
}
a:hover {
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 10;
  padding: 10px 16px;
  background: #fff;
  border-radius: var(--r-chip);
  font-weight: 600;
}
.skip:focus {
  top: 12px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Glass and buttons ---------- */

.glass {
  background: rgba(255, 255, 255, 0.6);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 12px 32px rgba(52, 190, 237, 0.12);
}
@media (prefers-reduced-transparency: reduce) {
  .glass {
    background: #f1f7fb;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 28px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  /* Glossy pill: a top highlight over the brand blue. Ink text keeps 5.8:1 contrast. */
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0) 52%),
    var(--blue);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 6px 18px rgba(52, 190, 237, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.button:hover {
  color: var(--ink);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 10px 24px rgba(52, 190, 237, 0.4);
}
.button:active {
  transform: translateY(0);
}
.button:disabled {
  cursor: progress;
  opacity: 0.75;
  transform: none;
}
.button--small {
  min-height: 40px;
  padding: 8px 18px;
  font-size: 0.9375rem;
}

/* Glossy look for the ocean bubbles. */
.bubbles span {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.95) 0 8%, rgba(255, 255, 255, 0.25) 26%, rgba(255, 255, 255, 0) 46%),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0) 55%, rgba(52, 190, 237, 0.22) 100%);
}

/* ---------- Sky: header, headline and story ---------- */

.sky {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 60% 45% at 50% 18%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 70%),
    linear-gradient(180deg, #cfe9f8 0%, var(--sky) 38%, #eef7fc 72%, #eef7fc 100%);
}
/* On tall desktop screens the sky fills the first screen, so the next section starts below the fold.
   Any spare height opens up above the hill. */
@media (min-width: 960px) {
  .sky { display: flex; flex-direction: column; min-height: 100vh; }
  .sky > main,
  .story-section { flex: 1; display: flex; flex-direction: column; }
  .story-section .hill { margin-top: auto; }
  .story-section > .wrap { margin-bottom: 8px; }
}

/* Growth rings behind the headline: the target from the mark, with a blue-to-leaf gradient. */
.sky__rings {
  position: absolute;
  top: -150px;
  right: -230px;
  width: 600px;
  height: 600px;
  opacity: 0.16;
  pointer-events: none;
  /* Fade the outer rings into the sky instead of ending at an edge. */
  -webkit-mask-image: radial-gradient(circle at 47% 48%, #000 38%, transparent 70%);
  mask-image: radial-gradient(circle at 47% 48%, #000 38%, transparent 70%);
}
@media (min-width: 760px) {
  .sky__rings { top: -230px; right: -190px; width: 820px; height: 820px; opacity: 0.18; }
}

/* ---------- Sky bubbles ----------
   app.js moves them with transforms: a slow sideways drift with a gentle bob, always above the hill.
   Hovering wobbles a bubble; clicking pops it from the point you clicked, and a new one floats in. */

.bubble-field {
  position: absolute;
  inset: 0 0 clamp(90px, 14vw, 180px) 0; /* stop where the hill starts */
  overflow: hidden;
  pointer-events: none;
}
.bubble {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--s);
  height: var(--s);
  opacity: 0;
  pointer-events: auto;
  cursor: pointer;
  will-change: transform;
}
.bubble-field.is-ready .bubble {
  opacity: 0.85;
}
@media (max-width: 639px) {
  .bubble:nth-child(n + 5) { display: none; }
}
.bubble__body {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.8);
  /* Specular highlights, a faint iridescent rim (violet top-left, aqua bottom-right) and a bright edge. */
  background:
    radial-gradient(circle at 30% 26%, rgba(255, 255, 255, 0.95) 0 5%, rgba(255, 255, 255, 0.35) 13%, rgba(255, 255, 255, 0) 24%),
    radial-gradient(circle at 70% 76%, rgba(255, 255, 255, 0.7) 0 2.5%, rgba(255, 255, 255, 0) 7%),
    radial-gradient(circle at 22% 18%, rgba(205, 160, 255, 0.22), rgba(205, 160, 255, 0) 40%),
    radial-gradient(circle at 80% 84%, rgba(79, 209, 197, 0.32), rgba(79, 209, 197, 0) 42%),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.04) 56%, rgba(52, 190, 237, 0.17) 84%, rgba(255, 255, 255, 0.75) 100%);
  box-shadow: inset 0 0 14px rgba(255, 255, 255, 0.45), 0 6px 18px rgba(52, 190, 237, 0.12);
  transform-origin: var(--hx, 50%) var(--hy, 50%);
  /* Hover push (app.js sets these from the pointer): stretch away from the cursor along its direction,
     with a slight overshoot when it springs back. */
  transform: rotate(var(--pa, 0deg)) scale(var(--sx, 1), var(--sy, 1)) rotate(calc(var(--pa, 0deg) * -1));
  translate: var(--tx, 0px) var(--ty, 0px);
  transition:
    transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
    translate 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Registered so the hole's size and center can animate. */
@property --hole {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}
@property --mx {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}
@property --my {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}

@media (prefers-reduced-motion: no-preference) {
  .bubble.is-arriving .bubble__body { animation: float-in 3s cubic-bezier(0.22, 1, 0.36, 1) both; }

  /* The pop: the film squashes toward the click and a hole opens there. The hole grows and slides to the
     center in step with the splash rim (same 0.18s, same easing), then the last of the film fades. */
  .bubble.is-popping { pointer-events: none; }
  .bubble.is-popping .bubble__body {
    -webkit-mask-image: radial-gradient(circle at var(--mx) var(--my), transparent var(--hole), #000 calc(var(--hole) + 1px));
    mask-image: radial-gradient(circle at var(--mx) var(--my), transparent var(--hole), #000 calc(var(--hole) + 1px));
    animation:
      squash 0.1s ease-out both,
      hole 0.18s ease-out both,
      film-out 0.06s 0.18s linear forwards;
  }
}
@keyframes float-in {
  0% { opacity: 0; transform: translateY(70px) scale(0.3); }
  45% { opacity: 1; transform: translateY(14px) scale(0.9); }
  65% { transform: translateY(3px) scale(1.06, 0.94); }
  82% { transform: translateY(-2px) scale(0.97, 1.03); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes squash {
  0% { transform: scale(1, 1); }
  60% { transform: scale(1.07, 0.92); }
  100% { transform: scale(1.03, 0.97); }
}
@keyframes hole {
  from { --hole: calc(var(--s) * 0.05); --mx: var(--hx); --my: var(--hy); }
  to { --hole: calc(var(--s) * 0.46); --mx: calc(var(--s) / 2); --my: calc(var(--s) / 2); }
}
@keyframes film-out {
  to { opacity: 0; }
}

/* The splash left behind: a wispy rim with tendrils, then a spray of droplets. */
.splash {
  position: absolute;
  width: calc(var(--s) * 1.5);
  height: calc(var(--s) * 1.5);
  margin: calc(var(--s) * -0.75) 0 0 calc(var(--s) * -0.75);
  pointer-events: none;
}
.splash svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
}
.splash__rim { animation: splash-rim 0.42s ease-out forwards; }
.splash__spray { animation: splash-spray 0.3s 0.14s ease-out forwards; }
/* 0-43% (0.18s) tracks the hole's edge; then the rim spreads and decays away. It never brightens. */
@keyframes splash-rim {
  0% { opacity: 0.8; transform: translate(var(--dx), var(--dy)) scale(0.1) rotate(0deg); }
  43% { opacity: 0.6; transform: translate(0, 0) scale(0.92) rotate(5deg); }
  100% { opacity: 0; transform: translate(0, 0) scale(1.1) rotate(9deg); }
}
@keyframes splash-spray {
  0% { opacity: 0.55; transform: scale(0.85); }
  100% { opacity: 0; transform: scale(1.35); }
}

@media (prefers-reduced-motion: reduce) {
  .bubble.is-popping .bubble__body { animation: fade-out 0.15s forwards; }
  .bubble.is-arriving .bubble__body { animation: fade-in 0.4s both; }
  .splash { display: none; }
}
@keyframes fade-out { to { opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.site-header {
  position: relative;
  z-index: 2;
  padding-top: 16px;
}
/* Full-width wrappers above the bubbles let clicks through; only their real content takes them. */
.site-header,
.story-section {
  pointer-events: none;
}
.nav,
.story,
.steps {
  pointer-events: auto;
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 10px 10px 16px;
  border-radius: 999px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
  text-decoration: none;
}
.brand img {
  display: block;
}
.nav__links {
  display: flex;
  align-items: center;
  gap: 20px;
}
.nav__link {
  display: none;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}
.nav__link:hover {
  text-decoration: underline;
}
@media (min-width: 640px) {
  .nav__link { display: inline; }
}

.hero {
  position: relative;
  z-index: 1;
  max-width: calc(21ch + 2 * var(--gutter));
  margin-block: 0;
  padding-block: 64px 40px;
  text-align: center;
}
@media (min-width: 760px) {
  .hero { padding-block: 88px 56px; }
}

/* ---------- The story animation ---------- */

.story-section {
  position: relative;
  z-index: 1;
}

.story {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  padding-top: 64px; /* room for the source chips on mobile */
}
@media (min-width: 960px) {
  .story { padding-top: 0; }
}

.source {
  position: absolute;
  top: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-chip);
  background: #fff;
  border: 1px solid var(--silver);
  box-shadow: 0 4px 12px rgba(34, 52, 74, 0.08);
  font-size: 0.9375rem;
  font-weight: 600;
  white-space: nowrap;
  /* How far each chip drifts to end inside the card. */
  --to-x: 0px;
  --to-y: 120px;
}
.source svg { flex: none; }
.source--call { left: 0; }
.source--slack { left: 50%; margin-left: -38px; }
.source--schema { right: 0; }

@media (min-width: 960px) {
  .source { left: auto; right: auto; margin: 0; }
  .source--call { left: -190px; top: 60px; --to-x: 190px; --to-y: 40px; }
  .source--slack { left: -210px; top: 140px; --to-x: 210px; --to-y: -10px; }
  .source--schema { left: -180px; top: 220px; --to-x: 180px; --to-y: -60px; }
}

.card {
  position: relative;
  padding: 24px;
  border-radius: var(--r-panel);
  text-align: left;
}
.card__head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}
.card__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
}
.card__claim {
  margin: 0 0 2px;
  font-size: 1.1875rem;
  font-weight: 600;
}
.card__who {
  margin: 0 0 14px;
  color: var(--ink-soft);
  font-size: 1rem;
}
.card__check {
  padding: 12px 14px;
  border-radius: var(--r-card);
  background: #fff;
  border: 1px solid var(--silver);
}
.card__sql {
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}
.card__results {
  display: grid;
}
.card__result {
  grid-area: 1 / 1;
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

/* Marcus's answer, from his inbox. */
.reply {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--r-card);
  background: #e8f7fd;
  border: 1px solid #bfe6f6;
}
.avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--blue);
  font-size: 0.8125rem;
  font-weight: 600;
}
.reply__text {
  margin: 0 0 4px;
  font-size: 1rem;
  line-height: 1.45;
}
.reply__who {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.875rem;
}

/* The coding agent picking up the rule. */
.agent-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 0;
  padding: 8px 12px;
  border-radius: var(--r-chip);
  background: #e6f8f6;
  border: 1px solid #b4e9e3;
  font-size: 0.9375rem;
  font-weight: 600;
}
.agent-row svg { flex: none; color: #1f8f84; }

/* Status chip: four stacked states, crossfaded. The final state (Ready) is the resting one. */
.status {
  position: relative;
  display: grid;
  justify-items: start;
}
.status > * {
  grid-area: 1 / 1;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-chip);
  border: 1px solid;
  font-size: 0.9375rem;
  font-weight: 600;
  white-space: nowrap;
  background: #fff;
}
.chip--contradicted { border-color: var(--contradicted); background: #fdeeeb; }
.chip--confirmed { border-color: var(--blue); background: #e8f7fd; }
.chip--verified { border-color: var(--verified); background: #ebf6ed; }
.chip--ready { border-color: var(--leaf); background: #eef8ea; }
.chip--contradicted svg { color: #c9493a; }
.chip--confirmed svg { color: #1c8fb8; }
.chip--verified svg,
.chip--ready svg { color: var(--verified); }

.pulse {
  width: 34px;
  height: 34px;
  margin-left: 1px;
  align-self: center;
  border-radius: 50%;
  border: 2px solid;
  opacity: 0;
  pointer-events: none;
}
.pulse--contradicted { border-color: var(--contradicted); }
.pulse--confirmed { border-color: var(--blue); }
.pulse--verified { border-color: var(--verified); }
.pulse--ready { border-color: var(--leaf); }

/* Resting (and reduced-motion) state: the final frame. */
.chip--contradicted,
.chip--confirmed,
.chip--verified,
.card__result--fail {
  opacity: 0;
}

.steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px 20px;
  max-width: 900px;
  margin: 28px auto 0;
  padding: 0;
  list-style: none;
  font-size: 1rem;
}
@media (min-width: 560px) {
  .steps { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .steps { grid-template-columns: repeat(4, 1fr); }
}
.steps li {
  display: flex;
  gap: 8px;
  align-items: baseline;
}
.steps__dot {
  flex: none;
  position: relative;
  top: 1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  color: var(--blue);
  background: currentColor;
}
.steps li:last-child .steps__dot { color: var(--leaf); }
/* A ring that ripples out of the dot as its step arrives. */
.steps__dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  opacity: 0;
  pointer-events: none;
}

/* Shared timing for the looping animations. app.js adds .is-paused offscreen or in a hidden tab. */
@media (prefers-reduced-motion: no-preference) {
  .story *,
  .steps__dot,
  .steps__dot::after,
  .steps__text {
    animation-duration: 19.6s;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
  }
  .team *,
  .team *::after {
    animation-duration: 10s;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
  }
  .is-paused *,
  .is-paused *::after,
  .story.is-paused ~ .steps .steps__dot,
  .story.is-paused ~ .steps .steps__dot::after,
  .story.is-paused ~ .steps .steps__text {
    animation-play-state: paused;
  }

  .source { animation-name: source-in; }
  .source--slack { animation-delay: 0.33s; }
  .source--schema { animation-delay: 0.67s; }

  .chip--contradicted { animation-name: s-contradicted; }
  .chip--confirmed { animation-name: s-confirmed; }
  .chip--verified { animation-name: s-verified; }
  .chip--ready { animation-name: s-ready; }
  .pulse--contradicted { animation-name: p-contradicted; }
  .pulse--confirmed { animation-name: p-confirmed; }
  .pulse--verified { animation-name: p-verified; }
  .pulse--ready { animation-name: p-ready; }

  .card__result--fail { animation-name: r-fail; }
  .card__result--pass { animation-name: r-pass; }
  .reply { animation-name: reply; }
  .agent-row { animation-name: agent; }

  .steps li:nth-child(1) .steps__dot { animation-name: d1; }
  .steps li:nth-child(2) .steps__dot { animation-name: d2; }
  .steps li:nth-child(3) .steps__dot { animation-name: d3; }
  .steps li:nth-child(4) .steps__dot { animation-name: d4; }
  .steps li:nth-child(1) .steps__dot::after { animation-name: dp1; }
  .steps li:nth-child(2) .steps__dot::after { animation-name: dp2; }
  .steps li:nth-child(3) .steps__dot::after { animation-name: dp3; }
  .steps li:nth-child(4) .steps__dot::after { animation-name: dp4; }
  .steps li:nth-child(1) .steps__text { animation-name: t1; }
  .steps li:nth-child(2) .steps__text { animation-name: t2; }
  .steps li:nth-child(3) .steps__text { animation-name: t3; }
  .steps li:nth-child(4) .steps__text { animation-name: t4; }
}

/* Story timeline (19.6s): sources 0-15% (they rest beside the card before drifting in), then one step
   every 3.64s with a 1s beat between: Contradicted 16%, Confirmed with Marcus's reply 34%,
   Verified 53%, Ready with the coding agent 72%, hold to 95%. */
@keyframes source-in {
  0% { opacity: 0; transform: translate(calc(var(--to-x) * -0.35), calc(var(--to-y) * -0.35)); }
  3% { opacity: 1; transform: translate(0, 0); }
  10.6% { opacity: 1; transform: translate(0, 0); }
  15.1%, 100% { opacity: 0; transform: translate(var(--to-x), var(--to-y)) scale(0.6); }
}
@keyframes s-contradicted {
  0%, 15.8% { opacity: 0; transform: scale(0.9); }
  18.1%, 34.4% { opacity: 1; transform: scale(1); }
  36.6%, 100% { opacity: 0; transform: scale(1); }
}
@keyframes s-confirmed {
  0%, 34.4% { opacity: 0; transform: scale(0.9); }
  36.6%, 53% { opacity: 1; transform: scale(1); }
  55.2%, 100% { opacity: 0; transform: scale(1); }
}
@keyframes s-verified {
  0%, 53% { opacity: 0; transform: scale(0.9); }
  55.2%, 71.5% { opacity: 1; transform: scale(1); }
  73.8%, 100% { opacity: 0; transform: scale(1); }
}
@keyframes s-ready {
  0%, 71.5% { opacity: 0; transform: scale(0.9); }
  73.8%, 95.4% { opacity: 1; transform: scale(1); }
  99.1%, 100% { opacity: 0; transform: scale(1); }
}
@keyframes p-contradicted {
  0%, 16.5% { opacity: 0; transform: scale(0.6); }
  16.6% { opacity: 0.8; transform: scale(0.6); }
  23.3%, 100% { opacity: 0; transform: scale(2.6); }
}
@keyframes p-confirmed {
  0%, 35.1% { opacity: 0; transform: scale(0.6); }
  35.2% { opacity: 0.8; transform: scale(0.6); }
  41.9%, 100% { opacity: 0; transform: scale(2.6); }
}
@keyframes p-verified {
  0%, 53.6% { opacity: 0; transform: scale(0.6); }
  53.7% { opacity: 0.8; transform: scale(0.6); }
  60.5%, 100% { opacity: 0; transform: scale(2.6); }
}
@keyframes p-ready {
  0%, 72.2% { opacity: 0; transform: scale(0.6); }
  72.3% { opacity: 0.9; transform: scale(0.6); }
  79.8%, 100% { opacity: 0; transform: scale(2.8); }
}
@keyframes r-fail {
  0%, 15.1% { opacity: 0; }
  17.3%, 53% { opacity: 1; }
  55.2%, 100% { opacity: 0; }
}
@keyframes r-pass {
  0%, 53% { opacity: 0; }
  55.2%, 95.4% { opacity: 1; }
  99.1%, 100% { opacity: 0; }
}
@keyframes reply {
  0%, 35.2% { opacity: 0; transform: translateY(6px); }
  38.1%, 95.4% { opacity: 1; transform: translateY(0); }
  99.1%, 100% { opacity: 0; transform: translateY(0); }
}
@keyframes agent {
  0%, 72.3% { opacity: 0; transform: translateY(6px); }
  75.3%, 95.4% { opacity: 1; transform: translateY(0); }
  99.1%, 100% { opacity: 0; transform: translateY(0); }
}
@keyframes d1 { 0%, 15.8% { opacity: 0.25; } 18.1%, 95.4% { opacity: 1; } 99.1%, 100% { opacity: 0.25; } }
@keyframes d2 { 0%, 34.4% { opacity: 0.25; } 36.6%, 95.4% { opacity: 1; } 99.1%, 100% { opacity: 0.25; } }
@keyframes d3 { 0%, 53% { opacity: 0.25; } 55.2%, 95.4% { opacity: 1; } 99.1%, 100% { opacity: 0.25; } }
@keyframes d4 { 0%, 71.5% { opacity: 0.25; } 73.8%, 95.4% { opacity: 1; } 99.1%, 100% { opacity: 0.25; } }
@keyframes t1 { 0%, 15.8% { opacity: 0.45; } 18.1%, 95.4% { opacity: 1; } 99.1%, 100% { opacity: 0.45; } }
@keyframes t2 { 0%, 34.4% { opacity: 0.45; } 36.6%, 95.4% { opacity: 1; } 99.1%, 100% { opacity: 0.45; } }
@keyframes t3 { 0%, 53% { opacity: 0.45; } 55.2%, 95.4% { opacity: 1; } 99.1%, 100% { opacity: 0.45; } }
@keyframes t4 { 0%, 71.5% { opacity: 0.45; } 73.8%, 95.4% { opacity: 1; } 99.1%, 100% { opacity: 0.45; } }
@keyframes dp1 { 0%, 16.5% { opacity: 0; transform: scale(1); } 16.6% { opacity: 0.8; transform: scale(1); } 23.3%, 100% { opacity: 0; transform: scale(3.2); } }
@keyframes dp2 { 0%, 35.1% { opacity: 0; transform: scale(1); } 35.2% { opacity: 0.8; transform: scale(1); } 41.9%, 100% { opacity: 0; transform: scale(3.2); } }
@keyframes dp3 { 0%, 53.6% { opacity: 0; transform: scale(1); } 53.7% { opacity: 0.8; transform: scale(1); } 60.5%, 100% { opacity: 0; transform: scale(3.2); } }
@keyframes dp4 { 0%, 72.2% { opacity: 0; transform: scale(1); } 72.3% { opacity: 0.8; transform: scale(1); } 79%, 100% { opacity: 0; transform: scale(3.2); } }

/* The hill the story sits on. */
.hill {
  display: block;
  width: 100%;
  height: clamp(90px, 14vw, 180px);
  margin-top: 8px;
}

/* ---------- Ground: green from the hill, easing into blue ---------- */

.ground {
  background: linear-gradient(180deg, #e4f3dc 0px, #f0f8eb 260px, #eff8f1 55%, #e2f2f8 100%);
}

.section {
  padding-block: 72px;
}
.section__title {
  margin-bottom: 32px;
}

.steps-grid {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 760px) {
  .steps-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }
}

.tile {
  padding: 24px;
  border-radius: var(--r-card);
  background: #fff;
  border: 1px solid var(--silver);
}
.tile h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 1.375rem;
}
.tile p {
  margin: 0;
}

/* A numbered ring, glossy like the buttons. */
.ring-num {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--blue);
  box-shadow: inset 0 0 0 4px #fff, inset 0 0 0 6px rgba(52, 190, 237, 0.35);
  background: linear-gradient(180deg, #fff, #e8f7fd);
  font-size: 1rem;
  color: var(--ink);
}

/* ---------- Everyone works from the same map ---------- */

.team {
  position: relative;
  display: grid;
  gap: 16px;
}
.team__spokes,
.team__dot {
  display: none;
}

.team__map {
  justify-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 220px;
  aspect-ratio: 1;
  padding: 20px;
  border-radius: 50%;
  text-align: center;
}
.team__map img {
  display: block;
}
.team__map-name {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
}
.ticker {
  display: grid;
  width: 100%;
  min-height: 2.8em;
  font-size: 0.9375rem;
  line-height: 1.35;
}
.tick {
  grid-area: 1 / 1;
  opacity: 0;
}
.tick--static {
  opacity: 1;
}

.team__roles {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 560px) {
  .team__roles { grid-template-columns: 1fr 1fr; }
}

.role {
  position: relative;
  padding: 20px;
  border-radius: var(--r-card);
  background: #fff;
  border: 1px solid var(--silver);
}
.role h3 {
  margin: 12px 0 6px;
}
.role p {
  margin: 0;
}
.role__icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--c);
  background: var(--tint);
  color: var(--ink);
}
/* The ring that pings when this role acts. */
.role__icon::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid var(--c);
  opacity: 0;
}
.role--agents { --c: var(--aqua); --tint: #e6f8f6; }
.role--customer { --c: var(--blue); --tint: #e8f7fd; }
.role--engineers { --c: var(--leaf); --tint: #eef8ea; }
.role--coders { --c: var(--aqua); --tint: #e6f8f6; }

/* Desktop: the map in the middle, the four roles around it, dots travelling the spokes. */
@media (min-width: 900px) {
  .team {
    container-type: inline-size;
    grid-template-columns: 1fr 24% 1fr;
    grid-template-rows: 1fr 1fr;
    column-gap: 3%;
    row-gap: 32px;
    height: 460px;
  }
  .team__roles { display: contents; }
  .role {
    position: relative;
    z-index: 1;
    align-self: center;
  }
  .role--agents { grid-area: 1 / 1; }
  .role--customer { grid-area: 1 / 3; }
  .role--engineers { grid-area: 2 / 1; }
  .role--coders { grid-area: 2 / 3; }
  .team__map {
    grid-area: 1 / 2 / 3 / 3;
    align-self: center;
    width: 100%;
    z-index: 1;
  }
  .team__spokes {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }
  /* Dots start at the center; --x/--y point at a role card's inner edge. */
  .team__dot {
    display: block;
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 2;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border-radius: 50%;
    border: 1px solid #fff;
    background: radial-gradient(circle at 35% 30%, #fff 0 18%, var(--c) 60%);
    box-shadow: 0 0 12px var(--c);
    opacity: 0;
  }
  .team__dot--1 { --c: var(--aqua); --x: -16cqw; --y: -123px; }
  .team__dot--2 { --c: var(--blue); --x: 16cqw; --y: -123px; }
  .team__dot--3 { --c: var(--blue); --x: 16cqw; --y: -123px; }
  .team__dot--4 { --c: var(--leaf); --x: -16cqw; --y: 123px; }
  .team__dot--5 { --c: var(--aqua); --x: 16cqw; --y: 123px; }
}

/* Team timeline (10s): five hand-offs, one every 2s. */
@media (prefers-reduced-motion: no-preference) {
  .tick--static { display: none; }
  .tick { animation-name: tick; }
  .tick:nth-child(3) { animation-delay: 2s; }
  .tick:nth-child(4) { animation-delay: 4s; }
  .tick:nth-child(5) { animation-delay: 6s; }
  .tick:nth-child(6) { animation-delay: 8s; }

  .team__dot--1 { animation-name: dot-in; }
  .team__dot--2 { animation-name: dot-out; animation-delay: 2s; }
  .team__dot--3 { animation-name: dot-in; animation-delay: 4s; }
  .team__dot--4 { animation-name: dot-in; animation-delay: 6s; }
  .team__dot--5 { animation-name: dot-out; animation-delay: 8s; }

  .role__icon::after { animation-name: ping; }
  .role--customer .role__icon::after { animation-delay: 3.6s; }
  .role--engineers .role__icon::after { animation-delay: 6s; }
  .role--coders .role__icon::after { animation-delay: 9.6s; }
}
@keyframes tick {
  0% { opacity: 0; transform: translateY(4px); }
  3%, 18% { opacity: 1; transform: translateY(0); }
  20%, 100% { opacity: 0; transform: translateY(0); }
}
@keyframes dot-in {
  0% { opacity: 0; transform: translate(var(--x), var(--y)) scale(0.6); }
  3% { opacity: 1; transform: translate(var(--x), var(--y)) scale(1); }
  15% { opacity: 1; transform: translate(0, 0) scale(1); }
  18%, 100% { opacity: 0; transform: translate(0, 0) scale(0.6); }
}
@keyframes dot-out {
  0% { opacity: 0; transform: translate(0, 0) scale(0.6); }
  3% { opacity: 1; transform: translate(0, 0) scale(1); }
  15% { opacity: 1; transform: translate(var(--x), var(--y)) scale(1); }
  18%, 100% { opacity: 0; transform: translate(var(--x), var(--y)) scale(0.6); }
}
@keyframes ping {
  0% { opacity: 0; transform: scale(1); }
  2% { opacity: 0.9; transform: scale(1); }
  14%, 100% { opacity: 0; transform: scale(1.7); }
}

/* ---------- Ocean: the demo request and footer ---------- */

.ocean {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 50% 30% at 18% 12%, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0) 70%),
    radial-gradient(ellipse 40% 25% at 82% 30%, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0) 70%),
    linear-gradient(180deg, #cbe8f5 0%, #bfe3f3 45%, #aedbef 100%);
}
/* Soft light shafts from the surface. */
.ocean::before,
.ocean::after {
  content: "";
  position: absolute;
  top: 0;
  width: 220px;
  height: 100%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0));
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 70%);
  mask-image: linear-gradient(180deg, #000, transparent 70%);
  transform: skewX(-18deg);
  pointer-events: none;
}
.ocean::before { left: 18%; }
.ocean::after { left: 62%; width: 140px; opacity: 0.7; }

.waterline {
  display: block;
  width: 100%;
  height: 60px;
  margin-bottom: -1px;
  background: #e2f2f8;
}

.bubbles span {
  bottom: -40px;
  opacity: 0.85;
  border-color: rgba(255, 255, 255, 0.9);
  background:
    radial-gradient(circle at 32% 28%, #fff 0 10%, rgba(255, 255, 255, 0.3) 28%, rgba(255, 255, 255, 0) 48%),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.05) 50%, rgba(255, 255, 255, 0.55) 100%);
}
.bubbles span:nth-child(1) { left: 6%; width: 22px; height: 22px; }
.bubbles span:nth-child(2) { left: 14%; width: 12px; height: 12px; }
.bubbles span:nth-child(3) { left: 27%; width: 30px; height: 30px; }
.bubbles span:nth-child(4) { left: 44%; width: 14px; height: 14px; }
.bubbles span:nth-child(5) { left: 58%; width: 26px; height: 26px; }
.bubbles span:nth-child(6) { left: 71%; width: 10px; height: 10px; }
.bubbles span:nth-child(7) { left: 83%; width: 34px; height: 34px; }
.bubbles span:nth-child(8) { left: 93%; width: 16px; height: 16px; }
.bubbles span:nth-child(9) { left: 2%; width: 18px; height: 18px; }
.bubbles span:nth-child(10) { left: 97%; width: 24px; height: 24px; }
.bubbles span:nth-child(11) { left: 9%; width: 9px; height: 9px; }
.bubbles span:nth-child(12) { left: 89%; width: 12px; height: 12px; }

@media (prefers-reduced-motion: no-preference) {
  .bubbles span { animation: rise 18s linear infinite; }
  .bubbles span:nth-child(2) { animation-duration: 14s; animation-delay: -5s; }
  .bubbles span:nth-child(3) { animation-duration: 22s; animation-delay: -11s; }
  .bubbles span:nth-child(4) { animation-duration: 16s; animation-delay: -2s; }
  .bubbles span:nth-child(5) { animation-duration: 20s; animation-delay: -15s; }
  .bubbles span:nth-child(6) { animation-duration: 13s; animation-delay: -8s; }
  .bubbles span:nth-child(7) { animation-duration: 24s; animation-delay: -4s; }
  .bubbles span:nth-child(8) { animation-duration: 17s; animation-delay: -12s; }
  .bubbles span:nth-child(9) { animation-duration: 19s; animation-delay: -16s; }
  .bubbles span:nth-child(10) { animation-duration: 15s; animation-delay: -9s; }
  .bubbles span:nth-child(11) { animation-duration: 12s; animation-delay: -3s; }
  .bubbles span:nth-child(12) { animation-duration: 21s; animation-delay: -18s; }
}
@media (prefers-reduced-motion: reduce) {
  .bubbles span:nth-child(odd) { bottom: 30%; }
  .bubbles span:nth-child(even) { bottom: 60%; }
}
@keyframes rise {
  0% { opacity: 0; transform: translate3d(0, 0, 0); }
  10% { opacity: 0.85; }
  50% { transform: translate3d(12px, -420px, 0); }
  85% { opacity: 0.7; }
  100% { opacity: 0; transform: translate3d(-6px, -860px, 0); }
}

.ocean .section {
  position: relative;
  z-index: 1;
  padding-block: 40px 64px;
}

.demo {
  display: grid;
  gap: 28px;
  padding: 28px 20px;
  border-radius: var(--r-panel);
  background: rgba(255, 255, 255, 0.78);
}
@media (min-width: 900px) {
  .demo {
    gap: 32px;
    padding: 48px 56px;
  }
}
.demo__text {
  text-align: center;
}
.demo__text h2 {
  margin-bottom: 12px;
}
.demo__text p {
  margin: 0;
  font-size: clamp(1.125rem, 1rem + 0.4vw, 1.25rem);
}

.form {
  display: grid;
  gap: 18px;
}
@media (min-width: 760px) {
  .form {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
  .form > * {
    grid-column: 1 / -1;
  }
  .form > .field--short {
    grid-column: auto;
  }
}
.field {
  display: grid;
  gap: 6px;
}
.field label {
  font-weight: 600;
}
.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #b9c7d3;
  border-radius: var(--r-chip);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 1.0625rem;
}
.field textarea {
  min-height: 130px;
  resize: vertical;
}
.field input:focus-visible,
.field textarea:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
  border-color: var(--blue);
}
.field [aria-invalid="true"] {
  border-color: #c9493a;
}

/* Honeypot: off-screen rather than display:none, so naive bots still fill it. */
.hp {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.turnstile {
  display: flex;
  justify-content: center;
  min-height: 65px;
}

.form__submit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 20px;
}
.form-status {
  text-align: center;
}
.form__privacy {
  margin: 0;
  color: var(--ink);
  font-size: 0.9375rem;
}

.form-status {
  margin: 0;
  font-weight: 600;
}
.form-status:empty {
  display: none;
}
.form-status--error {
  padding: 12px 14px;
  border-radius: var(--r-chip);
  background: #fdeeeb;
  border: 1px solid var(--contradicted);
}

.success {
  padding: 28px;
  border-radius: var(--r-card);
  background: #fff;
  border: 1px solid var(--leaf);
}
.success h3 {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ---------- Footer ---------- */

.site-footer {
  position: relative;
  z-index: 1;
  padding-block: 8px 40px;
  font-size: 1rem;
}
.site-footer__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.7);
}
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}
.site-footer p {
  margin: 0;
}
.site-footer a {
  color: var(--ink);
}

/* ---------- Plain pages (privacy, 404) ---------- */

.plain {
  max-width: 44rem;
  padding-top: 48px;
  padding-bottom: 48px;
}
.plain h1 {
  font-size: clamp(2rem, 1.5rem + 2vw, 2.75rem);
}
.plain h2 {
  margin-top: 1.6em;
  font-size: 1.5rem;
}
.plain ul {
  padding-left: 1.2em;
}
.plain li {
  margin-bottom: 6px;
}
.plain__meta {
  color: var(--ink-soft);
}
