/* Do-ri-Do · dorido.app
 *
 * Los colores son los de la app (DSColor), con sus valores de claro y de
 * oscuro. Fraunces va solo en titulares y cifras, con los mismos ejes que en
 * la app (SOFT 28, WONK 0); el texto corrido va en la fuente del sistema, que
 * en un aparato de Apple es la misma de la app.
 */

@font-face {
  font-family: "Fraunces";
  src: url("/assets/Fraunces-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  --bg: #FAF7F2;
  --surface: #FFFDFA;
  --surface-hi: #FFFFFF;
  --text: #2B2825;
  --text-2: #6E675D;
  --text-3: #767065;
  --hairline: #E8E2D8;

  --sage-50: #E8EFE9;
  --sage-200: #A6C0AC;
  --sage-500: #7C9885;
  --sage-700: #5E7A67;
  --sage-900: #3A4A40;
  --action: #5D7264;
  --on-action: #FCFBF7;

  --peach-50: #F9EADB;
  --peach-700: #C4834F;
  --ochre-50: #F6EFDC;
  --ochre-700: #A38442;
  --mist-50: #E7EBF0;

  /* Las formas del fondo: el 500 de cada familia al 26 %, como en las
     capturas de la tienda (22 % en oscuro). */
  --forma-sage: rgb(124 152 133 / .26);
  --forma-peach: rgb(229 168 124 / .26);
  --forma-mist: rgb(122 140 166 / .26);
  --forma-ochre: rgb(201 169 97 / .26);
  --forma-mauve: rgb(155 138 166 / .26);

  /* La banda del foco es de noche en los dos modos: la sesión es oscura. */
  --noche: #1B1917;
  --noche-text: #F2EDE5;
  --noche-text-2: #B5ADA1;

  --screen-edge: rgb(0 0 0 / .07);
  --screen-shadow: 0 30px 70px -18px rgb(43 40 37 / .28), 0 8px 20px -10px rgb(43 40 37 / .12);
  --mark: rgb(124 152 133 / .30);

  --display: "Fraunces", "Iowan Old Style", "Palatino", Georgia, serif;
  --body: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;

  --gutter: clamp(20px, 5vw, 56px);
  --max: 1160px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1B1917;
    --surface: #272320;
    --surface-hi: #37312D;
    --text: #F2EDE5;
    --text-2: #B5ADA1;
    --text-3: #948D82;
    --hairline: #3A3532;
    --sage-50: #222A24;
    --sage-200: #3A4A40;
    --sage-700: #A6C0AC;
    --sage-900: #D3E0D6;
    --action: #7C9885;
    --on-action: #1B1917;
    --peach-50: #2E2219;
    --peach-700: #F0C9A4;
    --ochre-50: #2B2418;
    --ochre-700: #DFCB9B;
    --mist-50: #1F252E;
    --forma-sage: rgb(124 152 133 / .22);
    --forma-peach: rgb(229 168 124 / .11);
    --forma-mist: rgb(122 140 166 / .22);
    --forma-ochre: rgb(201 169 97 / .11);
    --forma-mauve: rgb(155 138 166 / .22);
    --noche: #141210;
    --screen-edge: rgb(255 255 255 / .14);
    --screen-shadow: 0 30px 70px -18px rgb(0 0 0 / .6), 0 8px 20px -10px rgb(0 0 0 / .4);
    --mark: rgb(124 152 133 / .38);
  }
}
:root[data-theme="dark"] {
  --bg: #1B1917;
  --surface: #272320;
  --surface-hi: #37312D;
  --text: #F2EDE5;
  --text-2: #B5ADA1;
  --text-3: #948D82;
  --hairline: #3A3532;
  --sage-50: #222A24;
  --sage-200: #3A4A40;
  --sage-700: #A6C0AC;
  --sage-900: #D3E0D6;
  --action: #7C9885;
  --on-action: #1B1917;
  --peach-50: #2E2219;
  --peach-700: #F0C9A4;
  --ochre-50: #2B2418;
  --ochre-700: #DFCB9B;
  --mist-50: #1F252E;
  --forma-sage: rgb(124 152 133 / .22);
  --forma-peach: rgb(229 168 124 / .11);
  --forma-mist: rgb(122 140 166 / .22);
  --forma-ochre: rgb(201 169 97 / .11);
  --forma-mauve: rgb(155 138 166 / .22);
  --noche: #141210;
  --screen-edge: rgb(255 255 255 / .14);
  --screen-shadow: 0 30px 70px -18px rgb(0 0 0 / .6), 0 8px 20px -10px rgb(0 0 0 / .4);
  --mark: rgb(124 152 133 / .38);
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img, svg { display: block; max-width: 100%; }
p { margin: 0; }

a {
  color: var(--action);
  text-decoration-thickness: 1px;
  text-underline-offset: .18em;
}
a:hover { text-decoration-thickness: 2px; }

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

.saltar {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 10;
  padding: 10px 14px;
  background: var(--surface-hi);
  color: var(--text);
  border-radius: 10px;
}
.saltar:focus { top: 12px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Fraunces con los ejes de la app. El tamaño óptico lo pone el navegador. */
.display, h1, h2, h3 {
  font-family: var(--display);
  font-weight: 520;
  font-variation-settings: "SOFT" 28, "WONK" 0;
  font-optical-sizing: auto;
  letter-spacing: -0.012em;
  text-wrap: balance;
  margin: 0;
}

h1 { font-size: clamp(2.35rem, 1.4rem + 3.6vw, 4.1rem); line-height: 1.04; }
h2 { font-size: clamp(1.9rem, 1.3rem + 2.2vw, 2.95rem); line-height: 1.08; }
h3 { font-size: 1.3rem; line-height: 1.25; }

.envoltura {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Cabecera ---------- */

.cabecera {
  position: relative;
  z-index: 3;
}
.cabecera .envoltura {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 22px;
}
.marca {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--display);
  font-weight: 560;
  font-variation-settings: "SOFT" 28, "WONK" 0;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
}
.marca svg { width: 32px; height: 32px; }
.cs-a { fill: var(--sage-200); }
.cs-b { fill: var(--sage-500); }
.cs-c { fill: var(--sage-700); }
.nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 28px);
  font-size: .95rem;
}
.nav a {
  color: var(--text-2);
  text-decoration: none;
}
.nav a:hover { color: var(--text); }
.nav .idioma {
  padding: 5px 10px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  font-size: .82rem;
  letter-spacing: .04em;
}

