/*
  Pywa Cloud — design system
  --------------------------------------------------------------
  This file is the shared visual language for Pywa Cloud: the marketing
  site today, the dashboard eventually. Dark foundation, restrained
  WhatsApp-green accent, monospace used as a design material (labels,
  status, diagrams) rather than only for code. No framework, no build
  step — plain CSS custom properties so any of this can be lifted into
  the dashboard's own stylesheet later without translation.
*/

:root {
  color-scheme: dark;

  /* ---- surfaces ---- */
  --bg: #0a0a0b;
  --bg-raised: #0e0f11;
  --surface: #131418;
  --surface-2: #191b1f;
  --surface-3: #202329;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);
  --border-accent: rgba(47, 214, 107, 0.35);

  /* ---- text ---- */
  --text-1: #f3f2ee;
  --text-2: #9a9ea5;
  --text-3: #676b72;

  /* ---- accent: WhatsApp green, deliberately restrained ---- */
  --accent: #2fd66b;
  --accent-strong: #48e37f;
  --accent-dim: #1f9950;
  --accent-soft: rgba(47, 214, 107, 0.12);
  --accent-soft-strong: rgba(47, 214, 107, 0.22);
  --accent-line: rgba(47, 214, 107, 0.4);

  /* ---- signal colors, used sparingly ---- */
  --danger: #f2555a;
  --danger-soft: rgba(242, 85, 90, 0.12);
  --warning: #e2a33d;

  /* ---- type ---- */
  --font-display: "Space Grotesk", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* ---- spacing scale ---- */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
  --sp-9: 96px;
  --sp-10: 140px;

  /* ---- radius: small and consistent, not pill-shaped ---- */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 24px;

  --content-width: 1160px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-1);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a {
  color: inherit;
}

.wrap {
  max-width: var(--content-width);
  margin: 0 auto;
  padding-inline: var(--sp-5);
}

@media (max-width: 640px) {
  .wrap {
    padding-inline: var(--sp-4);
  }
}

section {
  padding-block: var(--sp-9);
  position: relative;
}

@media (max-width: 900px) {
  section {
    padding-block: var(--sp-8);
  }
}

@media (max-width: 560px) {
  section {
    padding-block: var(--sp-7);
  }
}

.section-seam {
  border-top: 1px solid var(--border);
}

/* ---------------------------------------------------------------- */
/* Typography                                                        */
/* ---------------------------------------------------------------- */

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--text-1);
}

h1 {
  font-size: clamp(2.4rem, 5.2vw, 3.9rem);
  line-height: 1.06;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.7rem, 3.2vw, 2.5rem);
  line-height: 1.15;
}

h3 {
  font-size: 1.2rem;
  line-height: 1.3;
}

p {
  margin: 0;
}

.lede {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  color: var(--text-2);
  max-width: 46ch;
  line-height: 1.6;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}

.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.section-head {
  max-width: 640px;
  margin-bottom: var(--sp-7);
}

.section-head h2 {
  margin-bottom: var(--sp-3);
}

.section-head p {
  color: var(--text-2);
  font-size: 1.05rem;
  max-width: 54ch;
}

code,
.mono {
  font-family: var(--font-mono);
}

/* ---------------------------------------------------------------- */
/* Buttons                                                           */
/* ---------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  font-family: var(--font-body);
  font-size: 0.94rem;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s var(--ease), background 0.15s var(--ease), border-color 0.15s var(--ease);
  white-space: nowrap;
}

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

.btn-primary {
  background: var(--accent);
  color: #08130c;
}

.btn-primary:hover {
  background: var(--accent-strong);
}

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  padding: 8px 4px;
}

.btn-ghost:hover {
  color: var(--text-1);
}

.btn-ghost::after {
  content: "→";
  transition: transform 0.15s var(--ease);
}

.btn-ghost:hover::after {
  transform: translateX(3px);
}

/* ---------------------------------------------------------------- */
/* Nav                                                                */
/* ---------------------------------------------------------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 10, 11, 0.78);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s var(--ease);
}

.nav.is-scrolled {
  border-bottom-color: var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-1);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
}

.brand svg {
  width: 20px;
  height: 20px;
  color: var(--text-1);
}

.brand .dim {
  color: var(--text-2);
  font-weight: 500;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
}

.nav-links a:not(.btn) {
  font-size: 0.92rem;
  color: var(--text-2);
  text-decoration: none;
  transition: color 0.15s var(--ease);
}

.nav-links a:not(.btn):hover {
  color: var(--text-1);
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

.nav-menu-btn {
  display: none;
  background: none;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  color: var(--text-1);
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
}

@media (max-width: 780px) {
  .nav-links {
    display: none;
  }
  .nav-links.is-open {
    display: flex;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-4);
    background: var(--bg-raised);
    padding: var(--sp-5);
    border-bottom: 1px solid var(--border);
  }
  .nav-menu-btn {
    display: inline-flex;
  }
}

@media (max-width: 380px) {
  /* Below ~380px (a 360px Android is the common case) the full-size "Join the waitlist" pill
     crowds straight into the hamburger button, sometimes past the viewport edge - the hero has
     its own copy of this same CTA one scroll away, so the nav's version can afford to shrink. */
  .nav-cta {
    gap: var(--sp-2);
  }
  .nav-cta .btn-primary {
    padding: 10px 14px;
    font-size: 0.82rem;
  }
}

/* ---------------------------------------------------------------- */
/* Badge / status chips                                              */
/* ---------------------------------------------------------------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--text-2);
  background: var(--surface);
}

.chip .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.chip.live {
  color: var(--accent-strong);
  border-color: var(--border-accent);
  background: var(--accent-soft);
}

.chip.live .dot {
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%,
  100% {
    box-shadow: 0 0 0 0 var(--accent-soft-strong);
  }
  50% {
    box-shadow: 0 0 0 5px transparent;
  }
}

/* ---------------------------------------------------------------- */
/* Hero                                                               */
/* ---------------------------------------------------------------- */

.hero {
  padding-top: var(--sp-8);
  padding-bottom: var(--sp-9);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: var(--sp-8);
  align-items: center;
}

@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
    gap: var(--sp-6);
  }
}

.hero-top,
.hero-stage {
  min-width: 0;
}

.hero h1 {
  margin-bottom: var(--sp-4);
}

.hero .lede {
  max-width: 54ch;
  margin-bottom: var(--sp-6);
}

.hero-ctas {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  flex-wrap: wrap;
  margin-bottom: var(--sp-4);
}

.hero-note {
  color: var(--text-3);
  font-size: 0.85rem;
}

@media (max-width: 960px) {
  .hero-stage {
    margin-top: var(--sp-6);
  }
}

/* ---------------------------------------------------------------- */
/* Terminal window                                                   */
/* ---------------------------------------------------------------- */

.terminal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.6);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 12px var(--sp-4);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.terminal-dots {
  display: flex;
  gap: 6px;
}

.terminal-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--surface-3);
}

.terminal-dots span:nth-child(1) {
  background: #ff5f56;
}
.terminal-dots span:nth-child(2) {
  background: #ffbd2e;
}
.terminal-dots span:nth-child(3) {
  background: #27c93f;
}

.terminal-title {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-3);
}

.terminal-body {
  padding: var(--sp-5) var(--sp-5) var(--sp-6);
  font-family: var(--font-mono);
  font-size: 0.92rem;
  line-height: 1.75;
  min-height: 300px;
  overflow-wrap: anywhere;
}

@media (max-width: 560px) {
  .terminal-body {
    font-size: 0.8rem;
    padding: var(--sp-4);
    min-height: 260px;
  }
}

