/* Copalo — landing. Tokens de DESIGN.md §2. */

:root {
  --bg: #0a0a0d;
  --bg-elevated: #111116;
  --surface: #16161c;
  --surface-high: #1e1e26;
  --text: #f2f2f5;
  --muted: #9b9ba6;
  --faint: #6e6e78;
  --red: #ff3b30;
  --blue: #0a84ff;
  --yellow: #ffd60a;
  --glass-fill: rgba(255, 255, 255, 0.08);
  --glass-fill-strong: rgba(255, 255, 255, 0.14);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-border-soft: rgba(255, 255, 255, 0.08);
  --glass-tint: rgba(10, 10, 13, 0.55);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --header-h: 64px;
  --radius-s: 12px;
  --radius-m: 18px;
  --radius-l: 24px;
  --radius-xl: 32px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Archivo, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  font-weight: 400;
  font-stretch: 100%;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background: var(--bg);
}

img,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

a {
  color: inherit;
}

p {
  margin: 0 0 1em;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 400;
}

::selection {
  background: rgba(255, 59, 48, 0.55);
  color: var(--text);
}

:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: 20px;
  top: -80px;
  z-index: 100;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
  transition: top 160ms var(--ease-out);
}

.skip-link:focus-visible {
  top: 12px;
}

/* ---------------------------------------------------------- tipografía */
.display {
  font-style: italic;
  font-stretch: 125%;
  font-weight: 800;
  text-transform: uppercase;
  line-height: 0.95;
  letter-spacing: -0.02em;
}

.overline {
  margin: 0 0 12px;
  font-style: italic;
  font-stretch: 125%;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-title {
  font-size: clamp(1.9rem, 5.2vw, 3.1rem);
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.section-lede {
  max-width: 52ch;
  margin-top: 16px;
  color: var(--muted);
  font-size: 1.0625rem;
  line-height: 1.6;
}

.team-red {
  color: var(--red);
}

.team-blue {
  color: var(--blue);
}

.team-yellow {
  color: var(--yellow);
}

/* ---------------------------------------------------------- layout */
.container {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: 20px;
}

.section {
  padding-block: 72px;
}

main {
  padding-top: var(--header-h);
}

/* ---------------------------------------------------------- vidrio */
.glass {
  position: relative;
  border-radius: var(--radius-l);
  background:
    linear-gradient(var(--glass-tint), var(--glass-tint)),
    var(--glass-fill);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  backdrop-filter: blur(24px) saturate(160%);
}

.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.06));
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass {
    background: rgba(22, 22, 28, 0.94);
  }
}

/* ---------------------------------------------------------- botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 30px;
  border: 0;
  border-radius: 999px;
  font-family: inherit;
  font-style: italic;
  font-stretch: 125%;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 100ms var(--ease-out),
    background-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn--primary {
  background: var(--red);
  color: var(--bg);
  box-shadow:
    0 0 36px rgba(255, 59, 48, 0.4),
    0 12px 32px rgba(255, 59, 48, 0.18);
}

.btn--glass {
  background: var(--glass-fill-strong);
  color: var(--text);
  border: 1px solid var(--glass-border);
}

.btn--small {
  min-height: 42px;
  padding: 0 20px;
  font-size: 13px;
}

@media (max-width: 480px) {
  .btn {
    font-size: 14px;
    padding: 0 22px;
  }

  .btn--small {
    font-size: 12px;
    padding: 0 16px;
  }
}

@media (max-width: 380px) {
  .brand__name {
    display: none;
  }
}

.btn--small.btn--primary {
  box-shadow: 0 0 22px rgba(255, 59, 48, 0.35);
}

@media (hover: hover) and (pointer: fine) {
  .btn--primary:hover {
    background: #ff5148;
  }

  .btn--glass:hover {
    background: rgba(255, 255, 255, 0.2);
  }
}

/* ---------------------------------------------------------- barra superior */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--header-h);
  background: rgba(10, 10, 13, 0.72);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  backdrop-filter: blur(24px) saturate(160%);
  border-bottom: 1px solid var(--glass-border-soft);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 100%;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  margin-right: auto;
}

.brand img {
  width: 34px;
  height: 34px;
}

