:root {
  --paper: #eef1f4;
  --paper-2: #e2e7ec;
  --surface: #ffffff;
  --ink: #172131;
  --ink-2: #4f5b6b;
  --line: #d3dae2;
  --magenta: #c8206a;
  --magenta-ink: #a3164f;
  --green: #1f9d63;
  --amber: #a86b00;
  --stage-glow: rgba(200, 32, 106, .16);
  --f-display: "Archivo", system-ui, sans-serif;
  --f-body: "Onest", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121822; --paper-2: #1a2230; --surface: #1d2635; --ink: #e8edf3; --ink-2: #9eabbb;
    --line: #2c3748; --magenta: #ec4f8f; --magenta-ink: #ff86b6; --green: #45c98a; --amber: #e8b04a;
    --stage-glow: rgba(236, 79, 143, .2); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #121822; --paper-2: #1a2230; --surface: #1d2635; --ink: #e8edf3; --ink-2: #9eabbb;
  --line: #2c3748; --magenta: #ec4f8f; --magenta-ink: #ff86b6; --green: #45c98a; --amber: #e8b04a;
  --stage-glow: rgba(236, 79, 143, .2); color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.55 var(--f-body);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--f-display); margin: 0; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--magenta); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 8px; z-index: 10; }
.skip:focus { top: 12px; }

/* Navegación */
.nav {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 32px;
  padding: 14px clamp(16px, 4vw, 48px);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 8px; font: 800 21px var(--f-display); font-stretch: 112%; text-decoration: none; }
.brand svg { width: 26px; height: 26px; }
.nav nav { display: flex; gap: 24px; font-size: 15px; }
.nav nav a { text-decoration: none; color: var(--ink-2); }
.nav nav a:hover { color: var(--ink); }
.nav-cta { margin-left: auto; display: flex; align-items: center; gap: 18px; font-size: 15px; }
.link { text-decoration: none; font-weight: 500; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 22px; border-radius: 999px;
  background: var(--magenta); color: #fff; text-decoration: none;
  font: 600 16px var(--f-body); border: 0;
  transition: background .15s;
}
.btn:hover { background: var(--magenta-ink); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 15px; }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-ghost:hover { background: var(--paper-2); }
.btn-light { background: #fff; color: #7d0f3d; }
.btn-light:hover { background: #ffe3ef; }

/* Hero / estudio */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(16px, 3vw, 40px);
  align-items: center;
  padding: clamp(24px, 4vw, 56px) clamp(16px, 4vw, 48px) 40px;
  min-height: calc(100svh - 68px);
}
.hero-copy { max-width: 600px; }
h1 {
  font-size: clamp(40px, 5.4vw, 78px);
  font-weight: 850;
  font-stretch: 122%;
  line-height: .94;
  letter-spacing: -0.03em;
}
.lead { margin-top: 22px; font-size: clamp(17px, 1.4vw, 19px); color: var(--ink-2); max-width: 46ch; }

.controls { margin-top: 32px; display: grid; gap: 14px; }
.seg {
  display: inline-grid; grid-auto-flow: column; justify-self: start;
  padding: 4px; border-radius: 999px; background: var(--paper-2);
}
.seg button {
  font: 600 15px var(--f-body); color: var(--ink-2);
  border: 0; background: transparent; padding: 9px 16px; border-radius: 999px; cursor: pointer;
  transition: background .2s, color .2s;
}
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(15,25,40,.12), 0 2px 8px rgba(15,25,40,.06); }

.feats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.feats button {
  display: flex; align-items: center; gap: 9px;
  min-height: 48px; padding: 0 14px;
  font: 500 15px var(--f-body); color: var(--ink); text-align: left;
  background: transparent; border: 1.5px solid var(--line); border-radius: 14px; cursor: pointer;
  transition: border-color .2s, background .2s, color .2s;
}
.feats button svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.feats button:hover:not(:disabled) { border-color: var(--ink-2); }
.feats button[aria-pressed="true"] { background: var(--magenta); border-color: var(--magenta); color: #fff; }
.feats button:disabled { opacity: .38; cursor: not-allowed; }

.hero-ctas { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 12px; }

.stage {
  position: relative;
  height: min(78svh, 760px);
  min-height: 460px;
  border-radius: 36px;
  background:
    radial-gradient(60% 55% at 50% 42%, var(--stage-glow), transparent 70%),
    radial-gradient(120% 90% at 50% 0%, var(--surface), var(--paper-2));
  overflow: hidden;
  opacity: 0;
  transition: opacity .8s ease;
}
.stage.is-ready { opacity: 1; }
.stage canvas { width: 100%; height: 100%; display: block; cursor: grab; touch-action: pan-y; }
.stage canvas:active { cursor: grabbing; }
.stage-caption {
  position: absolute; left: 28px; bottom: 26px; max-width: min(380px, calc(100% - 56px));
  pointer-events: none;
}
.feat-title { font: 800 22px var(--f-display); font-stretch: 110%; }
.feat-desc { margin-top: 4px; font-size: 15px; color: var(--ink-2); }
.stage-hint { position: absolute; right: 26px; top: 22px; font-size: 13px; color: var(--ink-2); pointer-events: none; }
.stage.is-demo .stage-hint::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin-right: 7px; vertical-align: 1px; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .25; } }