.term-line {
  opacity: 0;
  transform: translateY(4px);
  white-space: pre-wrap;
}

.term-line.shown {
  opacity: 1;
  transform: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}

.term-prompt {
  color: var(--text-2);
}

.term-cmd {
  color: var(--text-1);
}

.term-ok {
  color: var(--accent);
}

.term-dim {
  color: var(--text-3);
}

.term-status {
  margin-top: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}

.term-status.shown {
  opacity: 1;
}

.term-status-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-1) var(--sp-3);
}

.term-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.term-status.shown .term-status-dot {
  animation: pulse-dot 2s ease-in-out infinite;
}

.term-status-name {
  color: var(--text-1);
}

.term-status-phone {
  color: var(--text-3);
  font-size: 0.82rem;
}

.term-status-sep {
  color: var(--text-3);
  font-size: 0.82rem;
  line-height: 1;
  margin-inline: calc(-1 * var(--sp-1));
}

.term-status-badge {
  color: var(--accent-strong);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: var(--sp-3);
}

.term-status {
  flex-wrap: wrap;
  gap: var(--sp-2);
}

/* ---------------------------------------------------------------- */
/* Code panel (non-terminal, for source display)                     */
/* ---------------------------------------------------------------- */

.code-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.code-panel .terminal-bar {
  background: var(--surface-2);
}

.code-body {
  padding: var(--sp-5);
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.7;
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--text-2);
}

.code-body .kw,
.seq-step .kw {
  color: #ef8fd0;
}
.code-body .fn,
.seq-step .fn {
  color: #7cc6ff;
}
.code-body .str,
.seq-step .str {
  color: var(--accent-strong);
}
.code-body .nm,
.seq-step .nm {
  color: #f0b25b;
}
.seq-step .tp {
  color: #5fd0c0;
}

/* ---------------------------------------------------------------- */
/* Magic moment — three step sequence                                 */
/* ---------------------------------------------------------------- */

.sequence {
  display: grid;
  grid-template-columns: 1.8fr auto 1fr auto 0.8fr;
  align-items: stretch;
  gap: var(--sp-4);
}

@media (max-width: 980px) {
  .sequence {
    grid-template-columns: 1fr;
  }
  .sequence .seq-arrow {
    transform: rotate(90deg);
    margin-block: -4px;
  }
}

.seq-step {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--sp-4);
  transition: border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.seq-step.active {
  border-color: var(--border-accent);
  box-shadow: 0 0 0 1px var(--border-accent) inset, 0 20px 50px -30px var(--accent-soft-strong);
}

.seq-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}

.seq-step.active .seq-label {
  color: var(--accent);
}

.seq-step pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.65;
  color: var(--text-2);
  overflow-x: auto;
  /* Same problem `.pipeline` already solves below: a long line (main.py's reply_text call) can
     run past the panel's edge on a narrow viewport with nothing to show more is scrollable. */
  mask-image: linear-gradient(to right, black calc(100% - 24px), transparent);
  -webkit-mask-image: linear-gradient(to right, black calc(100% - 24px), transparent);
}

.seq-step.active pre {
  color: var(--text-1);
}

.seq-arrow {
  align-self: center;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 1.1rem;
}

/* ---------------------------------------------------------------- */
/* Architecture — ownership statement                                 */
/* ---------------------------------------------------------------- */

.ownership {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-8);
  padding: var(--sp-7) 0;
}

@media (max-width: 700px) {
  .ownership {
    flex-direction: column;
    gap: var(--sp-5);
    padding: var(--sp-6) 0;
  }

  .ownership-divider {
    width: 100%;
    height: 1px;
  }
}

.ownership-col {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.ownership-col-wide {
  flex: 1;
  min-width: 0;
}

.ownership-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-3);
}

.ownership-value {
  font-family: var(--font-mono);
  font-size: 2.2rem;
  font-weight: 600;
  color: var(--text-1);
}

.ownership-divider {
  width: 1px;
  align-self: stretch;
  background: var(--border);
  flex-shrink: 0;
}

.ownership-list {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--text-1);
  margin: 0;
  max-width: 640px;
}

/* ---------------------------------------------------------------- */
/* Security pipeline                                                 */
/* ---------------------------------------------------------------- */

.pipeline {
  display: flex;
  align-items: flex-start;
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: var(--sp-3);
}

@media (max-width: 1100px) {
  .pipeline {
    mask-image: linear-gradient(to right, black calc(100% - 40px), transparent);
    -webkit-mask-image: linear-gradient(to right, black calc(100% - 40px), transparent);
  }
}

.pipe-stage {
  flex: 0 0 184px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--sp-2);
}

.pipe-box {
  width: 100%;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: var(--r-md);
  padding: var(--sp-4) var(--sp-3);
}

.pipe-stage.pass .pipe-box {
  border-color: var(--border-accent);
}

.pipe-icon {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  color: var(--accent);
  margin-bottom: var(--sp-2);
}

.pipe-title {
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 4px;
}

.pipe-detail {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-3);
}

.pipe-connector {
  flex: 0 0 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  font-family: var(--font-mono);
  padding-top: 44px;
}

.pipe-reject-slot {
  min-height: 30px;
  display: flex;
  align-items: flex-start;
}

.pipe-reject {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid rgba(242, 85, 90, 0.3);
  border-radius: var(--r-sm);
  padding: 4px 8px;
  white-space: nowrap;
}

.security-facts {
  margin-top: var(--sp-8);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-3) var(--sp-6);
}

@media (max-width: 700px) {
  .security-facts {
    grid-template-columns: 1fr;
  }
}

.security-facts li {
  list-style: none;
  padding-left: var(--sp-5);
  position: relative;
  color: var(--text-2);
  font-size: 0.94rem;
  line-height: 1.5;
}

.security-facts li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 8px;
  height: 1px;
  background: var(--accent);
}

.security-facts {
  margin-left: 0;
  padding-left: 0;
}

.security-note {
  margin-top: var(--sp-6);
  padding: var(--sp-4) var(--sp-5);
  border: 1px solid var(--border);
  border-left: 2px solid var(--warning);
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 0.9rem;
  background: var(--surface);
}

.architecture-note {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
}

.architecture-note-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--text-2);
}

.security-note a {
  color: var(--text-1);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 3px;
}

/* ---------------------------------------------------------------- */
/* Two-column layout helper                                          */
/* ---------------------------------------------------------------- */

.split {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: var(--sp-8);
  align-items: center;
}

.split.reverse {
  grid-template-columns: 1.15fr 0.85fr;
}

.split.reverse .split-media {
  order: 2;
}

@media (max-width: 900px) {
  .split,
  .split.reverse {
    grid-template-columns: 1fr;
    gap: var(--sp-6);
  }
  .split.reverse .split-media {
    order: 0;
  }
}

.split-text,
.split-media {
  min-width: 0;
}

.split-text h2 {
  margin-bottom: var(--sp-3);
}

.split-text p {
  color: var(--text-2);
  font-size: 1rem;
  margin-bottom: var(--sp-5);
}

.split-text p.hero-note {
  color: var(--text-3);
  font-size: 0.85rem;
  margin-top: var(--sp-3);
  margin-bottom: 0;
}

/* ---------------------------------------------------------------- */
/* Tunnel diagram                                                    */
/* ---------------------------------------------------------------- */