.brand__name {
  font-style: italic;
  font-stretch: 125%;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav-links {
  display: none;
  gap: 4px;
}

.nav-links a {
  padding: 10px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-style: italic;
  font-stretch: 125%;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: color 160ms ease, background-color 160ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .nav-links a:hover {
    color: var(--text);
    background: var(--glass-fill);
  }
}

@media (min-width: 1080px) {
  .nav-links {
    display: flex;
  }
}

/* ---------------------------------------------------------- hero */
.hero {
  position: relative;
  overflow: clip;
  padding-block: 48px 64px;
  min-height: calc(100svh - var(--header-h));
  display: flex;
  align-items: center;
}

.hero-map {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
}

.hero-map .terr {
  fill-opacity: 0.22;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
  transition:
    stroke-dashoffset 1500ms var(--ease-out),
    fill-opacity 900ms ease;
}

/* Con JS los territorios arrancan vacíos y se pintan al dibujarse. */
.js .hero-map .terr {
  fill-opacity: 0;
}

.hero-map.is-painted .terr {
  fill-opacity: 0.22;
}

.hero-map .terr--yellow {
  stroke: var(--yellow);
  fill: var(--yellow);
}

.hero-map .terr--red {
  stroke: var(--red);
  fill: var(--red);
}

.hero-map .terr--blue {
  stroke: var(--blue);
  fill: var(--blue);
}

.hero-map.is-painted .terr {
  fill-opacity: 0.22;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(90% 70% at 18% 30%, rgba(10, 10, 13, 0.82) 0%, rgba(10, 10, 13, 0) 65%),
    linear-gradient(180deg, rgba(10, 10, 13, 0.45) 0%, rgba(10, 10, 13, 0) 35%, rgba(10, 10, 13, 0.85) 100%);
  pointer-events: none;
}

.hero__grid {
  display: grid;
  gap: 48px;
  align-items: center;
}

.hero__copy {
  max-width: 640px;
}

.hero__title {
  font-size: clamp(2.7rem, 9.4vw, 4.9rem);
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.hero__lede {
  max-width: 42ch;
  margin-top: 20px;
  color: var(--muted);
  font-size: 1.125rem;
  line-height: 1.6;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.hero__phone {
  justify-self: center;
}

@media (min-width: 960px) {
  .hero__grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 40px;
  }

  .hero__phone {
    justify-self: end;
  }
}

/* ---------------------------------------------------------- teléfono */
.phone {
  position: relative;
  width: min(300px, 100%);
  padding: 10px;
  border-radius: 46px;
  background: #0d0d11;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 40px 90px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.phone__screen {
  overflow: hidden;
  border-radius: 37px;
  background: var(--bg);
}

.phone__screen img {
  width: 100%;
  border-radius: 0;
}

.phone--small {
  width: min(244px, 100%);
}

/* ---------------------------------------------------------- pasos */
.steps {
  display: grid;
  gap: 12px;
  margin: 40px 0 0;
  padding: 0;
  list-style: none;
}

.step {
  padding: 24px;
  border-radius: var(--radius-l);
}

.step__number {
  margin: 0;
  font-size: 3.5rem;
  line-height: 1;
}

.step__diagram {
  height: 132px;
  margin: 20px 0 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step__diagram svg {
  width: 100%;
  max-width: 220px;
  height: 100%;
}

.step__title {
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

.step__text {
  margin: 8px 0 0;
  color: var(--muted);
}

@media (min-width: 900px) {
  .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }
}

/* ---------------------------------------------------------- reglas */
.rules-grid {
  display: grid;
  gap: 12px;
  margin-top: 40px;
}

.rule {
  padding: 24px;
  border-radius: var(--radius-l);
}

.rule__icon {
  width: 40px;
  height: 40px;
  margin-bottom: 18px;
}

.rule__icon svg {
  width: 100%;
  height: 100%;
}

.rule__title {
  font-size: 1.25rem;
}

.rule p {
  margin: 8px 0 0;
  color: var(--muted);
}

@media (min-width: 720px) {
  .rules-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .rules-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ---------------------------------------------------------- split (texto + captura) */
.split {
  display: grid;
  gap: 40px;
  align-items: center;
}

.split__copy {
  max-width: 560px;
}

.split__media {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

@media (min-width: 960px) {
  .split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 56px;
  }

  .split--flip .split__copy {
    order: 2;
  }

  .split--flip .split__media {
    order: 1;
  }
}

/* ---------------------------------------------------------- posiciones */
.standings {
  margin-top: 28px;
  padding: 18px 20px;
  border-radius: var(--radius-m);
}

.standings__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
}

.standings__city {
  margin: 0;
  font-style: italic;
  font-stretch: 125%;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.standings__meter {
  flex: 1 1 100%;
  min-width: 0;
}

.standings__bar {
  display: flex;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  gap: 2px;
}

.standings__bar span {
  width: calc(var(--w) * 1%);
  background: var(--c);
}

.standings__legend {
  display: flex;
  margin-top: 8px;
  font-style: italic;
  font-stretch: 125%;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.standings__legend span {
  width: calc(var(--w) * 1%);
  color: var(--c);
}

@media (min-width: 560px) {
  .standings__meter {
    flex: 1 1 auto;
    min-width: 200px;
  }
}

/* ---------------------------------------------------------- descargar */
.download {
  text-align: center;
}

.download .section-lede {
  margin-inline: auto;
}

.play-badge {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  margin-top: 32px;
  padding: 14px 28px;
  border-radius: var(--radius-m);
  border: 1px solid var(--glass-border);
  background: var(--surface);
  color: var(--muted);
  cursor: not-allowed;
  text-align: left;
}

.play-badge__icon {
  width: 0;
  height: 0;
  border-top: 13px solid transparent;
  border-bottom: 13px solid transparent;
  border-left: 21px solid currentColor;
  opacity: 0.55;
}

.play-badge__small {
  display: block;
  font-style: italic;
  font-stretch: 125%;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

.play-badge__big {
  display: block;
  font-style: italic;
  font-stretch: 125%;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}

.download__note {
  margin: 20px 0 0;
  font-size: 0.875rem;
  color: var(--faint);
}

/* ---------------------------------------------------------- reloj */
.watch {
  width: min(300px, 82vw);
  aspect-ratio: 1;
  padding: 12px;
  border-radius: 50%;
  background: #0d0d11;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 40px 90px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.watch img {
  width: 100%;
  border-radius: 50%;
}

/* ---------------------------------------------------------- privacidad */
.privacy-card {
  padding: 32px;
  border-radius: var(--radius-xl);
}

.privacy-card p {
  color: var(--muted);
}

.text-link {
  color: var(--text);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.35);
  text-underline-offset: 3px;
  transition: text-decoration-color 160ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .text-link:hover {
    text-decoration-color: var(--text);
  }
}

/* ---------------------------------------------------------- footer */
.site-footer {
  margin-top: 40px;
  border-top: 1px solid var(--glass-border-soft);
  padding-block: 48px 64px;
}

.site-footer__grid {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.site-footer__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}

.site-footer__brand img {
  width: 28px;
  height: 28px;
}

.site-footer__brand span {
  font-style: italic;
  font-stretch: 125%;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-size: 0.9375rem;
}

.site-footer__links a {
  color: var(--muted);
  text-decoration: none;
  transition: color 160ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .site-footer__links a:hover {
    color: var(--text);
  }
}

.site-footer__legal {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
}

@media (min-width: 800px) {
  .site-footer__grid {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
  }

  .site-footer__legal {
    text-align: right;
  }
}

/* ---------------------------------------------------------- legales */
.legal {
  padding-block: 64px 96px;
}

.legal__inner {
  max-width: 68ch;
}

.legal h1 {
  font-size: clamp(2rem, 6vw, 3.1rem);
  letter-spacing: -0.025em;
}

.legal__date {
  margin: 18px 0 40px;
  font-style: italic;
  font-stretch: 125%;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.legal section {
  margin-top: 36px;
}

.legal h2 {
  margin-bottom: 10px;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
}

.legal p,
.legal li {
  color: var(--muted);
  line-height: 1.7;
}

.legal ul {
  margin: 0 0 1em;
  padding-left: 1.2em;
}

.legal li {
  margin-bottom: 8px;
}

.legal li::marker {
  color: var(--faint);
}

/* ---------------------------------------------------------- 404 */
.not-found {
  min-height: calc(100svh - var(--header-h));
  display: flex;
  align-items: center;
  text-align: center;
}

.not-found .not-found__code {
  margin: 0;
  font-size: clamp(5rem, 22vw, 10rem);
  letter-spacing: -0.04em;
  color: var(--red);
}

.not-found p {
  margin: 8px auto 32px;
  max-width: 40ch;
  color: var(--muted);
}

/* ---------------------------------------------------------- aparición */
.js .reveal {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 500ms var(--ease-out),
    transform 500ms var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

.js .reveal[data-visible] {
  opacity: 1;
  transform: none;
}

/* ---------------------------------------------------------- accesibilidad */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .btn {
    transition: none;
  }

  .btn:active {
    transform: none;
  }

  .hero-map .terr {
    transition: none;
    stroke-dashoffset: 0 !important;
    fill-opacity: 0.22 !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .glass {
    background: var(--surface);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .glass::before {
    background: rgba(255, 255, 255, 0.12);
  }

  .site-header {
    background: var(--bg-elevated);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
