:root {
  --bg: #ffffff;
  --bg-alt: #f3eefc;
  --surface: #ffffff;
  --text: #1a1030;
  --text-dim: #5b5270;
  --accent1: #6D28D9;
  --accent2: #C026D3;
  --border: rgba(20, 10, 40, 0.12);
  --nodefill: #ffffff;
  --nav-h: 40px;
  --particle-dot: #C026D3;
  --particle-line: #6D28D9;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #140B26;
    --bg-alt: #1E1033;
    --surface: #1c1138;
    --text: #F3EEFF;
    --text-dim: #B9A9DE;
    --accent1: #8B5CF6;
    --accent2: #E879F9;
    --border: rgba(255, 255, 255, 0.12);
    --nodefill: #140B26;
    --particle-dot: #E879F9;
    --particle-line: #8B5CF6;
  }
}

:root[data-theme="dark"] {
  --bg: #140B26;
  --bg-alt: #1E1033;
  --surface: #1c1138;
  --text: #F3EEFF;
  --text-dim: #B9A9DE;
  --accent1: #8B5CF6;
  --accent2: #E879F9;
  --border: rgba(255, 255, 255, 0.12);
  --nodefill: #140B26;
  --particle-dot: #E879F9;
  --particle-line: #8B5CF6;
}

* {
  box-sizing: border-box
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 12px + env(safe-area-inset-top, 0px));
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1,
h2,
h3,
.brand {
  font-family: 'Quicksand', sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
}

p {
  line-height: 1.6;
  color: var(--text-dim);
}

a {
  color: inherit
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 80px 24px;
}

@media(max-width:640px) {
  .wrap {
    padding: 40px 20px;
  }
}

/* Nav */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding-top: env(safe-area-inset-top, 20px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease;
}

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

.nav-logo {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .35s ease, transform .35s ease;
  pointer-events: none;
}

.nav-logo.visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
  .nav-logo {
    transition: none;
  }
}

nav .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
  max-width: 1080px;
  margin: 0 auto;
  padding: 30px 24px;
}

@media(max-width:640px) {
  nav .row {
    padding: 30px 20px;
  }
}

nav .links {
  display: flex;
  gap: 28px;
  font-size: 14.5px;
  color: var(--text-dim);
}

nav .links a {
  text-decoration: none;
  transition: color .2s ease;
}

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

nav .cta {
  font-size: 14px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--accent1), var(--accent2));
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}

@media(max-width:720px) {
  nav .links {
    display: none;
  }
}

/* Hero */
.hero {
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 140px 24px 80px;
  position: relative;
}

.particles-bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: auto;
}

#root > *:not(.particles-bg) {
  position: relative;
  z-index: 1;
}

.hero-logo {
  width: min(720px, 92vw);
  height: auto;
  margin-bottom: 12px;
  pointer-events: none;
}

.hero-logo svg {
  width: 100%;
  height: auto;
  display: block;
}

.hero h1 {
  font-size: clamp(24px, 3.6vw, 38px);
  line-height: 1.25;
  max-width: 26ch;
  margin: 12px auto 18px;
  text-wrap: balance;
}

.hero p.lead {
  font-size: clamp(16px, 1.8vw, 18.5px);
  max-width: 50ch;
  margin: 0 auto 34px;
  text-wrap: balance;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 600;
  padding: 13px 26px;
  border-radius: 100px;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .25s ease, box-shadow .25s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(90deg, var(--accent1), var(--accent2));
  color: #fff;
  box-shadow: 0 10px 30px -12px rgba(139, 92, 246, .55);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

/* reveal */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .7s cubic-bezier(.16, .84, .44, 1), transform .7s cubic-bezier(.16, .84, .44, 1);
}

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

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  html {
    scroll-behavior: auto;
  }
}

section {
  padding: 220px 24px;
}

@media(max-width:640px) {
  section {
    padding: 120px 20px;
  }
}

.eyebrow-none {
  margin: 0 0 10px;
}

.section-head {
  max-width: 640px;
  margin-bottom: 56px;
}

.section-head h2 {
  font-size: clamp(24px, 3.4vw, 34px);
  margin: 0 0 14px;
}

.section-head p {
  font-size: 16.5px;
  margin: 0;
}

/* Problem section custom alignment */
#problema .section-head {
  margin-left: auto;
  margin-right: auto;
}

