/* Didáskalos — portada de «próximamente». Todo son tokens del sistema; aquí solo se compone. */

:root {
  --font-greek: "GFS Didot", "Gentium Plus", Georgia, serif;
  --font-serif: "Gentium Plus", Georgia, serif;
  --font-ui: "Hanken Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "Spline Sans Mono", ui-monospace, SFMono-Regular, monospace;

  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-16: 64px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-strong: cubic-bezier(0.23, 1, 0.32, 1);
  --dur-fast: 140ms;
  --dur: 240ms;

  --maxw: 1160px;
  --r-pill: 999px;
}

:root,
[data-theme="light"] {
  --bg: oklch(0.965 0.012 84);
  --surface: oklch(0.992 0.007 84);
  --ink: oklch(0.255 0.018 58);
  --ink-2: oklch(0.435 0.02 56);
  --ink-faint: oklch(0.515 0.018 60);
  --line: oklch(0.885 0.014 78);
  --line-2: oklch(0.825 0.018 78);
  --line-strong: oklch(0.74 0.02 70);
  --accent: oklch(0.52 0.138 250);
  --accent-strong: oklch(0.45 0.142 252);
  --accent-ring: oklch(0.52 0.138 250 / 0.32);
}

[data-theme="dark"] {
  --bg: oklch(0.205 0.018 256);
  --surface: oklch(0.252 0.019 256);
  --ink: oklch(0.93 0.012 86);
  --ink-2: oklch(0.78 0.013 84);
  --ink-faint: oklch(0.69 0.015 252);
  --line: oklch(0.33 0.02 256);
  --line-2: oklch(0.4 0.022 256);
  --line-strong: oklch(0.5 0.024 256);
  --accent: oklch(0.7 0.13 250);
  --accent-strong: oklch(0.78 0.12 250);
  --accent-ring: oklch(0.7 0.13 250 / 0.4);
}

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

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

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.6;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

/* Grano de papel. En oscuro no: la tinta no tiene grano. */
.paper-grain::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image: radial-gradient(oklch(0.7 0.03 70 / 0.05) 1px, transparent 1px);
  background-size: 4px 4px;
}
[data-theme="dark"] .paper-grain::before {
  display: none;
}

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

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover {
  color: var(--accent-strong);
}
:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-ring);
  border-radius: 4px;
}

/* Foliación. Vive en el margen o no vive: por debajo de 1280 se montaba encima del texto. */
.folio {
  position: fixed;
  left: var(--s-5);
  top: 50%;
  z-index: 1;
  display: none;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  opacity: 0.55;
  transform: translateY(-50%) rotate(-90deg);
  transform-origin: center;
  pointer-events: none;
}
@media (min-width: 80rem) {
  .folio {
    display: block;
  }
}

.cabecera {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  width: min(100% - var(--s-8), var(--maxw));
  margin-inline: auto;
  padding-block: var(--s-5) var(--s-4);
}

.marca {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin: 0;
}

/* Dos sellos y no un filtro: el oscuro no es el claro invertido, cambia el degradado del disco. */
.marca-sello {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
}
@media (max-width: 30rem) {
  .marca-sello {
    width: 34px;
    height: 34px;
  }
}
[data-theme="light"] .marca-sello-oscuro,
[data-theme="dark"] .marca-sello-claro {
  display: none;
}

.marca-nombre {
  font-family: var(--font-greek);
  font-size: 1.25rem;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.theme-coin {
  position: relative;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px dotted var(--line-strong);
  background: var(--surface);
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.55), inset 0 -1px 2px oklch(0 0 0 / 0.1);
  display: grid;
  place-items: center;
  color: var(--ink-2);
  cursor: pointer;
  perspective: 240px;
  transition: border-color 150ms var(--ease), color 150ms var(--ease), transform 140ms var(--ease-out);
}
[data-theme="dark"] .theme-coin {
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.08), inset 0 -1px 2px oklch(0 0 0 / 0.45);
}
.theme-coin:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}
.theme-coin:active {
  transform: scale(0.94);
}
.coin-disc {
  position: relative;
  width: 22px;
  height: 22px;
  transform-style: preserve-3d;
  transition: transform 360ms var(--ease-out-strong);
}
.coin-disc.night {
  transform: rotateY(180deg);
}
.coin-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  backface-visibility: hidden;
}
.coin-moon {
  transform: rotateY(180deg);
}

/* Sin movimiento la moneda no gira: las caras se cruzan en opacidad. */
@media (prefers-reduced-motion: reduce) {
  .coin-disc {
    transition: none;
    transform: none;
  }
  .coin-face {
    backface-visibility: visible;
    transition: opacity 150ms var(--ease);
  }
  .coin-moon {
    transform: none;
    opacity: 0;
  }
  .coin-disc.night .coin-moon {
    opacity: 1;
  }
  .coin-disc.night .coin-sun {
    opacity: 0;
  }
}

