/* Mascot: a soft, character-led page. Pastel daylight, night sky after dark. */

:root {
  color-scheme: light;
  --bg: #fff7ee;
  --bg-2: #fdeee0;
  --surface: #ffffff;
  --surface-2: #fffaf3;
  --ink: #1f2f45;
  --ink-soft: #55627a;
  --line: #f1dfcb;
  --navy: #182735;
  --cream: #fff3d6;
  --pink: #ffd8cf;
  --pink-2: #ffe9e4;
  --pink-ink: #b8402f;
  --pink-strong: #e85d4a;
  --gold: #f2b84b;
  --gold-soft: #ffeab8;
  --gold-ink: #8a5c10;
  --teal: #2a9d8f;
  --teal-soft: #ccefe9;
  --teal-ink: #1b6f65;
  --lav: #e4e7fb;
  --lav-ink: #46508c;
  --bubble: #ffffff;
  --bubble-line: #f1dfcb;
  --shadow: 0 12px 30px -12px rgba(184, 64, 47, 0.25), 0 2px 6px rgba(31, 47, 69, 0.05);
  --shadow-soft: 0 6px 18px -8px rgba(31, 47, 69, 0.18);
  --glow: none;
  --code-bg: #22324a;
  --code-ink: #fff3d6;
  --blob-a: #ffd8cf;
  --blob-b: #ccefe9;
  --blob-c: #ffeab8;
  --font-display: "M PLUS Rounded 1c", "Nunito", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Menlo, Consolas, monospace;
  --r-lg: 28px;
  --r-md: 20px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d1430;
    --bg-2: #141d42;
    --surface: #1a2550;
    --surface-2: #1f2c5c;
    --ink: #fff3d6;
    --ink-soft: #c3c8e4;
    --line: #2d3a6e;
    --pink: rgba(232, 93, 74, 0.24);
    --pink-2: rgba(232, 93, 74, 0.14);
    --pink-ink: #ffab9c;
    --pink-strong: #ff8a78;
    --gold: #ffd27a;
    --gold-soft: rgba(242, 184, 75, 0.2);
    --gold-ink: #ffd88f;
    --teal: #5fd3c4;
    --teal-soft: rgba(42, 157, 143, 0.26);
    --teal-ink: #8ce6da;
    --lav: rgba(150, 160, 255, 0.18);
    --lav-ink: #c6cbff;
    --bubble: #24326a;
    --bubble-line: #3a4a8a;
    --shadow: 0 0 0 1px rgba(255, 255, 255, 0.05), 0 14px 40px -16px rgba(0, 0, 0, 0.7);
    --shadow-soft: 0 0 0 1px rgba(255, 255, 255, 0.05);
    --glow: 0 0 36px -6px rgba(95, 211, 196, 0.35);
    --code-bg: #0a1028;
    --code-ink: #fff3d6;
    --blob-a: rgba(232, 93, 74, 0.16);
    --blob-b: rgba(95, 211, 196, 0.14);
    --blob-c: rgba(160, 150, 255, 0.16);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1430;
  --bg-2: #141d42;
  --surface: #1a2550;
  --surface-2: #1f2c5c;
  --ink: #fff3d6;
  --ink-soft: #c3c8e4;
  --line: #2d3a6e;
  --pink: rgba(232, 93, 74, 0.24);
  --pink-2: rgba(232, 93, 74, 0.14);
  --pink-ink: #ffab9c;
  --pink-strong: #ff8a78;
  --gold: #ffd27a;
  --gold-soft: rgba(242, 184, 75, 0.2);
  --gold-ink: #ffd88f;
  --teal: #5fd3c4;
  --teal-soft: rgba(42, 157, 143, 0.26);
  --teal-ink: #8ce6da;
  --lav: rgba(150, 160, 255, 0.18);
  --lav-ink: #c6cbff;
  --bubble: #24326a;
  --bubble-line: #3a4a8a;
  --shadow: 0 0 0 1px rgba(255, 255, 255, 0.05), 0 14px 40px -16px rgba(0, 0, 0, 0.7);
  --shadow-soft: 0 0 0 1px rgba(255, 255, 255, 0.05);
  --glow: 0 0 36px -6px rgba(95, 211, 196, 0.35);
  --code-bg: #0a1028;
  --code-ink: #fff3d6;
  --blob-a: rgba(232, 93, 74, 0.16);
  --blob-b: rgba(95, 211, 196, 0.14);
  --blob-c: rgba(160, 150, 255, 0.16);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 6rem; }

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

img, svg { max-width: 100%; }
a { color: var(--pink-ink); text-underline-offset: 0.2em; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; border-radius: 12px; }

h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0; }

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--navy); color: #fff3d6; padding: 0.6rem 1rem; border-radius: 999px;
}
.skip:focus { top: 1rem; }

