/* ============================================================================
   PORTADA · kardfire.com/  y  /en
   ----------------------------------------------------------------------------
   Hoja de la portada estática (`landing/template.html`). No es la app: aquí no
   hay React Native ni `useThemeTokens()`, así que los tokens se copian como
   variables de CSS, y `styles.check.ts` comprueba que sigan siendo los de
   `core/theme/palette.ts` (tema oscuro, el de fábrica) — igual que hace con la
   pantalla de arranque de `public/index.html`.

   Lo mismo que en la app, por las mismas razones:
     - Neutros cálidos de tinta impresa; el oro (`mtg`) es el acento, y sobre él
       la tinta es el FONDO, nunca un blanco fijo (E-27).
     - Asap variable servida por nosotros, sin Google Fonts.
     - Radios por tamaño de caja (botón pill, panel 24, marco 32) y la esquina
       de una carta con `CARD_CORNER_RADIUS_RATIO`, nunca un radio fijo (E-68).
     - Foco visible siempre y `prefers-reduced-motion` respetado (E-86).
   Lo que es solo de la portada: los discos de maná pálidos (el color IMPRESO
   del símbolo, el de `MANA_COLOR_CONFIG`) marcan cada fortaleza.
   ========================================================================== */

/* --- Tipografía: los mismos ficheros que la app ---------------------------- */
@font-face {
  font-family: 'Asap';
  font-style: normal;
  font-weight: 400 900;
  font-stretch: 100%;
  font-display: swap;
  src: url('/fonts/asap-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Asap';
  font-style: italic;
  font-weight: 400 900;
  font-stretch: 100%;
  font-display: swap;
  src: url('/fonts/asap-latin-italic.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Los símbolos de maná (fuente Mana de Andrew Gioia, SIL OFL 1.1). `block`:
   sus glifos viven en el área privada de Unicode y con otra fuente saldría un
   cuadro vacío. */
@font-face {
  font-family: 'Mana';
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url('/fonts/mana.woff2') format('woff2');
}

/* --- Tokens -------------------------------------------------------------- */
:root {
  /* `darkColors` de palette.ts */
  --bg: #0C0B0A;
  --surface: #16140F;
  --elevated: #211E1A;
  --border: #2E2925;
  --line: rgba(255, 253, 250, 0.12);
  --text: #F7F4F0;
  --text-2: #ABA39B;
  --text-3: #7C736C;
  --accent: #E0A100;
  --accent-subtle: rgba(224, 161, 0, 0.15);
  --accent-glow: rgba(224, 161, 0, 0.5);
  --glass: rgba(12, 11, 10, 0.88);
  /* La barra de estado de la app bajo su cabecera (`edgeTint`) y sobre la
     cámara (`cameraEdge`): las dos de las capturas. */
  --edge: #15130E;
  --camera-edge: #000000;

  /* Disco pálido IMPRESO de cada maná y su glifo negro (`MANA_COLOR_CONFIG`). */
  --mana-w: #F8F6D8;
  --mana-u: #C1D7E9;
  --mana-b: #CAC5C0;
  --mana-r: #E49977;
  --mana-g: #A3C095;
  --mana-c: #CAC5C0;
  --mana-ink: #0D0F0F;

  /* `radii` de tokens.ts, y la esquina de carta como proporción del ancho */
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 32px;
  --pill: 999px;
  --card-corner: 5.04% / 3.62%;

  --font: 'Asap', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --header-h: 64px;
  --gutter: 20px;
  --section: 96px;

  color-scheme: dark;
}

@media (min-width: 720px) {
  :root {
    --gutter: 32px;
    --section: 128px;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p,
ul,
ol,
figure {
  margin: 0;
}

h1,
h2,
h3 {
  font-weight: 800;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

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

.wrap {
  width: 100%;
  max-width: calc(1200px + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
}

.lead {
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  line-height: 1.55;
  color: var(--text-2);
  max-width: 36em;
}

.skip {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--pill);
  background: var(--accent);
  color: var(--bg);
  font-weight: 700;
  text-decoration: none;
}

.skip:focus {
  top: 12px;
}

/* --- Botones -------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: var(--pill);
  font: inherit;
  font-size: 1rem;
  font-weight: 650;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

/* Tinta del acento = el fondo, como `SheetActions` (E-27). */
.btn-primary {
  background: var(--accent);
  color: var(--bg);
}

.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-ghost {
  border-color: var(--line);
  color: var(--text);
  background: transparent;
}

.btn-ghost:hover {
  background: var(--surface);
  border-color: var(--border);
}

.btn-quiet {
  min-height: 40px;
  padding: 0 16px;
  font-size: 0.9375rem;
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}

.btn-quiet:hover {
  background: var(--elevated);
}

.btn-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn[hidden] {
  display: none;
}

/* --- Cabecera --------------------------------------------------------------- */
.top {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--glass);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(140%) blur(16px);
  backdrop-filter: saturate(140%) blur(16px);
  padding-top: env(safe-area-inset-top);
}

.top-row {
  display: flex;
  align-items: center;
  gap: 24px;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.1875rem;
  letter-spacing: -0.01em;
}

/* El logo es un PNG blanco con alfa: como máscara se pinta del color que
   toque, sin un segundo fichero por color. */
.brand-mark {
  width: 30px;
  height: 30px;
  background: var(--accent);
  -webkit-mask: url('/landing/img/logo.png') center / contain no-repeat;
  mask: url('/landing/img/logo.png') center / contain no-repeat;
}

.top-nav {
  display: none;
  gap: 28px;
  margin-left: 16px;
}

.top-nav a {
  color: var(--text-2);
  text-decoration: none;
  font-weight: 550;
  font-size: 0.9375rem;
}

.top-nav a:hover {
  color: var(--text);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

.lang {
  color: var(--text-2);
  font-size: 0.9375rem;
  font-weight: 550;
  text-decoration: none;
}

.lang:hover {
  color: var(--text);
}

@media (min-width: 860px) {
  .top-nav {
    display: flex;
  }
}

/* --- Portada (hero) ------------------------------------------------------------ */
.hero {
  position: relative;
  padding: 48px 0 var(--section);
  overflow: hidden;
}

/* La luz cae sobre el móvil y la carta, como un flexo sobre la mesa. */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(50% 45% at 72% 42%, rgba(224, 161, 0, 0.09), transparent 70%);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  gap: 56px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.625rem, 1.75rem + 4.4vw, 5rem);
  line-height: 1;
  letter-spacing: -0.03em;
  max-width: 11em;
}

.hero .lead {
  margin-top: 24px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.hero-note {
  margin-top: 20px;
  color: var(--text-3);
  font-size: 0.9375rem;
}

.store-soon {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 8px 16px 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  color: var(--text-2);
  font-size: 0.875rem;
  font-weight: 600;
}

.store-soon-pre {
  color: var(--text-3);
  font-weight: 500;
}

.store-icon {
  width: 16px;
  height: 16px;
  fill: var(--text-2);
}

.hero-visual {
  position: relative;
  justify-self: center;
  width: min(100%, 420px);
  padding: 0 0 24px 18%;
}

@media (min-width: 960px) {
  .hero {
    padding-top: 72px;
  }

  .hero-grid {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 48px;
  }

  .hero-visual {
    justify-self: end;
  }
}

/* --- Marco de móvil ------------------------------------------------------------ */
/* Pantalla de 390 × 844 (la de las capturas): barra de estado de 44 y captura
   de 390 × 800. El radio de la pantalla y del marco escalan con el ancho. */
.phone {
  position: relative;
  width: min(300px, 76vw);
  padding: 9px;
  border-radius: 50px;
  background: linear-gradient(160deg, var(--border), var(--bg) 60%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 253, 250, 0.1),
    0 0 0 1px #000,
    0 40px 80px -24px rgba(0, 0, 0, 0.8);
}

.phone-screen {
  container-type: inline-size;
  position: relative;
  overflow: hidden;
  border-radius: 41px;
  background: var(--bg);
}

.phone-screen img {
  width: 100%;
  aspect-ratio: 390 / 800;
  object-fit: cover;
}

.statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  aspect-ratio: 390 / 44;
  padding: 0 7.5cqw 0 9cqw;
  background: var(--edge);
  color: var(--text);
  font-size: 4cqw;
  font-weight: 650;
  letter-spacing: 0.01em;
}

/* Sobre la cámara la barra es negra, como en la app (`cameraEdge`). */
.statusbar-camera {
  background: var(--camera-edge);
}

/* La isla dinámica, y la batería con `::after`. */
.statusbar i {
  position: absolute;
  left: 50%;
  top: 1.6cqw;
  width: 29cqw;
  height: 8.5cqw;
  transform: translateX(-50%);
  border-radius: var(--pill);
  background: #000;
}

.statusbar::after {
  content: '';
  width: 6.4cqw;
  height: 3cqw;
  border-radius: 1cqw;
  border: 0.35cqw solid currentColor;
  box-shadow: inset 0 0 0 0.5cqw #000, inset 4cqw 0 0 currentColor;
  opacity: 0.9;
}

.phone-hero {
  width: 100%;
}

/* --- La carta que se gira ------------------------------------------------------ */
/* El único momento animado de la página: el dorso de KardFire se gira y deja
   ver la carta, y luego llega su precio. Es lo que hace el escáner. */
.flip {
  position: absolute;
  left: 0;
  bottom: 15%;
  width: 38%;
  aspect-ratio: 488 / 680;
  perspective: 1400px;
  transform: rotate(-9deg);
}

.flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  animation: kf-flip 1.1s cubic-bezier(0.25, 0.8, 0.25, 1) 0.6s both;
}

.flip-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: var(--card-corner);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  box-shadow: 0 30px 40px -18px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(0, 0, 0, 0.6);
}

.flip-front {
  transform: rotateY(180deg);
}

@keyframes kf-flip {
  from {
    transform: rotateY(0deg) translateY(0);
  }

  45% {
    transform: rotateY(100deg) translateY(-8%);
  }

  to {
    transform: rotateY(180deg) translateY(0);
  }
}

.price-chip {
  position: absolute;
  left: 17%;
  bottom: 6%;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 16px;
  border: 1px solid var(--accent-glow);
  border-radius: var(--r-md);
  background: var(--elevated);
  box-shadow: 0 16px 32px -12px rgba(0, 0, 0, 0.8);
  animation: kf-chip 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.2) 1.6s both;
}

.price-chip-name {
  color: var(--text-2);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
}

.price-chip-value {
  color: var(--accent);
  font-size: 1.375rem;
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

@keyframes kf-chip {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.94);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* --- Secciones ------------------------------------------------------------------ */
.section-head {
  max-width: 44em;
}

.section-head h2,
.support-head h2 {
  font-size: clamp(2rem, 1.35rem + 2.6vw, 3.25rem);
  line-height: 1.06;
  letter-spacing: -0.025em;
}

.section-head .lead {
  margin-top: 16px;
}

/* --- Fortalezas ------------------------------------------------------------------ */
.features {
  padding: var(--section) 0;
  border-top: 1px solid var(--line);
  /* El glifo gigante de detrás de cada móvil se sale por los lados: `clip`
     y no `hidden`, que haría de la sección un contenedor con scroll propio. */
  overflow: clip;
}

.mana-w { --pip: var(--mana-w); --glyph: '\e600'; }
.mana-u { --pip: var(--mana-u); --glyph: '\e601'; }
.mana-b { --pip: var(--mana-b); --glyph: '\e602'; }
.mana-r { --pip: var(--mana-r); --glyph: '\e603'; }
.mana-g { --pip: var(--mana-g); --glyph: '\e604'; }
.mana-c { --pip: var(--mana-c); --glyph: '\e904'; }

.pip {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--pip);
  color: var(--mana-ink);
  font-family: 'Mana', sans-serif;
  font-size: 24px;
  line-height: 1;
  box-shadow: -2px 2px 0 rgba(0, 0, 0, 0.55);
}

.feature {
  display: grid;
  gap: 48px;
  align-items: center;
  margin-top: 96px;
}

.section-head + .feature {
  margin-top: 64px;
}

.feature-copy {
  max-width: 32em;
}

.feature h3 {
  margin-top: 20px;
  font-size: clamp(1.625rem, 1.2rem + 1.5vw, 2.375rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.feature-copy > p {
  margin-top: 16px;
  color: var(--text-2);
  font-size: 1.125rem;
}

.points {
  display: grid;
  gap: 12px;
  margin-top: 24px;
  padding: 0;
  list-style: none;
}

.points li {
  position: relative;
  padding-left: 26px;
  color: var(--text);
}

.points li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.55em;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--pip);
}

/* El símbolo del maná, enorme y casi apagado, detrás del móvil. */
.feature .phone {
  justify-self: center;
  isolation: isolate;
}

.feature .phone::before {
  content: var(--glyph);
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Mana', sans-serif;
  font-size: min(150vw, 620px);
  line-height: 1;
  color: var(--pip);
  opacity: 0.06;
  pointer-events: none;
}

@media (min-width: 960px) {
  .feature {
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    margin-top: 144px;
  }

  .section-head + .feature {
    margin-top: 80px;
  }

  .feature .phone {
    width: 320px;
  }

  /* Uno sí y uno no, el móvil a la izquierda. */
  .feature:nth-of-type(even) .feature-copy {
    order: 2;
  }

  .feature:nth-of-type(odd) .phone {
    justify-self: end;
    margin-right: 48px;
  }

  .feature:nth-of-type(even) .phone {
    justify-self: start;
    margin-left: 48px;
  }
}

/* --- Precio, sin conexión e IA: las tres sin captura ------------------------------- */
.notes {
  display: grid;
  gap: 16px;
  margin-top: 112px;
}

.note {
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.note h3 {
  margin-top: 20px;
  font-size: clamp(1.375rem, 1.15rem + 0.9vw, 1.75rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
}

.note p {
  margin-top: 12px;
  color: var(--text-2);
}

@media (min-width: 960px) {
  .notes {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }
}

/* --- Instalar ------------------------------------------------------------------- */
.install {
  padding: var(--section) 0;
  border-top: 1px solid var(--line);
}

.platforms {
  display: grid;
  gap: 16px;
  margin-top: 48px;
}

.platform {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.platform h3 {
  font-size: 1.375rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.platform > p {
  color: var(--text-2);
}

.steps {
  display: grid;
  gap: 14px;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  min-height: 28px;
  padding-left: 42px;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -1px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-subtle);
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.inline-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-left: 4px;
  vertical-align: -3px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.platform .btn,
.store-soon-inline {
  margin-top: auto;
}

.store-soon-inline {
  margin-top: 0;
}

.btn-install + .store-soon-inline {
  margin-top: 0;
}

@media (min-width: 960px) {
  .platforms {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }
}

/* --- Soporte -------------------------------------------------------------------- */
.support {
  padding: var(--section) 0;
  border-top: 1px solid var(--line);
}

.support-grid {
  display: grid;
  gap: 48px;
}

.support-head p {
  margin-top: 16px;
  color: var(--text-2);
  max-width: 30em;
}

.support-head .btn {
  margin-top: 28px;
}

.faq {
  border-top: 1px solid var(--line);
}

.faq details {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 0;
  font-size: 1.125rem;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

/* El chevron, dibujado con dos bordes: gira al abrir. */
.faq summary::after {
  content: '';
  flex: none;
  width: 9px;
  height: 9px;
  margin-right: 6px;
  border-right: 2px solid var(--text-2);
  border-bottom: 2px solid var(--text-2);
  transform: translateY(-3px) rotate(45deg);
  transition: transform 0.2s ease;
}

.faq details[open] summary::after {
  transform: translateY(2px) rotate(225deg);
}

.faq details p {
  padding: 0 40px 24px 0;
  color: var(--text-2);
}

@media (min-width: 960px) {
  .support-grid {
    grid-template-columns: 5fr 7fr;
    gap: 96px;
    align-items: start;
  }

  .support-head {
    position: sticky;
    top: calc(var(--header-h) + 32px);
  }
}

/* --- Pie ------------------------------------------------------------------------ */
.foot {
  padding: 72px 0 calc(40px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.foot-grid {
  display: grid;
  gap: 40px;
}

.foot-brand p {
  margin-top: 12px;
  color: var(--text-2);
  max-width: 22em;
}

.foot-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.foot-col h2 {
  margin-bottom: 4px;
  color: var(--text-3);
  font-size: 0.875rem;
  font-weight: 600;
}

.foot-col a {
  color: var(--text-2);
  text-decoration: none;
  font-size: 0.9375rem;
}

.foot-col a:hover {
  color: var(--text);
}

.foot-fine {
  display: grid;
  gap: 10px;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--text-3);
  font-size: 0.8125rem;
  line-height: 1.55;
}

.foot-fine p {
  max-width: 72em;
}

@media (min-width: 720px) {
  .foot-grid {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }
}

/* --- Movimiento reducido: sin viaje, con el estado FINAL (E-86) ---------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .flip-inner {
    animation: none;
    transform: rotateY(180deg);
  }

  .price-chip {
    animation: none;
  }

  .btn,
  .faq summary::after {
    transition: none;
  }
}
