/* Halo, pagina publica.
   Los colores y la letra son los de la app (Theme.kt): noche, no negro;
   un solo acento, el ambar del intermitente del porton; Barlow, una
   grotesca de senaletica. La pagina tiene que parecer la app, no un
   folleto sobre ella. */

@font-face { font-family: Barlow; src: url(fonts/barlow-regular.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: Barlow; src: url(fonts/barlow-semibold.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: Barlow; src: url(fonts/barlow-extrabold.woff2) format("woff2"); font-weight: 800; font-display: swap; }

:root {
  --night: #0E1726;
  --night-deep: #09101C;
  --surface: #18243C;
  --edge: #243352;
  --signal: #F5A524;
  --refused: #E5484D;
  --ink: #EEF3FA;
  --muted: #8FA2C0;

  --gutter: clamp(16px, 5vw, 72px);
  --max: 1240px;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font: 400 1.125rem/1.5 Barlow, system-ui, sans-serif;
  overflow-x: hidden;
}
h1, h2, h3, p, dl, dd, figure, ul { margin: 0; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--signal); color: var(--night); padding: 10px 14px; border-radius: 10px; font-weight: 600; }
.skip:focus { top: 12px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 26px;
  border-radius: 999px; border: 0;
  background: var(--signal); color: var(--night);
  font-weight: 800; font-size: 1.0625rem; letter-spacing: .01em;
  text-decoration: none;
  box-shadow: 0 0 0 0 rgba(245, 165, 36, .5), 0 10px 30px -12px rgba(245, 165, 36, .6);
  transition: transform .18s var(--ease-spring), box-shadow .3s var(--ease-out);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 0 0 6px rgba(245, 165, 36, .14), 0 16px 34px -12px rgba(245, 165, 36, .7); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn-quiet { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--edge); }
.btn-quiet:hover { box-shadow: inset 0 0 0 1.5px var(--muted); }
.btn-small { min-height: 42px; padding: 0 18px; font-size: 1rem; }

/* ---------- Cabecera ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 24px;
  padding: 14px var(--gutter);
  background: rgba(14, 23, 38, .82);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.top.scrolled { border-bottom-color: var(--edge); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 1.375rem; letter-spacing: .01em; }
.brand svg { width: 26px; height: 26px; color: var(--signal); }
.top nav { display: flex; gap: 26px; margin-left: auto; }
.top nav a { text-decoration: none; color: var(--muted); font-weight: 600; transition: color .2s; }
.top nav a:hover { color: var(--ink); }
@media (max-width: 640px) {
  .top nav { display: none; }
  .top .btn-small { margin-left: auto; }
}

/* ---------- Portada ---------- */
.hero {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(32px, 6vw, 80px) var(--gutter) clamp(40px, 6vw, 72px);
  display: grid; gap: clamp(40px, 5vw, 72px);
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: center;
}
.hero h1 {
  font-weight: 800;
  font-size: clamp(2.75rem, 6vw, 5.25rem);
  line-height: .94;
  letter-spacing: -.025em;
  text-wrap: balance;
}
.lede { margin-top: 26px; max-width: 30em; color: var(--muted); font-size: clamp(1.125rem, 1.6vw, 1.3125rem); line-height: 1.5; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

/* El escenario: un porton de verdad con la pantalla de la app delante */
.stage {
  --open: 0;
  position: relative;
  aspect-ratio: .96 / 1;
  width: 100%;
  max-width: 620px;
  justify-self: end;
}
.garage {
  position: absolute; inset: 3% 44px 7% 27%;
  display: grid; grid-template-rows: 12% 1fr;
}
.lintel {
  position: relative;
  background: linear-gradient(#1d2a45, #152037);
  border-radius: 14px 14px 0 0;
  box-shadow: inset 0 -1px 0 var(--edge);
}
.lamp {
  position: absolute; right: 9%; top: 50%;
  width: 18px; height: 18px; margin-top: -9px;
  border-radius: 50%;
  background: #5b4520;
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .25);
}
.stage.moving .lamp { animation: blink .62s steps(1) infinite alternate; }
@keyframes blink {
  0% { background: #5b4520; box-shadow: none; }
  50%, 100% { background: var(--signal); box-shadow: 0 0 18px 6px rgba(245, 165, 36, .55), 0 0 60px 14px rgba(245, 165, 36, .18); }
}
.bay {
  position: relative; overflow: hidden;
  border: 10px solid #152037; border-top: 0;
  background: var(--night-deep);
}
.interior { position: absolute; inset: 0; background: linear-gradient(#0b1322, #111c30 70%, #0b1322); }
.parked {
  position: absolute; left: 60%; bottom: 12%; width: 70%;
  transform: translateX(-50%);
  opacity: calc(.15 + var(--open) * .85);
}
.bulb {
  position: absolute; left: 50%; top: 10%;
  width: 70%; height: 70%; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(245, 190, 110, .28), transparent 70%);
  opacity: calc(.25 + var(--open) * .75);
}
.floor {
  position: absolute; left: 0; right: 0; bottom: 0; height: 30%;
  background: radial-gradient(70% 90% at 50% 100%, rgba(245, 165, 36, .22), transparent 70%);
  opacity: var(--open);
}
/* La hoja: lamas horizontales. Sube con --open, que mueve main.js */
.door {
  position: absolute; inset: 0;
  transform: translateY(calc(var(--open) * -94%));
  background:
    linear-gradient(90deg, rgba(0,0,0,.18), transparent 12%, transparent 88%, rgba(0,0,0,.2)),
    repeating-linear-gradient(180deg,
      #2a3a5c 0, #26365a 40%, #1f2d4b 78%, #121b2e 80%, #121b2e 84%, #34466b 86%, #2a3a5c 100%);
  background-size: 100% 100%, 100% 11.2%;
  box-shadow: 0 10px 0 0 #121b2e, 0 18px 30px rgba(0, 0, 0, .45);
}
.door::after {
  content: ""; position: absolute; left: 50%; bottom: 4%;
  width: 16%; height: 2.2%; transform: translateX(-50%);
  border-radius: 6px; background: #121b2e; box-shadow: inset 0 1px 0 #3b4f78;
}
.spill {
  position: absolute; left: -10%; right: -10%; bottom: -12%; height: 22%;
  background: radial-gradient(50% 60% at 50% 0%, rgba(245, 165, 36, .32), transparent 75%);
  opacity: var(--open);
  pointer-events: none;
}

/* ---------- El movil (pantalla Abrir, fiel a OpeningScreen.kt) ---------- */
.phone {
  position: absolute; left: 0; bottom: 0;
  height: 100%; aspect-ratio: 9 / 19;
  padding: 9px;
  border-radius: 44px;
  background: linear-gradient(145deg, #3a4660, #1a2234 40%, #0b111c);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .08),
    0 40px 60px -20px rgba(0, 0, 0, .7),
    0 0 0 1px #05080e;
  animation: rise 1s var(--ease-out) .1s both;
}
@keyframes rise { from { opacity: 0; transform: translateY(28px); } }
.phone-screen {
  position: relative; height: 100%;
  border-radius: 36px; overflow: hidden;
  background: var(--night);
}
.app {
  display: flex; flex-direction: column;
  padding: 12px 7% 7%;
}
/* Medidas de la app en dp, sobre un ancho de 360: 1em = 16dp */
.phone { container-type: inline-size; }
.app { font-size: 4.9cqw; }
.app-bar { display: flex; justify-content: space-between; align-items: center; font-size: .82em; font-weight: 600; color: var(--ink); padding: 0 4px; }
.app-bar-icons { display: flex; gap: 3px; }
.app-bar-icons i { width: 5px; height: 9px; border-radius: 1px; background: var(--muted); }
.app-bar-icons i:nth-child(3) { width: 14px; border-radius: 2px; background: var(--ink); }
.app-door { margin-top: 1.4em; font-weight: 600; font-size: 1.03em; color: var(--muted); }
.app-status {
  flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
  gap: .6em; text-align: center; padding-bottom: 1.9em;
}
.app-head { font-weight: 800; font-size: 2.05em; line-height: 1.08; letter-spacing: -.005em; color: var(--ink); min-height: 1.08em; }
.app-head:empty { display: none; }
.app-head.signal { color: var(--signal); }
.app-detail { color: var(--muted); font-size: 1.05em; line-height: 1.35; }

/* El boton redondo. Anillo de 6dp sobre 212dp, como en la app */
.ring {
  --ring: rgba(143, 162, 192, .45);
  --size: 12em;
  position: relative; align-self: center;
  width: var(--size); height: var(--size); flex: none;
  padding: 0; border: 0; border-radius: 50%;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
  transition: transform .16s var(--ease-spring);
}
.ring::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  box-shadow: inset 0 0 0 calc(var(--size) * .028) var(--ring);
  transition: box-shadow .25s;
}
.ring-face {
  position: absolute; inset: 6.6%;
  display: grid; place-items: center;
  border-radius: 50%; background: var(--surface);
  font-weight: 800; font-size: calc(var(--size) * .142); letter-spacing: .02em; color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 6px 18px -6px rgba(0, 0, 0, .6);
  transition: background .2s, box-shadow .2s;
}
.ring:hover .ring-face { background: #1c2a46; }
.ring:active, .ring.pressed { transform: scale(.955); }
.ring:active .ring-face, .ring.pressed .ring-face { box-shadow: inset 0 3px 10px rgba(0, 0, 0, .5); }
.ring[aria-disabled="true"] { cursor: default; }
.ring.working { --ring: var(--ink); }
.ring.signal { --ring: var(--signal); }
.ring.working::before, .ring.signal::before { animation: pulse .62s ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: .15; } to { opacity: 1; } }
/* «Pruébalo», encima del propio boton, y una invitacion lenta a pulsar.
   Se apaga en cuanto alguien pulsa (.used). */
.ring-hint {
  position: absolute; left: 50%; bottom: 17%;
  transform: translateX(-50%);
  padding: .15em .7em .2em; border-radius: 999px;
  background: var(--signal); color: var(--night);
  font-weight: 800; font-size: calc(var(--size) * .072); letter-spacing: .01em; white-space: nowrap;
  box-shadow: 0 4px 14px -4px rgba(245, 165, 36, .7);
  transition: opacity .3s, transform .3s var(--ease-out);
}
.stage.used .ring-hint { opacity: 0; transform: translate(-50%, 6px); }
.stage:not(.used) .ring { animation: nudge 3.6s var(--ease-out) 1.6s infinite; }
.stage:not(.used) .ring::after {
  content: ""; position: absolute; inset: -3%; border-radius: 50%; pointer-events: none;
  animation: breathe 3.6s ease-in-out 1.6s infinite;
}
@keyframes breathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 165, 36, 0); }
  45% { box-shadow: 0 0 34px 6px rgba(245, 165, 36, .28), inset 0 0 0 2px rgba(245, 165, 36, .55); }
}
@keyframes nudge {
  0%, 62%, 100% { transform: none; }
  70% { transform: scale(1.03); }
  78% { transform: scale(.99); }
  86% { transform: scale(1.01); }
}

/* Onda al pulsar: el "clic" que se ve */
.ring .wave {
  position: absolute; inset: 0; border-radius: 50%;
  box-shadow: 0 0 0 2px var(--signal);
  animation: wave .7s var(--ease-out) forwards; pointer-events: none;
}
@keyframes wave { from { opacity: .9; transform: scale(1); } to { opacity: 0; transform: scale(1.35); } }

.app-foot { border-top: 1px solid var(--edge); padding-top: 1em; margin-top: 2.2em; }
.app-key { font-weight: 600; color: var(--ink); }
.app-valid { color: var(--muted); font-size: .92em; }
.app-nav {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: .8em; padding: .7em 1em;
  border-radius: .75em; background: var(--surface); border: 1px solid var(--edge);
  font-weight: 600;
}
.app-nav span:last-child { color: var(--muted); font-size: 1.5em; line-height: .8; }

@keyframes fadein { from { opacity: 0; } }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .stage { justify-self: center; max-width: 520px; }
}
@media (max-width: 480px) {
  .garage { inset: 3% 30px 7% 30%; }
  .phone { height: 95%; }
}

/* ---------- Lo basico ---------- */
.truths {
  max-width: var(--max); margin: 0 auto;
  padding: 28px var(--gutter);
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 48px;
  border-top: 1px solid var(--edge); border-bottom: 1px solid var(--edge);
  color: var(--muted);
}
.truths strong { display: block; color: var(--ink); font-weight: 600; font-size: 1.1875rem; }
@media (max-width: 760px) { .truths { grid-template-columns: 1fr; gap: 20px; } }

/* ---------- Titulos de seccion ---------- */
h2 {
  font-weight: 800; font-size: clamp(2.25rem, 5vw, 3.75rem);
  line-height: 1; letter-spacing: -.02em; text-wrap: balance;
}

/* ---------- Tranquilidad ---------- */
.start { max-width: var(--max); margin: 0 auto; padding: clamp(72px, 10vw, 140px) var(--gutter); }
/* Tres pasos: marca pegada a cada paso y una linea que los une. Al entrar
   en pantalla la linea se llena de ambar hasta el ultimo, que late una vez. */
.steps {
  list-style: none; margin: clamp(28px, 4vw, 44px) 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px;
}
.steps li { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.step-mark {
  position: relative; z-index: 1;
  display: grid; place-items: center; width: 40px; height: 40px; flex: none;
  border-radius: 50%; border: 2px solid var(--edge); background: var(--night);
  font-weight: 600; font-size: 1rem; color: var(--ink); font-variant-numeric: tabular-nums;
}
.step-mark svg { width: 20px; height: 20px; }
.step-t { font-weight: 800; font-size: clamp(1.5rem, 2.3vw, 2rem); line-height: 1.1; letter-spacing: -.015em; text-wrap: balance; }
.steps li:not(:last-child)::after {
  content: ""; position: absolute; top: 19px; left: 52px; right: 0; height: 2px; border-radius: 2px;
  background: linear-gradient(var(--signal), var(--signal)) left / 0% 100% no-repeat, var(--edge);
  transition: background-size .6s var(--ease-out);
}
.steps li:nth-child(2)::after { transition-delay: .45s; }
.steps.go li:not(:last-child)::after { background-size: 100% 100%; }
.step-last .step-mark { border-color: var(--signal); color: var(--signal); }
.step-last .step-t { color: var(--signal); }
.steps.go .step-last .step-mark { animation: arrive .7s var(--ease-spring) 1.05s both; }
@keyframes arrive {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245, 165, 36, 0); }
  45% { transform: scale(1.18); box-shadow: 0 0 0 8px rgba(245, 165, 36, .18); }
  100% { transform: scale(1); box-shadow: 0 0 18px 2px rgba(245, 165, 36, .35); }
}
@media (max-width: 900px) {
  .steps { grid-template-columns: 1fr; gap: 0; }
  .steps li { flex-direction: row; align-items: center; gap: 18px; padding: 12px 0; }
  .step-t { font-size: clamp(1.5rem, 5.6vw, 2rem); }
  .steps li:not(:last-child)::after {
    top: 52px; bottom: -12px; left: 19px; right: auto; width: 2px; height: auto;
    background: linear-gradient(var(--signal), var(--signal)) top / 100% 0% no-repeat, var(--edge);
  }
}