/* A top-down fork, not a sideways branch: WhatsApp sends one request, Pywa Cloud's ingress
   receives it at a URL that never changes, and it lands at exactly one of two places - whichever
   this bot's tunnel state currently points at. The two destinations are drawn as genuine
   alternatives (same shape, side by side under one fork) rather than a primary path with a
   fallback hanging off it, since the tunnel is meant to be switched on and off constantly during
   a normal dev session, not reached for only in an edge case. */

.tunnel-diagram {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-6) var(--sp-5);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tunnel-node {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 9px 18px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text-1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-align: center;
  transition: border-color 0.4s var(--ease), background 0.4s var(--ease), color 0.4s var(--ease);
}

.tunnel-node-title {
  letter-spacing: 0.01em;
}

.tunnel-node-sub {
  font-size: 0.7rem;
  color: var(--text-3);
  transition: color 0.4s var(--ease);
}

.tunnel-node.active {
  border-color: var(--border-accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.tunnel-node.active .tunnel-node-sub {
  color: var(--accent-strong);
  opacity: 0.8;
}

.tunnel-node.muted {
  color: var(--text-3);
  border-style: dashed;
  opacity: 0.55;
}

.tunnel-node.muted .tunnel-node-sub {
  color: var(--text-3);
}

/* Vertical stem between stacked nodes (WhatsApp -> ingress -> fork) - same dashed-line-with-
   arrowhead device the architecture diagram already uses, reused here rather than invented fresh. */
.tunnel-stem {
  width: 1px;
  height: 28px;
  background: linear-gradient(var(--border-strong), var(--border-strong)) center/1px 6px repeat-y;
  position: relative;
}

.tunnel-stem::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--text-3);
}

.tunnel-fork {
  width: 100%;
  max-width: 420px;
  height: 32px;
  position: relative;
}

.tunnel-fork::before {
  /* horizontal bar spanning the two branches' centers (each is a 1fr column, so 25%/75%) */
  content: "";
  position: absolute;
  top: 0;
  left: 25%;
  right: 25%;
  height: 1px;
  background: var(--border-strong);
}

.tunnel-fork-drops {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.tunnel-fork-drop {
  justify-self: center;
  width: 1px;
  height: 100%;
  position: relative;
  background: repeating-linear-gradient(to bottom, var(--border-strong) 0 5px, transparent 5px 10px);
  transition: background 0.4s var(--ease);
}

.tunnel-fork-drop::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--text-3);
  transition: border-top-color 0.4s var(--ease);
}

.tunnel-fork-drop.on {
  background: repeating-linear-gradient(to bottom, var(--accent-line) 0 5px, transparent 5px 10px);
}

.tunnel-fork-drop.on::after {
  border-top-color: var(--accent);
}

.tunnel-branches {
  width: 100%;
  max-width: 420px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}

.tunnel-branches .tunnel-node {
  /* Shrinks to fit its text on one line whenever there's room (true up to ~480px of container
     width), and wraps at the natural word boundary - not mid-flag - once there isn't. */
  justify-self: center;
  max-width: 100%;
}

/* ---------------------------------------------------------------- */
/* WhatsApp connection — provider mark                                */
/* ---------------------------------------------------------------- */

.provider-mark {
  max-width: 360px;
  margin: 0 auto;
  text-align: center;
  padding: var(--sp-5) var(--sp-6);
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.provider-mark-icon {
  width: 36px;
  height: 36px;
  color: var(--accent);
  margin-bottom: var(--sp-3);
}

.provider-mark-icon svg {
  width: 100%;
  height: 100%;
}

.provider-mark-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: var(--sp-2);
}

.provider-mark-sub {
  font-size: 0.85rem;
  color: var(--text-3);
  line-height: 1.5;
}

/* ---------------------------------------------------------------- */
/* Product / dashboard showcase                                       */
/* ---------------------------------------------------------------- */

.browser-frame {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 50px 100px -50px rgba(0, 0, 0, 0.7);
}

.browser-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 10px var(--sp-4);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.browser-url {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px;
}

.shot-wrap {
  position: relative;
  overflow: hidden;
}

.browser-frame img {
  display: block;
  width: 100%;
  filter: brightness(0.96) saturate(0.94);
}

.shot-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow:
    inset 0 -50px 40px -30px rgba(0, 0, 0, 0.45),
    inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.showcase-caption {
  margin-top: var(--sp-3);
  font-size: 0.85rem;
  color: var(--text-3);
  font-family: var(--font-mono);
}

/* ---------------------------------------------------------------- */
/* Why section — removal list                                        */
/* ---------------------------------------------------------------- */

.removal-list {
  list-style: none;
  margin: 0 0 var(--sp-7);
  padding: 0;
  display: flex;
  flex-direction: column;
}

.removal-list li {
  display: flex;
  align-items: baseline;
  gap: var(--sp-4);
  padding-block: var(--sp-3);
  border-bottom: 1px solid var(--border);
  font-size: 1.05rem;
  color: var(--text-3);
}

.removal-list li:first-child {
  border-top: 1px solid var(--border);
}

.removal-list .no {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-3);
  width: 20px;
  flex-shrink: 0;
}

.removal-list s {
  text-decoration-color: var(--text-3);
}

.removal-final {
  display: flex;
  align-items: baseline;
  gap: var(--sp-4);
  padding-block: var(--sp-4);
  font-size: 1.15rem;
  color: var(--text-1);
}

.removal-final .no {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  width: 20px;
  flex-shrink: 0;
}

.removal-final code {
  color: var(--accent-strong);
  background: var(--accent-soft);
  padding: 3px 8px;
  border-radius: var(--r-sm);
  font-size: 0.95rem;
}

/* ---------------------------------------------------------------- */
/* Final CTA                                                          */
/* ---------------------------------------------------------------- */

.final-cta {
  text-align: center;
  border-top: 1px solid var(--border);
  padding-block: var(--sp-10);
  position: relative;
}

.final-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 600px 300px at 50% 0%, var(--accent-soft), transparent 70%);
  pointer-events: none;
}

.final-cta h2 {
  font-size: clamp(2rem, 4.4vw, 3.2rem);
  margin-bottom: var(--sp-6);
  position: relative;
}

.final-cta .hero-ctas {
  justify-content: center;
  position: relative;
}

/* ---------------------------------------------------------------- */
/* Waitlist form                                                     */
/* ---------------------------------------------------------------- */

.waitlist-lede {
  margin-inline: auto;
  margin-bottom: var(--sp-6);
}

.waitlist-card {
  max-width: 460px;
  margin: 0 auto;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.form-row label {
  font-size: 0.85rem;
  color: var(--text-2);
}

.form-row .optional {
  color: var(--text-3);
  font-weight: 400;
}

.form-row input,
.form-row textarea,
.form-row select {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-1);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.15s var(--ease);
}

.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus {
  border-color: var(--accent);
}

.form-row textarea {
  resize: vertical;
  min-height: 72px;
}

.form-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.waitlist-form button[type="submit"] {
  align-self: flex-start;
}

.form-msg {
  min-height: 1.2em;
  font-size: 0.85rem;
  color: var(--text-3);
}

.form-msg.success {
  color: var(--accent-strong);
}

.form-msg.error {
  color: var(--danger);
}

.waitlist-form.submitted > *:not(.form-msg) {
  display: none;
}

.waitlist-form.submitted .form-msg {
  font-size: 1rem;
  min-height: 0;
}

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

footer {
  border-top: 1px solid var(--border);
  padding-block: var(--sp-7);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: var(--sp-6);
}

@media (max-width: 780px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  margin-bottom: var(--sp-3);
}

.footer-brand svg {
  width: 18px;
  height: 18px;
}

.footer-tagline {
  color: var(--text-3);
  font-size: 0.88rem;
  max-width: 30ch;
}