.hoja {
  position: relative;
  z-index: 2;
  flex: 1;
  width: min(100% - var(--s-8), var(--maxw));
  margin-inline: auto;
  display: grid;
  align-content: center;
  gap: clamp(var(--s-8), 5vw, var(--s-12));
  padding-block: clamp(var(--s-8), 6vh, var(--s-16));
}

/* Dos columnas con el filete en medio: en una sola, el botón y el colofón caían bajo el pliegue. */
@media (min-width: 62rem) {
  .hoja {
    grid-template-columns: minmax(0, 1.05fr) 3px minmax(0, 0.78fr);
    align-items: center;
    column-gap: clamp(var(--s-10), 5vw, var(--s-16));
  }
}

.entrada {
  max-width: 46ch;
}

.kinetic {
  position: relative;
  display: inline-flex;
  font-family: var(--font-greek);
  font-weight: 400; /* Didot no tiene negrita de verdad; el navegador la fingiría. */
  font-size: clamp(2.5rem, 9vw, 6rem);
  line-height: 0.95;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.kinetic .stem {
  position: relative;
  color: var(--accent);
}
.kinetic .stem::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.08em;
  height: 0.06em;
  background: var(--accent);
  opacity: 0.32;
  border-radius: 2px;
}
.kinetic .ending {
  display: inline-block;
  position: relative;
}

/* El repinte de la página de enfrente. Centrado porque scaleX(-1) pivota sobre el centro: si no, parece un borrón. */
.kinetic-ghost {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  transform: scaleX(-1) translate(-6px, 6px);
  color: var(--ink);
  opacity: 0.045;
  filter: blur(3px);
  pointer-events: none;
  user-select: none;
}
[data-theme="dark"] .kinetic-ghost {
  opacity: 0.06;
}
@keyframes flipIn {
  0% {
    transform: translateY(0.28em) rotateX(-55deg);
    filter: blur(2px);
  }
  100% {
    transform: translateY(0) rotateX(0);
    filter: blur(0);
  }
}
.kinetic .ending.swap,
.kinetic .stem.swap {
  display: inline-block;
  animation: flipIn 520ms var(--ease-out) both;
  transform-origin: top center;
}

.aparato {
  margin: var(--s-5) 0 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--ink-2);
}
.aparato sup {
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 0.65em;
  color: var(--accent-strong);
  margin-right: 2px;
}
.aparato .ap-forma {
  font-style: normal;
  color: var(--ink);
}
/* El tema, azul aquí también: es el mismo lema de arriba y la raíz no cambia. */
.aparato .ap-tema {
  color: var(--accent);
}

/* La transcripción no es prosa, es notación: en monoespaciada se lee como lo que es y no se
   confunde con la glosa de arriba. */
.translit {
  margin: var(--s-2) 0 0;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  letter-spacing: 0.02em;
  color: var(--ink-faint);
}

.pips {
  display: flex;
  gap: var(--s-2);
  margin: var(--s-5) 0 0;
}
/* La raya se ve de 4px pero la diana mide 26×24, o con el dedo no se acierta. */
.pip {
  width: 26px;
  height: 24px;
  padding: 10px 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.pip::before {
  content: "";
  display: block;
  height: 4px;
  border-radius: 999px;
  background: var(--line-2);
  transition: background var(--dur) var(--ease), transform var(--dur-fast) var(--ease);
}
.pip.on::before {
  background: var(--accent);
}
.pip:hover::before {
  background: var(--accent-strong);
}
.pip:active::before {
  transform: scaleY(1.6);
}

/* La acepción en una línea: partida en dos parecen dos ideas. Solo se rompe por debajo de 30rem. */
.glosa {
  margin: var(--s-5) 0 0;
  font-family: var(--font-serif);
  font-size: clamp(1rem, 1.9vw, 1.375rem);
  line-height: 1.45;
  white-space: nowrap;
  color: var(--ink);
}
@media (max-width: 30rem) {
  .glosa {
    white-space: normal;
    text-wrap: balance;
  }
}

.cita {
  margin: var(--s-6) 0 0;
}
.nowrap {
  white-space: nowrap;
}
.cita blockquote {
  margin: 0;
}
/* Resaltar la palabra dentro de su cita: igual que en la ficha del diccionario. */
.cita-griego .hl {
  color: var(--accent-strong);
}
.cita-griego {
  font-family: var(--font-greek);
  font-weight: 400;
  font-size: clamp(1.375rem, 3.4vw, 2rem);
  line-height: 1.35;
  margin: 0;
  color: var(--ink);
}
.cita-trad {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1rem, 1.8vw, 1.125rem);
  line-height: 1.5;
  margin: var(--s-2) 0 0;
  color: var(--ink-2);
}
.cita-ref {
  display: block;
  margin: var(--s-3) 0 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
}
.cita-ref cite {
  font-style: normal;
}

