/* PaperFlow · base compartida de todas las páginas.
   Sale del design system «PaperFlow nueva» (7/11/2026), armado desde el código
   de la app nueva: papel claro y tinta negra, una sola familia (Apfel Grotezk)
   y el color sólo en el contenido, un color por tema. La cabecera, el pie y el
   selector de idioma están en site-theme.css; cada tipo de página tiene su hoja
   (home.css, pages.css, editorial.css y blog.css). */

@import url('/site-theme.css');

@font-face {
  font-family: "Apfel Grotezk";
  src: url("/assets/fonts/ApfelGrotezk-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Apfel Grotezk";
  src: url("/assets/fonts/ApfelGrotezk-Fett.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* papel y tinta */
  --paper: #f3f1ec;
  --raised: #ffffff;
  --step: #e8e5de;
  --ink: #141414;
  --ink2: #5e5b55;
  --line: rgba(20, 20, 20, 0.10);
  --action: #141414;
  --onAction: #ffffff;

  /* los ocho temas: color, tinta encima, tinta secundaria y versión del feed */
  --salud: #2e9e5b; --salud-on: #ffffff; --salud-soft: rgba(255, 255, 255, 0.78); --salud-feed: #3f8d5e;
  --tecnologia: #8ccbf2; --tecnologia-on: #141414; --tecnologia-soft: rgba(20, 20, 20, 0.68); --tecnologia-feed: #9bc7e3;
  --sociedad: #ff86b4; --sociedad-on: #141414; --sociedad-soft: rgba(20, 20, 20, 0.68); --sociedad-feed: #ed98b8;
  --planeta: #0f8a86; --planeta-on: #ffffff; --planeta-soft: rgba(255, 255, 255, 0.8); --planeta-feed: #217875;
  --mente: #f0532d; --mente-on: #ffffff; --mente-soft: rgba(255, 255, 255, 0.82); --mente-feed: #d3654a;
  --economia: #f6c53a; --economia-on: #141414; --economia-soft: rgba(20, 20, 20, 0.68); --economia-feed: #dab856;
  --aprendizaje: #ff8a1f; --aprendizaje-on: #141414; --aprendizaje-soft: rgba(20, 20, 20, 0.7); --aprendizaje-feed: #dd8b41;
  --cerebro: #2f4fe0; --cerebro-on: #ffffff; --cerebro-soft: rgba(255, 255, 255, 0.78); --cerebro-feed: #4a60c5;
  --track-on-white: rgba(255, 255, 255, 0.3);
  --track-on-ink: rgba(20, 20, 20, 0.18);
  --glass-on-color: rgba(255, 255, 255, 0.2);
  --glass-edge-on-color: rgba(255, 255, 255, 0.35);

  /* los planes usan la paleta del paywall aprobado: dos suaves y un fuerte */
  --plan-paper: #f5f5f2;
  --plan-ink: #242424;
  --plan-accent: #d90058;

  /* forma */
  --radius-pill: 999px;
  --radius-card: 28px;
  --radius-cover: 22px;
  --radius-row: 16px;
  --radius-square: 14px;
  --radius-badge: 10px;
  --shadow-glass: 0 2px 10px rgba(20, 20, 20, 0.10);
  --shadow-thumb: 0 2px 8px rgba(0, 0, 0, 0.22);
  --size-button: 52px;
  --size-glass: 44px;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);

  /* página */
  --font: "Apfel Grotezk", ui-sans-serif, system-ui, sans-serif;
  --inline: clamp(24px, 4.5vw, 72px);
  --max: 1376px;
  --section: clamp(72px, 9vw, 136px);
  --measure: 38em;
}

/* Cada tema apunta a sus valores; .feed baja la saturación para pantallas enteras de color. */
.t-salud { --c: var(--salud); --on: var(--salud-on); --soft: var(--salud-soft); --track: var(--track-on-white); }
.t-tecnologia { --c: var(--tecnologia); --on: var(--tecnologia-on); --soft: var(--tecnologia-soft); --track: var(--track-on-ink); }
.t-sociedad { --c: var(--sociedad); --on: var(--sociedad-on); --soft: var(--sociedad-soft); --track: var(--track-on-ink); }
.t-planeta { --c: var(--planeta); --on: var(--planeta-on); --soft: var(--planeta-soft); --track: var(--track-on-white); }
.t-mente { --c: var(--mente); --on: var(--mente-on); --soft: var(--mente-soft); --track: var(--track-on-white); }
.t-economia { --c: var(--economia); --on: var(--economia-on); --soft: var(--economia-soft); --track: var(--track-on-ink); }
.t-aprendizaje { --c: var(--aprendizaje); --on: var(--aprendizaje-on); --soft: var(--aprendizaje-soft); --track: var(--track-on-ink); }
.t-cerebro { --c: var(--cerebro); --on: var(--cerebro-on); --soft: var(--cerebro-soft); --track: var(--track-on-white); }
.feed.t-salud { --c: var(--salud-feed); }
.feed.t-tecnologia { --c: var(--tecnologia-feed); }
.feed.t-sociedad { --c: var(--sociedad-feed); }
.feed.t-planeta { --c: var(--planeta-feed); }
.feed.t-mente { --c: var(--mente-feed); }
.feed.t-economia { --c: var(--economia-feed); }
.feed.t-aprendizaje { --c: var(--aprendizaje-feed); }
.feed.t-cerebro { --c: var(--cerebro-feed); }
.on-color { background: var(--c); color: var(--on); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 24px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
html.dialog-open { overflow: hidden; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font: 400 18px/28px var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 0.18em; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; text-wrap: balance; }
p, ul, ol, figure, blockquote { margin: 0; }
p { text-wrap: pretty; }
button, input, select, textarea { font: inherit; color: inherit; }
strong, b { font-weight: 700; }
cite { font-style: normal; }
::selection { background: var(--ink); color: var(--paper); }

:focus-visible { outline: 3px solid currentColor; outline-offset: 3px; border-radius: 6px; }
:focus:not(:focus-visible) { outline: none; }

.skip-link {
  position: absolute; left: 16px; top: -80px; z-index: 50;
  padding: 12px 20px; border-radius: var(--radius-pill);
  background: var(--ink); color: var(--paper); font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 12px; }
.vh, .ed-vh {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
[hidden] { display: none !important; }

/* Números: cifras tabulares y espaciado negativo en los tamaños grandes. */
.num { font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.045em; line-height: 0.92; white-space: nowrap; }

/* ---- Acciones ---- */
/* La acción principal es una píldora de tinta; sobre un color de tema, la tinta
   del tema con el color de fondo como letra. Al tocar se achica a 0,97. */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--size-button); padding: 0 28px;
  border: 0; border-radius: var(--radius-pill);
  background: var(--action); color: var(--onAction);
  font: 700 18px/24px var(--font); text-decoration: none; white-space: nowrap;
  cursor: pointer;
  transition: transform 160ms var(--ease), background-color 160ms var(--ease);
}
.button:hover { background: #2e2d2b; }
.button:active { transform: scale(0.97); }
.button:disabled { opacity: 0.5; cursor: default; }
.on-color .button, .button.on-color { background: var(--on); color: var(--c); }
.on-color .button:hover, .button.on-color:hover { background: color-mix(in srgb, var(--on) 88%, var(--c)); }
.button svg { width: 18px; height: 18px; flex: none; }

/* Botón secundario de borde: «Ya lo leí» en la app. */
.button-line {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--size-button); padding: 0 24px;
  border: 2px solid currentColor; border-radius: var(--radius-pill);
  background: transparent; color: inherit;
  font: 700 18px/24px var(--font); text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: transform 160ms var(--ease), background-color 160ms var(--ease);
}
.button-line:hover { background: color-mix(in srgb, currentColor 8%, transparent); }
.button-line:active { transform: scale(0.97); }

/* Botón redondo de 44: guardar, compartir, volver. Sobre color, vidrio claro. */
.glass {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: var(--size-glass); height: var(--size-glass);
  border: 0; border-radius: 22px; background: var(--raised); color: var(--ink);
  box-shadow: var(--shadow-glass); cursor: pointer; text-decoration: none;
  transition: transform 160ms var(--ease);
}
.glass:active { transform: scale(0.97); }
.on-color .glass { background: var(--glass-on-color); border: 1px solid var(--glass-edge-on-color); box-shadow: none; color: var(--on); }
.glass svg { width: 20px; height: 20px; }

.text-link {
  font-weight: 700; color: inherit;
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.22em;
}
.text-link:hover { text-decoration-thickness: 3px; }
.quiet-link { color: inherit; text-decoration: underline; text-underline-offset: 0.22em; }

/* Etiqueta del feed: «Adiviná». */
.badge {
  display: inline-flex; align-items: center; padding: 4px 10px;
  border-radius: var(--radius-badge); background: var(--on); color: var(--c);
  font: 700 15px/20px var(--font);
}

/* ---- Piezas de la app que se repiten ---- */

/* Banda de tema (Explorar): de borde a borde, sin tarjeta ni radio. */
.band {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 112px; padding: 20px var(--inline);
  background: var(--c); color: var(--on); text-decoration: none; overflow: hidden;
  transition: opacity 160ms var(--ease);
}
.band:hover { opacity: 0.92; }
.band:active { opacity: 0.88; }
.band-name { display: block; font: 700 clamp(22px, 2vw, 28px)/1.1 var(--font); letter-spacing: -0.02em; }
.band-count { display: block; margin-top: 4px; color: var(--soft); font-size: 16px; line-height: 20px; }
.band-art { width: clamp(72px, 7vw, 96px); height: auto; flex: none; color: var(--on); opacity: 0.92; }
.band:focus-visible { outline-offset: -6px; outline-color: var(--on); }

/* Fila de paper (Explorar por tema): cuadrado de color, título y tema. */
.paper-row {
  display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 16px;
  padding: 12px 0; text-decoration: none; color: var(--ink);
}
.paper-row-square {
  display: grid; place-items: center; width: 64px; height: 64px;
  border-radius: var(--radius-square); background: var(--c); color: var(--on);
}
.paper-row-square svg { width: 40px; height: 40px; }
.paper-row-title { display: block; font: 700 18px/24px var(--font); letter-spacing: -0.01em; }
.paper-row-meta { display: block; margin-top: 2px; color: var(--ink2); font-size: 15px; line-height: 20px; }
a.paper-row:hover .paper-row-title { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.18em; }

/* Grupo de filas sobre blanco (Perfil, ajustes): la línea sólo separa filas. */
.row-group { border-radius: var(--radius-row); background: var(--raised); overflow: hidden; }
.row-group > * + * { border-top: 1px solid var(--line); }

/* Campo de búsqueda y selector, en el gris de paso. */
.field-step {
  display: block; width: 100%; min-height: 56px; padding: 0 20px;
  border: 0; border-radius: var(--radius-row); background: var(--step); color: var(--ink);
  font: 400 18px/24px var(--font);
}
.field-step::placeholder { color: var(--ink2); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

/* ---- Movimiento de entrada ----
   Al cargar, el arriba de cada página entra solo (CSS, también sin JavaScript): títulos que suben,
   el dibujo del tema que aparece girando y la hoja que sube sobre el campo de color.
   Al bajar, script.js marca lo que todavía no se vio (.motion-pending) y lo hace entrar (.entering),
   escalonado con --d. Con movimiento reducido no se mueve nada. */
@keyframes enter-rise { from { opacity: 0; translate: 0 36px; } }
@keyframes enter-pop { from { opacity: 0; translate: 0 28px; scale: 0.92; } }
@keyframes enter-slide { from { opacity: 0; translate: -56px 0; } }
@keyframes enter-wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes enter-unveil { from { clip-path: inset(0 0 0 100%); } to { clip-path: inset(0 0 0 0); } }
@keyframes enter-art { from { opacity: 0; scale: 0.5; rotate: -20deg; } }
@keyframes enter-sheet { from { translate: 0 72px; } }
@keyframes enter-fade { from { opacity: 0; } }

@media (prefers-reduced-motion: no-preference) {
  /* Portada: el título línea por línea, después el resto; el juego se descubre desde la derecha. */
  .hero h1 span { animation: enter-rise 900ms var(--ease) backwards; }
  .hero h1 span:nth-child(2) { animation-delay: 90ms; }
  .hero h1 span:nth-child(3) { animation-delay: 180ms; }
  .hero-copy > :not(h1) { animation: enter-rise 800ms var(--ease) 300ms backwards; }
  .hero-copy > .hero-description { animation-delay: 360ms; }
  .hero-copy > .hero-actions { animation-delay: 420ms; }
  .hero-copy > .hero-store-note { animation-delay: 480ms; }
  .guess { animation: enter-unveil 1000ms var(--ease) 100ms backwards; }
  /* Cada pregunta nueva entra igual; la primera espera a que se descubra el juego. */
  .guess-post :is(.guess-kicker, .guess-question) { animation: enter-rise 700ms var(--ease) backwards; }
  .guess-post .guess-question { animation-delay: 80ms; }
  .guess-post .guess-art { animation: enter-art 900ms var(--ease) 160ms backwards; }
  .guess-post:first-of-type .guess-kicker { animation-delay: 520ms; }
  .guess-post:first-of-type .guess-question { animation-delay: 600ms; }
  .guess-post:first-of-type .guess-art { animation-delay: 760ms; }
  .ticker { animation: enter-rise 900ms var(--ease) 640ms backwards; }

  /* Lecturas, temas, blog y páginas de información: el campo de color y su hoja. */
  :is(.ed-field-copy, .pg-intro, .ed-opening) > * { animation: enter-rise 800ms var(--ease) backwards; }
  :is(.ed-field-copy, .pg-intro, .ed-opening) > :nth-child(2) { animation-delay: 70ms; }
  :is(.ed-field-copy, .pg-intro, .ed-opening) > :nth-child(3) { animation-delay: 140ms; }
  :is(.ed-field-copy, .pg-intro, .ed-opening) > :nth-child(4) { animation-delay: 210ms; }
  :is(.ed-field-copy, .pg-intro, .ed-opening) > :nth-child(n+5) { animation-delay: 280ms; }
  :is(.ed-field-art, .pg-field-art) { animation: enter-art 1100ms var(--ease) 200ms backwards; }
  :is(.ed-sheet, .pg-sheet) { animation: enter-sheet 1000ms var(--ease) 120ms backwards; }
  .ed-opening + .ed-bands .band { animation: enter-slide 800ms var(--ease) backwards; }
  .ed-opening + .ed-bands .band:nth-child(2) { animation-delay: 60ms; }
  .ed-opening + .ed-bands .band:nth-child(3) { animation-delay: 120ms; }
  .ed-opening + .ed-bands .band:nth-child(4) { animation-delay: 180ms; }
  .ed-opening + .ed-bands .band:nth-child(5) { animation-delay: 240ms; }
  .ed-opening + .ed-bands .band:nth-child(6) { animation-delay: 300ms; }
  .ed-opening + .ed-bands .band:nth-child(7) { animation-delay: 360ms; }
  .ed-opening + .ed-bands .band:nth-child(8) { animation-delay: 420ms; }

  /* Al bajar. */
  .reveal-ready .motion-pending { opacity: 0; }
  .reveal-ready .entering { animation: enter-rise 800ms var(--ease) var(--d, 0ms) backwards; }
  .reveal-ready .entering:is(.ed-card, .plan, .slip-stage, .proof-screen, .sample-post, .blog-summary, .blog-table-wrap) { animation-name: enter-pop; }
  .reveal-ready .pg-notes > .entering { animation-name: enter-pop; }
  .reveal-ready .entering.band { animation-name: enter-slide; }
  .reveal-ready .entering.ed-key { animation: enter-wipe 1000ms var(--ease) var(--d, 0ms) backwards; }
}
