/* Estilo de pivote.dev: los mismos tokens, tipografía y componentes de la app
   (docs/design-direction.md, ios/Pivote/DesignSystem). Todas las páginas usan este archivo. */

@font-face {
  font-family: "Figtree";
  src: url("/assets/fonts/Figtree-Variable.ttf") format("truetype");
  font-weight: 300 900;
  font-display: swap;
}

/* ---------------------------------------------------------------- Tokens */
:root {
  color-scheme: light;
  --canvas: #FFFFFF;
  --paper: #F2F5EB;
  --mint: #58CC00;
  --forest-deep: #122314;
  --forest-ink: #273F2B;
  --moss: #3E5B43;
  --sage: #7E8371;
  --leaf: #26A200;
  --leaf-pale: #E7F9DD;
  --rule: #D9DECA;

  --radius-panel: 32px;
  --radius-card: 24px;
  --radius-inner: 16px;
  --gutter: 24px;
  --button-height: 54px;
}

/* ---------------------------------------------------------------- Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--forest-ink);
  font: 400 17px/1.35 "Figtree", -apple-system, system-ui, sans-serif;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: var(--forest-deep); text-underline-offset: 3px; }
a:hover { color: var(--leaf); }
:focus-visible { outline: 3px solid var(--mint); outline-offset: 3px; border-radius: 8px; }

/* ---------------------------------------------------------------- Tipografía (estilos de la app) */
.display-xl, .display-l, .display-m, .display-s {
  font-weight: 800; color: var(--forest-deep); margin: 0; text-wrap: balance;
}
.display-xl { font-size: clamp(44px, 7vw, 56px); line-height: 1; letter-spacing: -0.03em; }
.display-l  { font-size: 44px; line-height: 1; letter-spacing: -0.03em; }
.display-m  { font-size: 34px; line-height: 1.02; letter-spacing: -0.025em; }
.display-s  { font-size: 28px; line-height: 1.05; letter-spacing: -0.02em; }
.title      { font-size: 19px; font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; color: var(--forest-deep); margin: 0; }
.body-l     { font-size: 17px; line-height: 1.35; }
.body-m     { font-size: 15px; line-height: 1.35; letter-spacing: -0.003em; }
.label      { font-size: 14px; font-weight: 500; line-height: 1.3; }
.caption    { font-size: 12px; font-weight: 500; line-height: 1.3; }
.muted      { color: var(--sage); }
.code       { font-size: 28px; font-weight: 700; line-height: 1; letter-spacing: 0.12em; color: var(--forest-deep); }

/* ---------------------------------------------------------------- Botones */
.button {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--button-height); padding: 0 28px; width: 100%;
  border-radius: 999px; border: 0;
  font: 600 17px/1.2 "Figtree", system-ui, sans-serif; letter-spacing: -0.005em;
  text-decoration: none; cursor: pointer;
  transition: transform .15s ease, background-color .15s ease;
}
.button:active { transform: scale(0.98); }
.button-primary { background: var(--forest-deep); color: var(--canvas); }
.button-primary:hover { background: var(--forest-ink); color: var(--canvas); }
.button-plain { background: transparent; color: var(--forest-ink); }
.button-plain:hover { color: var(--leaf); }
.actions { display: grid; gap: 4px; max-width: 400px; }