/* ---------- Las formas ---------- */

/* Las formas viven entre una sección y la siguiente, partidas por la
   frontera, como en las capturas de la tienda: al bajar se lee un solo
   lienzo. Van detrás de todo y no reciben toques. */
.forma {
  position: absolute;
  overflow: visible; /* con variación, la silueta pasa del radio */
  z-index: 0;
  pointer-events: none;
}
.forma path { fill: var(--c); }
.f-sage { --c: var(--forma-sage); }
.f-peach { --c: var(--forma-peach); }
.f-mist { --c: var(--forma-mist); }
.f-ochre { --c: var(--forma-ochre); }
.f-mauve { --c: var(--forma-mauve); }

/* ---------- Las pantallas ---------- */

/* La pantalla real, sin marco de dispositivo: esquinas del iPhone, un filo
   que la separa del fondo y una sombra suave. */
.pantalla {
  --w: 320px;
  position: relative;
  width: var(--w);
  max-width: 100%;
  border-radius: calc(var(--w) * .118);
  box-shadow: var(--screen-shadow);
  flex: none;
}
.pantalla img, .pantalla picture {
  display: block;
  width: 100%;
  height: auto;
  border-radius: inherit;
}
.pantalla::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1.5px var(--screen-edge);
  pointer-events: none;
}
.pantalla.ipad { border-radius: calc(var(--w) * .026); }
.pantalla.reloj {
  padding: calc(var(--w) * .085);
  border-radius: calc(var(--w) * .32);
  background: #211F1D;
  box-shadow: inset 0 0 0 2px rgb(255 255 255 / .16), 0 26px 50px -16px rgb(0 0 0 / .45);
}
.pantalla.reloj img { border-radius: calc(var(--w) * .24); }
.pantalla.reloj::after { display: none; }

/* ---------- Secciones ---------- */

.seccion {
  position: relative;
  padding-block: clamp(64px, 9vw, 124px);
}
.seccion > .envoltura { position: relative; z-index: 1; }

.par {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(40px, 7vw, 110px);
}
.par.al-reves { grid-template-columns: auto minmax(0, 1fr); }
.par.al-reves .texto { order: 2; }

