/* Opos web, "Marcador" identity (docs/design/SISTEMA-DISENO.md §11). No dependencies and no third-party resources.
   Colours: COLOR_… markers (in double braces) filled in by scripts/build-landing.sh from AppBrand.Palette.Hex (light; _DARK in dark).
   Archivo (OFL, landing/src/fuentes, scripts/build-web-assets.sh) for titles and labels; the system font for text. */

@font-face {
  font-family: "Archivo SemiExpanded";
  src: url("/fuentes/ArchivoSemiExpanded-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Archivo SemiExpanded";
  src: url("/fuentes/ArchivoSemiExpanded-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --bg: #FFFFFF;
  --surface: #F4F2FB;
  --surface2: #EAE6F7;
  --ink: #14111F;
  --muted: #625E78;
  --brand: #5B3DF5;
  --on-brand: #FFFFFF;
  --brand-text: #5B3DF5;
  --brand-soft: #ECE8FE;
  /* Night: the same in both modes (hero, phone frames). */
  --night: #16112E;
  --on-night: #FFFFFF;
  --on-night-muted: #A7A3B8;
  --on-night-accent: #B3A8FF;
  --brand-on-night: #7C66FF;
  --brand-soft-on-night: #2A2350;
  --night-tile: #FFFFFF1A;
  --night-option-border: #FFFFFF33;
  --correct: #15803D;
  --correct-soft-on-night: #12301F;

  --display: "Archivo SemiExpanded", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --text: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius: 1rem;
  --measure: 40rem;
  --wide: 64rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0D0B14;
    --surface: #1A1726;
    --surface2: #252136;
    --ink: #F4F2FF;
    --muted: #A7A3B8;
    --brand: #5B3DF5;
    --on-brand: #FFFFFF;
    --brand-text: #B3A8FF;
    --brand-soft: #2A2350;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 1.0625rem/1.6 var(--text);
}
img { max-width: 100%; height: auto; }

/* Titles never break inside a word (§4.3): they shrink with the viewport instead. */
h1, h2, h3 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.15;
  overflow-wrap: normal;
  hyphens: manual;
  text-wrap: balance;
}
h1 { font-size: clamp(1.75rem, 8vw, 2.25rem); margin: 0 0 1rem; }
h2 { font-size: clamp(1.25rem, 5.5vw, 1.625rem); margin: 2.5rem 0 1rem; }
h3 { font-size: 1.125rem; margin: 0 0 .5rem; }
p { margin: 0 0 1rem; }
a { color: var(--brand-text); text-underline-offset: .15em; }
.muted { color: var(--muted); }

/* Brand header of the inner pages. */
.site { max-width: var(--measure); margin: 0 auto; padding: 1.5rem 1rem 0; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  color: var(--ink);
  font: 700 1.125rem/1 var(--display);
  text-decoration: none;
}
.mark {
  /* The mascot icon (the same image as favicon.svg), 40 px: decorative, the name is next to it. */
  display: block;
  width: 2.5rem;
  height: 2.5rem;
}

/* Legal and support pages: comfortable reading (§11). */
.page { max-width: var(--measure); margin: 0 auto; padding: 2rem 1rem; }
/* Legal texts (aviso legal, términos, privacidad, soporte): body 17 px, measure 40 rem. */
.legal ul { padding-left: 1.25rem; margin: 0 0 1rem; }
.legal li { margin-bottom: .5rem; }
/* Long addresses and URLs (the Apple EULA) wrap instead of overflowing at 320 px. */
.legal a { overflow-wrap: anywhere; }
.legal h2 { scroll-margin-top: 1rem; }
.updated { color: var(--muted); font-size: .9375rem; }
/* Support FAQ with native <details>, no scripts. */
.faq details { border-top: 1px solid var(--surface2); }
.faq details:last-child { border-bottom: 1px solid var(--surface2); }
.faq summary { cursor: pointer; padding: .9rem 0; font-weight: 600; }
.faq summary:focus-visible { outline: 2px solid var(--brand-text); outline-offset: 2px; }
.faq details p { margin: 0 0 1rem; }

/* Home hero: always Night, in both modes. */
.hero { background: var(--night); color: var(--on-night); }
.hero-inner { max-width: var(--wide); margin: 0 auto; padding: 3.5rem 1rem 3rem; }
/* From 48rem: copy on the left, the Inicio capture on the right. On phones it is hidden here
   (it is already in "Así es la app"). */
.hero-shot { display: none; }
@media (min-width: 48rem) {
  .hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 3rem;
  }
  .hero-shot { display: block; width: clamp(14rem, 24vw, 16.5rem); }
  /* Inicio is already in the header: "Así es la app" shows question, result and record. */
  .shot-inicio { display: none; }
}
/* On Night the frame is a lighter bezel so it does not vanish into the background. */
.hero .phone { background: var(--night-tile); box-shadow: 0 0 0 1px var(--night-option-border); }
.hero h1 {
  font-size: clamp(2.5rem, 13vw, 4.5rem);
  letter-spacing: -.01em;
  margin: 1.5rem 0 .75rem;
}
.lead { font-size: clamp(1.125rem, 4.5vw, 1.375rem); line-height: 1.45; max-width: 34rem; color: var(--on-night); }
.tiles {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.tiles li {
  min-width: 1.9em;
  padding: .45em .5em;
  border-radius: .36em;
  background: var(--night-tile);
  color: var(--on-night);
  font: 700 clamp(1.25rem, 6vw, 1.75rem)/1 var(--display);
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.tiles .gap {
  display: grid;
  background: var(--brand-soft-on-night);
  box-shadow: inset 0 0 0 2px var(--brand-on-night);
  color: var(--on-night-accent);
  transition: background-color .2s ease, box-shadow .2s ease, color .2s ease;
}
/* "?" and "48" share one grid cell, so the tile keeps its width when the answer shows. */
.gap > span { grid-area: 1 / 1; }
.gap-a { visibility: hidden; }

/* "¿Cuál sigue?" with no scripts, a native <details>. The DOM keeps tiles → question (reading
   order), so the gap tile reacts through :has(); without :has() the answer is only in the text. */
.reveal { margin-top: 1rem; }
.reveal summary {
  display: inline-block;
  list-style: none;
  cursor: pointer;
  padding: .55rem 1.1rem;
  border-radius: var(--radius);
  background: var(--night-tile);
  box-shadow: inset 0 0 0 1px var(--night-option-border);
  color: var(--on-night);
  font: 600 .9375rem/1.3 var(--display);
}
.reveal summary::-webkit-details-marker { display: none; }
.reveal summary::marker { content: ""; }
.reveal summary:focus-visible { outline: 2px solid var(--on-night-accent); outline-offset: 3px; }
.reveal p { margin: .75rem 0 0; color: var(--on-night); }
.hero-copy:has(.reveal[open]) .gap {
  background: var(--correct-soft-on-night);
  box-shadow: inset 0 0 0 2px var(--correct);
  color: var(--on-night);
}
.hero-copy:has(.reveal[open]) .gap-q { visibility: hidden; }
.hero-copy:has(.reveal[open]) .gap-a { visibility: visible; }
@media (prefers-reduced-motion: reduce) {
  .tiles .gap { transition: none; }
}
.button {
  display: inline-block;
  padding: .9rem 1.5rem;
  border-radius: var(--radius);
  background: var(--brand);
  color: var(--on-brand);
  font-weight: 600;
  text-decoration: none;
}
.soon {
  display: inline-block;
  padding: .6rem 1.1rem;
  border-radius: var(--radius);
  text-wrap: balance;
  box-shadow: inset 0 0 0 1px var(--night-option-border);
  color: var(--on-night-accent);
  font: 600 .9375rem/1.3 var(--display);
}

/* Home content. */
.home { max-width: var(--wide); margin: 0 auto; padding: 1rem 1rem 2rem; }
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: 1rem;
}
.features article { background: var(--surface); border-radius: var(--radius); padding: 1.25rem; }
.features p { margin: 0; color: var(--muted); }

/* Real captures inside an iPhone frame drawn in CSS (no third-party frame images). */
.shots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  gap: 2rem 1.5rem;
  justify-items: center;
}
.shots figure { margin: 0; width: min(100%, 15rem); }
.phone {
  position: relative;
  padding: .55rem;
  border-radius: 2.6rem;
  background: var(--night);
  box-shadow: 0 0 0 1px var(--surface2), 0 1.25rem 2.5rem -1.5rem color-mix(in srgb, var(--night) 45%, transparent);
}
.phone::before {
  /* Dynamic Island */
  content: "";
  position: absolute;
  top: 1.15rem;
  left: 50%;
  width: 27%;
  height: 1.05rem;
  translate: -50% 0;
  border-radius: 999px;
  background: var(--night);
}
.phone img { display: block; width: 100%; border-radius: 2.1rem; }
figcaption { margin-top: .9rem; text-align: center; font: 600 .9375rem/1.4 var(--display); }

nav ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
/* Footer: "Aviso legal · Términos · Privacidad · Soporte". The dots only appear when the four links fit on
   one line, so a "·" never ends or starts a line (same rule as PhraseText in the app). */
@media (min-width: 26rem) {
  .legal-links { gap: .5rem .6rem; }
  .legal-links li + li::before { content: "·"; margin-right: .6rem; color: var(--muted); }
}
footer {
  max-width: var(--measure);
  margin: 0 auto;
  border-top: 1px solid var(--surface2);
  padding: 1rem 1rem 2rem;
  font-size: .9375rem;
}
footer p { margin: .75rem 0 0; color: var(--muted); }
/* On the home page the footer lines up with the wider content. */
.home + footer { max-width: var(--wide); }
