/* cosas.info · base
   Tokens, reset y piezas comunes a toda la web (cabecera, botones, pie).
   Un papel cálido de fondo, tinta casi negra y el azul de la app como único acento. */

:root {
  --fuente: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --fuente-acento: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Georgia, serif;

  --papel: #F6F3EC;
  --papel-2: #EEEAE1;
  --superficie: #FFFFFF;
  --tinta: #16181D;
  --tinta-2: #5E636C;
  --tinta-3: #969BA5;
  --filete: rgba(22, 24, 29, .08);
  --filete-2: rgba(22, 24, 29, .16);

  --azul: #2F6FED;
  --azul-texto: #2F6FED; /* El azul cuando es texto o icono: en oscuro se aclara para que se lea. */
  --turquesa-texto: #158F89;
  --azul-oscuro: #245BC7;
  --azul-suave: #E5EDFF;
  --verde: #22C55E;

  /* La paleta de la app. */
  --c-azul: #2F6FED; --c-noche: #1E2A44; --c-turquesa: #1BA39C; --c-verde: #2E8B57;
  --c-amarillo: #F2B705; --c-naranja: #F2711C; --c-coral: #EF5B5B; --c-rosa: #E85D9E;
  --c-morado: #7A4FD6; --c-arena: #EADFCB; --c-blanco: #FFFFFF; --c-negro: #111111;

  --sombra-suave: 0 1px 2px rgba(22, 24, 29, .04), 0 16px 40px -20px rgba(22, 24, 29, .18);
  --sombra-telefono: 0 40px 80px -30px rgba(22, 24, 29, .35), 0 0 0 1px rgba(22, 24, 29, .06);

  --radio: 28px;
  --radio-m: 22px;
  --radio-s: 14px;

  --suave: cubic-bezier(.2, .8, .2, 1);
  --rapido: .18s;
  --medio: .32s;
  --lento: .7s;

  --ancho: 1120px;
  --margen: clamp(16px, 4vw, 40px);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --papel: #111317;
    --papel-2: #171A1F;
    --superficie: #1C1F25;
    --tinta: #F2F0EA;
    --tinta-2: #A9ADB5;
    --tinta-3: #8A8F99;
    --filete: rgba(242, 240, 234, .09);
    --filete-2: rgba(242, 240, 234, .18);
    --azul-texto: #7FA8FF;
    --turquesa-texto: #4FD8CF;
    --azul-suave: #1B2A4D;
    --sombra-suave: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 40px -20px rgba(0, 0, 0, .6);
    --sombra-telefono: 0 40px 80px -30px rgba(0, 0, 0, .8), 0 0 0 1px rgba(255, 255, 255, .08);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --papel: #111317;
  --papel-2: #171A1F;
  --superficie: #1C1F25;
  --tinta: #F2F0EA;
  --tinta-2: #A9ADB5;
  --tinta-3: #8A8F99;
  --filete: rgba(242, 240, 234, .09);
  --filete-2: rgba(242, 240, 234, .18);
  --azul-texto: #7FA8FF;
  --turquesa-texto: #4FD8CF;
  --azul-suave: #1B2A4D;
  --sombra-suave: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 40px -20px rgba(0, 0, 0, .6);
  --sombra-telefono: 0 40px 80px -30px rgba(0, 0, 0, .8), 0 0 0 1px rgba(255, 255, 255, .08);
  color-scheme: dark;
}

/* ---------- Reset ---------- */

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

html {
  background: var(--papel);
  color: var(--tinta);
  font-family: var(--fuente);
  font-size: 100%;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

/* Color y tipografía también en body: si el sitio se incrusta en otra página que fija los
   suyos en body (un visor, un artefacto), los títulos siguen tomando la tinta del tema. */
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--papel);
  color: var(--tinta);
  font-family: var(--fuente);
  font-size: 1rem;
  line-height: 1.5;
  overflow-x: hidden;
}

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

ul, ol { padding: 0; list-style: none; }

a { color: inherit; text-decoration: none; }

img, svg { display: block; }

button, input {
  font: inherit;
  color: inherit;
  touch-action: manipulation;
}

button {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

[hidden] { display: none !important; }

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

::selection { background: var(--azul); color: #fff; }

svg.icono {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

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

/* ---------- Tipografía ---------- */

.acento {
  font-family: var(--fuente-acento);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
}

.antetitulo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  color: var(--tinta-2);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.antetitulo::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--azul);
}

.titulo-seccion {
  max-width: 18ch;
  font-size: clamp(32px, 4.6vw, 52px);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -.035em;
  text-wrap: balance;
}

.entradilla {
  max-width: 52ch;
  margin-top: 18px;
  color: var(--tinta-2);
  font-size: clamp(17px, 1.6vw, 19px);
  line-height: 1.55;
  text-wrap: pretty;
}

/* ---------- Botones ---------- */

.boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 24px;
  border-radius: 26px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: transform var(--rapido) var(--suave), background-color var(--rapido) ease, box-shadow var(--rapido) ease, color var(--rapido) ease;
}