.texto {
  display: grid;
  gap: 20px;
  max-width: 34rem;
}
.texto p { color: var(--text-2); font-size: 1.125rem; line-height: 1.6; }
.texto p.nota {
  font-size: .9rem;
  color: var(--text-3);
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.nota svg { flex: none; width: 16px; height: 16px; margin-top: 3px; }

/* ---------- Portada ---------- */

.portada { padding-top: clamp(24px, 5vw, 64px); }
.portada .texto { max-width: 37rem; gap: 26px; }
.portada .texto > p:first-of-type { font-size: clamp(1.1rem, 1rem + .35vw, 1.25rem); }
.portada .pantalla { --w: 380px; }

.tienda {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  margin-top: 6px;
}
.tienda small { color: var(--text-3); font-size: .9rem; }

.insignia { display: inline-block; line-height: 0; border-radius: 10px; }
.insignia img { height: 50px; width: auto; }

/* Mientras no estén las insignias oficiales de Apple, un botón propio con el
   color de acción de la app. Se cambia solo al poner los SVG en insignias/. */
.boton {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--action);
  color: var(--on-action);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: transform .2s ease, background-color .2s ease;
}
.boton:hover { transform: translateY(-1px); text-decoration: none; }
.boton svg { width: 16px; height: 16px; }
.boton.claro {
  background: var(--surface-hi);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--hairline);
}

/* ---------- Escribe como hablas ---------- */

.captura-demo {
  width: 420px;
  max-width: 100%;
  padding: 22px 20px 20px;
  background: var(--surface);
  border-radius: 26px;
  box-shadow: var(--screen-shadow);
  position: relative;
}
.captura-demo::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px var(--screen-edge);
  pointer-events: none;
}
.demo-texto {
  min-height: 2.6em;
  font-family: var(--display);
  font-weight: 480;
  font-variation-settings: "SOFT" 28, "WONK" 0;
  font-size: 1.45rem;
  line-height: 1.3;
  color: var(--text);
}
.demo-texto mark {
  background: var(--mark);
  color: inherit;
  border-radius: 5px;
  padding: 0 2px;
  margin: 0 -2px;
  transition: background-color .35s ease;
}
.demo-texto .cursor {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 1px;
  vertical-align: -0.14em;
  background: var(--action);
  animation: parpadeo 1.1s steps(1) infinite;
}
@keyframes parpadeo { 50% { opacity: 0; } }

.ranuras {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}
.ranura {
  display: grid;
  gap: 1px;
  min-height: 58px;
  align-content: center;
  padding: 9px 12px;
  border-radius: 13px;
  border: 1px solid var(--hairline);
  transition: background-color .3s ease, border-color .3s ease;
}
.ranura span { font-size: .75rem; color: var(--text-3); }
.ranura strong {
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
  min-height: 1.35em;
  font-variant-numeric: tabular-nums;
}
.ranura.llena {
  background: var(--bg);
  border-color: var(--sage-200);
}
.ranura.llena strong { animation: entra .35s ease both; }
@keyframes entra { from { opacity: 0; transform: translateY(4px); } }

.escribe .lado {
  display: flex;
  align-items: flex-end;
  gap: clamp(20px, 3vw, 36px);
}
.escribe .pantalla { --w: 260px; }

/* ---------- Foco: la banda de noche ---------- */

.noche {
  background: var(--noche);
  color: var(--noche-text);
  overflow: clip;
}
.noche h2 { color: var(--noche-text); }
.noche .texto p { color: var(--noche-text-2); }
.noche .pantalla { --screen-edge: rgb(255 255 255 / .14); box-shadow: 0 30px 80px -20px rgb(0 0 0 / .7); }
.noche .forma path { fill: rgb(122 140 166 / .18); }

/* ---------- Formas y progreso ---------- */

.formas .cabeza { max-width: 40rem; display: grid; gap: 20px; }
.formas .cabeza p { color: var(--text-2); font-size: 1.125rem; }
.trio {
  display: grid;
  grid-template-columns: repeat(3, auto);
  justify-content: center;
  align-items: start;
  gap: clamp(20px, 4vw, 56px);
  margin-top: clamp(48px, 7vw, 88px);
}
.trio figure { margin: 0; display: grid; gap: 16px; justify-items: center; }
.trio figure:nth-child(2) { margin-top: clamp(0px, 5vw, 64px); }
.trio figcaption { font-size: .9rem; color: var(--text-3); }
.trio .pantalla { --w: 300px; }

/* ---------- Donde lo mires ---------- */

.donde .cabeza { max-width: 40rem; display: grid; gap: 20px; }
.donde .cabeza p { color: var(--text-2); font-size: 1.125rem; }
.mesa {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(20px, 4vw, 48px);
  margin-top: clamp(48px, 7vw, 88px);
}
.mesa .ipad { --w: 760px; }
.mesa .reloj { --w: 190px; margin-bottom: clamp(0px, 4vw, 48px); }

/* ---------- Privacidad ---------- */