/* Secciones */
h2 { font-size: clamp(32px, 4.2vw, 56px); font-weight: 820; font-stretch: 116%; line-height: 1; letter-spacing: -0.025em; }
h3 { font-size: 20px; font-weight: 750; font-stretch: 108%; }

.band { padding: clamp(64px, 9vw, 120px) clamp(16px, 4vw, 48px); }
.band-head { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 32px; align-items: end; }
.band-head p { color: var(--ink-2); max-width: 42ch; }
.steps {
  list-style: none; counter-reset: s; margin: 56px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0;
  border-top: 1.5px solid var(--ink);
}
.steps li { counter-increment: s; padding: 22px 28px 0 0; }
.steps li::before {
  content: counter(s);
  display: block; font: 850 64px/1 var(--f-display); font-stretch: 125%;
  color: var(--magenta); margin-bottom: 16px;
}
.steps p { margin-top: 8px; color: var(--ink-2); max-width: 34ch; }

.rules {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 5vw, 72px);
  padding: clamp(64px, 9vw, 120px) clamp(16px, 4vw, 48px);
  background: #172131; color: #eef1f4;
}
.rules-copy p { margin-top: 20px; color: rgba(238, 241, 244, .72); max-width: 44ch; }
.rule-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; align-content: center; }
.rule {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 20px; border-radius: 18px;
  background: rgba(255, 255, 255, .06);
}
.when { font-size: 16px; }
.then {
  flex: none; font-weight: 600; font-size: 14px; padding: 7px 13px; border-radius: 999px;
  background: color-mix(in srgb, var(--green) 22%, transparent); color: #7fe0b0;
}
.then.is-amber { background: rgba(232, 176, 74, .2); color: #f5c873; }
.then.is-magenta { background: rgba(236, 79, 143, .22); color: #ff9cc4; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .rules { background: #0a0f17; } }
:root[data-theme="dark"] .rules { background: #0a0f17; }

.trust {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 4vw, 56px);
  padding: clamp(64px, 8vw, 104px) clamp(16px, 4vw, 48px);
}
.trust p { margin-top: 10px; color: var(--ink-2); max-width: 36ch; }

.cta {
  margin: 0 clamp(16px, 4vw, 48px) clamp(16px, 4vw, 48px);
  padding: clamp(48px, 7vw, 96px) clamp(24px, 5vw, 64px);
  border-radius: 36px; background: var(--magenta); color: #fff;
}
.cta p { margin: 16px 0 28px; font-size: 18px; max-width: 44ch; opacity: .9; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cta { background: #b51b5e; } }
:root[data-theme="dark"] .cta { background: #b51b5e; }

.foot { padding: 0 clamp(16px, 4vw, 48px) 32px; font-size: 14px; color: var(--ink-2); }
.foot-row { display: flex; justify-content: space-between; gap: 16px; }
.legal { margin-top: 16px; font-size: 12.5px; max-width: 90ch; }

/* Funciona con iPhone: imágenes oficiales de Apple, sin efectos (guía de marketing de Apple) */
.ios { padding: 0 clamp(16px, 4vw, 48px) clamp(64px, 9vw, 120px); }
.ios-head { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 32px; align-items: end; }
.ios-head p { color: var(--ink-2); max-width: 44ch; }
.ios-shots {
  list-style: none; margin: 56px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 4vw, 56px);
}
.ios-shots li { min-width: 0; }
.ios-shots img { display: block; width: 100%; max-width: 300px; height: auto; margin: 0 auto 24px; }
.ios-shots p { margin-top: 6px; color: var(--ink-2); max-width: 34ch; }

/* Responsivo */
@media (max-width: 980px) {
  .hero { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .hero-copy { max-width: none; display: contents; }
  .hero-copy > h1 { order: 1; }
  .hero-copy > .lead { order: 2; margin-top: -4px; }
  .stage { order: 3; height: 62svh; min-height: 420px; border-radius: 28px; }
  .controls { order: 4; margin-top: 0; }
  .hero-ctas { order: 5; margin-top: 8px; }
  .nav nav { display: none; }
  .band-head, .rules, .ios-head { grid-template-columns: minmax(0, 1fr); }
  .ios-shots { grid-template-columns: minmax(0, 1fr); }
  .ios-shots img { max-width: 260px; }
  .steps, .trust { grid-template-columns: minmax(0, 1fr); }
  .steps li { padding: 22px 0 28px; border-bottom: 1px solid var(--line); }
}
@media (max-width: 560px) {
  .nav { gap: 12px; }
  .nav-cta .link { display: none; }
  .seg { justify-self: stretch; grid-auto-columns: 1fr; }
  .seg button { padding: 9px 6px; font-size: 14px; }
  .feats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stage-caption { left: 18px; bottom: 16px; }
  .feat-title { font-size: 19px; }
  .feat-desc { font-size: 14px; }
  .stage-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .stage { transition: none; }
  .stage.is-demo .stage-hint::before { animation: none; }
}