.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: var(--sp-3);
  font-weight: 500;
}

.footer-col a {
  display: block;
  color: var(--text-2);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: var(--sp-2);
}

.footer-col a:hover {
  color: var(--text-1);
}

.footer-bottom {
  margin-top: var(--sp-7);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-3);
  color: var(--text-3);
  font-size: 0.82rem;
}

/* ---------------------------------------------------------------- */
/* Legal pages (privacy / terms) — plain prose, reusing the same     */
/* tokens as the rest of the site rather than a separate stylesheet. */
/* ---------------------------------------------------------------- */

.legal-hero {
  padding-top: var(--sp-8);
  padding-bottom: var(--sp-6);
}

.legal-updated {
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  margin-top: var(--sp-3);
}

.legal-content {
  padding-bottom: var(--sp-9);
  max-width: 760px;
}

.legal-content h2 {
  font-size: 1.4rem;
  margin-top: var(--sp-8);
  margin-bottom: var(--sp-3);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--border);
}

.legal-content h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.legal-content h3 {
  font-size: 1.02rem;
  margin-top: var(--sp-5);
  margin-bottom: var(--sp-2);
  color: var(--text-1);
}

.legal-content p {
  color: var(--text-2);
  font-size: 0.98rem;
  line-height: 1.7;
  margin-bottom: var(--sp-4);
}

.legal-content ul,
.legal-content ol {
  color: var(--text-2);
  font-size: 0.98rem;
  line-height: 1.7;
  margin: 0 0 var(--sp-4);
  padding-left: 1.3em;
}

.legal-content li {
  margin-bottom: var(--sp-2);
}

.legal-content a {
  color: var(--text-1);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 3px;
}

.legal-content strong {
  color: var(--text-1);
}

.legal-note {
  margin: var(--sp-5) 0;
  padding: var(--sp-4) var(--sp-5);
  border: 1px solid var(--border);
  border-left: 2px solid var(--warning);
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 0.9rem;
  background: var(--surface);
}

.legal-note strong {
  color: var(--warning);
}

/* ---------------------------------------------------------------- */
/* Scroll reveal                                                     */
/* ---------------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

/* ================================================================ */
/* v2 — premium layer                                                */
/* Everything below only animates transform/opacity, pauses when its */
/* section is offscreen (.is-offscreen, set from script.js), and     */
/* collapses under prefers-reduced-motion.                           */
/* ================================================================ */

::selection {
  background: var(--accent-soft-strong);
  color: var(--text-1);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

.is-offscreen,
.is-offscreen *,
.is-offscreen *::before,
.is-offscreen *::after {
  animation-play-state: paused !important;
}

.skip-link {
  position: absolute;
  left: var(--sp-4);
  top: -60px;
  z-index: 100;
  background: var(--accent);
  color: #08130c;
  padding: 8px 14px;
  border-radius: var(--r-md);
  font-weight: 600;
  transition: top 0.2s var(--ease);
}

.skip-link:focus {
  top: var(--sp-3);
}

.progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  z-index: 60;
  pointer-events: none;
}

.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent-strong));
  transform-origin: left;
  transform: scaleX(var(--p, 0));
  box-shadow: 0 0 10px var(--accent);
}

.grad {
  background: linear-gradient(100deg, #f3f2ee 0%, var(--accent-strong) 45%, #8af5b8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

h1,
h2 {
  text-wrap: balance;
}

/* ---- entrance: staggered rise, CSS only ---- */
.rise {
  animation: rise 0.9s var(--ease) both;
  animation-delay: calc(var(--d, 0) * 90ms + 60ms);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---- scroll reveal, now staggerable with --i ---- */
.reveal {
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: calc(var(--i, 0) * 80ms);
}

/* ---- buttons ---- */
.btn {
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(180deg, var(--accent-strong), var(--accent));
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18) inset, 0 10px 28px -10px rgba(47, 214, 107, 0.65);
}

.btn-primary:hover {
  background: linear-gradient(180deg, #62ee95, var(--accent-strong));
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25) inset, 0 14px 34px -10px rgba(47, 214, 107, 0.8);
}

.btn-primary::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.45) 50%, transparent 65%);
  transform: translateX(-120%);
  transition: transform 0.7s var(--ease);
}

.btn-primary:hover::before {
  transform: translateX(120%);
}

.btn-lg {
  padding: 15px 26px;
  font-size: 1rem;
}

.btn-sm {
  padding: 9px 16px;
  font-size: 0.88rem;
}

/* ---- nav ---- */
.nav {
  background: rgba(10, 10, 11, 0.6);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
}

.nav-links a.is-current {
  color: var(--text-1) !important;
}

.nav-links a:not(.btn) {
  position: relative;
}

@media (min-width: 781px) {
  .nav-links a.is-current::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -8px;
    height: 1px;
    background: var(--accent);
  }
}

.burger {
  position: relative;
  display: block;
  width: 16px;
  height: 10px;
}

.burger i {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.3s var(--ease);
}

.burger i:nth-child(1) {
  top: 1px;
}
.burger i:nth-child(2) {
  top: 8px;
}

.nav-menu-btn[aria-expanded="true"] .burger i:nth-child(1) {
  transform: translateY(3.5px) rotate(45deg);
}
.nav-menu-btn[aria-expanded="true"] .burger i:nth-child(2) {
  transform: translateY(-3.5px) rotate(-45deg);
}

@media (max-width: 780px) {
  .nav-menu-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--r-md);
  }
  .nav-links,
  .nav-links.is-open {
    display: flex;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--sp-2) var(--sp-4) var(--sp-4);
    background: rgba(14, 15, 17, 0.94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0.25s;
  }
  .nav-links.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
  }
  .nav-links a:not(.btn) {
    font-size: 1.05rem;
    padding: 14px 4px;
    border-bottom: 1px solid var(--border);
    color: var(--text-1);
  }
  .nav-links a:last-child {
    border-bottom: none;
  }
}

/* ---- hero ---- */
.hero-shell {
  position: relative;
  overflow: hidden;
  overflow: clip;
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 10%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 10%, transparent 75%);
  opacity: 0.55;
}

.orb {
  position: absolute;
  border-radius: 50%;
  will-change: transform;
}

.orb-a {
  width: 780px;
  height: 780px;
  top: -340px;
  left: -160px;
  background: radial-gradient(circle, rgba(47, 214, 107, 0.2), transparent 65%);
  animation: drift-a 22s ease-in-out infinite alternate;
}

.orb-b {
  width: 620px;
  height: 620px;
  top: -120px;
  right: -200px;
  background: radial-gradient(circle, rgba(92, 160, 255, 0.13), transparent 65%);
  animation: drift-b 26s ease-in-out infinite alternate;
}

@keyframes drift-a {
  to {
    transform: translate3d(120px, 60px, 0) scale(1.1);
  }
}

@keyframes drift-b {
  to {
    transform: translate3d(-140px, 80px, 0) scale(1.15);
  }
}

.hero {
  position: relative;
  z-index: 1;
  padding-top: var(--sp-9);
  padding-bottom: var(--sp-10);
}

.hero h1 {
  font-size: clamp(2.5rem, 5.6vw, 4.3rem);
  line-height: 1.04;
  margin-top: var(--sp-4);
}

.lede-link {
  color: var(--text-1);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 4px;
  transition: text-decoration-color 0.2s;
}

.lede-link:hover {
  text-decoration-color: var(--accent);
}