.privado .par { align-items: center; }
.candado {
  position: relative;
  width: clamp(200px, 26vw, 300px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}
.candado .contorno { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.candado .contorno path { fill: var(--sage-50); stroke: var(--sage-500); stroke-width: .5; }
.candado .icono { position: relative; width: 26%; color: var(--sage-700); }

.filas {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 14px;
}
.filas li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  font-weight: 560;
  font-size: 1.05rem;
  color: var(--text);
}
.filas svg { flex: none; width: 24px; height: 24px; margin-top: 1px; }
.filas svg path.fondo { fill: var(--sage-500); }
.filas svg path.check { fill: none; stroke: var(--on-action); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Cierre ---------- */

.cierre { text-align: center; }
.cierre .envoltura { display: grid; justify-items: center; gap: 22px; }
.cierre h2 { font-size: clamp(2.3rem, 1.4rem + 3.4vw, 4rem); }
.cierre p { color: var(--text-2); font-size: 1.15rem; }
.cierre .requisitos { font-size: .85rem; color: var(--text-3); }
.cierre .cosecha { width: 84px; height: 84px; margin-bottom: 4px; }

/* ---------- Pie ---------- */

.pie {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--hairline);
  padding-block: 36px 44px;
  font-size: .9rem;
  color: var(--text-3);
}
.pie .envoltura { display: grid; gap: 18px; }
.pie .fila {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px 28px;
}
.pie nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.pie a { color: var(--text-2); text-decoration: none; }
.pie a:hover { color: var(--text); text-decoration: underline; }
.pie .legal { font-size: .78rem; max-width: 60rem; line-height: 1.5; }

/* ---------- Páginas de lectura: soporte y legales ---------- */

.lectura { padding-block: clamp(32px, 7vw, 88px) clamp(72px, 10vw, 120px); position: relative; }
.lectura .envoltura { max-width: 820px; position: relative; z-index: 1; }
.lectura header { display: grid; gap: 18px; margin-bottom: clamp(40px, 6vw, 64px); }
.lectura header p { color: var(--text-2); font-size: 1.15rem; max-width: 36rem; }
.lectura .fecha { font-size: .9rem; color: var(--text-3); }

.grupo { margin-top: clamp(36px, 5vw, 56px); }
.grupo h2 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}
.pregunta {
  border-bottom: 1px solid var(--hairline);
}
.pregunta summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 0;
  font-weight: 600;
  font-size: 1.05rem;
}
.pregunta summary::-webkit-details-marker { display: none; }
.pregunta summary::after {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  margin: 7px 4px 0 0;
  border-right: 1.8px solid var(--text-3);
  border-bottom: 1.8px solid var(--text-3);
  transform: rotate(45deg);
  transition: transform .2s ease;
}
.pregunta[open] summary::after { transform: rotate(-135deg); margin-top: 11px; }
.pregunta p { padding: 0 32px 20px 0; color: var(--text-2); max-width: 40rem; }

.contacto {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
}

.legal-cuerpo { display: grid; gap: clamp(28px, 4vw, 40px); max-width: 40rem; }
.legal-cuerpo section { display: grid; gap: 10px; }
.legal-cuerpo h2 { font-size: 1.45rem; }
.legal-cuerpo p { color: var(--text-2); line-height: 1.65; }
.legal-cuerpo .firma {
  margin-top: 8px;
  font-family: var(--display);
  font-variation-settings: "SOFT" 28, "WONK" 0;
  font-size: 1.25rem;
  color: var(--text);
}

/* ---------- Teléfono y tableta ---------- */

@media (max-width: 860px) {
  .par, .par.al-reves {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
  }
  .par .texto, .par.al-reves .texto { order: 0; justify-self: stretch; max-width: 36rem; margin-inline: auto; }
  .portada .pantalla { --w: 300px; }
  .pantalla { --w: 280px; }
  .escribe .lado { flex-direction: column; align-items: stretch; width: 100%; max-width: 36rem; }
  .captura-demo { width: 100%; }
  .escribe .pantalla { display: none; }
  .trio { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .trio .pantalla { --w: 30vw; }
  .trio figure:nth-child(2) { margin-top: 28px; }
  .mesa { flex-direction: column; align-items: center; }
  .mesa .ipad { --w: calc(100vw - 2 * var(--gutter)); }
  .mesa .reloj { display: none; }
}

@media (max-width: 480px) {
  .nav .solo-ancho { display: none; }
  .trio { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .trio figcaption { font-size: .78rem; }
  .ranura strong { font-size: .88rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