/* Background: pastel blobs by day, stars and a moon by night. */
.sky { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.sky::before, .sky::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(60px);
}
.sky::before { width: 46vw; height: 46vw; left: -12vw; top: -10vw; background: var(--blob-a); }
.sky::after { width: 40vw; height: 40vw; right: -10vw; top: 30vh; background: var(--blob-b); }
.stars, .moon { display: none; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body { background: radial-gradient(120% 80% at 50% 0%, #1b2656 0%, #0d1430 55%, #090e24 100%) fixed; }
  :root:not([data-theme="light"]) .stars, :root:not([data-theme="light"]) .moon { display: block; }
}
:root[data-theme="dark"] body { background: radial-gradient(120% 80% at 50% 0%, #1b2656 0%, #0d1430 55%, #090e24 100%) fixed; }
:root[data-theme="dark"] .stars, :root[data-theme="dark"] .moon { display: block; }

.stars { position: absolute; inset: 0; }
.stars-a {
  background-image:
    radial-gradient(1.4px 1.4px at 20px 30px, #fff3d6, transparent),
    radial-gradient(1px 1px at 90px 120px, #ffffff, transparent),
    radial-gradient(1.6px 1.6px at 160px 60px, #ffd27a, transparent),
    radial-gradient(1px 1px at 230px 180px, #ffffff, transparent),
    radial-gradient(1.2px 1.2px at 280px 20px, #bff3ea, transparent);
  background-size: 300px 220px;
  opacity: 0.8;
}
.stars-b {
  background-image:
    radial-gradient(1px 1px at 50px 80px, #ffffff, transparent),
    radial-gradient(1.5px 1.5px at 140px 10px, #fff3d6, transparent),
    radial-gradient(1px 1px at 200px 140px, #c6cbff, transparent),
    radial-gradient(1.3px 1.3px at 330px 90px, #ffffff, transparent);
  background-size: 380px 260px;
  opacity: 0.6;
}
.moon {
  position: absolute; right: 8vw; top: 110px; width: 70px; height: 70px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff8e6, #ffe3a3 70%);
  box-shadow: 0 0 60px 18px rgba(255, 227, 163, 0.18);
}
.moon::after {
  content: ""; position: absolute; width: 60px; height: 60px; border-radius: 50%;
  left: 22px; top: -8px; background: #141d42; opacity: 0.0;
}

/* Header. */
.site-header { position: sticky; top: 0; z-index: 50; padding: 0.8rem 1rem 0; }
.header-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; gap: 1rem;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 0.45rem 0.55rem 0.45rem 0.9rem;
  box-shadow: var(--shadow-soft);
}
.brand {
  display: flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-display); font-weight: 800; font-size: 1.25rem;
  color: var(--ink); text-decoration: none;
}
.brand img { width: 36px; height: 36px; }
.nav { margin-left: auto; }
.nav ul { list-style: none; display: flex; gap: 0.2rem; margin: 0; padding: 0; }
.nav a {
  display: block; padding: 0.45rem 0.85rem; border-radius: 999px;
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: 0.95rem;
}
.nav a:hover { background: var(--pink-2); color: var(--pink-ink); }
.header-actions { display: flex; align-items: center; gap: 0.5rem; }

.theme-seg {
  display: inline-flex; background: var(--bg-2); border-radius: 999px; padding: 3px;
  border: 1.5px solid var(--line);
}
.theme-seg button {
  font: 700 0.8rem/1 var(--font-body); color: var(--ink-soft);
  background: none; border: 0; border-radius: 999px; padding: 0.45rem 0.65rem; cursor: pointer;
}
.theme-seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12); }
html:not(.js) .theme-seg { display: none; }

/* Buttons. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  font: 800 1rem/1 var(--font-display);
  padding: 0.95rem 1.5rem; border-radius: 999px; border: 0;
  text-decoration: none; cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.3, 1.6, 0.5, 1), box-shadow 0.18s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(1px) scale(0.98); }
.btn-small { padding: 0.6rem 1rem; font-size: 0.9rem; }
.btn-pink { background: #e85d4a; color: #fff; box-shadow: 0 6px 0 #b8402f, 0 12px 24px -10px rgba(232, 93, 74, 0.7); }
.btn-pink:hover { box-shadow: 0 8px 0 #b8402f, 0 16px 28px -10px rgba(232, 93, 74, 0.7); }
.btn-soft { background: var(--surface); color: var(--ink); box-shadow: 0 6px 0 var(--line); border: 2px solid var(--line); }
.btn-navy { background: var(--navy); color: #fff3d6; }
:root[data-theme="dark"] .btn-navy { background: #fff3d6; color: #182735; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-navy { background: #fff3d6; color: #182735; } }
.btn-gold { background: #f2b84b; color: #182735; box-shadow: 0 5px 0 #c98a2b; }

/* Hero. */
.hero {
  max-width: 1200px; margin: 0 auto; padding: 3.5rem 1.25rem 4rem;
  display: grid; gap: 3rem; align-items: center;
}
@media (min-width: 1000px) {
  .hero { grid-template-columns: 1fr 1.05fr; gap: 2.5rem; padding-top: 4.5rem; }
}
.hero > * { min-width: 0; }
.chip-row { display: flex; gap: 0.5rem; margin: 0 0 1.2rem; flex-wrap: wrap; }
.chip {
  display: inline-block; font-weight: 800; font-size: 0.82rem; letter-spacing: 0.02em;
  padding: 0.35rem 0.8rem; border-radius: 999px; background: var(--pink); color: var(--pink-ink);
}
.chip-teal { background: var(--teal-soft); color: var(--teal-ink); }
h1 {
  font-size: clamp(2.3rem, 5.2vw, 3.9rem); font-weight: 800; letter-spacing: -0.01em;
  text-wrap: balance;
}
.lead { font-size: 1.2rem; color: var(--ink-soft); margin: 1.3rem 0 0; max-width: 34em; }
.cta { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 2rem; }
.works-with { margin: 1.8rem 0 0; font-weight: 700; font-size: 0.95rem; color: var(--ink-soft); }

/* Stage: mascot, bubble, and the demo flow card. */
.stage { position: relative; display: grid; gap: 1.2rem; justify-items: center; }
@media (min-width: 640px) {
  .stage { grid-template-columns: 1fr 1fr; align-items: end; }
}
.stage-mascot { position: relative; display: grid; justify-items: center; gap: 0.9rem; padding-top: 6.5rem; width: 100%; }
.mascot-wrap {
  position: relative; width: min(300px, 78vw); aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 55%, var(--cream) 0 52%, var(--pink) 53% 70%, transparent 71%);
}
:root[data-theme="dark"] .mascot-wrap { background: radial-gradient(circle at 50% 55%, rgba(255, 243, 214, 0.16) 0 52%, rgba(95, 211, 196, 0.12) 53% 70%, transparent 71%); box-shadow: 0 0 80px -10px rgba(95, 211, 196, 0.35); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mascot-wrap { background: radial-gradient(circle at 50% 55%, rgba(255, 243, 214, 0.16) 0 52%, rgba(95, 211, 196, 0.12) 53% 70%, transparent 71%); box-shadow: 0 0 80px -10px rgba(95, 211, 196, 0.35); }
}
.mascot { width: 100%; height: 100%; display: block; overflow: visible; filter: drop-shadow(0 14px 14px rgba(24, 39, 53, 0.18)); }

.key-spin, .gear-spin, .eye-blink { transform-box: fill-box; transform-origin: center; }
.eyes-happy { display: none; }
.mascot-wrap.is-happy .eyes-open { display: none; }
.mascot-wrap.is-happy .eyes-happy { display: inline; }
.mascot-wrap.is-blink .eye-blink { transform: scaleY(0.12); }
.cable-pulse { stroke-dasharray: 0.08 1; stroke-dashoffset: 1; opacity: 0; }

.key-hotspot {
  position: absolute; left: 7%; top: 1%; width: 27%; height: 27%;
  border-radius: 50%; border: 0; background: transparent; cursor: pointer;
}
.key-hotspot:hover { background: radial-gradient(circle, rgba(242, 184, 75, 0.35), transparent 70%); }
.key-hotspot:focus-visible { outline: 3px dashed var(--gold); outline-offset: 0; }
html:not(.js) .key-hotspot, html:not(.js) .wind-btn { display: none; }

@media (prefers-reduced-motion: no-preference) {
  .mascot-wrap .mascot { animation: bob 3.6s ease-in-out infinite; }
  .eye-blink { transition: transform 0.08s; }
  .mascot-wrap.is-winding .key-spin { animation: wind 0.45s linear 3; }
  .mascot-wrap.is-winding .mascot { animation: wobble 1.35s ease-in-out; }
  .mascot-wrap.is-running .gear-spin { animation: spin 1.6s linear infinite; }
  .mascot-wrap.is-running .cable-pulse { opacity: 1; animation: pulse 0.9s linear infinite; }
  .mascot-wrap.is-hop .mascot { animation: hop 0.6s cubic-bezier(0.3, 1.5, 0.5, 1) 2; }
  .mascot-wrap.is-shake .mascot { animation: shake 0.4s ease-in-out; }
}
@keyframes bob { 50% { transform: translateY(-6px); } }
@keyframes wind { 0% { transform: scaleX(1); } 50% { transform: scaleX(-1); } 100% { transform: scaleX(1); } }
@keyframes wobble { 20% { transform: rotate(-4deg); } 40% { transform: rotate(3deg); } 60% { transform: rotate(-2deg); } 80% { transform: rotate(1deg); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { to { stroke-dashoffset: 0; } }
@keyframes hop { 40% { transform: translateY(-18px) scale(1.02, 0.98); } 70% { transform: translateY(0) scale(1.04, 0.95); } }
@keyframes shake { 25% { transform: translateX(-5px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }

/* Speech bubbles. */
.bubble {
  position: relative; margin: 0;
  background: var(--bubble); color: var(--ink);
  border: 2px solid var(--bubble-line);
  border-radius: 22px; padding: 0.8rem 1rem;
  font-weight: 700; font-size: 0.98rem; line-height: 1.45;
  box-shadow: var(--shadow-soft), var(--glow);
}
.bubble::after {
  content: ""; position: absolute; width: 16px; height: 16px;
  background: var(--bubble); border: 2px solid var(--bubble-line);
  border-top: 0; border-left: 0;
  transform: rotate(45deg);
}
.bubble-hero {
  position: absolute; top: 0; left: 50%; translate: -50% 0;
  width: min(320px, 92%); z-index: 2; min-height: 5.4rem;
}
.bubble-hero::after { bottom: -9px; left: 60%; }
@media (prefers-reduced-motion: no-preference) {
  .bubble-hero.is-new { animation: bubble-pop 0.35s cubic-bezier(0.3, 1.6, 0.5, 1); }
}
@keyframes bubble-pop { from { transform: scale(0.92); } }

/* Demo flow card. */
.flowcard {
  width: 100%; max-width: 420px;
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--r-lg);
  padding: 1rem; box-shadow: var(--shadow), var(--glow);
}
.fc-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.8rem; }
.fc-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--teal); flex: none; }
.fc-title { font-size: 0.98rem; font-weight: 800; flex: 1; }
.fc-badge { font-size: 0.75rem; font-weight: 800; padding: 0.25rem 0.6rem; border-radius: 999px; background: var(--teal-soft); color: var(--teal-ink); white-space: nowrap; }
.fc-nodes { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; position: relative; }
.fc-node {
  position: relative;
  display: flex; align-items: center; gap: 0.6rem;
  background: var(--surface-2); border: 2px solid var(--line); border-radius: 16px;
  padding: 0.6rem 0.7rem;
  transition: border-color 0.2s, background-color 0.2s, transform 0.25s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.fc-text { display: grid; min-width: 0; flex: 1; }
.fc-text b { font-family: var(--font-display); font-weight: 800; font-size: 0.95rem; }
.fc-text small { color: var(--ink-soft); font-size: 0.78rem; line-height: 1.35; }
.fc-icon { width: 28px; height: 28px; border-radius: 10px; flex: none; position: relative; }
.fc-icon-trigger { background: var(--gold-soft); }
.fc-icon-trigger::after { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: var(--gold); }
.fc-icon-action { background: var(--teal-soft); }
.fc-icon-action::after { content: ""; position: absolute; left: 9px; top: 7px; width: 10px; height: 14px; border-radius: 3px; background: var(--teal); }
.fc-state {
  font-size: 0.72rem; font-weight: 800; padding: 0.2rem 0.55rem; border-radius: 999px;
  background: var(--bg-2); color: var(--ink-soft); white-space: nowrap;
}
.fc-tries { display: flex; gap: 4px; }
.fc-tries i { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); }
.fc-tries i.is-run { background: var(--gold); border-color: var(--gold); }
.fc-tries i.is-fail { background: var(--pink-strong); border-color: var(--pink-strong); }
.fc-tries i.is-ok { background: var(--teal); border-color: var(--teal); }
.fc-branches { display: grid; grid-template-columns: 1fr 1fr; gap: 0.55rem; }
.fc-branches .fc-node { padding-top: 1rem; }
.fc-port {
  position: absolute; top: -0.65rem; left: 0.7rem;
  font-size: 0.7rem; font-weight: 800; padding: 0.1rem 0.5rem; border-radius: 999px;
  background: var(--teal-soft); color: var(--teal-ink);
}
.fc-err .fc-port { background: var(--pink); color: var(--pink-ink); }
.fc-node.is-active { border-color: var(--gold); background: var(--gold-soft); transform: scale(1.02); }
.fc-node.is-failed { border-color: var(--pink-strong); background: var(--pink-2); }
.fc-node.is-ok { border-color: var(--teal); background: var(--teal-soft); }
.fc-node.is-dim { opacity: 0.45; }
.fc-node.is-active .fc-state { background: var(--gold); color: #182735; }
.fc-node.is-failed .fc-state { background: var(--pink-strong); color: #fff; }
.fc-node.is-ok .fc-state { background: var(--teal); color: #fff; }
:root[data-theme="dark"] .fc-node.is-ok .fc-state, :root[data-theme="dark"] .fc-node.is-failed .fc-state { color: #0d1430; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .fc-node.is-ok .fc-state, :root:not([data-theme="light"]) .fc-node.is-failed .fc-state { color: #0d1430; } }
.fc-log { margin: 0.8rem 0 0; font-size: 0.85rem; color: var(--ink-soft); font-weight: 600; }

/* Sections. */
.section { max-width: 1200px; margin: 0 auto; padding: 4.5rem 1.25rem; }
.section-tint { max-width: none; background: var(--bg-2); border-radius: 48px; margin-inline: clamp(0px, 2vw, 24px); }
.section-tint > * { max-width: 1160px; margin-inline: auto; }
:root[data-theme="dark"] .section-tint { background: rgba(20, 29, 66, 0.6); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .section-tint { background: rgba(20, 29, 66, 0.6); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05); } }

.section-head { text-align: center; margin-bottom: 3rem; }
.eyebrow {
  display: inline-block; margin: 0 0 0.8rem;
  font-weight: 800; font-size: 0.85rem; color: var(--pink-ink);
  background: var(--pink-2); padding: 0.3rem 0.85rem; border-radius: 999px;
}
.section h2 { font-size: clamp(1.8rem, 3.6vw, 2.7rem); font-weight: 800; text-wrap: balance; }
.section-lead { color: var(--ink-soft); font-size: 1.1rem; margin: 0.9rem auto 0; max-width: 36em; }

.guide-row {
  display: grid; gap: 1.2rem; align-items: center;
  margin: 0 auto 2.6rem; max-width: 1000px;
}
@media (min-width: 820px) {
  .guide-row { grid-template-columns: 260px 1fr; gap: 2rem; }
  .guide-row-flip { grid-template-columns: 1fr 260px; }
  .guide-row-flip .guide { order: 2; }
}
.guide { display: flex; align-items: flex-end; gap: 0.6rem; }
.guide-mascot { width: 88px; height: 88px; flex: none; }
.guide .bubble::after { left: -10px; bottom: 18px; transform: rotate(135deg); }
@media (min-width: 820px) {
  .guide { flex-direction: column; align-items: center; text-align: center; }
  .guide .bubble { order: -1; }
  .guide .bubble::after { left: calc(50% - 8px); bottom: -9px; transform: rotate(45deg); }
  .guide-mascot { width: 104px; height: 104px; }
}
@media (prefers-reduced-motion: no-preference) {
  .guide-mascot { animation: bob 4s ease-in-out infinite; }
  .guide-row:nth-child(odd) .guide-mascot { animation-delay: -1.5s; }
}
.guide-center { justify-content: center; max-width: 460px; margin: -1rem auto 2rem; }
@media (min-width: 820px) { .guide-center { flex-direction: row; text-align: left; } .guide-center .bubble { order: 2; } .guide-center .bubble::after { left: -10px; bottom: 22px; transform: rotate(135deg); } }

.card {
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--r-lg);
  padding: 1.6rem; box-shadow: var(--shadow);
}
.card h3 { font-size: 1.35rem; font-weight: 800; margin-bottom: 0.5rem; }
.card p { margin: 0 0 1rem; color: var(--ink-soft); }
.card p:last-child { margin-bottom: 0; }
.card-teal { border-color: var(--teal-soft); }
.card-teal h3 { color: var(--teal-ink); }
.card-pink { border-color: var(--pink); }
.card-pink h3 { color: var(--pink-ink); }
.card-gold { border-color: var(--gold-soft); }
.card-gold h3 { color: var(--gold-ink); }
.card-lav { border-color: var(--lav); }
.card-lav h3 { color: var(--lav-ink); }
.card-small h3 { font-size: 1.15rem; }
.card-small p { font-size: 0.98rem; }
.card-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* Flow editor illustration. Node cards follow the app's editor: header with icon,
   port rows with typed pills, port dots on the card edge, and bezier edges that
   script.js draws between the dots. Colors follow Catppuccin Latte and Mocha. */
.editor {
  --ed-canvas: #eff1f5; --ed-grid: #ccd0da; --ed-node: #ffffff; --ed-line: #bcc0cc; --ed-head: #e6e9ef;
  --ed-text: #4c4f69; --ed-sub: #6c6f85; --ed-pill: rgba(234, 118, 203, 0.16); --ed-pill-ink: #a8338a;
  --ed-edge: #ea76cb; --ed-in: #8c8fa1; --ed-ok: #40a02b; --ed-run: #1e66f5; --ed-warn: #df8e1d; --ed-err: #d20f39;
  container-type: inline-size;
  position: relative; height: 250px; margin-top: 1rem; border-radius: 18px; overflow: hidden;
  background: radial-gradient(var(--ed-grid) 1px, transparent 1.3px) 0 0 / 14px 14px, var(--ed-canvas);
  border: 2px solid var(--line);
  font-family: Inter, var(--font-body); color: var(--ed-text);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .editor {
    --ed-canvas: #11111b; --ed-grid: #2a2b3c; --ed-node: #1e1e2e; --ed-line: #45475a; --ed-head: #313244;
    --ed-text: #cdd6f4; --ed-sub: #a6adc8; --ed-pill: rgba(245, 194, 231, 0.16); --ed-pill-ink: #f5c2e7;
    --ed-edge: #f5c2e7; --ed-in: #7f849c; --ed-ok: #a6e3a1; --ed-run: #89b4fa; --ed-warn: #f9e2af; --ed-err: #f38ba8;
  }
}
:root[data-theme="dark"] .editor {
  --ed-canvas: #11111b; --ed-grid: #2a2b3c; --ed-node: #1e1e2e; --ed-line: #45475a; --ed-head: #313244;
  --ed-text: #cdd6f4; --ed-sub: #a6adc8; --ed-pill: rgba(245, 194, 231, 0.16); --ed-pill-ink: #f5c2e7;
  --ed-edge: #f5c2e7; --ed-in: #7f849c; --ed-ok: #a6e3a1; --ed-run: #89b4fa; --ed-warn: #f9e2af; --ed-err: #f38ba8;
}
.ed-inner { position: absolute; inset: 16px 18px; }
.ed-edges { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.ed-edges path { fill: none; stroke: var(--ed-edge); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: stroke 0.3s; }
.ed-edges path.is-active { stroke-width: 2.2; stroke-dasharray: 6 5; animation: edge-flow 0.6s linear infinite; }
.ed-edges path.is-err { stroke: var(--ed-err); }
.ed-edges circle { fill: var(--ed-edge); }
@keyframes edge-flow { to { stroke-dashoffset: -11; } }

.en {
  position: absolute; width: 20%; z-index: 1;
  background: var(--ed-node); border: 2px solid var(--ed-line); border-radius: 9px;
  font-size: 12px; line-height: 1.2; transition: border-color 0.3s, box-shadow 0.3s;
}
.en[data-en="mqtt"] { left: 0; top: 44px; }
.en[data-en="tw"] { left: 26.6%; top: 0; }
.en[data-en="ha"] { left: 53.3%; top: 30px; }
.en[data-en="notify"] { left: 80%; top: 112px; }
.en-head {
  display: flex; align-items: center; gap: 6px; padding: 7px 8px;
  border-bottom: 1px solid var(--ed-head); font-weight: 600;
}
.en-head b { font-weight: 600; min-width: 0; }
.en-ic { flex: none; width: 14px; height: 14px; fill: none; stroke: var(--ed-sub); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.en-chip {
  margin-left: auto; flex: none; font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 6px;
  background: var(--ed-head); color: var(--ed-text);
}
.en-row { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 4px; padding: 4px 8px; color: var(--ed-sub); }
.en-row:last-child { padding-bottom: 7px; }
.en-in, .en-out { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.en-pill { font-style: normal; font-size: 11px; font-weight: 600; padding: 1px 4px; border-radius: 4px; background: var(--ed-pill); color: var(--ed-pill-ink); }
.en-dot {
  position: absolute; right: -6px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--ed-edge); border: 2px solid var(--ed-node);
}
.en-dot-in { left: -6px; right: auto; background: var(--ed-in); }
.en-dot-err { background: var(--ed-err); }
.en-foot { padding: 5px 8px 7px; border-top: 1px solid var(--ed-head); font-size: 11px; color: var(--ed-sub); }

.en.is-run { border-color: var(--ed-run); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ed-run) 25%, transparent); }
.en.is-retry { border-color: var(--ed-warn); border-style: dashed; }
.en.is-ok { border-color: var(--ed-ok); }
.en.is-fail { border-color: var(--ed-err); box-shadow: inset 0 0 0 1px var(--ed-err); }
.en.is-retry .en-chip { background: color-mix(in srgb, var(--ed-warn) 25%, transparent); }
.en.is-fail .en-chip { background: color-mix(in srgb, var(--ed-err) 22%, transparent); }

/* Narrow cards: two columns, the third edge steps back through the gap between rows. */
@container (max-width: 640px) {
  .ed-inner { inset: 14px 12px; }
  .en { width: 44%; }
  .en[data-en="mqtt"] { left: 0; top: 12px; }
  .en[data-en="tw"] { left: 56%; top: 0; }
  .en[data-en="ha"] { left: 0; top: 150px; }
  .en[data-en="notify"] { left: 56%; top: 172px; }
}
@media (max-width: 700px) { .editor { height: 290px; } }

.guide-row-wide { grid-template-columns: 1fr; }
.guide-row-wide .guide { justify-content: center; }
@media (min-width: 820px) {
  .guide-row-wide { grid-template-columns: 1fr; gap: 1rem; }
  .guide-row-wide .guide { flex-direction: row; text-align: left; max-width: 520px; margin: 0 auto; }
  .guide-row-wide .guide .bubble { order: 2; }
  .guide-row-wide .guide .bubble::after { left: -10px; bottom: 22px; transform: rotate(135deg); }
}

/* Retry policy chips and beads. */
.policy { list-style: none; margin: 0 0 1.2rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0.5rem; }
.policy li { background: var(--pink-2); border-radius: 14px; padding: 0.5rem 0.75rem; display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.88rem; }
.policy b { font-family: var(--font-display); color: var(--pink-ink); }
.beads { display: flex; align-items: center; flex-wrap: wrap; row-gap: 0.6rem; }
.bead {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; font-size: 0.85rem; flex: none;
  background: var(--pink); color: var(--pink-ink); border: 2px solid var(--pink-strong);
}
.bead-err { width: auto; padding: 0 0.8rem; border-radius: 999px; background: var(--pink-strong); color: #fff; border-color: var(--pink-strong); }
:root[data-theme="dark"] .bead-err { color: #0d1430; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bead-err { color: #0d1430; } }
.gap { position: relative; height: 4px; width: calc(var(--g, 1) * 22px + 8px); background: repeating-linear-gradient(90deg, var(--pink-strong) 0 6px, transparent 6px 10px); margin: 0 4px; }
.gap em { position: absolute; top: -1.4rem; left: 50%; translate: -50% 0; font-style: normal; font-size: 0.75rem; font-weight: 800; color: var(--pink-ink); white-space: nowrap; }
.gap-err { width: 24px; background: var(--pink-strong); }
.policy-note { font-size: 0.82rem !important; margin: 0.8rem 0 0 !important; }

/* Versions illustration. */
.versions { display: grid; gap: 0.8rem; grid-template-columns: 1fr 1.4fr; align-items: center; }
.ver {
  background: var(--surface-2); border: 2px solid var(--line); border-radius: 16px;
  padding: 0.55rem 0.8rem; display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
}
.ver b { font-family: var(--font-display); }
.ver small { color: var(--ink-soft); font-size: 0.8rem; }
.ver-draft { flex-direction: column; align-items: flex-start; border-style: dashed; border-color: var(--gold); background: var(--gold-soft); }
.ver-btn { font-weight: 800; font-size: 0.8rem; background: var(--gold); color: #182735; padding: 0.25rem 0.7rem; border-radius: 999px; }
.ver-stack { display: grid; gap: 0.4rem; }
.ver-link { margin-left: auto; font-size: 0.78rem; font-weight: 800; color: var(--pink-ink); }
.ver-live { border-color: var(--teal); background: var(--teal-soft); }
.ver-live small { color: var(--teal-ink); font-weight: 700; }

/* Integration stickers. */
.stickers { list-style: none; margin: 0 auto; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.8rem; max-width: 1000px; }
.st {
  display: grid; padding: 0.7rem 1.1rem; border-radius: 22px;
  border: 2px solid transparent; box-shadow: var(--shadow-soft);
  transition: transform 0.25s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.st:nth-child(3n) { transform: rotate(-1.5deg); }
.st:nth-child(3n + 1) { transform: rotate(1deg); }
.st:hover { transform: translateY(-3px) rotate(0); }
.st b { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; }
.st small { font-size: 0.8rem; font-weight: 600; opacity: 0.85; }
.st-teal { background: var(--teal-soft); color: var(--teal-ink); }
.st-pink { background: var(--pink); color: var(--pink-ink); }
.st-gold { background: var(--gold-soft); color: var(--gold-ink); }
.st-lav { background: var(--lav); color: var(--lav-ink); }

/* Dashboards. */
.dash-layout { display: grid; gap: 2rem; align-items: start; }
@media (min-width: 960px) { .dash-layout { grid-template-columns: 1fr 1fr; gap: 2.5rem; } }
.dash-layout > * { min-width: 0; }
.dash-text { display: grid; gap: 1.6rem; }
.guide-row-tight { margin: 0; grid-template-columns: 1fr; }
@media (min-width: 820px) {
  .guide-row-tight { grid-template-columns: 1fr; }
  .guide-row-tight .guide { flex-direction: row; align-items: flex-end; text-align: left; }
  .guide-row-tight .guide .bubble { order: 2; }
  .guide-row-tight .guide .bubble::after { left: -10px; bottom: 18px; transform: rotate(135deg); }
  .guide-row-tight .guide-mascot { width: 80px; height: 80px; }
}
.tablet {
  background: #182735; border-radius: 34px; padding: 16px;
  box-shadow: 0 24px 50px -20px rgba(24, 39, 53, 0.5), var(--glow);
}
.tablet-screen { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile {
  border-radius: 18px; padding: 0.8rem; min-height: 110px;
  display: flex; flex-direction: column; gap: 0.15rem;
  background: #24364a; color: #fff3d6;
}
.tile small { font-size: 0.72rem; font-weight: 700; opacity: 0.8; }
.tile b { font-family: var(--font-display); font-size: 1.45rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.tile span { margin-top: auto; font-size: 0.7rem; opacity: 0.75; }
.tile-clock { grid-column: span 2; background: #fff3d6; color: #182735; }
.tile-clock b { font-size: 2.4rem; }
.tile-on { background: #f2b84b; color: #182735; }
.tile-chart svg { width: 100%; height: 38px; margin-top: auto; }
.tile-chart path { fill: none; stroke: #7ce0d3; stroke-width: 3; vector-effect: non-scaling-stroke; }
.media-bar { height: 6px; border-radius: 3px; background: rgba(255, 243, 214, 0.25); opacity: 1 !important; }
.media-bar i { display: block; height: 100%; width: 40%; border-radius: inherit; background: #e85d4a; }
.tile-cam { background: linear-gradient(160deg, #2e475c, #1c2b3a); }
.cam-dot::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #e85d4a; margin-right: 0.35rem; }
.tile-btn { background: #2a9d8f; }
.tablet-note { margin: 0.8rem 0 0; text-align: center; font-size: 0.78rem; color: #c3c8e4; }
.themes-label { font-weight: 800; color: var(--ink) !important; margin-bottom: 0.6rem !important; }
.themes { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.themes li {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.85rem; font-weight: 700; padding: 0.3rem 0.7rem 0.3rem 0.35rem; border-radius: 999px;
  background: var(--bg-2);
}
.themes li::before {
  content: ""; width: 18px; height: 18px; border-radius: 50%;
  background: linear-gradient(135deg, var(--c1) 50%, var(--c2) 50%);
  box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, 0.15);
}
.formats { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.formats li { font-weight: 800; font-size: 0.82rem; padding: 0.3rem 0.7rem; border-radius: 10px; background: var(--lav); color: var(--lav-ink); }

/* Operations. */
/* Remote machine agents: a server with its enrolled machines, then what an
   agent adds. */
.agent-map {
  position: relative; display: grid; gap: 1.2rem; align-items: center; margin: 0 auto 2.5rem;
  grid-template-columns: 1fr; max-width: 1040px;
}
@media (min-width: 900px) {
  .agent-map { grid-template-columns: 240px 1fr; gap: 3rem; }
}
.agent-server {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.3rem;
  padding: 1.4rem 1rem; border-radius: var(--r-lg); background: var(--surface); border: 2px solid var(--teal);
  box-shadow: var(--shadow), var(--glow);
}
.agent-server img { width: 72px; height: 72px; }
.agent-server b { font-family: var(--font-display); font-size: 1.1rem; }
.agent-server small { color: var(--ink-soft); font-size: 0.85rem; }
@media (min-width: 900px) {
  /* The link from the server to the machines' column. */
  .agent-server::after {
    content: ""; position: absolute; left: 100%; top: 50%; width: 3rem; border-top: 3px dashed var(--teal);
  }
}
.machines { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
@media (min-width: 900px) { .machines { grid-template-columns: repeat(2, 1fr); } }
.machine {
  padding: 0.9rem 1rem 1rem; border-radius: var(--r-md); background: var(--surface);
  border: 2px solid var(--line); box-shadow: var(--shadow-soft);
}
.machine-head { display: flex; align-items: baseline; gap: 0.5rem; margin-bottom: 0.6rem; }
.machine-head b { font-family: var(--mono); font-size: 0.95rem; }
.machine-head small { margin-left: auto; color: var(--ink-soft); font-size: 0.8rem; font-weight: 700; }
.machine-dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--teal); align-self: center; box-shadow: 0 0 0 3px var(--teal-soft); }
.machine-nodes { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.machine-nodes li {
  font-size: 0.8rem; font-weight: 700; padding: 0.2rem 0.6rem; border-radius: 999px;
  background: var(--lav); color: var(--lav-ink);
}
.agent-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 2rem; }
.agent-install {
  display: grid; gap: 1.5rem; margin-top: 2rem; padding: 1.4rem; align-items: center;
  border-radius: var(--r-lg); background: var(--surface); border: 2px solid var(--line); box-shadow: var(--shadow);
}
@media (min-width: 900px) { .agent-install { grid-template-columns: 1fr 1.1fr; } }
.agent-install > * { min-width: 0; }
.agent-install h3 { margin: 0 0 0.5rem; }
.agent-install p { margin: 0 0 0.6rem; }
.agent-note { color: var(--ink-soft); font-size: 0.92rem; }

.ops-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

/* Install. */
.install { display: grid; gap: 1.5rem; max-width: 980px; margin: 0 auto; align-items: start; }
@media (min-width: 820px) { .install { grid-template-columns: 220px 1fr; } .install .guide { padding-top: 2rem; } }
.install > * { min-width: 0; }
.install-card { background: var(--surface); border: 2px solid var(--line); border-radius: var(--r-lg); padding: 1.4rem; box-shadow: var(--shadow), var(--glow); }
.tabs { display: inline-flex; flex-wrap: wrap; max-width: 100%; background: var(--bg-2); border-radius: 24px; padding: 4px; margin-bottom: 1rem; }
.tabs[hidden] { display: none; }
.tabs button {
  font: 800 0.92rem/1 var(--font-display); color: var(--ink-soft);
  border: 0; background: none; padding: 0.6rem 1.1rem; border-radius: 999px; cursor: pointer;
}
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12); }
.panel + .panel { margin-top: 1.4rem; }
.js-tabs .panel + .panel { margin-top: 0; }
.panel-title { font-size: 1.1rem; margin-bottom: 0.6rem; }
.js-tabs .panel-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.panel-note { margin: 0.8rem 0 0; font-size: 0.92rem; color: var(--ink-soft); }
.code { position: relative; background: var(--code-bg); border-radius: 18px; }
.code pre {
  margin: 0; padding: 1.1rem 1.2rem; overflow-x: auto;
  font-family: var(--mono); font-size: 0.84rem; line-height: 1.7; color: var(--code-ink);
}
.js .code pre { padding-top: 2.8rem; }
.copy {
  position: absolute; top: 0.6rem; right: 0.6rem;
  font: 800 0.78rem/1 var(--font-body); color: #182735; background: #ffeab8;
  border: 0; border-radius: 999px; padding: 0.45rem 0.85rem; cursor: pointer;
}
.copy.is-copied { background: #7ce0d3; }
html:not(.js) .copy { display: none; }
.install-after { margin: 1.2rem 0 0; font-weight: 600; }
.panel-step { display: flex; align-items: center; gap: 0.6rem; margin: 1.1rem 0 0.6rem; font-weight: 700; }
.panel .panel-step:first-of-type { margin-top: 0; }
.step-n {
  flex: none; display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem;
  border-radius: 50%; background: var(--gold-soft); color: var(--gold-ink); font: 800 0.85rem/1 var(--font-display);
}
.panel-step code, .panel-note code {
  font-family: var(--mono); font-size: 0.86em; background: var(--bg-2); padding: 0.1em 0.4em; border-radius: 6px;
}

/* Footer. */
.site-footer { margin-top: 3rem; color: #fff3d6; }
.footer-hill { display: block; width: 100%; height: 60px; }
.footer-hill path { fill: #182735; }
.footer-inner {
  background: #182735; padding: 1.5rem 1.25rem 2.5rem;
  display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: space-between; align-items: center;
}
.footer-inner > * { max-width: 1160px; }
.footer-brand { display: flex; gap: 0.8rem; align-items: center; }
.footer-brand p { margin: 0; font-size: 0.95rem; }
.footer-links { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.2rem; flex-wrap: wrap; }
.footer-links a { color: #ffeab8; font-weight: 700; }
@media (min-width: 1200px) { .footer-inner { padding-inline: calc((100% - 1160px) / 2); } }

/* Scroll reveal: a soft bounce in when JS runs and motion is allowed. */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(28px) scale(0.97); }
  .js .reveal.is-in { animation: bounce-in 0.7s cubic-bezier(0.3, 1.45, 0.5, 1) forwards; }
}
@keyframes bounce-in {
  0% { opacity: 0; transform: translateY(28px) scale(0.97); }
  60% { opacity: 1; transform: translateY(-6px) scale(1.01); }
  100% { opacity: 1; transform: none; }
}

/* Narrow screens. */
@media (max-width: 860px) {
  .header-inner { flex-wrap: wrap; border-radius: 26px; row-gap: 0.2rem; }
  .header-actions { margin-left: auto; }
  .nav { order: 3; width: 100%; margin: 0; }
  .nav ul { justify-content: center; flex-wrap: wrap; gap: 0; }
  .nav a { padding: 0.3rem 0.45rem; font-size: 0.82rem; }
}
@media (max-width: 480px) {
  .site-header { padding: 0.5rem 0.5rem 0; }
  .header-inner { padding: 0.35rem 0.4rem 0.35rem 0.6rem; gap: 0.4rem; }
  .brand span { display: none; }
  .theme-seg button { padding: 0.4rem 0.5rem; font-size: 0.75rem; }
  .btn-small { padding: 0.5rem 0.75rem; font-size: 0.82rem; }
  .tablet-screen { grid-template-columns: repeat(2, 1fr); }
  .tile-clock { grid-column: span 2; }
  .versions { grid-template-columns: 1fr; }
  .card { padding: 1.2rem; }
  .section { padding: 3.5rem 1rem; }
  .section-tint { border-radius: 32px; }
}

/* Layout refinements. */
@media (min-width: 1000px) {
  .hero { grid-template-columns: 0.92fr 1.08fr; }
}
@media (min-width: 640px) {
  .stage { grid-template-columns: minmax(220px, 250px) minmax(0, 1fr); align-items: center; }
  .stage .mascot-wrap { width: min(250px, 100%); }
  .stage .bubble-hero { width: 100%; }
}
.flowcard { min-width: 0; }
@media (min-width: 600px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
.ops-grid { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.tile-cam { grid-column: 1 / -1; min-height: 80px; }
h1 { font-size: clamp(2.2rem, 4.4vw, 3.4rem); }
.chip { background: var(--surface); box-shadow: inset 0 0 0 2px var(--pink); }
.chip-teal { box-shadow: inset 0 0 0 2px var(--teal-soft); background: var(--teal-soft); }
@media (max-width: 700px) { .moon { display: none !important; } }

/* Phones: mascot and bubble sit side by side directly above the flow card,
   so the narration stays on screen while the card runs. */
@media (max-width: 639px) {
  .stage { gap: 0.9rem; justify-items: stretch; }
  .stage-mascot {
    padding-top: 0;
    grid-template-columns: 128px minmax(0, 1fr);
    grid-template-areas: "mascot bubble" "wind bubble";
    align-items: center; column-gap: 0.9rem; row-gap: 0.5rem;
  }
  .stage .mascot-wrap { grid-area: mascot; width: 128px; }
  .stage .wind-btn { grid-area: wind; padding: 0.6rem 0.8rem; font-size: 0.85rem; justify-self: center; }
  .stage .bubble-hero {
    grid-area: bubble; position: relative; top: auto; left: auto; translate: none;
    width: auto; align-self: center;
    min-height: 8.6em; display: flex; align-items: center;
    font-size: 0.92rem; padding: 0.7rem 0.85rem;
  }
  .stage .bubble-hero::after { left: -10px; top: calc(50% - 8px); bottom: auto; transform: rotate(135deg); }
  .stage .flowcard { max-width: none; }
  .stage-mascot { scroll-margin-top: 7.2rem; }
}

/* Phones: the nav stays one line and scrolls sideways when its links do not
   fit, rather than wrapping the header taller. */
@media (max-width: 560px) {
  .nav ul { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; }
  .nav ul::-webkit-scrollbar { display: none; }
  .nav li { flex: none; }
  .nav-wide { display: none; }
  .nav a { padding: 0.3rem 0.4rem; font-size: 0.8rem; white-space: nowrap; }
}
@media (max-width: 360px) {
  .nav a { padding: 0.3rem 0.28rem; font-size: 0.76rem; }
}