/* ---------------------------------------------------------------- Wordmark: balón + "Pivote" */
.wordmark {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 22px; font-weight: 800; letter-spacing: -0.02em;
  color: var(--forest-deep); text-decoration: none;
}
.wordmark img {
  width: 26px; height: 26px; transform: rotate(-12deg);
  /* Sobre blanco el balón (blanco) necesita su contorno; sobre menta no. */
  filter: drop-shadow(0.8px 0 0 #1B1B1F) drop-shadow(-0.8px 0 0 #1B1B1F)
          drop-shadow(0 0.8px 0 #1B1B1F) drop-shadow(0 -0.8px 0 #1B1B1F);
}
.pitch-panel .wordmark img { filter: none; }

/* ---------------------------------------------------------------- Panel menta con la cancha */
.pitch-panel {
  position: relative; overflow: hidden;
  background: var(--mint) url("/assets/cancha.svg") center / cover no-repeat;
  border-radius: 0 0 var(--radius-panel) var(--radius-panel);
}
.pitch-panel.rounded { border-radius: var(--radius-panel); }
.pitch-panel.plain { background-image: none; }

/* Los balones del panel caen como en la bienvenida de la app. */
.ball-pit { position: absolute; inset: auto 0 0 0; height: 46%; pointer-events: none; }
.ball-pit img {
  position: absolute; width: var(--size, 22%); aspect-ratio: 1;
  left: var(--x); bottom: var(--y); transform: rotate(var(--r, 0deg));
  animation: ball-drop .9s cubic-bezier(.3, 1.35, .5, 1) both;
  animation-delay: var(--delay, 0s);
}
@keyframes ball-drop {
  from { transform: translateY(-420%) rotate(calc(var(--r, 0deg) - 140deg)); opacity: 0; }
  12%  { opacity: 1; }
  to   { transform: translateY(0) rotate(var(--r, 0deg)); }
}
@media (prefers-reduced-motion: reduce) {
  .ball-pit img { animation: none; }
  .button { transition: none; }
}

/* ---------------------------------------------------------------- Superficies */
.card { background: var(--paper); border-radius: var(--radius-card); padding: 24px; }

/* ---------------------------------------------------------------- Pie de página */
.site-footer {
  max-width: 1080px; margin: 0 auto; padding: 32px var(--gutter) 48px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  border-top: 1px solid var(--rule);
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.site-footer nav a { color: var(--sage); text-decoration: none; }
.site-footer nav a:hover { color: var(--forest-deep); }

/* ---------------------------------------------------------------- Páginas de texto (términos, privacidad) */
.doc-header { max-width: 720px; margin: 0 auto; padding: 32px var(--gutter) 0; }
.doc { max-width: 720px; margin: 0 auto; padding: 40px var(--gutter) 64px; }
.doc .updated { margin: 12px 0 32px; }
.doc h2 { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; color: var(--forest-deep); margin: 36px 0 8px; }
.doc p, .doc li { line-height: 1.5; }
.doc ul { padding-left: 20px; }
.doc li { margin-bottom: 8px; }
.doc strong { color: var(--forest-deep); }
.doc .lead { font-size: 19px; line-height: 1.45; color: var(--forest-ink); }

/* ---------------------------------------------------------------- Inicio */
.home {
  max-width: 1080px; margin: 0 auto;
  display: grid; gap: 32px;
}
.home-hero { position: relative; aspect-ratio: 4 / 5; max-height: 72vh; width: 100%; }
.home-wordmark { position: absolute; top: 20px; left: var(--gutter); z-index: 1; }
.home-copy { display: grid; gap: 16px; padding: 0 var(--gutter); align-content: center; }
.home-copy .body-l { margin: 0; max-width: 28ch; }
.home-copy .actions { margin-top: 8px; }
.home-copy .caption { margin: 0; }

.features { max-width: 1080px; margin: 0 auto; padding: 72px var(--gutter) 64px; }
.features > h2 { margin-bottom: 24px; }
.feature-grid { display: grid; gap: 16px; }
.feature { display: grid; gap: 8px; align-content: start; }
.feature p { margin: 0; color: var(--forest-ink); }
/* Las ilustraciones van sobre menta, como en la app: el balón blanco necesita ese fondo. */
.feature-art {
  height: 132px; margin-bottom: 12px; border-radius: var(--radius-inner);
  background: var(--mint); display: grid; place-items: center; overflow: hidden;
}
.feature-art-pitch { background: var(--mint) url("/assets/cancha.svg") center / auto 88% no-repeat; }
.feature-ball { width: 76px; transform: rotate(-14deg); }
.feature-goal { width: 180px; }

@media (min-width: 860px) {
  .home { grid-template-columns: 1fr 1fr; align-items: center; padding: 24px var(--gutter) 0; gap: 56px; }
  .home-hero { border-radius: var(--radius-panel); max-height: none; }
  .home-copy { padding: 0; }
  .feature-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---------------------------------------------------------------- Invitación */
.invite { max-width: 1080px; margin: 0 auto; display: grid; gap: 32px; padding-bottom: 48px; }
.invite-hero { display: grid; place-items: end center; height: 300px; padding-bottom: 40px; }
.invite-goal { width: min(78%, 320px); }
.invite-ball {
  position: absolute; width: 64px; left: calc(50% + min(26%, 104px)); bottom: 34px;
  transform: rotate(-20deg); animation: ball-roll 1s cubic-bezier(.2, .9, .3, 1) .2s both;
}
@keyframes ball-roll {
  from { transform: translateX(160%) rotate(220deg); opacity: 0; }
  to   { transform: translateX(0) rotate(-20deg); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .invite-ball { animation: none; } }
.invite-copy { display: grid; gap: 16px; padding: 0 var(--gutter); }
.invite-copy .body-l { margin: 0; max-width: 34ch; }
.invite-code {
  display: grid; gap: 10px; justify-items: start;
  background: var(--paper); border-radius: var(--radius-inner); padding: 20px; max-width: 400px;
}
.invite-copy .caption { margin: 0; }

@media (min-width: 860px) {
  .invite { grid-template-columns: 1fr 1fr; align-items: center; padding: 24px var(--gutter) 48px; gap: 56px; }
  .invite-hero { border-radius: var(--radius-panel); height: 520px; padding-bottom: 120px; }
  .invite-ball { bottom: 114px; }
  .invite-copy { padding: 0; }
}
