/* =========================================================================
   PIVOT — Design System
   App premium para organizar y jugar partidos de fútbol amateur.
   Dirección visual: dark premium, sobrio, deportivo. Neutro al 85–90 %,
   acento verde muy contenido (solo detalles, estados y foco del campo 3D).
   ========================================================================= */

/* ----------------------------------------------------------------------- */
/* Tokens                                                                  */
/* ----------------------------------------------------------------------- */
:root {
  /* Color system — neutral charcoal, sin tinte azulado */
  --bg:            #0A0A0B; /* negro neutro casi puro */
  --surface:       #141414; /* cards charcoal */
  --surface-2:     #1C1C1C; /* superficie secundaria */
  --accent:        #00E589; /* verde deportivo — uso muy contenido */
  --accent-dim:    rgba(0, 229, 137, 0.22);
  --accent-soft:   rgba(0, 229, 137, 0.07);
  --pro:           #7B61FF; /* violeta — reservado, casi sin uso */
  --text:          #F2F2F2; /* blanco roto neutro */
  --muted:         #8A8A8A; /* gris secundario neutro */

  /* Surfaces / lines */
  --glass-bg:      rgba(20, 20, 22, 0.66);
  --glass-border:  rgba(255, 255, 255, 0.06);
  --hairline:      rgba(255, 255, 255, 0.06);
  --line:          rgba(255, 255, 255, 0.10); /* bordes algo más marcados */
  --fill:          rgba(255, 255, 255, 0.04); /* relleno neutro de chips */

  /* Type */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Spacing / layout */
  --container: 1140px;
  --gutter: clamp(20px, 5vw, 48px);
  --section-y: clamp(80px, 13vh, 152px);
  --radius: 18px;
  --radius-sm: 12px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ----------------------------------------------------------------------- */
/* Reset                                                                   */
/* ----------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

::selection { background: var(--accent); color: var(--bg); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ----------------------------------------------------------------------- */
/* Typography                                                              */
/* ----------------------------------------------------------------------- */
h1, h2, h3, h4 { line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; }

.display {
  font-size: clamp(2.9rem, 7.4vw, 5.6rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.02;
  text-wrap: balance;
}
.h2 { font-size: clamp(1.9rem, 4vw, 2.9rem); letter-spacing: -0.03em; text-wrap: balance; }
.h3 { font-size: clamp(1.15rem, 2vw, 1.4rem); }

.eyebrow {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--muted); line-height: 1.62; text-wrap: pretty; }
.muted { color: var(--muted); }

/* ----------------------------------------------------------------------- */
/* Layout helpers                                                          */
/* ----------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section-y); position: relative; }
.section-head { max-width: 640px; margin-bottom: clamp(44px, 6vh, 80px); }
.section-head .h2 { margin-top: 14px; }
.section-head .lead { margin-top: 18px; }

/* ----------------------------------------------------------------------- */
/* Header                                                                  */
/* ----------------------------------------------------------------------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  transition: background 0.4s var(--ease-soft), border-color 0.4s var(--ease-soft);
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  background: rgba(10, 10, 11, 0.72);
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
  border-bottom-color: var(--hairline);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand img { display: block; height: 30px; width: auto; }

.nav { display: flex; align-items: center; gap: 34px; }
.nav-links { display: flex; gap: 30px; }
.nav-links a {
  font-size: 0.92rem;
  color: var(--muted);
  font-weight: 500;
  transition: color 0.25s var(--ease-soft);
}
.nav-links a:hover { color: var(--text); }

@media (max-width: 860px) {
  .nav-links { display: none; }
}

/* ----------------------------------------------------------------------- */
/* Buttons                                                                 */
/* ----------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 22px;
  height: 44px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: -0.01em;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease-soft),
              border-color 0.25s var(--ease-soft), color 0.25s var(--ease-soft);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

/* Accent button — sólido, sin glow */
.btn-primary {
  background: var(--accent);
  color: var(--bg);
}
.btn-primary:hover { transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}
.btn-ghost:hover { border-color: rgba(255, 255, 255, 0.28); background: rgba(255, 255, 255, 0.04); }

.btn-sm { height: 38px; padding: 0 16px; font-size: 0.88rem; }

.btn .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }

