/*
  /instalar/ de MixtliApps (adaptada de nexo-landing): el producto al frente y la
  instalación en iPhone y Android a un toque. Tipografía del sistema (sin fuentes externas).
*/
:root {
  color-scheme: light dark;
  --bg: light-dark(#ffffff, #000000);
  --bg-2: light-dark(#f5f5f7, #161617);
  --ink: light-dark(#0b0b0c, #f5f5f7);
  --muted: light-dark(#86868b, #98989d);
  --line: light-dark(rgba(0, 0, 0, .1), rgba(255, 255, 255, .14));
  --accent: #3bb0bd;
  --accent-2: #3c7cd6;
  --accent-ink: light-dark(#1f8e9a, #5cc8d4);
  --nav: light-dark(rgba(255, 255, 255, .78), rgba(0, 0, 0, .72));
}
:root[data-theme=light] { color-scheme: light; }
:root[data-theme=dark] { color-scheme: dark; }

* { box-sizing: border-box; min-width: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0; background: var(--bg); color: var(--ink); overflow-x: clip;
  font: 17px/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
h2 { font-size: clamp(32px, 4.5vw, 48px); line-height: 1.05; font-weight: 800; letter-spacing: -0.025em; text-wrap: balance; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* ---------- Navegación ---------- */
.nav {
  position: sticky; top: 0; z-index: 10; background: var(--nav);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.nav.scrolled { border-color: var(--line); }
.nav-inner { max-width: 1120px; margin: 0 auto; height: 60px; padding: 0 max(4vw, 16px); display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; text-decoration: none; letter-spacing: -0.01em; }
.brand-icon { width: 28px; height: 28px; border-radius: 22.5%; }
.nav-links { display: flex; gap: 22px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a { flex: none; text-decoration: none; color: var(--muted); font-size: 15px; font-weight: 500; padding: 10px 0; }
.nav-links a:hover { color: var(--ink); }
@media (max-width: 640px) {
  .nav-inner { gap: 12px; }
  .nav-links { gap: 16px; }
  .nav-links a:nth-child(n+3) { display: none; }
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 26px;
  border-radius: 999px; background: var(--accent); color: #fff; font-weight: 600; font-size: 17px;
  text-decoration: none; border: 0; cursor: pointer; transition: transform .15s, background .15s;
}
.btn:hover { background: #2fa2ae; }
.btn:active { transform: scale(.97); }
.btn:focus-visible, .copy:focus-visible, summary:focus-visible, .nav a:focus-visible { outline: 3px solid var(--accent-ink); outline-offset: 3px; }
.btn-ghost { background: var(--bg-2); color: var(--accent-ink); }
.btn-ghost:hover { background: var(--line); }
.btn-small { min-height: 36px; padding: 0 16px; font-size: 14px; flex: none; }
.cta-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

/* ---------- Portada ---------- */
.hero { text-align: center; padding: clamp(40px, 7vw, 88px) max(4vw, 16px) clamp(48px, 7vw, 96px); }
.app-icon {
  width: 96px; height: 96px; margin: 0 auto 22px; border-radius: 22.5%; display: block;
  box-shadow: 0 18px 40px -12px rgba(20, 20, 22, .55);
}
.app-icon svg { width: 52px; height: 52px; }
.hero h1 { font-size: clamp(64px, 11vw, 128px); line-height: .95; font-weight: 800; letter-spacing: -0.045em; }
.tagline { margin-top: 18px; font-size: clamp(24px, 3.4vw, 40px); line-height: 1.15; font-weight: 500; color: var(--muted); letter-spacing: -0.015em; text-wrap: balance; }

/* Dispositivos */
.devices { position: relative; width: min(980px, 92vw); margin: clamp(40px, 6vw, 72px) auto 0; padding-right: 9%; }
.ipad {
  aspect-ratio: 1400 / 973; padding: 2.1%; border-radius: 4.2% / 6%; background: #101012;
  box-shadow: 0 0 0 2px #3a3a3c, 0 40px 80px -30px rgba(0,0,0,.45);
}
.screen { width: 100%; height: 100%; overflow: hidden; background: #fff; }
.ipad .screen { border-radius: 2.4% / 3.4%; }
.screen img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.iphone {
  aspect-ratio: 560 / 1212; padding: 3.2%; border-radius: 15% / 7%; background: #101012;
  box-shadow: 0 0 0 2px #5b4a3a, 0 30px 60px -20px rgba(0,0,0,.5); position: relative;
}
.iphone .screen { border-radius: 12% / 5.6%; }
.iphone::before {
  content: ""; position: absolute; top: 4.6%; left: 50%; transform: translateX(-50%);
  width: 30%; height: 3%; border-radius: 999px; background: #000; z-index: 1;
}
.devices .iphone { position: absolute; right: 0; bottom: -6%; width: 26%; }

/* Instalación */
.install { margin-top: clamp(48px, 7vw, 80px); display: grid; justify-items: center; gap: 16px; }
.install p { color: var(--muted); }
.repo { display: flex; align-items: center; gap: 4px; background: var(--bg-2); border-radius: 14px; padding: 6px 6px 6px 18px; max-width: 100%; }
.repo code { font: 500 16px/1.4 ui-monospace, "SF Mono", Menlo, monospace; color: var(--accent-ink); overflow-wrap: anywhere; }
.copy { min-height: 40px; padding: 0 16px; border-radius: 10px; border: 0; background: var(--bg); color: var(--ink); font: 600 14px Inter, sans-serif; cursor: pointer; flex: none; }

/* ---------- Acerca de ---------- */
.about {
  max-width: 1120px; margin: 0 auto; padding: clamp(56px, 8vw, 120px) max(4vw, 16px);
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 80px); align-items: center;
}
.about-text h2 { margin-bottom: 20px; }
.about-text > p { color: var(--muted); font-size: 19px; max-width: 34em; margin-bottom: 14px; }
.features { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 4px; border-top: 1px solid var(--line); }
.features li { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.features strong { font-weight: 700; }
.features span { color: var(--muted); font-size: 16px; }
.about-phones { position: relative; display: flex; justify-content: center; gap: 4%; padding: 20px 0; }
.about-phones .iphone { width: 44%; }
.tilt-l { transform: rotate(-4deg) translateY(12px); }
.tilt-r { transform: rotate(4deg) translateY(-12px); }
@media (max-width: 820px) {
  .about { grid-template-columns: minmax(0, 1fr); }
  .about-phones { max-width: 440px; margin: 0 auto; width: 100%; }
}
@media (max-width: 480px) {
  .features li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

/* ---------- Equipo ---------- */
.team, .faq, .contact { padding: clamp(56px, 8vw, 110px) max(4vw, 16px); text-align: center; }
.team { background: var(--bg-2); }
.note { color: var(--muted); font-size: 14px; margin-top: 10px; }
.team-grid {
  list-style: none; padding: 0; margin: 40px auto 0; max-width: 960px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 32px 20px;
}
.member-avatar {
  width: 96px; height: 96px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 30px; box-shadow: 0 10px 24px -10px rgba(0,0,0,.35);
}
.member h3 { font-size: 18px; font-weight: 700; }
.member p { color: var(--muted); font-size: 15px; }

/* ---------- Preguntas ---------- */
.faq-list { max-width: 760px; margin: 36px auto 0; text-align: left; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  min-height: 64px; font-size: 19px; font-weight: 600;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 26px; font-weight: 400; color: var(--accent-ink); transition: transform .2s; flex: none; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--muted); padding: 0 0 20px; max-width: 60ch; }

/* ---------- Contacto y pie ---------- */
.contact { border-top: 1px solid var(--line); }
.contact .cta-row { margin: 28px 0 14px; }
.footer { padding: 40px max(4vw, 16px) 56px; text-align: center; border-top: 1px solid var(--line); display: grid; gap: 8px; font-size: 15px; }
.footer nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 24px; margin-bottom: 6px; }
.footer nav a { text-decoration: none; color: var(--accent-ink); font-weight: 500; padding: 8px 0; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 150%); z-index: 20; visibility: hidden;
  background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: 999px; font-size: 15px; font-weight: 500;
  transition: transform .3s, visibility .3s;
}
.toast.show { transform: translate(-50%, 0); visibility: visible; }

/* ---------- Movimiento ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1; transform: none; }
.about-phones.reveal.in .tilt-l { transform: rotate(-4deg) translateY(12px); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Instalación por plataforma ---------- */
.platforms { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.platform {
  display: inline-flex; align-items: center; gap: 12px; min-height: 60px; padding: 0 22px 0 18px; border-radius: 16px;
  border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); cursor: pointer; text-align: left;
  font: 600 18px/1.1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; transition: transform .15s, border-color .15s;
}
.platform svg { width: 28px; height: 28px; fill: currentColor; flex: none; }
.platform span { display: flex; flex-direction: column; gap: 2px; }
.platform small { font-size: 12px; font-weight: 500; color: var(--muted); }
.platform:hover { border-color: var(--accent); }
.platform:active { transform: scale(.97); }
.platform:focus-visible { outline: 3px solid var(--accent-ink); outline-offset: 3px; }
.platform.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.platform.primary small { color: color-mix(in srgb, var(--bg) 70%, transparent); }

/* ---------- Hecho por ---------- */
.maker { margin: 36px auto 0; max-width: 560px; }
img.member-avatar { object-fit: cover; display: block; }
.maker h3 { font-size: 20px; font-weight: 700; }
.maker p { color: var(--muted); }
.maker-bio { margin-top: 12px; font-size: 16px; }

/* ---------- Hoja de instrucciones ---------- */
.sheet-root { position: fixed; inset: 0; z-index: 30; }
.sheet-root[hidden] { display: none; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.42); opacity: 0; transition: opacity .28s; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; background: var(--bg); color: var(--ink); border-radius: 20px 20px 0 0;
  padding: 8px 24px calc(24px + env(safe-area-inset-bottom, 0px)); display: grid; justify-items: center; gap: 14px; text-align: center;
  transform: translateY(100%); transition: transform .3s cubic-bezier(.2,.8,.2,1); max-height: 90dvh; overflow-y: auto;
}
.sheet-root.in .sheet-backdrop { opacity: 1; }
.sheet-root.in .sheet { transform: none; }
@media (min-width: 700px) {
  .sheet { left: 50%; right: auto; bottom: 50%; width: 460px; border-radius: 20px; transform: translate(-50%, 60%); opacity: 0; transition: transform .3s, opacity .3s; }
  .sheet-root.in .sheet { transform: translate(-50%, 50%); opacity: 1; }
}
.grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--line); }
.sheet-icon { width: 72px; height: 72px; border-radius: 22.5%; box-shadow: 0 8px 20px -8px rgba(0,0,0,.4); }
.sheet h3 { font-size: 22px; font-weight: 800; }
.steps { text-align: left; margin: 0; padding-left: 24px; display: grid; gap: 12px; font-size: 17px; justify-self: stretch; }
.steps svg { width: 20px; height: 20px; vertical-align: -4px; color: var(--accent-ink); fill: currentColor; display: inline-block; }
.sheet .btn { justify-self: stretch; }

/* ---------- Marcos con la proporción exacta de la captura (sin recortes) ---------- */
.ipad, .iphone { aspect-ratio: auto; height: auto; }
.ipad .screen { aspect-ratio: 1180 / 820; height: auto; }
.iphone .screen { aspect-ratio: 390 / 844; height: auto; }
.screen img { object-fit: fill; }
.iphone { padding: 3.4%; border-radius: 17% / 8%; box-shadow: 0 0 0 1.5px #3a3a3c, 0 30px 60px -20px rgba(0,0,0,.5); }
.iphone .screen { border-radius: 14% / 6.5%; }
.iphone::before { top: calc(3.4% + 1.6%); width: 28%; height: 2.6%; }
.ipad { padding: 2%; border-radius: 5% / 7%; }
.ipad .screen { border-radius: 3% / 4.3%; }

/* Biseles delgados (como un iPhone y un iPad actuales) */
.iphone { padding: 1.7%; border-radius: 15% / 7%; box-shadow: 0 0 0 1px #48484a, 0 30px 60px -20px rgba(0,0,0,.5); }
.iphone .screen { border-radius: 13.5% / 6.3%; }
.iphone::before { top: calc(1.7% + 1.8%); width: 27%; height: 2.4%; }
.ipad { padding: 1%; border-radius: 3.2% / 4.6%; box-shadow: 0 0 0 1px #48484a, 0 40px 80px -30px rgba(0,0,0,.45); }
.ipad .screen { border-radius: 2.3% / 3.3%; }
