/* ==========================================================================
   Pymly · pymly.net
   Mismo sistema visual que streetly.net (fondo neutro, azul de marca
   #0163B9, radios generosos, modo oscuro automático), adaptado con el
   motivo "Órbita" del logo de Pymly en vez de la carretera de Streetly.
   ========================================================================== */

:root {
  --bg: #f8f9fb;
  --surface: #ffffff;
  --ink: #1a1d21;
  --ink-2: #5b6472;
  --line: #e2e6ee;

  --brand: #0163b9;
  --brand-text: #0163b9;
  --on-brand: #ffffff;
  --tint: #d8e2ff;
  --tint-ink: #001a41;

  --green: #1f8f5f;
  --violet: #6d4fd1;
  --amber: #b86e00;
  --teal: #0f9488;

  --bezel: #10141b;
  --phone-shadow: rgba(1, 40, 90, 0.42);

  --radius-s: 10px;
  --radius-m: 16px;
  --radius-l: 28px;

  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --wrap: 1180px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d1118;
    --surface: #151b25;
    --ink: #edf0f5;
    --ink-2: #a2abb9;
    --line: #252d3a;

    --brand-text: #8fc0f7;
    --tint: #10315a;
    --tint-ink: #d3e5ff;

    --green: #4cc38a;
    --violet: #a48cf2;
    --amber: #e8a13a;
    --teal: #3fc6b8;

    --bezel: #2b3343;
    --phone-shadow: rgba(0, 0, 0, 0.6);
  }
  :root:not([data-theme="light"]) .brand img,
  :root:not([data-theme="light"]) .footer__brand img { filter: brightness(1.45) saturate(0.85); }
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; font-size: 90%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--brand-text); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--brand-text);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--brand); color: var(--on-brand);
  padding: 10px 16px; border-radius: var(--radius-s); text-decoration: none;
}
.skip:focus { top: 16px; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 40px);
}

h1, h2, h3 {
  font-family: var(--font-display);
  margin: 0;
  color: var(--ink);
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.1rem, 4.8vw, 3.6rem);
  font-weight: 700;
  font-stretch: 88%;
  line-height: 1;
  letter-spacing: -0.035em;
}

h2 {
  font-size: clamp(1.55rem, 2.8vw, 2.2rem);
  font-weight: 650;
  font-stretch: 92%;
  line-height: 1.06;
  letter-spacing: -0.028em;
}

h1.as-h2 { font-size: clamp(1.55rem, 2.8vw, 2.2rem); font-weight: 650; font-stretch: 92%; line-height: 1.06; letter-spacing: -0.028em; }

h3 { font-size: 1.2rem; font-weight: 650; line-height: 1.2; letter-spacing: -0.015em; }

p { margin: 0; }
.lede { font-size: clamp(1rem, 1.3vw, 1.1rem); color: var(--ink-2); max-width: 46ch; }

/* ---------- Botones ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 0.9rem 1.35rem;
  border-radius: 14px;
  border: 0;
  font: 600 1rem/1.2 var(--font-body);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.btn--primary { background: var(--brand); color: var(--on-brand); }
.btn--primary:hover { background: #014c93; }
.btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn--ghost:hover { box-shadow: inset 0 0 0 1.5px var(--brand-text); color: var(--brand-text); }
.btn--sm { padding: 0.6rem 1rem; font-size: 0.95rem; border-radius: 12px; }
.btn--lg { padding: 1.05rem 1.7rem; font-size: 1.02rem; border-radius: 16px; }

/* ---------- Cabecera ---------- */

.site-header { position: sticky; top: 0; z-index: 30; background: var(--bg); border-bottom: 1px solid var(--line); }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; padding-block: 12px;
}
.brand {
  display: inline-flex; align-items: center; gap: 12px;
  color: var(--ink); text-decoration: none;
  font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; letter-spacing: -0.02em;
}
.brand img { width: 38px; height: 38px; }
.nav { display: flex; align-items: center; gap: clamp(16px, 3vw, 36px); }
.nav__links { display: flex; gap: clamp(12px, 1.8vw, 26px); }
.nav__links a { color: var(--ink-2); text-decoration: none; font-weight: 500; white-space: nowrap; }
.nav__links a:hover { color: var(--ink); }
.nav__links a[aria-current="page"] { color: var(--ink); box-shadow: 0 2px 0 var(--brand); }
.nav__auth { display: flex; align-items: center; gap: 8px; }
.nav__cta { white-space: nowrap; }
.nav .btn { white-space: nowrap; }