/* Store download buttons — neutro, refinado, sin neón */
.btn-store {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 12px 20px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: var(--text);
  transition: background 0.25s var(--ease-soft), border-color 0.25s var(--ease-soft), transform 0.25s var(--ease);
}
.btn-store:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.20);
  transform: translateY(-2px);
}
.btn-store:active { transform: translateY(0); }
.btn-store-icon { color: var(--text); flex: none; opacity: 0.92; }
.btn-store-label { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.btn-store-sub { font-size: 11px; color: var(--muted); }
.btn-store-name { font-size: 15px; font-weight: 600; color: var(--text); letter-spacing: -0.01em; }

@media (max-width: 540px) {
  .hero-cta { flex-direction: column; align-items: stretch; }
  .btn-store { justify-content: flex-start; }
}

/* ----------------------------------------------------------------------- */
/* Hero + 3D canvas                                                        */
/* ----------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transition: opacity 1.6s var(--ease-soft);
}
#hero-canvas.is-ready { opacity: 1; }

/* Fallback grid when WebGL is unavailable — líneas neutras, sin verde */
.hero-fallback {
  position: absolute;
  inset: 0;
  display: none;
  background:
    linear-gradient(transparent 0 39px, rgba(255, 255, 255, 0.04) 39px 40px) 0 0 / 100% 40px,
    linear-gradient(90deg, transparent 0 39px, rgba(255, 255, 255, 0.04) 39px 40px) 0 0 / 40px 100%;
  transform: perspective(600px) rotateX(58deg) scale(1.6);
  transform-origin: bottom center;
  mask-image: linear-gradient(to top, #000 10%, transparent 75%);
  -webkit-mask-image: linear-gradient(to top, #000 10%, transparent 75%);
}
.no-webgl #hero-canvas { display: none; }
.no-webgl .hero-fallback { display: block; }

/* Legibility gradient over the canvas */
.hero-veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(80% 60% at 18% 26%, rgba(10, 10, 11, 0.55), transparent 60%),
    linear-gradient(180deg, rgba(10, 10, 11, 0.50) 0%, rgba(10, 10, 11, 0.10) 34%, rgba(10, 10, 11, 0.40) 72%, var(--bg) 100%);
}

.hero-inner { position: relative; z-index: 2; max-width: 920px; }
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--muted);
}
.hero .eyebrow::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
}
.hero h1 { margin: 22px 0 0; }
.hero h1 .hl { color: var(--accent); }
.hero-sub { margin-top: 26px; max-width: 540px; }
.hero-cta { margin-top: 40px; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.hero-note { margin-top: 20px; font-size: 0.85rem; color: var(--muted); letter-spacing: 0.01em; }

.scroll-hint {
  position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%);
  z-index: 2; color: var(--muted); font-size: 0.7rem; letter-spacing: 0.18em;
  text-transform: uppercase; display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.scroll-hint .line { width: 1px; height: 38px; background: linear-gradient(rgba(255, 255, 255, 0.55), transparent); animation: drop 2.4s var(--ease-soft) infinite; }
@keyframes drop { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* ----------------------------------------------------------------------- */
/* Steps (Cómo funciona)                                                   */
/* ----------------------------------------------------------------------- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  counter-reset: step;
}
.step {
  position: relative;
  padding: 32px 28px 30px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--hairline);
  transition: border-color 0.3s var(--ease-soft), transform 0.3s var(--ease);
}
.step:hover { border-color: var(--line); transform: translateY(-2px); }
.step::before {
  counter-increment: step;
  content: "0" counter(step);
  font-size: 0.82rem; font-weight: 700; letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.28);
  font-variant-numeric: tabular-nums;
}
.step h3 { margin: 16px 0 8px; }
.step p { color: var(--muted); font-size: 0.96rem; }
.step .ico { position: absolute; top: 28px; right: 26px; color: var(--text); opacity: 0.45; }
.step .ico svg { width: 24px; height: 24px; }

@media (max-width: 760px) {
  .steps { grid-template-columns: 1fr; }
}

/* ----------------------------------------------------------------------- */
/* Audience panels (Jugadores / Organizadores)                             */
/* ----------------------------------------------------------------------- */
.panels { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }

.panel {
  position: relative;
  padding: clamp(28px, 4vw, 44px);
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--hairline);
  overflow: hidden;
  transition: border-color 0.3s var(--ease-soft), transform 0.3s var(--ease);
}
.panel:hover { border-color: var(--line); transform: translateY(-2px); }
.panel::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 80% at 100% 0%, rgba(255, 255, 255, 0.03), transparent 55%);
}
.panel .tag {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 5px 12px; border-radius: 999px; margin-bottom: 18px;
  background: var(--fill); color: var(--muted); border: 1px solid var(--hairline);
}
.panel h3 { font-size: clamp(1.4rem, 2.4vw, 1.8rem); margin-bottom: 6px; }
.panel > p { color: var(--muted); margin-bottom: 26px; }