.cmd-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-1);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: 10px 10px 10px 14px;
  margin-bottom: var(--sp-3);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.cmd-chip:hover {
  border-color: var(--border-accent);
  background: var(--surface-2);
}

.cmd-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  color: var(--text-3);
  padding: 3px 8px;
  border-radius: var(--r-sm);
  background: var(--surface-3);
  transition: color 0.2s, background 0.2s;
}

.cmd-copy svg {
  width: 13px;
  height: 13px;
}

.cmd-copy em {
  font-style: normal;
}

.cmd-chip:hover .cmd-copy {
  color: var(--text-1);
}

.cmd-chip.copied .cmd-copy {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.hero-stage {
  position: relative;
  margin-bottom: var(--sp-8);
}

.stage-glow {
  position: absolute;
  inset: -12% -8%;
  background: radial-gradient(ellipse at 50% 50%, rgba(47, 214, 107, 0.16), transparent 62%);
  pointer-events: none;
}

.terminal {
  position: relative;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.03), 0 50px 100px -40px rgba(0, 0, 0, 0.8),
    0 0 80px -30px rgba(47, 214, 107, 0.25);
}

.chat-card {
  position: absolute;
  right: -20px;
  bottom: -56px;
  width: 268px;
  background: rgba(19, 20, 24, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-xl);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(0.97);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.chat-card.show {
  opacity: 1;
  transform: none;
}

.chat-head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 12px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.chat-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(140deg, #3b82f6, #7c3aed);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  box-shadow: 0 0 0 2px var(--surface-2), 0 0 0 3px var(--border-strong);
}

.verified {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 4px;
  vertical-align: -2px;
  color: var(--accent);
}

.chat-id {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  font-size: 0.88rem;
}

.chat-id small {
  color: var(--accent);
  font-size: 0.72rem;
}

.chat-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  min-height: 118px;
}

.bubble {
  max-width: 85%;
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 0.86rem;
  line-height: 1.4;
  width: fit-content;
}

.bubble.out {
  align-self: flex-end;
  background: #0d4a34;
  color: var(--text-1);
  border-bottom-right-radius: 4px;
}

.bubble.in {
  align-self: flex-start;
  background: var(--surface-3);
  color: var(--text-1);
  border-bottom-left-radius: 4px;
}

.chat-body .bubble {
  opacity: 0;
  transform: translateY(8px) scale(0.96);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}

.chat-body .bubble.show {
  opacity: 1;
  transform: none;
}

.chat-body .bubble.gone {
  display: none;
}

.bubble.typing {
  display: flex;
  gap: 4px;
  align-self: flex-start;
  background: var(--surface-3);
  padding: 12px 14px;
}

.bubble.typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-3);
  animation: typing 1s ease-in-out infinite;
}

.bubble.typing i:nth-child(2) {
  animation-delay: 0.15s;
}
.bubble.typing i:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes typing {
  0%,
  60%,
  100% {
    transform: none;
    opacity: 0.4;
  }
  30% {
    transform: translateY(-3px);
    opacity: 1;
  }
}

@media (max-width: 960px) {
  .hero {
    padding-top: var(--sp-8);
    padding-bottom: var(--sp-8);
  }
  .hero-stage {
    margin-bottom: 0;
  }
  .chat-card {
    position: relative;
    right: auto;
    bottom: auto;
    width: auto;
    margin: var(--sp-4) 0 0;
    max-width: 340px;
  }
}

/* ---- trust strip ---- */
.trust-strip {
  padding-block: var(--sp-7);
  border-block: 1px solid var(--border);
  background: linear-gradient(180deg, var(--bg-raised), var(--bg));
}

/* ---- section heads ---- */
.section-head h2 {
  font-size: clamp(1.8rem, 3.6vw, 2.8rem);
  letter-spacing: -0.02em;
}

.section-seam {
  border-top: 0;
}

.section-seam::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: min(880px, 80%);
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
}

/* ---- sequence ---- */
.seq-step {
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, var(--surface), var(--bg-raised));
}

.seq-step.active {
  box-shadow: 0 0 0 1px var(--border-accent) inset, 0 30px 70px -30px rgba(47, 214, 107, 0.35);
}

.seq-label b {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-right: 6px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  font-weight: 500;
  font-size: 0.66rem;
  transition: all 0.4s var(--ease);
}

.seq-step.active .seq-label b {
  background: var(--accent);
  border-color: var(--accent);
  color: #08130c;
}

.seq-arrow {
  display: flex;
  align-items: center;
}

.seq-arrow span {
  position: relative;
  display: block;
  width: 34px;
  height: 2px;
  border-radius: 2px;
  background: var(--border-strong);
  overflow: hidden;
}

.seq-arrow span::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s var(--ease);
}

.seq-arrow.on span::after {
  transform: none;
}

.mini-chat {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mini-chat .bubble {
  opacity: 0.3;
  transition: opacity 0.5s var(--ease);
}

.seq-step.active .mini-chat .bubble {
  opacity: 1;
}

.seq-step.active .mini-chat .bubble.in {
  transition-delay: 0.45s;
}

/* ---- bento ---- */
.bento {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--sp-4);
  margin-top: var(--sp-5);
}

.bento-card {
  --mx: 50%;
  --my: 0%;
  position: relative;
  grid-column: span 2;
  overflow: hidden;
  padding: var(--sp-5);
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface), var(--bg-raised));
  transition: border-color 0.3s var(--ease), opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.bento-card.bento-wide {
  grid-column: span 3;
}

.bento-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(380px circle at var(--mx) var(--my), rgba(47, 214, 107, 0.13), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  pointer-events: none;
}

.bento-card:hover {
  border-color: var(--border-accent);
}

.bento-card:hover::before {
  opacity: 1;
}

.bento-card > * {
  position: relative;
}

.bento-card h3 {
  margin-bottom: var(--sp-2);
  font-size: 1.15rem;
}

.bento-card p {
  color: var(--text-2);
  font-size: 0.92rem;
  line-height: 1.55;
}

.bento-vis {
  height: 112px;
  margin-bottom: var(--sp-5);
  border-radius: var(--r-lg);
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--sp-2);
  padding: var(--sp-3);
  overflow: hidden;
}

.vis-box {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 9px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
}

.vis-box em {
  font-style: normal;
  color: var(--accent-strong);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.vis-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse-dot 2s ease-in-out infinite;
}

.vis-pill {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--text-2);
  background: var(--surface);
}

.vis-pill.ok {
  color: var(--accent-strong);
  border-color: var(--border-accent);
  background: var(--accent-soft);
}

.vis-logs {
  align-items: flex-start;
  justify-content: flex-start;
  padding: 0 var(--sp-4);
  -webkit-mask-image: linear-gradient(transparent, #000 25%, #000 75%, transparent);
  mask-image: linear-gradient(transparent, #000 25%, #000 75%, transparent);
}

/* Mirrors a real running pywa server's log lines (time, level, logger, request id, update ->
   handler (ms)). Real lines are wider than this card, so the right edge fades out like a terminal
   that's simply cut off, rather than wrapping. */
.log-roll {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  line-height: 1.9;
  color: var(--text-2);
  animation: log-roll 26s linear infinite;
}

.log-roll > div {
  white-space: pre;
}

.log-roll span {
  color: var(--text-3);
  margin-right: 8px;
}

.log-roll b {
  color: var(--accent);
  font-weight: 500;
  display: inline-block;
  min-width: 5ch;
}

.log-roll em {
  font-style: normal;
  color: #a98bf0;
}

@keyframes log-roll {
  to {
    transform: translateY(-50%);
  }
}

@media (max-width: 900px) {
  .bento {
    grid-template-columns: 1fr 1fr;
  }
  .bento-card,
  .bento-card.bento-wide {
    grid-column: span 1;
  }
  .bento-card:nth-child(3),
  .bento-card.bento-wide {
    grid-column: span 2;
  }
}

@media (max-width: 600px) {
  .bento {
    grid-template-columns: 1fr;
  }
  .bento-card,
  .bento-card.bento-wide,
  .bento-card:nth-child(3) {
    grid-column: span 1;
  }
}

/* ---- security pipeline ---- */
.pipeline-card {
  padding: var(--sp-5);
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface), var(--bg-raised));
}