/* ---------- Piloto: la comunidad lo estrena ---------- */
.pilot { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter) clamp(72px, 10vw, 140px); }
.pilot-card {
  padding: clamp(26px, 4vw, 48px);
  border-radius: 28px; border: 1px solid rgba(245, 165, 36, .4);
  background:
    radial-gradient(80% 60% at 100% 0%, rgba(245, 165, 36, .14), transparent 65%),
    var(--surface);
}
.pilot-card p { margin-top: 18px; max-width: 32em; color: var(--muted); font-size: 1.1875rem; }
.pilot-card .btn { margin-top: 28px; }
.pilot-admin { margin-top: 20px; color: var(--muted); }
.pilot-admin a { color: var(--ink); font-weight: 600; }

/* ---------- Hoja de ruta ---------- */
.roadmap { max-width: var(--max); margin: 0 auto; padding: clamp(72px, 10vw, 140px) var(--gutter); }
.roadmap > p { margin-top: 18px; color: var(--muted); font-size: 1.1875rem; }
.roadmap-list {
  list-style: none; margin: clamp(28px, 4vw, 44px) 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px;
}
.roadmap-list li {
  padding: 28px; border-radius: 20px; border: 1px dashed var(--edge);
  color: var(--muted); font-size: 1.0625rem;
}
.roadmap-list strong { display: block; margin-bottom: 6px; color: var(--ink); font-weight: 600; font-size: 1.1875rem; }
.roadmap-tag {
  display: inline-block; margin-bottom: 14px; padding: 4px 10px; border-radius: 999px;
  box-shadow: inset 0 0 0 1.5px var(--signal); color: var(--signal);
  font-size: .8125rem; font-weight: 600; letter-spacing: .02em;
}
@media (max-width: 760px) { .roadmap-list { grid-template-columns: 1fr; } }