/* Es un <hr>, no un div: también significa algo para un lector de pantalla. */
.filete {
  border: 0;
  margin: 0;
  height: 3px;
  border-top: 1px solid var(--line-2);
  border-bottom: 1px solid var(--line);
  transform-origin: left center;
}
@media (min-width: 62rem) {
  .filete {
    height: 100%;
    min-height: 60%;
    width: 3px;
    border: 0;
    border-left: 1px solid var(--line-2);
    border-right: 1px solid var(--line);
    transform-origin: center top;
  }
}

/* Sustituye al asterismo ⁂, que Didot no trae y caía a la fuente de símbolos del sistema. */
.filete-seccion {
  width: 100%;
  height: 3px;
  border: 0;
  margin: var(--s-8) 0 0;
  border-top: 1px solid var(--line-2);
  border-bottom: 1px solid var(--line);
  transform-origin: left center;
}

.estado {
  max-width: 62ch;
}
.estado-texto {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1rem, 1.8vw, 1.1875rem);
  line-height: 1.6;
  color: var(--ink-2);
  text-wrap: pretty;
}

.horizonte {
  margin: var(--s-6) 0 0;
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 3.4vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--accent);
}

.enlace {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  margin-top: var(--s-6);
  padding: var(--s-3) var(--s-5);
  border: 1px solid var(--line-2);
  border-radius: var(--r-pill);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur-fast) var(--ease);
}
.enlace:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.enlace:active {
  transform: scale(0.98);
}
/* Con el dedo no hay hover. */
@media (hover: none) {
  .enlace:hover {
    border-color: var(--line-2);
    color: var(--ink);
  }
}
.diple {
  font-family: var(--font-greek);
  transition: transform var(--dur) var(--ease);
}
.enlace:hover .diple {
  transform: translateX(3px);
}

.colofon {
  position: relative;
  z-index: 2;
  width: min(100% - var(--s-8), var(--maxw));
  margin-inline: auto;
  padding-block: var(--s-8) var(--s-10);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-4);
  border-top: 1px solid var(--line);
  font-size: 0.8125rem;
  color: var(--ink-faint);
}
.colofon p {
  margin: 0;
}

/* Una sola entrada de ~900 ms. El estado base de cada cosa es el VISIBLE y la animación
   va con `backwards`: si no llegara a correr, la página se ve entera igual. */
@keyframes surge {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}
@keyframes prensa {
  from {
    transform: scaleX(0);
  }
}
@keyframes aparece {
  from {
    opacity: 0;
  }
}

.kinetic,
.glosa,
.aparato,
.translit,
.pips,
.cita,
.estado-texto,
.horizonte,
.enlace {
  animation: surge 560ms var(--ease-out) backwards;
}
.kinetic {
  animation-delay: 40ms;
}
.glosa {
  animation-delay: 130ms;
}
.aparato {
  animation-delay: 200ms;
}
.translit {
  animation-delay: 250ms;
}
.pips {
  animation-delay: 300ms;
}
.cita {
  animation-delay: 330ms;
}
.estado-texto {
  animation-delay: 440ms;
}
.horizonte {
  animation-delay: 540ms;
}
.enlace {
  animation-delay: 590ms;
}
.filete-seccion {
  animation: prensa 620ms var(--ease-out) 280ms backwards;
}
.filete {
  animation: prensa 620ms var(--ease-out) 400ms backwards;
}
.cabecera,
.colofon,
.folio {
  animation: aparece 700ms var(--ease) 120ms backwards;
}

/* En escritorio el canal es vertical: la prensa baja, no cruza. */
@media (min-width: 62rem) {
  @keyframes prensa-vertical {
    from {
      transform: scaleY(0);
    }
  }
  .filete {
    animation-name: prensa-vertical;
  }
}

@media (prefers-reduced-motion: reduce) {
  .kinetic,
  .glosa,
  .aparato,
  .translit,
  .pips,
  .cita,
  .filete,
  .filete-seccion,
  .estado-texto,
  .horizonte,
  .enlace,
  .cabecera,
  .colofon,
  .folio {
    animation: none;
  }
  .enlace:active,
  .theme-coin:active {
    transform: none;
  }
  .enlace:hover .diple {
    transform: none;
  }
}

/* Una sola columna: todo centrado, como la home. Va al final del fichero a propósito:
   misma especificidad que las reglas de arriba, así que gana por orden. No lo muevas. */
@media (max-width: 61.999rem) {
  .entrada,
  .estado,
  .colofon {
    text-align: center;
    margin-inline: auto;
  }
  /* Los flex no obedecen a text-align. */
  .pips,
  .colofon {
    justify-content: center;
  }
  .entrada {
    max-width: min(100%, 34rem);
  }
  .estado {
    max-width: min(100%, 40rem);
  }
  .filete-seccion {
    margin-inline: auto;
  }
}