.mnav { display: none; position: relative; }
.mnav summary { list-style: none; cursor: pointer; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; box-shadow: inset 0 0 0 1.5px var(--line); color: var(--ink); }
.mnav summary::-webkit-details-marker { display: none; }
.mnav summary svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.mnav__panel { position: absolute; right: 0; top: 52px; min-width: 230px; display: grid; gap: 2px; padding: 8px; background: var(--bg); border-radius: 16px; box-shadow: 0 12px 40px rgba(0,0,0,.2), inset 0 0 0 1px var(--line); }
.mnav__panel a { padding: 12px 14px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 600; }
.mnav__panel a:hover, .mnav__panel a[aria-current="page"] { background: var(--tint); color: var(--tint-ink); }
@media (max-width: 1120px) { .nav__links { display: none; } .mnav { display: block; } }
@media (max-width: 520px) { .nav__login { display: none; } .nav { gap: 8px; } .site-header .wrap { gap: 10px; } .brand { font-size: 1.2rem; } }

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

.hero { position: relative; overflow: hidden; isolation: isolate; }

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: clamp(24px, 5vw, 72px);
  padding-block: clamp(24px, 4vw, 48px) clamp(40px, 6vw, 72px);
}

.hero__copy { display: grid; gap: 28px; justify-items: start; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* El motivo Órbita: nodos conectados que se dibujan al cargar */
.orbit {
  position: absolute; right: 2%; top: 8%; width: 38%; max-width: 320px; height: auto;
  z-index: -1; pointer-events: none; opacity: 0.55;
}
.orbit-line { fill: none; stroke: var(--brand); stroke-width: 10; stroke-linecap: round; opacity: 0.55; }
.orbit-line {
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: draw-orbit 1.1s cubic-bezier(0.55, 0.05, 0.25, 1) forwards;
}
.orbit-line:nth-child(2) { animation-delay: 0.08s; }
.orbit-line:nth-child(3) { animation-delay: 0.16s; }
.orbit-line:nth-child(4) { animation-delay: 0.24s; }
.orbit-node { fill: var(--brand); opacity: 0; animation: node-in 0.5s ease-out forwards; }
.orbit-node--center { fill: var(--brand); }
.orbit-node:nth-of-type(1) { animation-delay: 0s; }
.orbit-node:nth-of-type(2) { animation-delay: 0.3s; }
.orbit-node:nth-of-type(3) { animation-delay: 0.38s; }
.orbit-node:nth-of-type(4) { animation-delay: 0.46s; }
.orbit-node:nth-of-type(5) { animation-delay: 0.54s; }

@keyframes draw-orbit { to { stroke-dashoffset: 0; } }
@keyframes node-in {
  from { opacity: 0; transform: scale(0.4); transform-origin: center; }
  to   { opacity: 1; transform: scale(1); transform-origin: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .orbit-line { animation: none; stroke-dashoffset: 0; }
  .orbit-node { animation: none; opacity: 1; }
}

/* Mockup del panel en el hero: ventana de navegador, no de móvil (Pymly es una app web) */
.hero__device { display: grid; justify-items: center; position: relative; }

.browser {
  position: relative;
  width: min(460px, 92vw);
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 40px 80px -30px var(--phone-shadow), 0 0 0 1px var(--line);
}
.browser__bar {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px; background: var(--bezel);
}
.browser__bar i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.25); display: block; }
.browser__bar i:first-child { background: #e8594f; }
.browser__bar i:nth-child(2) { background: #e8b13a; }
.browser__bar i:nth-child(3) { background: #3fbf6c; }
.browser img { width: 100%; height: auto; display: block; }
.device-note { margin-top: 14px; font-size: 0.8rem; color: var(--ink-2); text-align: center; }

.stores { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.store { display: inline-flex; flex-direction: column; gap: 2px; padding: 10px 18px; border-radius: 14px; background: var(--ink); color: var(--bg); min-width: 168px; opacity: .92; cursor: default; }
.store__soon { font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; opacity: .85; }

/* ---------- Secciones ---------- */

.section { padding-block: clamp(36px, 5vw, 60px); }
.section--line { border-top: 1px solid var(--line); }
.head-row { display: grid; gap: 10px; margin-bottom: clamp(18px, 2.6vw, 28px); max-width: 60ch; }
.tag {
  font-family: var(--font-body); font-size: 0.78rem; font-weight: 600; letter-spacing: 0;
  padding: 0.15rem 0.6rem; border-radius: 999px; background: var(--tint); color: var(--tint-ink);
}

/* Índice de módulos (como el "explore" de Streetly) */
.explore { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; list-style: none; margin: 0; padding: 0; }
.explore a { display: grid; gap: 8px; height: 100%; padding: 22px; border-radius: 18px; text-decoration: none; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.explore a:hover { box-shadow: inset 0 0 0 1.5px var(--brand-text); }
.explore b { font-family: var(--font-display); font-size: 1.1rem; }
.explore span { color: var(--ink-2); font-size: .95rem; }
@media (max-width: 960px) { .explore { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 520px) { .explore { grid-template-columns: 1fr; } }

/* Vídeo de presentación */
.vid { margin: 28px 0 0; max-width: 640px; }
.vid video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 16px; background: #0a254a; border: 1px solid var(--line); }
.vid figcaption { margin-top: 10px; }
.vid-txt { max-width: 640px; margin: 14px 0 0; color: var(--ink-2); }
.vid-txt summary { cursor: pointer; font-weight: 600; color: var(--brand-text); }
.vid-txt p { margin-top: 10px; line-height: 1.6; }

/* Funciones: índice con líneas finas */
.features {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 7vw, 104px);
}
.features__intro { position: sticky; top: 90px; align-self: start; display: grid; gap: 20px; }
.feature-list { border-bottom: 1px solid var(--line); }
.feature {
  display: grid; grid-template-columns: 44px 1fr; gap: 20px;
  padding-block: 18px; border-top: 1px solid var(--line);
}
.feature svg {
  width: 30px; height: 30px; margin-top: 2px;
  fill: none; stroke: var(--brand-text); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.feature h3 { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 6px; }
.feature p { color: var(--ink-2); max-width: 52ch; }

/* Cómo funciona: secuencia con ruta de nodos */
.steps {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 7vw, 104px); align-items: start;
}
.steps__intro { display: grid; gap: 20px; }
.route { list-style: none; margin: 0; padding: 0; }
.route li { position: relative; padding: 0 0 44px 64px; }
.route li:last-child { padding-bottom: 0; }
.route li::before {
  content: ""; position: absolute; left: 0; top: 4px;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg); border: 7px solid var(--brand);
}
.route li:not(:last-child)::after {
  content: ""; position: absolute; left: 12.5px; top: 40px; bottom: 6px;
  border-left: 3px dashed var(--brand); opacity: 0.5;
}
.route h3 { margin-bottom: 6px; }
.route p { color: var(--ink-2); max-width: 46ch; }

/* Audiencias / casos de uso */
.cgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; list-style: none; margin: 0; padding: 0; }
.cgrid li { padding: 22px; border-radius: 18px; box-shadow: inset 0 0 0 1.5px var(--line); display: grid; gap: 8px; align-content: start; }
.cgrid h3 { font-size: 1.08rem; }
.cgrid p { color: var(--ink-2); font-size: .98rem; line-height: 1.55; }

/* Planes */
.plans-head { display: grid; gap: 16px; margin-bottom: 48px; max-width: 60ch; }
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.plan {
  display: flex; flex-direction: column; gap: 24px;
  padding: 32px; border-radius: var(--radius-l);
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
}
.plan h3 { font-size: 1.35rem; }
.plan__price { display: grid; gap: 2px; }
.plan__amount { font-family: var(--font-display); font-size: 2.2rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.plan__amount small { font-family: var(--font-body); font-size: 1rem; font-weight: 500; letter-spacing: 0; opacity: 0.75; }
.plan__alt { font-size: 0.92rem; opacity: 0.8; }
.plan ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.plan li { position: relative; padding-left: 28px; }
.plan li::before {
  content: ""; position: absolute; left: 0; top: 0.32em; width: 17px; height: 17px;
  background: var(--brand-text);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 12.5 5 5L20 6.5'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 12.5 5 5L20 6.5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.plan--featured { background: var(--brand); color: #fff; box-shadow: none; }
.plan--featured h3 { color: #fff; }
.plan--featured li::before { background: #fff; }
.plans-note { margin-top: 24px; font-size: 0.9rem; color: var(--ink-2); max-width: 70ch; }

/* Banda de alta inicial */
.soon-band {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 32px;
  padding: clamp(32px, 5vw, 56px); border-radius: var(--radius-l);
  background: var(--tint); color: var(--tint-ink);
}
.soon-band h2 { color: var(--tint-ink); font-size: clamp(1.5rem, 2.6vw, 2rem); margin-bottom: 12px; }
.soon-band p { max-width: 52ch; opacity: 0.88; }
.soon-band .btn--primary { background: var(--tint-ink); color: var(--tint); }

/* ---------- Preguntas ---------- */

.faq { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 7vw, 104px); align-items: start; }
.faq__list { border-bottom: 1px solid var(--line); }
.faq details { border-top: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; padding-block: 15px; padding-right: 44px; position: relative;
  font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; letter-spacing: -0.01em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 10px; height: 10px; margin-top: -8px;
  border-right: 2px solid var(--brand-text); border-bottom: 2px solid var(--brand-text);
  transform: rotate(45deg); transition: transform 0.2s ease;
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq details p { padding-bottom: 16px; color: var(--ink-2); max-width: 56ch; }
.faq__aside { display: grid; gap: 16px; align-content: start; }
.faq__aside .lede { max-width: 40ch; }
.faq__help { background: var(--tint); color: var(--tint-ink); border-radius: 18px; padding: 20px; display: grid; gap: 12px; }
.faq__help p { margin: 0; }
.faq__help .row { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Pie ---------- */

.site-footer { border-top: 1px solid var(--line); padding-block: 40px 56px; color: var(--ink-2); font-size: 0.95rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px 32px; }
.footer__brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; text-decoration: none; }
.footer__brand img { width: 30px; height: 30px; }
.footer__links { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.footer__links a { color: var(--ink-2); }
.credits-line { flex-basis: 100%; font-size: .8rem; color: var(--ink-2); }

/* ---------- Páginas de texto (privacidad, etc.) ---------- */

.doc { padding-block: clamp(40px, 7vw, 88px) clamp(72px, 10vw, 128px); }
.doc__inner { max-width: 72ch; margin-inline: auto; display: grid; gap: 22px; }
.doc h1 { font-size: clamp(1.9rem, 4.2vw, 2.9rem); margin-bottom: 4px; }
.doc h2 { font-size: 1.35rem; margin-top: 28px; letter-spacing: -0.02em; }
.doc ul { margin: 0; padding-left: 1.2rem; display: grid; gap: 8px; }
.doc .meta { color: var(--ink-2); font-size: 0.95rem; }

.crumbs { font-size: .9rem; color: var(--ink-2); margin-bottom: 18px; }
.crumbs a { color: var(--ink-2); }
.page-band { padding-block: clamp(40px, 7vw, 80px) 0; }

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .hero__grid { grid-template-columns: 1fr; padding-bottom: clamp(60px, 10vw, 100px); }
  .hero__device { margin-top: 12px; }
  .features, .steps, .faq { grid-template-columns: 1fr; }
  .features__intro { position: static; }
  .plans { grid-template-columns: 1fr; }
  .soon-band { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .site-header .btn--soon { display: none; }
}
@media (max-width: 420px) {
  .nav__login { display: none; }
}

/* Aviso de cookies necesarias */
.consent { position: fixed; left: 16px; right: 16px; bottom: max(16px, env(safe-area-inset-bottom, 0px)); z-index: 50; max-width: 720px; margin-inline: auto; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; padding: 14px 18px; background: var(--surface, #fff); color: var(--ink); border-radius: 16px; box-shadow: 0 8px 30px rgba(0,0,0,.18), inset 0 0 0 1px var(--line); }
.consent[hidden] { display: none; }
.consent p { margin: 0; flex: 1 1 320px; font-size: .92rem; }