/* ---------- Apuntate ---------- */
.join {
  position: relative; overflow: hidden;
  padding: clamp(72px, 10vw, 140px) var(--gutter);
  background: linear-gradient(180deg, var(--night), #121d31);
  border-top: 1px solid var(--edge);
}
.join > * { max-width: var(--max); margin-left: auto; margin-right: auto; }
.join::before {
  content: ""; position: absolute; right: -12vw; top: -14vw;
  width: 46vw; height: 46vw; min-width: 320px; min-height: 320px; border-radius: 50%;
  box-shadow: inset 0 0 0 clamp(18px, 3vw, 40px) rgba(245, 165, 36, .12);
  pointer-events: none;
}
.join h2 { font-size: clamp(2.75rem, 7vw, 5.5rem); line-height: .95; }
.join > p { margin-top: 18px; color: var(--muted); font-size: 1.1875rem; }
.join-form {
  position: relative;
  margin-top: 40px;
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr) minmax(0, .8fr);
  gap: 14px; align-items: end;
}
.join-form label { display: flex; flex-direction: column; gap: 8px; }
.join-form label span { font-size: .9375rem; font-weight: 600; color: var(--muted); }
.join-form input {
  min-height: 52px; width: 100%; padding: 0 16px;
  border-radius: 14px; border: 1.5px solid var(--edge); background: var(--night);
  transition: border-color .2s;
}
.join-form input::placeholder { color: #5f7090; }
.join-form input:focus { outline: none; border-color: var(--signal); }
.join-form input[aria-invalid="true"] { border-color: var(--refused); }
.join-form .check { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 12px; cursor: pointer; }
.join-form .check input { width: 22px; height: 22px; min-height: 0; margin: 0; accent-color: var(--signal); flex: none; }
.join-form .check span { color: var(--ink); font-size: 1rem; font-weight: 400; }
.join-form .btn { grid-column: 1 / -1; justify-self: start; }
.join-note, .join-legal { grid-column: 1 / -1; color: var(--muted); font-size: .9375rem; }
.join-legal a { color: var(--ink); }
.join-note.error { color: var(--refused); }
@media (max-width: 760px) { .join-form { grid-template-columns: 1fr; } }

/* ---------- Pie ---------- */
.bottom {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 28px var(--gutter); border-top: 1px solid var(--edge); color: var(--muted);
}
.bottom .brand { font-size: 1.125rem; color: var(--ink); }
.bottom .brand svg { width: 22px; height: 22px; }
.bottom nav { display: flex; gap: 20px; }
.bottom nav a { color: var(--muted); }
.bottom nav a:hover { color: var(--ink); }

/* ---------- Paginas de texto (privacidad) ---------- */
.legal { max-width: 46em; margin: 0 auto; padding: clamp(40px, 7vw, 96px) var(--gutter) clamp(72px, 10vw, 120px); }
.legal h1 { font-weight: 800; font-size: clamp(2.5rem, 6vw, 4rem); line-height: 1; letter-spacing: -.02em; }
.legal h2 { margin-top: 44px; font-size: clamp(1.5rem, 3vw, 1.875rem); }
.legal p, .legal ul { margin-top: 14px; color: var(--muted); }
.legal ul { padding-left: 1.2em; }
.legal li + li { margin-top: 6px; }
.legal strong { color: var(--ink); font-weight: 600; }
.legal .updated { margin-top: 18px; font-size: .9375rem; }

/* ---------- Sin movimiento ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .ring.working::before, .ring.signal::before { animation: none; opacity: 1; }
  .stage.moving .lamp { animation: none; background: var(--signal); }
}
