/* Raíz de Viento · opción A «Micelio nocturno» */

@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fuentes/instrument-serif-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("fuentes/instrument-serif-latin-400-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fuentes/geist-latin-wght-normal.woff2") format("woff2");
}

:root {
  color-scheme: dark;

  /* Rampa verde noche (6 pasos) */
  --noche-0: #0a1210;
  --noche-1: #0f1a15;
  --noche-2: #15241c;
  --noche-3: #1d3227;
  --noche-4: #2c4a3a;
  --noche-5: #4a735d;

  /* Texto (3 tonos) */
  --texto-1: #eaf0e4;
  --texto-2: #bccabe;
  --texto-3: #93a597;

  /* Un acento luminoso: raíces, foco, botón */
  --acento: #bddb8a;
  --acento-rgb: 189, 219, 138;
  --sobre-acento: #0d1a10;

  /* Material de vidrio */
  --vidrio: rgb(21 36 28 / 0.46);
  --vidrio-nucleo: rgb(29 50 39 / 0.38);
  --luz-borde: rgb(255 255 255 / 0.2);
  --luz-borde-baja: rgb(255 255 255 / 0.05);
  --trazo: #8fb59d;

  --fuente-titulo: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --fuente-cuerpo: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);

  --pad-x: clamp(1.5rem, 5vw, 4rem);
  --aire: clamp(6rem, 11vw, 10rem);
}

@media (prefers-contrast: more) {
  :root {
    --texto-2: #dbe6dd;
    --texto-3: #c3d1c6;
    --luz-borde: rgb(255 255 255 / 0.55);
    --luz-borde-baja: rgb(255 255 255 / 0.35);
    --vidrio: rgb(15 26 21 / 0.92);
    --vidrio-nucleo: rgb(21 36 28 / 0.92);
  }
}