.pipeline-status {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-5);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-strong);
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--border-accent);
  transition: all 0.4s var(--ease);
}

.ps-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.pipeline-status.is-blocked {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: rgba(242, 85, 90, 0.35);
}

.pipeline {
  overflow: visible;
  padding-bottom: 0;
  -webkit-mask-image: none;
  mask-image: none;
}

.pipe-box {
  border-radius: var(--r-lg);
  background: var(--bg);
  transition: border-color 0.35s var(--ease), box-shadow 0.35s var(--ease), background 0.35s var(--ease);
}

.pipe-stage.lit .pipe-box {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft), 0 10px 30px -10px rgba(47, 214, 107, 0.5);
  background: var(--surface-2);
}

.pipe-stage.passed .pipe-box {
  border-color: var(--border-accent);
}

.pipe-stage.blocked .pipe-box {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-soft);
}

.pipe-stage.blocked .pipe-icon {
  color: var(--danger);
}

.pipe-reject {
  opacity: 0.3;
  transform: translateY(-4px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}

.pipe-stage.blocked .pipe-reject {
  opacity: 1;
  transform: none;
}

@media (max-width: 1100px) {
  .pipeline {
    flex-direction: column;
    align-items: stretch;
  }
  .pipe-stage {
    flex: none;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    text-align: left;
  }
  .pipe-box {
    flex: 1 1 260px;
    width: auto;
    display: grid;
    grid-template-columns: 34px 1fr;
    column-gap: var(--sp-3);
    align-items: center;
  }
  .pipe-icon {
    grid-row: span 2;
    margin: 0;
    text-align: center;
  }
  .pipe-connector {
    flex: none;
    height: 22px;
    padding: 0;
    margin-left: 30px;
    justify-content: flex-start;
    transform: rotate(90deg);
    transform-origin: left center;
    width: 14px;
    align-self: flex-start;
    margin-block: 6px 10px;
  }
  .pipe-reject-slot {
    min-height: 0;
  }
}

/* ---- security facts: a touch more presence ---- */
.security-facts li::before {
  width: 10px;
  height: 2px;
  border-radius: 2px;
}

/* ---- provider mark ---- */
.provider-mark {
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, var(--surface), var(--bg-raised));
  box-shadow: 0 30px 70px -40px rgba(47, 214, 107, 0.4);
}

.tunnel-diagram {
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, var(--surface), var(--bg-raised));
}

.code-panel {
  border-radius: var(--r-lg);
}

/* ---- why: strike-through that draws itself ---- */
.removal-list s {
  text-decoration: none;
  background: linear-gradient(var(--text-2), var(--text-2)) no-repeat 0 55% / 0% 1.5px;
  transition: background-size 0.8s var(--ease), color 0.6s var(--ease);
  transition-delay: calc(var(--i, 0) * 80ms + 350ms);
}

.removal-list li.in s {
  background-size: 100% 1.5px;
}

.removal-list li {
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease), padding 0.3s var(--ease);
  transition-delay: calc(var(--i, 0) * 80ms);
}

.removal-final {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
}

.removal-final code {
  font-size: 1.2rem;
  padding: 5px 12px;
  box-shadow: 0 0 0 1px var(--border-accent), 0 10px 30px -12px rgba(47, 214, 107, 0.6);
}

/* ---- FAQ ---- */
.faq-wrap {
  max-width: 860px;
}

.faq details {
  border-bottom: 1px solid var(--border);
}

.faq details:first-child {
  border-top: 1px solid var(--border);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-5) 0;
  cursor: pointer;
  list-style: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-1);
  transition: color 0.2s;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "";
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background:
    linear-gradient(var(--text-2), var(--text-2)) center / 10px 1.5px no-repeat,
    linear-gradient(var(--text-2), var(--text-2)) center / 1.5px 10px no-repeat;
  transition: transform 0.35s var(--ease), border-color 0.2s;
}

.faq summary:hover::after {
  border-color: var(--accent);
}

.faq details[open] summary {
  color: var(--accent-strong);
}

.faq details[open] summary::after {
  transform: rotate(135deg);
  border-color: var(--border-accent);
}

.faq details p {
  color: var(--text-2);
  padding: 0 var(--sp-7) var(--sp-5) 0;
  max-width: 68ch;
  animation: rise 0.45s var(--ease) both;
}

/* ---- final CTA ---- */
.final-cta {
  overflow: hidden;
  overflow: clip;
}

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

.cta-aurora::before,
.cta-aurora::after {
  content: "";
  position: absolute;
  width: 640px;
  height: 640px;
  border-radius: 50%;
  will-change: transform;
}

.cta-aurora::before {
  left: -160px;
  bottom: -320px;
  background: radial-gradient(circle, rgba(47, 214, 107, 0.16), transparent 65%);
  animation: drift-a 20s ease-in-out infinite alternate;
}

.cta-aurora::after {
  right: -180px;
  top: -280px;
  background: radial-gradient(circle, rgba(92, 160, 255, 0.1), transparent 65%);
  animation: drift-b 24s ease-in-out infinite alternate;
}

.final-cta .wrap {
  position: relative;
  z-index: 1;
}

.waitlist-card {
  max-width: 480px;
  border: 1px solid transparent;
  border-radius: var(--r-xl);
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(145deg, rgba(47, 214, 107, 0.55), rgba(255, 255, 255, 0.06) 40%, rgba(255, 255, 255, 0.12)) border-box;
  box-shadow: 0 40px 100px -40px rgba(47, 214, 107, 0.3);
}

.form-row input,
.form-row textarea,
.form-row select {
  font-size: 1rem;
  background: var(--bg);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus {
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.waitlist-form button[type="submit"] {
  align-self: stretch;
}

.waitlist-form button[disabled] {
  opacity: 0.6;
  cursor: progress;
}

/* ---- mobile sticky CTA ---- */
.mobile-cta {
  display: none;
}

@media (max-width: 780px) {
  .mobile-cta {
    display: block;
    position: fixed;
    inset: auto 0 0 0;
    z-index: 55;
    padding: var(--sp-6) var(--sp-4) calc(var(--sp-3) + env(safe-area-inset-bottom));
    background: linear-gradient(to top, rgba(10, 10, 11, 0.96) 55%, transparent);
    transform: translateY(110%);
    transition: transform 0.4s var(--ease);
    pointer-events: none;
  }
  .mobile-cta.show {
    transform: none;
  }
  .mobile-cta.show .btn {
    pointer-events: auto;
  }
  .mobile-cta .btn {
    width: 100%;
  }
  footer {
    padding-bottom: 110px;
  }
}

/* ---- small screens ---- */
@media (max-width: 560px) {
  .hero h1 {
    font-size: clamp(2.2rem, 10vw, 2.7rem);
  }
  .hero-ctas {
    gap: var(--sp-3);
  }
  .hero-ctas .btn-primary {
    flex: 1 1 100%;
  }
  .ownership-value {
    font-size: 1.8rem;
  }
  .ownership-list {
    font-size: 1.2rem;
  }
  .faq summary {
    font-size: 1rem;
  }
  .faq details p {
    padding-right: 0;
  }
  .waitlist-card {
    padding: var(--sp-5);
  }
  .removal-final {
    font-size: 1.2rem;
  }
  .footer-grid {
    gap: var(--sp-6) var(--sp-4);
  }
}

/* touch devices: no sticky hover states */
@media (hover: none) {
  .bento-card::before {
    display: none;
  }
}

html {
  scroll-padding-top: 72px;
}

/* ---- trust strip (replaces the numeric stats) ---- */
.trust {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-5);
}

.trust-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.trust-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--r-md);
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid var(--border-accent);
}