#problema .section-head h2 {
  text-align: center;
}

#problema .section-head p {
  text-align: justify;
  text-justify: inter-word;
}

/* Problem stats */
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 44px;
}

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

.stat {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.stat b {
  display: block;
  font-family: 'Quicksand', sans-serif;
  font-size: clamp(26px, 3.6vw, 36px);
  font-weight: 600;
  background: linear-gradient(90deg, var(--accent1), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat span {
  font-size: 13.5px;
  color: var(--text-dim);
}

.stat-row--problem {
  gap: 20px 32px;
  row-gap: 56px;
  margin-top: 60px;
}

.stat-row--problem .stat {
  text-align: center;
  padding-top: 24px;
}

.stat-row--problem .stat b {
  font-size: clamp(38px, 5.4vw, 56px);
}

/* Flow (real sequence -> numbered) */
.flow {
  position: relative;
  margin-top: 20px;
}

.flow-line {
  position: absolute;
  left: 23px;
  top: 14px;
  bottom: 14px;
  width: 2px;
  background: linear-gradient(var(--accent1), var(--accent2));
  opacity: .35;
}

.flow-step {
  display: flex;
  gap: 22px;
  padding: 22px 0;
  position: relative;
}

.flow-num {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Quicksand', sans-serif;
  font-weight: 600;
  font-size: 16px;
  color: #fff;
  position: relative;
  z-index: 1;
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
}

.flow-step h3 {
  margin: 2px 0 6px;
  font-size: 18px;
}

.flow-step p {
  margin: 0;
  font-size: 15px;
  max-width: 52ch;
}

/* Scrollytelling: Como Funciona */
.flow-scrolly-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 48px;
  align-items: start;
  margin-top: 20px;
}

.flow-scrolly-steps {
  display: flex;
  flex-direction: column;
}

.flow-scrolly-step {
  display: flex;
  gap: 22px;
  min-height: 62vh;
  padding: 12px 0;
  align-items: center;
  opacity: .35;
  transform: translateY(8px);
  transition: opacity .5s ease, transform .5s ease;
}

.flow-scrolly-step:first-child {
  min-height: calc(var(--nav-h) + 28px + min(72vh, 560px) / 2 + 24px);
  align-items: center;
}

.flow-scrolly-step:last-child {
  min-height: 42vh;
}

.flow-scrolly-step.active {
  opacity: 1;
  transform: none;
}

.flow-scrolly-step .flow-num {
  transition: background .4s ease, transform .4s ease;
}

.flow-scrolly-step.active .flow-num {
  transform: scale(1.08);
}

@media (prefers-reduced-motion: reduce) {
  .flow-scrolly-step {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.phone-stage {
  position: sticky;
  top: calc(var(--nav-h) + env(safe-area-inset-top, 0px) + 28px);
  display: flex;
  justify-content: center;
  z-index: 4;
}

.phone-frame {
  height: min(72vh, 560px);
  aspect-ratio: 9 / 19.5;
  max-width: 280px;
  border-radius: clamp(26px, 3.4vw, 42px);
  padding: clamp(8px, 1.1vw, 12px);
  background: linear-gradient(155deg, #1c1138, #05030b);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .06) inset, 0 10px 40px -12px rgba(139, 92, 246, .45);
  position: relative;
}

.phone-island {
  position: absolute;
  top: clamp(12px, 1.6vw, 22px);
  left: 50%;
  transform: translateX(-50%);
  width: clamp(50px, 6vw, 80px);
  height: clamp(14px, 1.6vw, 22px);
  border-radius: 16px;
  background: #000;
  z-index: 2;
}

.phone-screen {
  width: 100%;
  height: 100%;
  border-radius: clamp(20px, 2.6vw, 34px);
  background: #f4f3f8;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

.phone-statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: #1a1030;
  flex: none;
  white-space: nowrap;
}

.phone-statusbar .icons {
  display: flex;
  gap: 5px;
  align-items: center;
  white-space: nowrap;
  font-size: 10.5px;
  color: #1a1030;
}

.phone-chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: #ffffff;
  border-bottom: 1px solid rgba(20, 10, 40, 0.1);
  flex: none;
}

.phone-chat-header .phone-logo {
  width: 26px;
  flex: none;
}

.phone-chat-header .who b {
  display: block;
  font-family: 'Quicksand', sans-serif;
  font-size: 13px;
  color: #1a1030;
}

.phone-chat-header .who span {
  font-size: 11px;
  color: #25D366;
}

.phone-messages {
  flex: 1;
  padding: 12px 12px 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  justify-content: flex-end;
}

.chat-day-label {
  align-self: center;
  font-size: 10.5px;
  color: #7a7290;
  background: rgba(20, 10, 40, 0.06);
  padding: 3px 10px;
  border-radius: 100px;
  margin: 6px 0 2px;
}

.chat-group-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .02em;
  margin: 6px 2px 0;
}

.chat-group-label.from-laboratorio,
.chat-group-label.from-coordinador {
  align-self: flex-end;
  color: #4a7d3c;
}

.chat-group-label.from-soporte {
  align-self: flex-start;
  color: #6D28D9;
}

.chat-bubble {
  max-width: 82%;
  padding: 8px 11px;
  border-radius: 14px;
  font-size: 12px;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(10px) scale(.97);
  transition: opacity .45s ease, transform .45s ease;
}

.chat-bubble.in-view {
  opacity: 1;
  transform: none;
}

.chat-bubble.from-soporte {
  align-self: flex-start;
  background: #ffffff;
  color: #1a1030;
  border: 1px solid rgba(20, 10, 40, 0.08);
  border-bottom-left-radius: 4px;
}

.chat-bubble.from-laboratorio,
.chat-bubble.from-coordinador {
  align-self: flex-end;
  background: #DCF8C6;
  color: #06210f;
  border-bottom-right-radius: 4px;
}

.phone-composer {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #ffffff;
  border-top: 1px solid rgba(20, 10, 40, 0.08);
}

.phone-composer .field {
  flex: 1;
  height: 30px;
  border-radius: 100px;
  background: #f0eef7;
  color: #a39cb8;
  font-size: 11.5px;
  display: flex;
  align-items: center;
  padding: 0 12px;
}

.phone-composer .send {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #25D366;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #06210f;
}

.phone-composer .send svg {
  width: 15px;
  height: 15px;
}

/* Dashboard mock (final step) */
.phone-dashboard {
  flex: 1;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .5s ease, transform .5s ease;
}

.phone-dashboard.in-view {
  opacity: 1;
  transform: none;
}

.phone-dashboard h4 {
  margin: 0;
  font-family: 'Quicksand', sans-serif;
  font-size: 13px;
  color: #1a1030;
}

.dash-kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.dash-kpi {
  background: #ffffff;
  border: 1px solid rgba(20, 10, 40, 0.08);
  border-radius: 12px;
  padding: 8px 10px;
}

.dash-kpi b {
  display: block;
  font-family: 'Quicksand', sans-serif;
  font-size: 17px;
  background: linear-gradient(90deg, var(--accent1), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.dash-kpi span {
  font-size: 9.5px;
  color: #7a7290;
}

.dash-chart {
  background: #ffffff;
  border: 1px solid rgba(20, 10, 40, 0.08);
  border-radius: 12px;
  padding: 10px;
  flex: 1;
  display: flex;
  align-items: flex-end;
  gap: 6px;
}

.dash-chart span {
  flex: 1;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, var(--accent2), var(--accent1));
}

@media (prefers-reduced-motion: reduce) {

  .chat-bubble,
  .phone-dashboard {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

@media(max-width:860px) {
  .flow-scrolly-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .flow-scrolly-steps {
    order: 2;
  }

  .phone-stage {
    order: 1;
    position: sticky;
    top: calc(var(--nav-h) + env(safe-area-inset-top, 0px) + 14px);
    z-index: 5;
    padding-bottom: 8px;
    background: var(--bg);
  }

  .phone-frame {
    height: min(40vh, 360px);
    max-width: 190px;
    border-radius: 26px;
    padding: 8px;
  }

  .phone-island {
    top: 10px;
    width: 44px;
    height: 13px;
    border-radius: 10px;
  }

  .phone-statusbar {
    padding: 10px 14px 2px;
    font-size: 10px;
  }

  .phone-statusbar .icons {
    gap: 3px;
    font-size: 9px;
  }

  .phone-screen {
    border-radius: 20px;
  }

  .phone-chat-header {
    gap: 6px;
    padding: 6px 10px;
  }

  .phone-chat-header .phone-logo {
    width: 18px;
  }

  .phone-chat-header .who b {
    font-size: 11px;
  }

  .phone-chat-header .who span {
    font-size: 9px;
  }

  .phone-messages {
    padding: 8px 8px 4px;
    gap: 4px;
  }

  .chat-day-label {
    font-size: 9px;
    padding: 2px 8px;
    margin: 4px 0 1px;
  }

  .chat-group-label {
    font-size: 9px;
    margin: 4px 2px 0;
  }

  .chat-bubble {
    padding: 6px 9px;
    border-radius: 11px;
    font-size: 10px;
    line-height: 1.35;
  }

  .phone-composer {
    padding: 6px 8px;
    gap: 6px;
  }

  .phone-composer .field {
    height: 24px;
    font-size: 9.5px;
    padding: 0 10px;
  }

  .phone-composer .send {
    width: 24px;
    height: 24px;
  }

  .phone-composer .send svg {
    width: 12px;
    height: 12px;
  }

  .phone-dashboard {
    padding: 10px 8px;
    gap: 8px;
  }

  .phone-dashboard h4 {
    font-size: 11px;
  }

  .dash-kpi {
    padding: 6px 8px;
  }

  .dash-kpi b {
    font-size: 14px;
  }

  .dash-kpi span {
    font-size: 8px;
  }

  .flow-scrolly-step {
    min-height: 42vh;
    padding: 8px 0;
  }

  .flow-scrolly-step:first-child {
    min-height: calc(var(--nav-h) + 14px + min(40vh, 360px) / 2 + 20px);
  }

  .flow-scrolly-step:last-child {
    min-height: 30vh;
  }
}

/* Features - asymmetric grid, not identical cards */
.features {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 18px;
  margin-top: 8px;
}

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

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

.feat {
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 26px;
  background: var(--surface);
}

.feat.big {
  grid-row: span 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.feat h3 {
  font-size: 17px;
  margin: 14px 0 8px;
}

.feat p {
  font-size: 14.5px;
  margin: 0;
}

.feat-icon {
  width: 34px;
  height: 34px;
}

.feat.big .feat-icon {
  width: 40px;
  height: 40px;
}

/* Form + WhatsApp */
.contact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
}

@media(max-width:860px) {
  .contact {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

.wa-card {
  border-radius: 22px;
  padding: 30px;
  background: linear-gradient(155deg, var(--bg-alt), var(--bg));
  border: 1px solid var(--border);
}

.wa-card h3 {
  margin: 14px 0 10px;
  font-size: 20px;
}

.wa-btn {
  margin-top: 18px;
  display: inline-flex;
  gap: 10px;
  align-items: center;
  background: #25D366;
  color: #06210f;
  font-weight: 600;
  padding: 13px 22px;
  border-radius: 100px;
  text-decoration: none;
  font-size: 15px;
  transition: transform .25s ease;
}

.wa-btn:hover {
  transform: translateY(-2px);
}

form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

label {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 6px;
  display: block;
}

input,
select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 14.5px;
}

input:focus,
select:focus {
  outline: 2px solid var(--accent1);
  outline-offset: 1px;
}

.phone-input-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.phone-input-group select {
  width: auto;
  min-width: 105px;
  max-width: 120px;
  flex-shrink: 0;
  cursor: pointer;
  padding: 12px 8px 12px 10px;
}

.phone-input-group select option {
  background: var(--bg);
  color: var(--text);
}

.phone-input-group input {
  flex: 1;
  min-width: 0;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media(max-width:480px) {
  .field-row {
    grid-template-columns: 1fr;
  }
}

.submit-btn {
  margin-top: 6px;
}

.form-note {
  font-size: 12.5px;
  margin-top: 4px;
}

.success {
  font-size: 14.5px;
  color: var(--text);
  background: var(--bg-alt);
  border-radius: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
}

footer {
  border-top: 1px solid var(--border);
  padding: 36px 0;
}

footer p {
  font-size: 12.5px;
  margin: 0;
  max-width: 70ch;
}

footer .foot-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

footer .brand {
  font-size: 16px;
}

:focus-visible {
  outline: 2px solid var(--accent2);
  outline-offset: 2px;
}