.feature-list { display: grid; gap: 16px; }
.feature-list li { display: grid; grid-template-columns: 26px 1fr; gap: 14px; align-items: start; }
.feature-list .check {
  width: 24px; height: 24px; border-radius: 7px; margin-top: 2px;
  display: grid; place-items: center; flex: none;
  background: var(--fill); color: var(--accent); border: 1px solid var(--hairline);
}
.feature-list .check svg { width: 13px; height: 13px; }
.feature-list b { font-weight: 600; color: var(--text); }
.feature-list span { display: block; color: var(--muted); font-size: 0.92rem; margin-top: 2px; }

@media (max-width: 820px) {
  .panels { grid-template-columns: 1fr; }
}

/* ----------------------------------------------------------------------- */
/* Trust (Sobre la app)                                                    */
/* ----------------------------------------------------------------------- */
.trust {
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  background: var(--surface);
  padding: clamp(32px, 4vw, 52px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(28px, 4vw, 52px);
}
.trust-item { display: flex; gap: 16px; align-items: flex-start; }
.trust-item .ico {
  width: 42px; height: 42px; border-radius: 11px; flex: none;
  display: grid; place-items: center;
  background: var(--fill); color: var(--text); border: 1px solid var(--hairline); opacity: 0.92;
}
.trust-item .ico svg { width: 20px; height: 20px; }
.trust-item h4 { font-size: 1.02rem; margin-bottom: 5px; }
.trust-item p { color: var(--muted); font-size: 0.9rem; }

@media (max-width: 760px) {
  .trust { grid-template-columns: 1fr; }
}

/* ----------------------------------------------------------------------- */
/* Footer                                                                  */
/* ----------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--hairline);
  padding-block: 56px 40px;
  margin-top: var(--section-y);
}
.footer-grid {
  display: flex; flex-wrap: wrap; gap: 32px;
  align-items: center; justify-content: space-between;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 26px; }
.footer-links a { color: var(--muted); font-size: 0.92rem; transition: color 0.25s var(--ease-soft); }
.footer-links a:hover { color: var(--text); }
.footer-meta { width: 100%; display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--hairline); color: var(--muted); font-size: 0.84rem; }
.footer-meta a { color: var(--muted); }
.footer-meta a:hover { color: var(--text); }

/* ----------------------------------------------------------------------- */
/* Reveal on scroll                                                        */
/* ----------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: 0.09s; }
.reveal[data-delay="2"] { transition-delay: 0.18s; }
.reveal[data-delay="3"] { transition-delay: 0.27s; }

/* ----------------------------------------------------------------------- */
/* Legal / content pages                                                   */
/* ----------------------------------------------------------------------- */
.page-hero {
  padding-top: 150px;
  padding-bottom: 40px;
  position: relative;
}
.page-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(90% 70% at 50% -10%, rgba(255, 255, 255, 0.035), transparent 60%);
}
.page-hero .eyebrow { margin-bottom: 14px; display: inline-block; }
.page-hero h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); letter-spacing: -0.03em; text-wrap: balance; }
.page-hero .updated { margin-top: 16px; color: var(--muted); font-size: 0.9rem; }