.trust-icon svg {
  width: 20px;
  height: 20px;
}

.trust-text {
  display: flex;
  flex-direction: column;
  line-height: 1.35;
  min-width: 0;
}

.trust-text strong {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.98rem;
}

.trust-text small {
  color: var(--text-3);
  font-size: 0.82rem;
}

@media (max-width: 960px) {
  .trust {
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-5) var(--sp-4);
  }
}

@media (max-width: 520px) {
  .trust {
    grid-template-columns: 1fr;
  }
}

/* Stacked sequence (<=980px): a short vertical connector between cards instead of a rotated
   horizontal one, which overhung the cards it sat between. */
@media (max-width: 980px) {
  .sequence {
    gap: 0;
  }
  .sequence .seq-arrow {
    transform: none;
    margin: 0;
    justify-content: center;
    height: 36px;
  }
  .seq-arrow span {
    width: 2px;
    height: 36px;
  }
  .seq-arrow span::after {
    transform: scaleY(0);
    transform-origin: top;
  }
  .seq-arrow.on span::after {
    transform: none;
  }
}

/* ---- mobile pass ---- */
@media (max-width: 600px) {
  .bento-vis {
    height: auto;
    min-height: 112px;
    padding: var(--sp-4) var(--sp-3);
  }
  .vis-logs {
    height: 112px;
  }
  .pipeline-status {
    border-radius: var(--r-lg);
    align-items: flex-start;
    line-height: 1.4;
  }
  .ps-dot {
    margin-top: 6px;
    flex: none;
  }
  .pipeline-card {
    padding: var(--sp-4);
  }

  /* Why list: number above text would waste space - keep the row, but let the struck text wrap
     cleanly and give it real breathing room. */
  .removal-list li {
    padding-block: var(--sp-4);
    font-size: 1rem;
    line-height: 1.4;
    align-items: flex-start;
    gap: var(--sp-3);
  }
  .removal-list .no {
    padding-top: 3px;
    width: 22px;
  }
  .removal-list s {
    /* one continuous line per wrapped row instead of a single 55%-height line through line 1 */
    text-decoration: line-through;
    text-decoration-color: var(--text-3);
    text-decoration-thickness: 1.5px;
    background: none;
  }
  .removal-final {
    font-size: 1.15rem;
    align-items: center;
    flex-wrap: wrap;
  }
  .removal-final code {
    font-size: 1rem;
  }
}

.removal-final > span:last-child code {
  margin-inline: 4px;
}

@media (max-width: 480px) {
  .tunnel-diagram {
    padding: var(--sp-5) var(--sp-3);
  }
  .tunnel-branches {
    gap: var(--sp-2);
  }
  .tunnel-branches .tunnel-node {
    padding: 8px 10px;
    font-size: 0.76rem;
  }
  .tunnel-branches .tunnel-node-sub {
    font-size: 0.64rem;
  }
}

/* Very narrow phones (<=359px): brand + CTA + burger don't fit on one row and push the page
   wider than the screen. The hero and the sticky bottom bar both carry the CTA already. */
@media (max-width: 359px) {
  .nav-cta .btn-primary {
    display: none;
  }
}

/* Hero entrance: quick, and never gate the primary action behind an animation delay. */
.rise {
  animation-duration: 0.55s;
  animation-delay: calc(var(--d, 0) * 50ms);
}

.hero-ctas.rise,
.hero-top > .rise:last-child {
  animation: none;
  opacity: 1;
  transform: none;
}

/* ---- Dashboard showcase ----
   Tabs, a desktop frame and a phone. Screens crossfade (opacity/transform only, no filters, so the
   compositor does all the work); script.js auto-advances them while in view and pans each
   screenshot inside its frame as the page scrolls. */
.showcase {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.showcase-tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin: 0 0 var(--sp-6);
}

.showcase-tab {
  position: relative;
  flex: none;
  padding: 10px 18px;
  border-radius: 999px;
  font: inherit;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-2);
  background: transparent;
  border: 1px solid var(--border);
  cursor: pointer;
  overflow: hidden;
  transition: color 0.25s var(--ease), background 0.25s var(--ease), border-color 0.25s var(--ease);
}

.showcase-tab:hover {
  color: var(--text-1);
  border-color: var(--border-strong);
}

.showcase-tab.is-active {
  color: var(--text-1);
  background: var(--surface-2);
  border-color: var(--border-accent);
}

/* The progress line under the active tab is also the timer: when it finishes, the next screen shows. */
.showcase-tab::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 6px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
}

.showcase-tab.is-active::after {
  transform: scaleX(1);
}

.showcase.auto .showcase-tab.is-active::after {
  animation: tab-fill var(--tab-ms, 6500ms) linear forwards;
}

.showcase.is-paused .showcase-tab.is-active::after {
  animation-play-state: paused;
}

@keyframes tab-fill {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

.showcase-stage {
  position: relative;
  width: min(100%, 1000px);
  margin: 0 auto 56px;
}

.showcase-frame {
  border-radius: var(--r-xl);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.03), 0 60px 120px -50px rgba(0, 0, 0, 0.85),
    0 0 100px -40px rgba(47, 214, 107, 0.22);
}

.shot-stage {
  position: relative;
  aspect-ratio: 1440 / 900;
  overflow: hidden;
  background: var(--bg);
}

.shot-stage .shot-wrap {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transform: translate3d(0, 14px, 0);
}

.shot-stage .shot-wrap.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
}

/* Taller than the frame; script.js translates it up as the page scrolls. */
.browser-frame .shot-wrap img.pan {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  max-width: none;
  filter: none;
  will-change: transform;
}

.phone-frame {
  position: absolute;
  right: -3%;
  bottom: -56px;
  width: clamp(190px, 26%, 290px);
  padding: 8px;
  border-radius: 40px;
  background: #050506;
  border: 1px solid var(--border-strong);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 40px 80px -20px rgba(0, 0, 0, 0.9),
    0 0 80px -30px rgba(47, 214, 107, 0.25);
  will-change: transform;
}

/* dynamic-island pill */
.phone-frame::before {
  content: "";
  position: absolute;
  top: 15px;
  left: 50%;
  width: 28%;
  height: 12px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #050506;
  z-index: 2;
}

/* A status-bar-height gap above the app so the island sits in the margin, not on the top bar. */
.phone-screen {
  position: relative;
  overflow: hidden;
  padding-top: 26px;
  border-radius: 33px;
  background: var(--bg);
}

.phone-screen .phone-view {
  position: absolute;
  inset: 26px 0 0 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translate3d(0, 14px, 0);
}

.phone-screen .phone-view.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
}

/* Sizer: keeps the screen at the real 390:844 once the views are absolutely positioned. */
.phone-screen::after {
  content: "";
  display: block;
  aspect-ratio: 390 / 844;
}

.phone-page {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  will-change: transform;
}