@media (prefers-reduced-transparency: reduce) {
  :root {
    --vidrio: #15241c;
    --vidrio-nucleo: #1a2c22;
  }
  .pildora, .tarjeta, .nota { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scrollbar-gutter: stable;
  scroll-padding-top: 6rem;
  background: var(--noche-0);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--noche-0);
  color: var(--texto-1);
  font: 400 1.0625rem/1.55 var(--fuente-cuerpo);
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

::selection { background: color-mix(in oklab, var(--acento) 35%, transparent); color: var(--texto-1); }

a { color: inherit; }
a:focus-visible, .boton:focus-visible {
  outline: 3px solid var(--acento);
  outline-offset: 3px;
  border-radius: 10px;
}

.solo-lectores {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.saltar {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 1.25rem;
  border-radius: 999px;
  background: var(--acento);
  color: var(--sobre-acento);
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s var(--ease);
}
.saltar:focus { top: max(1rem, env(safe-area-inset-top)); }

.contenedor {
  width: 100%;
  max-width: 82rem;
  margin-inline: auto;
  padding-inline: max(var(--pad-x), env(safe-area-inset-left)) max(var(--pad-x), env(safe-area-inset-right));
}

/* ───── Nav flotante ───── */
.flota {
  position: fixed;
  top: max(1rem, env(safe-area-inset-top));
  left: 0; right: 0;
  z-index: 30;
  display: flex;
  justify-content: center;
  padding-inline: 1rem;
  pointer-events: none;
}
.pildora {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.375rem 0.5rem 0.375rem 0.5rem;
  border-radius: 999px;
  background: rgb(15 26 21 / 0.55);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  backdrop-filter: blur(18px) saturate(1.5);
  border: 1px solid transparent;
  background-image: linear-gradient(rgb(15 26 21 / 0.62), rgb(15 26 21 / 0.62)),
    linear-gradient(180deg, rgb(255 255 255 / 0.26), rgb(255 255 255 / 0.06));
  background-origin: border-box;
  background-clip: padding-box, border-box;
  box-shadow: 0 18px 40px -16px rgb(2 10 6 / 0.7), inset 0 1px 0 rgb(255 255 255 / 0.05);
}
.marca {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 40px;
  padding-inline: 0.25rem 0.75rem;
  border-radius: 999px;
  text-decoration: none;
  font: 600 0.9375rem/1 var(--fuente-cuerpo);
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.icono { display: block; border-radius: 9px; }
.enlace {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding-inline: 0.875rem;
  border-radius: 999px;
  color: var(--texto-2);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.16s var(--ease);
}
.enlace:hover {
  color: var(--texto-1);
  background-color: color-mix(in oklab, var(--texto-1) 9%, transparent);
}
.enlace:active, .marca:active { transform: scale(0.97); }
@media (max-width: 23.74rem) {
  .marca-txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .marca { padding-inline: 0.25rem 0.5rem; }
}
@media (pointer: coarse) {
  .enlace, .marca { min-height: 44px; }
}

/* ───── Portada ───── */
.portada {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: end;
  min-height: 100vh;
  min-height: 100dvh;
  padding-block: 8rem calc(clamp(2.5rem, 7vh, 5rem) + env(safe-area-inset-bottom));
  overflow: hidden;
  background: linear-gradient(180deg, var(--noche-1), var(--noche-0) 85%);
}
.luz {
  position: absolute;
  z-index: -3;
  border-radius: 50%;
  pointer-events: none;
  will-change: transform;
}
.luz-a {
  width: 90vmax; height: 90vmax;
  right: -35vmax; top: -40vmax;
  background: radial-gradient(closest-side, rgb(72 140 98 / 0.42), rgb(72 140 98 / 0.14) 55%, transparent);
}
.luz-b {
  width: 80vmax; height: 80vmax;
  left: -42vmax; bottom: -48vmax;
  background: radial-gradient(closest-side, rgb(150 176 70 / 0.18), rgb(150 176 70 / 0.06) 55%, transparent);
}
.raices {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}
.grano {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.4;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 220px 220px;
}
.portada-in { position: relative; }
.portada::after {
  /* velo suave detrás del titular para leerlo sobre las raíces */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(90% 70% at 15% 95%, rgb(10 18 16 / 0.72), transparent 70%);
}
@media (max-width: 40rem) {
  .portada::after { background: linear-gradient(0deg, rgb(10 18 16 / 0.82) 8%, rgb(10 18 16 / 0.45) 45%, transparent 70%); }
}

h1, h2, h3 { font-family: var(--fuente-titulo); font-weight: 400; margin: 0; }
.portada h1 {
  max-width: 13ch;
  font-size: clamp(2.875rem, 1.4rem + 7.4vw, 8rem);
  line-height: 0.96;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.portada h1 .l { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.portada h1 .l > span { display: block; }
.portada h1 em { font-style: italic; color: var(--texto-2); letter-spacing: -0.02em; }
.bajada {
  max-width: 34ch;
  margin: clamp(1.5rem, 3vw, 2.25rem) 0 0;
  font-size: clamp(1.0625rem, 0.95rem + 0.5vw, 1.375rem);
  line-height: 1.5;
  color: var(--texto-2);
}

@media (prefers-reduced-motion: no-preference) {
  .js .portada h1 .l > span {
    transform: translateY(108%);
    animation: sube 0.9s var(--ease) forwards;
    animation-delay: calc(0.1s + var(--i) * 0.09s);
  }
  .js .bajada {
    opacity: 0;
    animation: aparece 0.9s var(--ease) 0.42s forwards;
  }
  @keyframes sube { to { transform: none; } }
  @keyframes aparece {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
  }
  .luz-a { animation: deriva-a 38s ease-in-out infinite alternate; }
  .luz-b { animation: deriva-b 46s ease-in-out infinite alternate; }
  @keyframes deriva-a { to { transform: translate3d(-6vmax, 5vmax, 0); } }
  @keyframes deriva-b { to { transform: translate3d(7vmax, -4vmax, 0); } }
}

/* ───── Secciones ───── */
.seccion { position: relative; padding-block: var(--aire); }
.t-seccion {
  font-size: clamp(2.5rem, 1.6rem + 3.4vw, 4.75rem);
  line-height: 1;
  letter-spacing: -0.03em;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.hacemos { isolation: isolate; overflow-x: clip; overflow-y: visible; padding-top: clamp(5rem, 9vw, 8rem); }
.hacemos::before, .hacemos::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
}
.hacemos::before {
  width: 70vmax; height: 70vmax;
  left: -30vmax; top: 4%;
  background: radial-gradient(closest-side, rgb(66 134 96 / 0.42), transparent);
}
.hacemos::after {
  width: 60vmax; height: 60vmax;
  right: -28vmax; bottom: -5%;
  background: radial-gradient(closest-side, rgb(140 168 70 / 0.12), transparent);
}

/* ───── Bento ───── */
.bento { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 40rem) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .t-audio, .t-apps { grid-column: 1 / -1; }
}
@media (min-width: 60rem) {
  .bento { grid-template-columns: repeat(6, 1fr); gap: 1.25rem; }
  .t-audio { grid-column: 1 / 5; grid-row: 1 / 3; }
  .t-libros { grid-column: 5 / 7; grid-row: 1; }
  .t-cursos { grid-column: 5 / 7; grid-row: 2; }
  .t-apps { grid-column: 1 / 7; grid-row: 3; }
}

/* Doble bisel: cáscara 30 = núcleo 24 + 6 de relleno */
.tarjeta {
  position: relative;
  display: flex;
  padding: 6px;
  border-radius: 30px;
  border: 1px solid transparent;
  background-color: var(--vidrio);
  background-image: linear-gradient(var(--vidrio), var(--vidrio)),
    linear-gradient(180deg, var(--luz-borde), var(--luz-borde-baja) 55%, var(--luz-borde-baja));
  background-origin: border-box;
  background-clip: padding-box, border-box;
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  backdrop-filter: blur(22px) saturate(1.5);
  box-shadow: 0 34px 60px -28px rgb(2 12 7 / 0.75), 0 2px 0 rgb(255 255 255 / 0.02) inset;
  overflow: hidden;
  transition: transform 0.16s var(--ease);
}
.tarjeta:active { transform: scale(0.985); }
.nucleo {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  min-height: 15rem;
  padding: clamp(1.5rem, 2.4vw, 2rem);
  border-radius: 24px;
  background: linear-gradient(165deg, rgb(255 255 255 / 0.06), transparent 55%), var(--vidrio-nucleo);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.1);
}
.t-audio .nucleo { min-height: 24rem; }
.nucleo-fila { flex-direction: column; }
@media (min-width: 40rem) {
  .nucleo-fila { flex-direction: row; align-items: center; min-height: 13rem; }
}
.texto-t h3 {
  font-size: clamp(1.875rem, 1.4rem + 1.2vw, 2.5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.t-audio .texto-t h3 { font-size: clamp(2.25rem, 1.6rem + 2vw, 3.5rem); }
.texto-t p { margin: 0.75rem 0 0; max-width: 30ch; color: var(--texto-2); }

/* reflejo a 115° y borde que se ilumina bajo el cursor (solo con mouse) */
.tarjeta::before, .tarjeta::after { content: ""; position: absolute; pointer-events: none; opacity: 0; }
.tarjeta::before {
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 0%), rgb(var(--acento-rgb) / 0.7), transparent 65%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  transition: opacity 0.4s var(--ease);
}
.tarjeta::after {
  top: 0; bottom: 0; left: 0;
  width: 70%;
  z-index: 2;
  background: linear-gradient(115deg, transparent 30%, rgb(255 255 255 / 0.09) 48%, rgb(255 255 255 / 0.03) 55%, transparent 70%);
  transform: translateX(-110%);
}
@media (hover: hover) and (pointer: fine) {
  .tarjeta:hover::before { opacity: 1; }
  .tarjeta:hover::after { opacity: 1; transform: translateX(150%); transition: transform 0.8s var(--ease); }
}

/* Ilustraciones */
.ilu { display: block; width: 100%; height: auto; max-width: 20rem; fill: none; stroke: var(--trazo); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.t-audio .ilu { max-width: none; flex: 1; min-height: 11rem; height: 100%; }
.onda line { vector-effect: non-scaling-stroke; }
.onda { stroke-width: 3; stroke: var(--trazo); }
.onda line { transform-box: fill-box; transform-origin: center; opacity: 0.85; }
.libro { max-width: 9.5rem; }
.ruta { max-width: 13rem; }
.ruta .traza { stroke-dasharray: 3 6; opacity: 0.8; }
.ruta .nodo { fill: var(--noche-2); stroke: var(--trazo); stroke-width: 1.5; }
.ruta .viajero { fill: var(--acento); stroke: none; offset-path: path("M16 96C60 96 56 40 100 44s50 46 90 16 34-34 34-36"); offset-rotate: 0deg; offset-distance: 0%; }
.telefono { max-width: 7.5rem; flex: none; }
.telefono rect { fill: rgb(10 18 16 / 0.4); }
.telefono .anillo { stroke: var(--trazo); transform-box: fill-box; transform-origin: center; opacity: 0.6; }
@media (min-width: 40rem) {
  .telefono { max-width: 9rem; margin-left: auto; }
}

@media (prefers-reduced-motion: no-preference) {
  .onda line { animation: respira 3.8s ease-in-out infinite; animation-delay: calc(var(--i) * -0.23s); }
  @keyframes respira { 0%, 100% { transform: scaleY(0.4); } 50% { transform: scaleY(1); } }
  .libro .pagina-d { transform-box: view-box; transform-origin: 80px 62px; animation: pagina 6s ease-in-out infinite; }
  @keyframes pagina { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(0.9); } }
  .ruta .nodo { animation: nodo 4.8s ease-in-out infinite; animation-delay: calc(var(--i) * 0.9s); }
  @keyframes nodo { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
  .ruta .viajero { animation: viaja 7s linear infinite; }
  @keyframes viaja { 0% { offset-distance: 0%; opacity: 0; } 8% { opacity: 1; } 92% { opacity: 1; } 100% { offset-distance: 100%; opacity: 0; } }
  .telefono .anillo { animation: anillo 5.4s ease-out infinite; animation-delay: calc(var(--i) * 1.8s); }
  @keyframes anillo { 0% { transform: scale(0.6); opacity: 0.7; } 100% { transform: scale(3.4); opacity: 0; } }
}

/* Nota del catálogo */
.nota {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin: 2rem 0 0;
  padding: 0.625rem 1.125rem 0.625rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--luz-borde-baja);
  background: var(--vidrio);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  color: var(--texto-2);
  font-size: 0.9375rem;
  line-height: 1.3;
}
.punto { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--acento); box-shadow: 0 0 0 4px rgb(var(--acento-rgb) / 0.16); }
@media (prefers-reduced-motion: no-preference) {
  .punto { animation: late 3.6s ease-in-out infinite; }
  @keyframes late { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
}

/* ───── Quiénes somos ───── */
.somos { padding-block: calc(var(--aire) * 0.9) var(--aire); }
.manifiesto {
  max-width: 22ch;
  margin: 0;
  font-family: var(--fuente-titulo);
  font-size: clamp(2.125rem, 1.2rem + 4.2vw, 5.25rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
  text-wrap: pretty;
}
@media (min-width: 60rem) { .manifiesto { max-width: 26ch; margin-left: 8.333%; } }
.manifiesto span { color: var(--texto-3); }

/* ───── Contacto ───── */
.contacto { isolation: isolate; padding-block: var(--aire) calc(var(--aire) + 3rem); }
.contacto .raices {
  inset: auto 0 -6rem 0;
  height: min(46rem, 100% + 6rem);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 45%);
  mask-image: linear-gradient(180deg, transparent, #000 45%);
}
.contacto .grano { display: none; }
.contacto-in { position: relative; }
.escribenos { margin: 0; color: var(--texto-2); font-size: 1.25rem; }
.correo-grande { margin: 0.5rem 0 0; }
.correo-grande a {
  font-family: var(--fuente-titulo);
  font-size: clamp(2rem, 0.6rem + 6.4vw, 6rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-decoration: none;
  overflow-wrap: anywhere;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size 0.5s var(--ease);
}
@media (hover: hover) { .correo-grande a:hover { background-size: 100% 1px; } }
.contacto-in > p:last-child { margin: clamp(2rem, 4vw, 3rem) 0 0; }

.boton {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  min-height: 48px;
  padding: 0.375rem 0.375rem 0.375rem 1.5rem;
  border-radius: 999px;
  background: var(--acento);
  color: var(--sobre-acento);
  font: 600 1.0625rem/1 var(--fuente-cuerpo);
  letter-spacing: -0.005em;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.45), 0 14px 30px -12px rgb(var(--acento-rgb) / 0.45);
  transition: background-color 0.2s var(--ease), transform 0.16s var(--ease);
}
.boton:hover { background: color-mix(in oklab, var(--acento) 88%, white); }
.boton:active { transform: scale(0.97); background: color-mix(in oklab, var(--acento) 85%, black); }
.boton-flecha {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--sobre-acento);
  color: var(--acento);
  transition: transform 0.3s var(--ease);
}
.boton:hover .boton-flecha { transform: translate(2px, -2px); }
@media (pointer: coarse) { .boton { min-height: 48px; } }

/* ───── Pie ───── */
.pie { position: relative; z-index: 1; padding-block: 1.5rem calc(2rem + env(safe-area-inset-bottom)); }
.pie p { margin: 0; color: var(--texto-2); font-size: 0.9375rem; }
.pie a { display: inline-flex; align-items: center; min-height: 24px; text-underline-offset: 0.2em; }
@media (pointer: coarse) { .pie a { min-height: 44px; } }

/* ───── Revelado al hacer scroll (lo agrega el JS) ───── */
.rv { opacity: 0; transform: translateY(14px); }
.rv.vis {
  opacity: 1;
  transform: none;
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: calc(var(--d, 0) * 60ms);
}

/* ───── Movimiento reducido ───── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .rv { opacity: 1; transform: none; }
}

/* ───── Páginas interiores (privacidad y 404) ───── */
.interior { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; background: radial-gradient(80% 50% at 15% 0%, var(--noche-2), transparent 70%), var(--noche-0); }
.interior main { flex: 1; padding-block: clamp(7rem, 14vw, 10rem) var(--aire); }
.interior h1 {
  margin: 0 0 clamp(1.5rem, 3vw, 2.5rem);
  max-width: 16ch;
  font: 400 clamp(2.5rem, 1.4rem + 5vw, 5rem)/1.04 var(--fuente-titulo);
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.prosa { max-width: 40rem; }
.prosa p { margin: 0 0 1.125rem; color: var(--texto-2); }
.prosa a:not(.boton) { color: var(--texto-1); text-underline-offset: 0.2em; }
.prosa .fecha { color: var(--texto-3); font-size: 0.9375rem; margin-top: 2rem; }
.interior .boton { margin-top: 1.5rem; padding-right: 1.5rem; }
.interior .pie { margin-top: auto; }