.boton:active { transform: scale(.97); }

.boton-primario {
  background: var(--tinta);
  color: var(--papel);
  box-shadow: 0 8px 24px -12px rgba(22, 24, 29, .5);
}

.boton-primario:hover { background: var(--azul); color: #fff; box-shadow: 0 10px 28px -12px rgba(47, 111, 237, .7); }

.boton-azul {
  background: var(--azul);
  color: #fff;
  box-shadow: 0 10px 28px -12px rgba(47, 111, 237, .7);
}

.boton-azul:hover { background: var(--azul-oscuro); }

.boton-secundario {
  background: var(--superficie);
  color: var(--tinta);
  box-shadow: inset 0 0 0 1px var(--filete-2);
}

.boton-secundario:hover { box-shadow: inset 0 0 0 1px var(--tinta); }

.boton-fantasma {
  color: var(--tinta);
  box-shadow: inset 0 0 0 1px var(--filete-2);
}

.boton-fantasma:hover { background: var(--superficie); }

.boton:disabled {
  opacity: .45;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.boton .icono { width: 18px; height: 18px; stroke-width: 2.2; }

.boton-icono {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: var(--tinta);
  box-shadow: inset 0 0 0 1px var(--filete-2);
  transition: background-color var(--rapido) ease, transform var(--rapido) var(--suave);
}

.boton-icono:hover { background: var(--superficie); }
.boton-icono:active { transform: scale(.92); }

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

.cabecera {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  padding: 14px var(--margen);
  transition: background-color var(--medio) ease, box-shadow var(--medio) ease, backdrop-filter var(--medio) ease;
}

.cabecera.pegada {
  background: color-mix(in srgb, var(--papel) 78%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  box-shadow: 0 1px 0 var(--filete);
}

.cabecera-interior {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--ancho);
  margin: 0 auto;
}

.marca {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -.02em;
}

.marca-icono {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--azul);
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 6px 14px -6px rgba(47, 111, 237, .8);
  transition: transform var(--medio) var(--suave);
}

.marca:hover .marca-icono { transform: rotate(-8deg) scale(1.06); }

.marca-icono svg { width: 18px; height: 18px; stroke-width: 2.6; }

.menu {
  display: flex;
  align-items: center;
  gap: 4px;
}

.menu a {
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--tinta-2);
  font-size: 15px;
  font-weight: 500;
  transition: color var(--rapido) ease, background-color var(--rapido) ease;
}

.menu a:hover { color: var(--tinta); background: color-mix(in srgb, var(--tinta) 6%, transparent); }

.cabecera .boton { min-height: 44px; padding: 0 18px; font-size: 15px; }

@media (max-width: 860px) {
  .menu { display: none; }
}

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

.pie {
  padding: 56px var(--margen) 40px;
  border-top: 1px solid var(--filete);
}

.pie-interior {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  max-width: var(--ancho);
  margin: 0 auto;
}

.pie-lema {
  margin-top: 12px;
  color: var(--tinta-2);
  font-size: 15px;
}

.pie-enlaces {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  font-size: 15px;
}

.pie-enlaces a { color: var(--tinta-2); transition: color var(--rapido) ease; }
.pie-enlaces a:hover { color: var(--tinta); }

.pie-nota {
  width: 100%;
  margin-top: 8px;
  color: var(--tinta-3);
  font-size: 13px;
}

/* ---------- Aparecer al hacer scroll ---------- */

/* Visibles de entrada; landing.js oculta solo los que quedan por debajo de la pantalla y los
   revela al llegar. Así la página está completa aunque no haya JavaScript. */
.revelar {
  transition: opacity var(--lento) var(--suave), transform var(--lento) var(--suave);
  transition-delay: var(--retardo, 0s);
}

.revelar.pendiente {
  opacity: 0;
  transform: translateY(18px);
}

.revelar.visto {
  opacity: 1;
  transform: none;
}

/* ---------- Aviso (toast) ---------- */

.toast {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 32px);
  min-height: 46px;
  padding: 0 18px;
  border-radius: 23px;
  background: var(--tinta);
  color: var(--papel);
  padding-top: 10px;
  padding-bottom: 10px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .22);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity var(--rapido) ease, transform var(--medio) var(--suave);
}

.toast.visible { opacity: 1; transform: translate(-50%, 0); }

.toast:empty { display: none; }

.toast .icono { width: 18px; height: 18px; color: var(--verde); stroke-width: 3; }

.toast-accion {
  align-self: stretch;
  flex: none;
  margin: -10px -18px -10px 4px;
  padding: 0 18px 0 14px;
  white-space: nowrap;
  border-left: 1px solid rgba(128, 128, 128, .35);
  border-radius: 0 23px 23px 0;
  color: inherit;
  font-weight: 700;
  pointer-events: auto;
}

/* ---------- Menos movimiento ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
  }
  .revelar.pendiente { opacity: 1; transform: none; }
}
