/* Diccionario de Japonés · página «próximamente».
   Estilo de los recursos de Japonés a Fondo: marino, rojo sol, celeste,
   Josefin Sans para titulares, Atkinson Hyperlegible Next para el texto
   y Klee One para el japonés. */

@font-face {
  font-family: "Josefin Sans";
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url(fonts/josefin-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Josefin Sans";
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url(fonts/josefin-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url(fonts/atkinson-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url(fonts/atkinson-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Klee One solo con los caracteres japoneses de la web (herramientas/fuentes.py). */
@font-face {
  font-family: "Klee One";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/klee-400.woff2) format("woff2");
}
@font-face {
  font-family: "Klee One";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/klee-600.woff2) format("woff2");
}

:root {
  color-scheme: light;
  --marino: #001d45;
  --marino-2: #0b2b5a;
  --rojo: #cd0000;
  --rojo-hover: #a90000;
  --cielo: #edf6ff;
  --cielo-2: #d0e0f3;
  --cielo-3: #dcebfb;
  --linea: #a9bbd3;
  --linea-suave: #e3ebf5;
  --tinta: #14284b;
  --texto: #2b3954;
  --suave: #46536b;
  --rt: #3d4a62;
  --petalo: #ffc2d6;
  --titular: "Josefin Sans", "Atkinson Hyperlegible Next", system-ui, sans-serif;
  --cuerpo: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --japones: "Klee One", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", "Meiryo", sans-serif;
  --margen: clamp(20px, 5vw, 80px);
  --curva: cubic-bezier(.2, .75, .2, 1);
}

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

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

body {
  margin: 0;
  min-width: 320px;
  overflow-x: clip;
  background: #fff;
  color: var(--texto);
  font-family: var(--cuerpo);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
[lang="ja"] { font-family: var(--japones); font-feature-settings: "palt"; line-break: strict; }
ruby { ruby-position: over; ruby-align: center; }
rt { font-family: var(--japones); font-feature-settings: "palt"; text-align: center; line-height: 1; }
.oculto { position: absolute; width: 0; height: 0; overflow: hidden; }
.sin-corte { white-space: nowrap; }

:focus-visible {
  outline: 3px solid #4c86e8;
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Pétalos ---------- */
.petalos {
  position: fixed;
  inset: 0;
  z-index: 6;
  overflow: hidden;
  pointer-events: none;
}
.petalo {
  position: absolute;
  top: 0;
  left: var(--x);
  width: var(--t);
  height: calc(var(--t) * 1.08);
  color: var(--petalo);
  opacity: 0;
  will-change: transform, opacity;
  animation: caer var(--d) linear var(--r) infinite;
}
@keyframes caer {
  0% { transform: translate3d(0, -12vh, 0) rotate(0deg); opacity: 0; }
  8% { opacity: .85; }
  90% { opacity: .85; }
  100% { transform: translate3d(var(--dx), 112vh, 0) rotate(560deg); opacity: 0; }
}

/* ---------- Portada ---------- */
.portada {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: #fff;
}
.portada__lienzo {
  position: relative;
  display: flex;
  flex-direction: column;
  max-width: 1440px;
  min-height: clamp(640px, 100svh, 980px);
  margin: 0 auto;
  padding: 0 var(--margen) clamp(40px, 7vh, 80px);
}

/* Seigaiha (olas) del kit, desvaneciéndose. En la portada va alrededor del sol
   (.sol__patron); en la 404, arriba (.patron). */
.patron,
.sol__patron {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cg fill='none' stroke='%23001d45' stroke-opacity='.075' stroke-width='.8'%3E%3Ccircle cx='20' cy='20' r='20'/%3E%3Ccircle cx='0' cy='0' r='20'/%3E%3Ccircle cx='40' cy='0' r='20'/%3E%3Ccircle cx='0' cy='40' r='20'/%3E%3Ccircle cx='40' cy='40' r='20'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 0%, rgba(0, 0, 0, .5) 45%, transparent 80%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 0%, rgba(0, 0, 0, .5) 45%, transparent 80%);
}
.sol__patron {
  inset: calc(var(--d) * -.85);
  -webkit-mask-image: radial-gradient(circle closest-side, #000 36%, rgba(0, 0, 0, .45) 62%, transparent 100%);
  mask-image: radial-gradient(circle closest-side, #000 36%, rgba(0, 0, 0, .45) 62%, transparent 100%);
}

.barra {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  height: clamp(68px, 11vh, 104px);
}
.marca {
  display: inline-flex;
  align-items: flex-start;
  gap: 2px;
  text-decoration: none;
  color: var(--marino);
}
.marca img { width: auto; height: clamp(28px, 2.5vw, 38px); }
.marca__r { font-size: 11px; font-weight: 700; line-height: 1; margin-top: 2px; }

/* Sol rojo del kit, con el anillo fino. */
.sol {
  --d: clamp(440px, 40vw, 640px);
  position: absolute;
  z-index: 1;
  top: calc(var(--d) * -.2);
  right: calc(var(--d) * -.15);
  width: var(--d);
  aspect-ratio: 1;
  animation: sol-entra 1s var(--curva) both;
}
.sol__disco {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #dd0a0a 0%, var(--rojo) 52%, #bd0000 100%);
  box-shadow: 0 40px 90px -40px rgba(160, 0, 0, .55);
}
@property --giro {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 100%;
}
.sol__anillo {
  position: absolute;
  inset: calc(var(--d) * -.11);
  border: 1.25px solid rgba(0, 29, 69, .2);
  border-radius: 50%;
  -webkit-mask: conic-gradient(from 200deg, #000 var(--giro), transparent 0);
  mask: conic-gradient(from 200deg, #000 var(--giro), transparent 0);
  animation: anillo 2.2s var(--curva) .3s both;
}
.sol__texto {
  position: absolute;
  left: 50%;
  top: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #fff;
  text-align: center;
  transform: translate(-50%, -50%) translate(calc(var(--d) * -.075), calc(var(--d) * .1));
}
.sol__kanji {
  font-weight: 600;
  font-size: calc(var(--d) * .19);
  line-height: 1;
  letter-spacing: .02em;
}
.sol__kanji rt {
  font-size: .25em;
  font-weight: 400;
  letter-spacing: .02em;
  padding-bottom: .25em;
  color: rgba(255, 255, 255, .92);
}
.sol__raya {
  display: block;
  width: calc(var(--d) * .15);
  height: 2px;
  margin: calc(var(--d) * .035) 0 calc(var(--d) * .03);
  background: rgba(255, 255, 255, .85);
  border-radius: 2px;
}
.sol__es {
  font-family: var(--titular);
  font-weight: 700;
  font-size: calc(var(--d) * .046);
  line-height: 1;
  letter-spacing: .14em;
  padding-left: .14em;
  padding-top: .15em;
  text-transform: uppercase;
}
.sol__romaji {
  margin-top: calc(var(--d) * .022);
  font-weight: 600;
  font-size: calc(var(--d) * .02);
  letter-spacing: .5em;
  padding-left: .5em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .8);
}

.portada__texto {
  position: relative;
  z-index: 3;
  max-width: min(730px, 56%);
  margin-block: auto;
  padding-block: 24px clamp(24px, 6vh, 64px);
}
.estado {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--rojo);
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .3em;
  text-transform: uppercase;
}
.estado__punto {
  position: relative;
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 50%;
  background: var(--rojo);
  animation: latido 2.2s ease-out infinite;
}
.portada h1 {
  margin: .42em 0 .32em;
  color: var(--marino);
  font-family: var(--titular);
  font-weight: 700;
  font-size: clamp(2.5rem, 1.1rem + 4vw, 4.3rem);
  line-height: 1.02;
  letter-spacing: -.01em;
  text-wrap: balance;
}
.portada__sub {
  max-width: 31em;
  color: var(--texto);
  font-size: clamp(1.06rem, .98rem + .35vw, 1.24rem);
  line-height: 1.55;
}
.acciones {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: clamp(24px, 4vh, 36px);
}

.boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55em;
  min-height: 50px;
  padding: .8em 1.45em;
  border: 0;
  border-radius: 999px;
  font-family: var(--cuerpo);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
  transition: transform .2s var(--curva), background-color .2s, border-color .2s, box-shadow .2s, color .2s;
}
.boton svg {
  width: 1.05em;
  height: 1.05em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.boton--rojo {
  background: var(--rojo);
  color: #fff;
  box-shadow: 0 12px 26px -14px rgba(205, 0, 0, .8);
}
.boton--rojo:hover { background: var(--rojo-hover); transform: translateY(-1px); }
.boton--rojo:hover svg { animation: bajar .9s var(--curva) infinite; }
.boton--linea {
  background: rgba(255, 255, 255, .78);
  color: var(--marino);
  box-shadow: inset 0 0 0 1.5px rgba(0, 29, 69, .22);
}
.boton--linea:hover { box-shadow: inset 0 0 0 1.5px var(--marino); transform: translateY(-1px); }
.boton--suave { background: var(--cielo); color: var(--marino); }
.boton--suave:hover { background: #ddeafa; }

/* Coco-chan en su disco celeste, como en las portadas de los recursos. */
.coco {
  --c: clamp(200px, 18vw, 280px);
  position: absolute;
  z-index: 2;
  right: 24%;
  bottom: clamp(18px, 4vh, 48px);
  width: calc(var(--c) * 1.16);
  margin: 0;
}
.coco__disco {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #e3eefa 0%, var(--cielo-2) 70%);
  animation: aparecer .8s var(--curva) .25s both;
}
.coco__img {
  position: relative;
  width: var(--c);
  height: auto;
  margin: 0 auto calc(var(--c) * .1);
  transform-origin: 50% 100%;
  animation: coco-entra .9s var(--curva) .45s both, flotar 4.5s ease-in-out 1.6s infinite;
}

/* ---------- Adelanto ---------- */
.adelanto {
  position: relative;
  z-index: 1;
  padding: clamp(72px, 10vw, 136px) var(--margen);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #fff 92%),
    linear-gradient(#e2edf8 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, #e2edf8 1px, transparent 1px) 0 0 / 44px 44px,
    #f7fbff;
}
.adelanto__dentro {
  max-width: 1160px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(0, 1fr);
  gap: clamp(36px, 6vw, 96px);
  align-items: center;
}
.kicker {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--rojo);
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .32em;
  text-transform: uppercase;
}
.kicker::before {
  content: "";
  width: 42px;
  height: 2px;
  background: var(--rojo);
}
.adelanto h2 {
  margin: .45em 0 .4em;
  color: var(--marino);
  font-family: var(--titular);
  font-weight: 700;
  font-size: clamp(2.1rem, 1.3rem + 2.6vw, 3.4rem);
  line-height: 1.04;
  letter-spacing: -.01em;
}
.adelanto__lead {
  max-width: 27em;
  font-size: clamp(1.04rem, .98rem + .25vw, 1.16rem);
  line-height: 1.6;
}
.adelanto__coco {
  display: block;
  width: min(260px, 70%);
  margin: clamp(20px, 4vw, 44px) 0 0 auto;
}
.adelanto__coco img { width: 100%; height: auto; }

/* Ficha de diccionario */
.ficha {
  position: relative;
  padding: clamp(22px, 3vw, 34px);
  background: #fff;
  border: 1px solid #cfdcec;
  border-top: 6px solid var(--rojo);
  border-radius: 20px;
  box-shadow: 0 40px 80px -42px rgba(0, 29, 69, .35), 0 2px 8px rgba(0, 29, 69, .05);
}
.ficha__cabecera {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px 22px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--linea-suave);
}
.ficha__palabra {
  color: var(--marino);
  font-weight: 600;
  font-size: clamp(3.2rem, 2.4rem + 2.6vw, 4.6rem);
  line-height: 1;
}
.ficha__palabra rt {
  font-size: .27em;
  font-weight: 400;
  letter-spacing: 0;
  padding-bottom: .3em;
  color: var(--rt);
}
.ficha__romaji {
  margin-bottom: 8px;
  color: var(--rojo);
  font-weight: 700;
  font-size: 1.08rem;
  letter-spacing: .02em;
}
.ficha__etiquetas {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.pastilla {
  padding: .5em .95em .45em;
  border-radius: 999px;
  font-size: .64rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .16em;
  text-transform: uppercase;
  white-space: nowrap;
}
.pastilla--marino { background: var(--marino); color: #fff; }
.pastilla--cielo { background: #d3e3f7; color: var(--marino); }
.ficha__acento {
  margin: 0;
  text-align: center;
}
.ficha__acento figcaption,
.ficha__titulo {
  margin: 0 0 8px;
  color: var(--rojo);
  font-family: var(--cuerpo);
  font-weight: 700;
  font-size: .68rem;
  line-height: 1;
  letter-spacing: .24em;
  text-transform: uppercase;
}
.ficha__acento svg { width: 96px; height: auto; overflow: visible; }
.acento__linea { fill: none; stroke: var(--rojo); stroke-width: 2.6; stroke-linecap: round; }
.acento__linea--part { stroke-dasharray: 3 4.5; opacity: .55; }
.acento__punto { fill: var(--rojo); }
.acento__punto--part { fill: #fff; stroke: var(--rojo); stroke-width: 2; }
.ficha__acento text {
  fill: var(--tinta);
  font-family: var(--japones);
  font-feature-settings: "palt";
  font-size: 15px;
  text-anchor: middle;
}
.ficha__acento .acento__part { fill: var(--suave); }

.ficha__bloque { padding: 18px 0; border-bottom: 1px solid var(--linea-suave); }
.ficha__bloque:last-child { padding-bottom: 0; border-bottom: 0; }
.ficha__significado {
  color: var(--tinta);
  font-weight: 600;
  font-size: 1.3rem;
}
.ficha__ejemplo {
  color: var(--tinta);
  font-size: clamp(1.2rem, 1.05rem + .5vw, 1.42rem);
  line-height: 2.05;
}
.ficha__ejemplo rt { font-size: .46em; color: var(--rt); }
.ficha__traduccion { margin-top: 2px; color: var(--suave); }
.ficha__nota {
  margin-top: 14px;
  padding: 11px 14px;
  border-radius: 12px;
  background: var(--cielo);
  color: var(--texto);
  font-size: .93rem;
  line-height: 1.5;
}
.ficha__nota span { color: var(--rojo); font-weight: 600; }

.ficha__kanji {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.kanji { display: flex; align-items: center; gap: 14px; min-width: 0; }
.kanji__dibujo {
  flex: none;
  width: 80px;
  height: 80px;
  padding: 7px;
  border: 1.5px dashed #8fa3c2;
  border-radius: 12px;
  background:
    linear-gradient(90deg, transparent calc(50% - .5px), #dfe7f2 calc(50% - .5px), #dfe7f2 calc(50% + .5px), transparent calc(50% + .5px)),
    linear-gradient(transparent calc(50% - .5px), #dfe7f2 calc(50% - .5px), #dfe7f2 calc(50% + .5px), transparent calc(50% + .5px)),
    #fff;
  cursor: pointer;
  transition: border-color .2s, transform .2s var(--curva);
}
.kanji__dibujo:hover { border-color: var(--rojo); transform: translateY(-1px); }
.kanji__dibujo svg { width: 100%; height: 100%; }
.trazos path {
  fill: none;
  stroke: var(--marino);
  stroke-width: 4.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Con JS y movimiento: los trazos esperan ocultos hasta que la ficha se ve. */
.js-anim .kanji__dibujo .trazos path { stroke-dasharray: 1 2; stroke-dashoffset: 1; stroke-opacity: 0; }
.js-anim .kanji__dibujo.animar .trazos path {
  animation: trazo .38s cubic-bezier(.45, 0, .25, 1) forwards;
  animation-delay: calc(var(--espera, 0s) + var(--i) * .27s);
}
.kanji__info { min-width: 0; }
.kanji__lecturas { color: var(--tinta); font-size: 1.05rem; font-weight: 600; }
.kanji__significado { color: var(--texto); font-size: .95rem; line-height: 1.35; }
.kanji__trazos { margin-top: 3px; color: var(--suave); font-size: .8rem; letter-spacing: .04em; }

/* ---------- Pie ---------- */
.pie {
  position: relative;
  z-index: 1;
  padding: clamp(36px, 5vw, 52px) var(--margen) 28px;
  color: #c7d6ec;
  background-color: var(--marino);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.065' stroke-width='.8'%3E%3Ccircle cx='20' cy='20' r='20'/%3E%3Ccircle cx='0' cy='0' r='20'/%3E%3Ccircle cx='40' cy='0' r='20'/%3E%3Ccircle cx='0' cy='40' r='20'/%3E%3Ccircle cx='40' cy='40' r='20'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 56px 56px;
}
.pie__dentro {
  max-width: 1160px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 22px 40px;
}
.pie__marca {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: #fff;
  font-size: .98rem;
  text-decoration: none;
}
.pie__marca img { width: 44px; height: 44px; flex: none; }
.pie__marca b { font-weight: 700; }
.pie__marca sup { font-size: .6em; line-height: 0; }
.pie__enlaces { display: flex; flex-wrap: wrap; gap: 10px 24px; }
.pie__enlaces a,
.pie__enlaces button {
  padding: 0;
  border: 0;
  background: none;
  color: #c7d6ec;
  font-size: .94rem;
  text-decoration: none;
  cursor: pointer;
}
.pie__enlaces a:hover,
.pie__enlaces button:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.pie__legal {
  max-width: 1160px;
  margin: 26px auto 0;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, .14);
  color: #91a7c6;
  font-size: .8rem;
  line-height: 1.5;
}

/* ---------- Aviso de cookies ---------- */
.cookies {
  position: fixed;
  z-index: 20;
  left: 12px;
  right: 12px;
  bottom: 12px;
  max-width: 410px;
  padding: 18px 18px 16px;
  background: #fff;
  border: 1px solid #d8e3f1;
  border-radius: 18px;
  box-shadow: 0 28px 70px -24px rgba(0, 29, 69, .45);
  animation: subir .38s var(--curva) both;
}
.cookies[hidden] { display: none; }
.cookies__titulo {
  margin-bottom: 6px;
  padding-top: .1em;
  color: var(--marino);
  font-family: var(--titular);
  font-weight: 700;
  font-size: 1.12rem;
}
.cookies__texto { margin-bottom: 14px; font-size: .92rem; line-height: 1.5; }
.cookies__botones { display: flex; gap: 10px; }
.cookies__botones .boton { flex: 1; min-height: 44px; padding: .7em 1em; font-size: .94rem; }

/* ---------- Entradas suaves ---------- */
.portada__texto > * { animation: aparecer .75s var(--curva) both; }
.portada__texto > :nth-child(1) { animation-delay: .1s; }
.portada__texto > :nth-child(2) { animation-delay: .18s; }
.portada__texto > :nth-child(3) { animation-delay: .27s; }
.portada__texto > :nth-child(4) { animation-delay: .36s; }
.barra { animation: aparecer .6s var(--curva) both; }

@keyframes aparecer { from { opacity: 0; transform: translateY(14px); } }
@keyframes sol-entra { from { opacity: 0; transform: scale(.94); } }
@keyframes anillo { from { --giro: 0%; } to { --giro: 100%; } }
@keyframes coco-entra { from { opacity: 0; transform: translateY(26px) scale(.96); } }
@keyframes flotar { 50% { transform: translateY(-5px) rotate(-.6deg); } }
@keyframes trazo {
  from { stroke-dashoffset: 1; stroke-opacity: 1; }
  to { stroke-dashoffset: 0; stroke-opacity: 1; }
}
@keyframes bajar { 50% { transform: translateY(2px); } }
@keyframes subir { from { opacity: 0; transform: translateY(18px); } }
@keyframes latido {
  0% { box-shadow: 0 0 0 0 rgba(205, 0, 0, .45); }
  70% { box-shadow: 0 0 0 10px rgba(205, 0, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(205, 0, 0, 0); }
}

/* ---------- Pantallas medianas ---------- */
@media (max-width: 1100px) {
  .portada__texto { max-width: min(600px, 58%); }
  .coco { right: 12%; }
}

/* ---------- Móvil y tableta vertical ---------- */
@media (max-width: 860px) {
  .portada__lienzo { min-height: 0; padding-bottom: 8px; }
  .sol {
    --d: clamp(230px, 56vw, 400px);
    top: calc(var(--d) * -.08);
    right: calc(var(--d) * -.2);
  }
  .sol__texto { transform: translate(-50%, -50%) translate(calc(var(--d) * -.09), calc(var(--d) * .04)); }
  .portada__texto {
    max-width: 640px;
    margin-block: 0;
    padding-top: calc(clamp(230px, 56vw, 400px) * .92 - clamp(68px, 11vh, 104px) + 14px);
    padding-bottom: 0;
  }
  .coco {
    --c: clamp(150px, 38vw, 220px);
    position: relative;
    right: auto;
    bottom: auto;
    align-self: flex-end;
    margin: 14px 4px 0 0;
  }
  .adelanto__dentro { grid-template-columns: minmax(0, 1fr); }
  .adelanto__texto { position: relative; }
  .adelanto__coco {
    position: absolute;
    right: -6px;
    bottom: -64px;
    width: clamp(118px, 30vw, 170px);
    margin: 0;
  }
  .adelanto__lead { max-width: none; padding-right: clamp(110px, 30vw, 170px); }
}

@media (max-width: 560px) {
  .petalo:nth-child(n + 7) { display: none; }
  .acciones { flex-direction: column; align-items: stretch; }
  .acciones .boton { width: 100%; }
  .ficha__cabecera { grid-template-columns: auto minmax(0, 1fr); }
  .ficha__acento {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 16px;
    text-align: left;
    padding-top: 6px;
  }
  .ficha__acento figcaption { margin: 0; }
  .ficha__kanji { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .adelanto__lead { padding-right: 0; }
  .adelanto__coco { position: static; margin: 18px 0 -8px auto; }
  .pie__dentro { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .petalos { display: none; }
  .sol__anillo { --giro: 100%; }
}

/* ---------- Página 404 ---------- */
.portada--error .portada__lienzo { min-height: 100svh; }
.error {
  position: relative;
  z-index: 3;
  max-width: 640px;
  margin: auto;
  padding: 24px 0 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.error > * { animation: aparecer .75s var(--curva) both; }
.error > :nth-child(2) { animation-delay: .1s; }
.error > :nth-child(3) { animation-delay: .18s; }
.error > :nth-child(4) { animation-delay: .26s; }
.error > :nth-child(5) { animation-delay: .34s; }
.error__coco { display: block; width: 220px; margin-bottom: 18px; }
.error__coco img { width: 100%; height: auto; }
.error h1 { font-size: clamp(2.1rem, 1.3rem + 3vw, 3.4rem); }
.error .portada__sub span { color: var(--rojo); font-weight: 600; }
.error .acciones { justify-content: center; }