.legal-layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
  padding-bottom: 40px;
}
.legal-toc {
  position: sticky; top: 96px;
  border-left: 1px solid var(--hairline);
  padding-left: 20px;
}
.legal-toc p { font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.legal-toc a { display: block; padding: 6px 0; font-size: 0.9rem; color: var(--muted); transition: color 0.2s var(--ease-soft); }
.legal-toc a:hover, .legal-toc a.active { color: var(--accent); }

.prose { max-width: 720px; }
.prose section { padding-top: 14px; margin-bottom: 44px; scroll-margin-top: 96px; }
.prose h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin-bottom: 18px; letter-spacing: -0.02em; text-wrap: balance; }
.prose h3 { font-size: 1.1rem; margin: 26px 0 10px; }
.prose p { color: var(--text); margin-bottom: 16px; line-height: 1.7; text-wrap: pretty; }
.prose ul { display: grid; gap: 10px; margin: 6px 0 18px; }
.prose ul li { position: relative; padding-left: 26px; color: var(--text); line-height: 1.7; }
.prose ul li::before {
  content: ""; position: absolute; left: 4px; top: 11px;
  width: 6px; height: 6px; border-radius: 2px; background: var(--muted);
}
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose strong { color: var(--text); }

.kvs { display: grid; gap: 0; border: 1px solid var(--hairline); border-radius: var(--radius-sm); overflow: hidden; margin: 8px 0 20px; }
.kvs div { display: grid; grid-template-columns: 200px 1fr; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--hairline); }
.kvs div:last-child { border-bottom: none; }
.kvs dt { color: var(--muted); font-size: 0.9rem; }
.kvs dd { color: var(--text); font-size: 0.94rem; }
@media (max-width: 620px) { .kvs div { grid-template-columns: 1fr; gap: 4px; } }

@media (max-width: 880px) {
  .legal-layout { grid-template-columns: 1fr; }
  .legal-toc { display: none; }
}

/* ----------------------------------------------------------------------- */
/* Delete account form                                                     */
/* ----------------------------------------------------------------------- */
.delete-steps { counter-reset: dstep; display: grid; gap: 14px; margin: 8px 0 28px; }
.delete-steps li {
  counter-increment: dstep;
  display: grid; grid-template-columns: 34px 1fr; gap: 16px; align-items: center;
  padding: 16px 18px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--hairline);
}
.delete-steps li::before {
  content: counter(dstep);
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: 0.9rem;
  background: var(--fill); color: var(--text); border: 1px solid var(--hairline);
}
.delete-steps b { color: var(--text); }

.form-card {
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  background: var(--surface);
  padding: clamp(26px, 4vw, 40px);
  margin-top: 12px;
}
.form-row { display: grid; gap: 8px; margin-bottom: 20px; }
.form-row label { font-size: 0.9rem; font-weight: 600; }
.form-row .hint { font-size: 0.82rem; color: var(--muted); font-weight: 400; }
.form-row input, .form-row textarea, .form-row select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  padding: 13px 15px;
  transition: border-color 0.2s var(--ease-soft), box-shadow 0.2s var(--ease-soft);
}
.form-row textarea { min-height: 110px; resize: vertical; }
.form-row input:focus, .form-row textarea:focus, .form-row select:focus {
  outline: none; border-color: var(--accent-dim);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-confirm {
  display: none;
  margin-top: 20px; padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft); border: 1px solid var(--accent-dim);
  color: var(--text); font-size: 0.92rem;
}
.form-confirm.is-visible { display: block; }

/* ----------------------------------------------------------------------- */
/* Utilities                                                               */
/* ----------------------------------------------------------------------- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 200;
  background: var(--accent); color: var(--bg); padding: 10px 16px; border-radius: 8px; font-weight: 600;
  transition: top 0.2s var(--ease-soft);
}
.skip-link:focus { top: 16px; }
.center { text-align: center; }
.mt-s { margin-top: 18px; }