/* The real top bar and bottom nav, laid over the panning page. */
.phone-chrome {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  -webkit-mask-image: linear-gradient(#000 6.4%, transparent 6.4%, transparent 91.8%, #000 91.8%);
  mask-image: linear-gradient(#000 6.4%, transparent 6.4%, transparent 91.8%, #000 91.8%);
}

@media (prefers-reduced-motion: no-preference) {
  .shot-stage .shot-wrap,
  .phone-screen .phone-view {
    transition: opacity 0.5s var(--ease), transform 0.8s cubic-bezier(0.22, 0.9, 0.24, 1),
      visibility 0s linear 0.5s;
  }
  .shot-stage .shot-wrap.is-active,
  .phone-screen .phone-view.is-active {
    transition-delay: 0s;
  }
}

.showcase-desc {
  margin-top: var(--sp-4);
  text-align: center;
  color: var(--text-2);
  font-size: 0.95rem;
  max-width: 640px;
  min-height: 2.9em;
}

/* Mobile: the desktop frame is dropped (no screen shown twice) and the phone - the device the
   visitor is actually holding - becomes the hero, panning as they scroll. */
@media (max-width: 760px) {
  .showcase-tabs {
    flex-wrap: nowrap;
    gap: 6px;
    margin-bottom: var(--sp-5);
  }
  .showcase-tab {
    padding: 9px 11px;
    font-size: 0.8rem;
    white-space: nowrap;
  }
  .showcase-tab::after {
    left: 11px;
    right: 11px;
  }
  .showcase-stage {
    width: auto;
    margin: 0;
  }
  .showcase-frame {
    display: none;
  }
  .phone-frame {
    position: relative;
    right: auto;
    bottom: auto;
    width: min(74vw, 300px);
  }
  .showcase-desc {
    min-height: 4.4em;
    font-size: 0.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .phone-frame,
  .phone-page,
  .browser-frame .shot-wrap img.pan {
    will-change: auto;
  }
}

/* ---- Pywa Studio section ---- */
.studio-grid {
  display: grid;
  grid-template-columns: 190px 280px minmax(0, 1fr);
  min-height: 420px;
}
.studio-col { padding: var(--sp-5); min-width: 0; }
.studio-palette,
.studio-canvas { border-right: 1px solid var(--border); }
.studio-palette {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.studio-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
}
.studio-hint { font-size: 0.8rem; color: var(--text-3); }
.studio-chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.studio-chip {
  font: inherit;
  font-size: 0.82rem;
  color: var(--text-2);
  background: transparent;
  border: 1px dashed var(--border-strong);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.studio-chip::before { content: "+ "; color: var(--text-3); }
.studio-chip:hover { color: var(--text-1); border-color: var(--accent-line); }
.studio-chip[aria-pressed="true"] {
  border-style: solid;
  border-color: var(--border-accent);
  background: var(--accent-soft);
  color: var(--text-1);
}
.studio-chip[aria-pressed="true"]::before { content: "\2713  "; color: var(--accent); }

.studio-canvas {
  display: grid;
  place-items: center;
  background-image: radial-gradient(var(--border-strong) 1px, transparent 1px);
  background-size: 18px 18px;
}
.studio-device {
  position: relative;
  width: 214px;
  height: 340px;
  border: 1px solid var(--border-strong);
  border-radius: 28px;
  background: #0b141a;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}
.studio-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: 22px 14px 14px;
  font-size: 0.78rem;
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
.studio-face-chat { opacity: 0; transform: translateY(12px); pointer-events: none; padding: 0; gap: var(--sp-3); }
.studio.is-live .studio-face-flow { opacity: 0; transform: translateY(-12px); }
.studio.is-live .studio-face-chat { opacity: 1; transform: none; }

.studio-screen-title {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text-1);
  padding-bottom: var(--sp-1);
}
.studio-fields { display: flex; flex-direction: column; gap: var(--sp-2); overflow: hidden; }
.studio-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  color: var(--text-1);
  animation: studio-in 0.3s var(--ease);
}
.studio-field i { font-style: normal; font-size: 0.64rem; color: var(--text-3); }
.studio-field.is-check { flex-direction: row; align-items: center; gap: var(--sp-2); font-size: 0.72rem; }
.studio-field.is-check::before {
  content: "";
  flex: none;
  width: 12px;
  height: 12px;
  border: 1px solid var(--text-3);
  border-radius: 3px;
}
.studio-footer {
  margin-top: auto;
  text-align: center;
  padding: 8px;
  border-radius: 999px;
  background: var(--accent);
  color: #04130a;
  font-weight: 600;
}
@keyframes studio-in {
  from { opacity: 0; transform: translateY(-6px); }
}

.studio-chat-head {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 22px 14px 10px;
  background: #12202a;
  color: var(--text-1);
  font-weight: 600;
}
.studio-chat-head i {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-dim);
}
.studio-face-chat .bubble { margin: 0 14px; max-width: 100%; }
.studio-flow-btn {
  display: block;
  margin: var(--sp-3) calc(var(--sp-3) * -1) calc(var(--sp-2) * -1);
  padding: 8px;
  border-top: 1px solid var(--border-strong);
  text-align: center;
  color: #6cc7ff;
  font-weight: 500;
}

.studio-source { display: flex; flex-direction: column; gap: var(--sp-3); }
.studio-source-head { display: flex; justify-content: space-between; align-items: center; }
.studio-copy {
  font: inherit;
  font-size: 0.75rem;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 3px 10px;
  cursor: pointer;
}
.studio-copy:hover { color: var(--text-1); }
.studio-code {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  line-height: 1.6;
  color: var(--text-2);
  overflow: auto;
}
.studio-code .tp { color: #5fd0c0; }
.studio-code .str { color: var(--accent-strong); }

.studio-publish {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-5);
  flex-wrap: wrap;
  padding: var(--sp-4) var(--sp-5);
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}
.studio-log {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-5);
  font-size: 0.84rem;
  color: var(--text-3);
}
.studio-log li::before { content: "\25CB"; margin-right: var(--sp-2); }
.studio-log li.done { color: var(--text-1); }
.studio-log li.done::before { content: "\2713"; color: var(--accent); }
.studio-publish-side { display: flex; align-items: center; gap: var(--sp-4); flex-wrap: wrap; }
.studio-publish-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-1);
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 8px 16px 8px 12px;
  cursor: pointer;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.studio-publish-btn svg { width: 16px; height: 16px; color: var(--accent); }
.studio-publish-btn:hover:not([disabled]) { border-color: var(--accent-line); background: var(--accent-soft); }
.studio-publish-btn[disabled] { cursor: default; color: var(--text-2); }
.studio.is-live .studio-publish-btn { border-color: var(--border-accent); color: var(--accent); }

.section-head .studio-cta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-4);
  max-width: none;
  margin-top: var(--sp-5);
  color: var(--text-3);
  font-size: 0.9rem;
}

@media (max-width: 900px) {
  .studio-grid { grid-template-columns: minmax(0, 1fr); }
  .studio-palette, .studio-canvas { border-right: 0; }
  .studio-palette { order: 1; border-bottom: 1px solid var(--border); }
  .studio-source { order: 2; }
  .studio-canvas { order: 3; border-top: 1px solid var(--border); }
}

/* ---- Analytics consent bar (analytics.js) ---- */
.consent-bar {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 90;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  font-size: 13px;
  color: var(--text-2);
}
.consent-bar p { flex: 1 1 320px; margin: 0; }
.consent-bar a { color: inherit; text-decoration: underline; }
.consent-actions { display: flex; gap: 8px; }
