/* ==========================================================================
   Ghibli en Español — sistema visual "Capas"
   La idea: una página se comporta como un fondo pintado de animación.
   Planos superpuestos, papel con grano, color plano y trazo dibujado.
   ========================================================================== */

/* ---------- Reset mínimo ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; }
img, svg, video { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }

/* ---------- Tokens: día ---------- */
:root {
  --paper:      #f7f0e3;
  --paper-deep: #efe4d1;
  --card:       #fffaf0;
  --card-2:     #f3ead9;
  --ink:        #1e2a24;
  --ink-soft:   #55655a;
  --ink-faint:  #8b978c;
  --line:       #ddcfb8;

  /* acentos por defecto (los sobreescribe cada película) */
  --accent:     #4f7f4a;
  --accent-2:   #c2582f;
  --accent-3:   #d9a441;
  --accent-ink: #ffffff;
  --wash:       #e9f0dd;

  --sky-1: #bfe0ef;
  --sky-2: #f2e6cf;

  --grain: .05;
  --shadow: 0 1px 2px rgba(40,32,20,.05), 0 12px 28px -18px rgba(40,32,20,.45);
  --shadow-lift: 0 2px 4px rgba(40,32,20,.06), 0 26px 50px -26px rgba(40,32,20,.5);

  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --prose: "Newsreader", Georgia, "Times New Roman", serif;
  --ui: "Newsreader", Georgia, serif;

  --wrap: 1180px;
  --measure: 68ch;
  --r-lg: 28px 6px 28px 6px;
  --r-md: 18px 4px 18px 4px;
}

/* ---------- Tokens: noche ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:      #12161d;
    --paper-deep: #0d1117;
    --card:       #1a1f28;
    --card-2:     #222833;
    --ink:        #ece3d3;
    --ink-soft:   #a9b3ae;
    --ink-faint:  #78837e;
    --line:       #333b45;
    --wash:       #1e2a26;
    --sky-1: #2a3d52;
    --sky-2: #1a2230;
    --grain: .07;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 28px -18px rgba(0,0,0,.9);
    --shadow-lift: 0 2px 4px rgba(0,0,0,.5), 0 26px 50px -26px rgba(0,0,0,.95);
  }
}
:root[data-theme="dark"] {
  --paper:      #12161d;
  --paper-deep: #0d1117;
  --card:       #1a1f28;
  --card-2:     #222833;
  --ink:        #ece3d3;
  --ink-soft:   #a9b3ae;
  --ink-faint:  #78837e;
  --line:       #333b45;
  --wash:       #1e2a26;
  --sky-1: #2a3d52;
  --sky-2: #1a2230;
  --grain: .07;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 28px -18px rgba(0,0,0,.9);
  --shadow-lift: 0 2px 4px rgba(0,0,0,.5), 0 26px 50px -26px rgba(0,0,0,.95);
}

/* ---------- Base ---------- */
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--prose);
  font-size: 1.075rem;
  line-height: 1.72;
  font-optical-sizing: auto;
  overflow-x: hidden;
}

/* grano de papel: una sola capa fija, barata */
body::before {
  content: "";
  position: fixed; inset: -20%;
  pointer-events: none; z-index: 9999;
  opacity: var(--grain);
  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='.82' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body::before { mix-blend-mode: screen; } }
:root[data-theme="dark"] body::before { mix-blend-mode: screen; }

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 600;
  font-variation-settings: "SOFT" 30, "WONK" 1;
  line-height: 1.08;
  letter-spacing: -.018em;
  margin: 0 0 .5em;
  text-wrap: balance;
}
p { margin: 0 0 1.1em; }
strong { font-weight: 700; color: var(--ink); }
em { font-style: italic; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.narrow { width: min(100% - 2.5rem, 780px); margin-inline: auto; }

/* ---------- Enlaces de texto: subrayado dibujado ---------- */
.prose a, .link {
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 100% 2px;
  background-repeat: no-repeat;
  background-position: 0 92%;
  color: inherit;
  transition: background-size .18s ease;
}
.prose a:hover, .link:hover { background-size: 100% 40%; }

/* ---------- Cabecera ---------- */
.topbar {
  position: sticky; top: 0; z-index: 60;
  padding: .6rem 0;
  backdrop-filter: blur(14px) saturate(1.2);
  background: color-mix(in oklab, var(--paper) 84%, transparent);
}
.topbar-in {
  display: flex; align-items: center; gap: 1rem;
  width: min(100% - 1.6rem, var(--wrap)); margin-inline: auto;
}
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; margin-right: auto; }
.brand svg { width: 38px; height: 38px; flex: none; }
.brand b {
  font-family: var(--display); font-size: 1.12rem; font-weight: 700;
  font-variation-settings: "SOFT" 60, "WONK" 1; letter-spacing: -.02em; line-height: 1;
}
.brand span { display: block; font-size: .72rem; color: var(--ink-faint); letter-spacing: .02em; }
.nav { display: flex; align-items: center; gap: .15rem; flex-wrap: wrap; }
.nav a {
  text-decoration: none; padding: .42rem .78rem; border-radius: 999px;
  font-size: .96rem; color: var(--ink-soft); white-space: nowrap;
}
.nav a:hover { background: var(--wash); color: var(--ink); }
.nav a.on { background: var(--accent); color: #fff; }
.theme-btn {
  border: 0; background: var(--card-2); width: 36px; height: 36px; border-radius: 50%;
  cursor: pointer; display: grid; place-items: center; flex: none; box-shadow: var(--shadow);
}
.theme-btn:hover { background: var(--accent); color: #fff; }
.burger { display: none; }

@media (max-width: 880px) {
  .burger {
    display: grid; place-items: center; border: 0; background: var(--card-2);
    width: 36px; height: 36px; border-radius: 50%; cursor: pointer; flex: none;
  }
  .nav {
    position: absolute; top: 100%; right: .8rem; left: .8rem;
    flex-direction: column; align-items: stretch; gap: .1rem;
    background: var(--card); border-radius: var(--r-md); padding: .5rem;
    box-shadow: var(--shadow-lift); display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: .6rem .8rem; }
}

/* ---------- Portada: escena en capas ---------- */
.hero { position: relative; isolation: isolate; padding: clamp(3rem, 9vw, 6.5rem) 0 0; }
.hero-scene { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.hero-scene svg { width: 100%; height: 100%; object-fit: cover; }
.hero h1 {
  font-size: clamp(2.9rem, 8.4vw, 6.6rem);
  font-variation-settings: "SOFT" 70, "WONK" 1;
  font-weight: 700; max-width: 15ch; margin-bottom: .25em;
}
.hero .kicker {
  font-family: var(--prose); font-style: italic; font-size: 1.06rem;
  color: var(--ink-soft); margin: 0 0 1.4rem;
}
.hero .entradilla { font-size: 1.22rem; max-width: 46ch; color: var(--ink-soft); }
.hero-actions { display: flex; gap: .7rem; flex-wrap: wrap; margin: 1.8rem 0 0; }

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .78rem 1.3rem; border-radius: 999px; text-decoration: none;
  background: var(--accent); color: #fff; font-size: 1rem; border: 0; cursor: pointer;
  box-shadow: var(--shadow); transition: transform .16s ease, box-shadow .16s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.btn.ghost:hover { box-shadow: inset 0 0 0 2px var(--accent); }

/* ---------- Secciones ---------- */
section { position: relative; }
.band { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.band.tint { background: var(--paper-deep); }
.band.ink { background: var(--ink); color: var(--paper); }
.band.ink h2, .band.ink h3 { color: var(--paper); }

.sec-head { max-width: 60ch; margin-bottom: 2.2rem; }
.sec-head h2 { font-size: clamp(1.9rem, 4.2vw, 3rem); }
.sec-head p { color: var(--ink-soft); font-size: 1.1rem; margin: 0; }
.eyebrow {
  display: inline-block; font-family: var(--prose); font-style: italic;
  color: var(--accent); font-size: 1.02rem; margin-bottom: .35rem;
}

/* onda de colinas entre secciones */
.hills { display: block; width: 100%; height: clamp(40px, 6vw, 90px); }

/* ---------- Rejilla de películas ---------- */
.filters { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1.8rem; align-items: center; }
.chip {
  border: 0; cursor: pointer; padding: .42rem .9rem; border-radius: 999px;
  background: var(--card-2); color: var(--ink-soft); font-size: .95rem;
}
.chip:hover { color: var(--ink); }
.chip.on { background: var(--ink); color: var(--paper); }
.search {
  flex: 1 1 220px; min-width: 180px; padding: .55rem 1rem; border-radius: 999px;
  border: 2px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-size: .98rem;
}
.search:focus { outline: none; border-color: var(--accent); }

.grid {
  display: grid; gap: 1.4rem;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
}
.film-card {
  --accent: var(--c1);
  display: flex; flex-direction: column; text-decoration: none;
  background: var(--card); border-radius: var(--r-md); overflow: hidden;
  box-shadow: var(--shadow); transition: transform .2s ease, box-shadow .2s ease;
}
.film-card:hover { transform: translateY(-5px) rotate(-.5deg); box-shadow: var(--shadow-lift); }
.film-card .poster { aspect-ratio: 3 / 4; position: relative; }
.film-card .poster svg { width: 100%; height: 100%; }
.film-card .meta { padding: .85rem 1rem 1.1rem; }
.film-card h3 { font-size: 1.16rem; margin: 0 0 .15rem; font-variation-settings: "SOFT" 50, "WONK" 1; }
.film-card .sub { font-size: .9rem; color: var(--ink-faint); font-style: italic; }
.film-card .yr {
  position: absolute; left: .7rem; top: .7rem; z-index: 2;
  background: rgba(255,255,255,.9); color: #1e2a24; border-radius: 999px;
  padding: .1rem .6rem; font-size: .82rem; font-weight: 600;
}

/* ---------- Página de película ---------- */
.film-hero { position: relative; padding: clamp(2rem, 5vw, 3.6rem) 0 0; background: var(--wash); overflow: hidden; }
.film-hero::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 40%;
  background: linear-gradient(to top, var(--paper), transparent);
  pointer-events: none;
}
.film-hero-in { position: relative; z-index: 2; display: grid; gap: 2rem; grid-template-columns: minmax(0, 1fr) 300px; align-items: end; }
@media (max-width: 860px) { .film-hero-in { grid-template-columns: 1fr; } }
.film-hero h1 { font-size: clamp(2.4rem, 6.4vw, 4.6rem); font-weight: 700; font-variation-settings: "SOFT" 70, "WONK" 1; }
.film-hero .orig { font-style: italic; color: var(--ink-soft); font-size: 1.05rem; margin-bottom: 1rem; }
.film-hero .tagline { font-size: 1.24rem; max-width: 40ch; color: var(--ink-soft); }
.crumbs { font-size: .92rem; color: var(--ink-faint); margin-bottom: 1rem; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.poster-frame { border-radius: var(--r-md); overflow: hidden; box-shadow: var(--shadow-lift); transform: rotate(-1.2deg); }
.poster-frame svg { width: 100%; aspect-ratio: 3/4; }

/* hueco de imagen para fotogramas oficiales */
.slot {
  position: relative; border-radius: var(--r-md); overflow: hidden;
  background: var(--card-2); box-shadow: var(--shadow); margin: 1.6rem 0;
}
.slot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slot .ph { position: relative; }
.slot .ph svg { width: 100%; height: 100%; }
.slot .ph-note {
  position: absolute; inset: auto 0 0 0; padding: .6rem .9rem;
  background: color-mix(in oklab, var(--ink) 72%, transparent); color: #fff;
  font-size: .82rem; font-style: italic; line-height: 1.35;
}
figure { margin: 1.8rem 0; }
figcaption { font-size: .9rem; color: var(--ink-faint); font-style: italic; margin-top: .5rem; }

/* ---------- Ficha técnica ---------- */
.ficha {
  background: var(--card); border-radius: var(--r-lg); padding: 1.5rem 1.6rem;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.ficha::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 8px; background: var(--accent); }
.ficha h3 { font-size: 1.25rem; margin-top: .4rem; }
.ficha dl { display: grid; grid-template-columns: auto 1fr; gap: .35rem 1rem; margin: 0; font-size: .98rem; }
.ficha dt { font-style: italic; color: var(--ink-faint); }
.ficha dd { margin: 0; }

/* ---------- Layout artículo + lateral ---------- */
.article-grid { display: grid; gap: 2.6rem; grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
@media (max-width: 980px) { .article-grid { grid-template-columns: 1fr; } }
.side { position: sticky; top: 84px; display: grid; gap: 1.2rem; }
@media (max-width: 980px) { .side { position: static; } }

.prose { max-width: var(--measure); }
.prose h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); margin-top: 2.4em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1.3rem; margin-top: 2em; color: var(--accent); }
.prose ul { padding-left: 0; list-style: none; }
.prose ul li { position: relative; padding-left: 1.7rem; margin-bottom: .6rem; }
.prose ul li::before {
  content: ""; position: absolute; left: 0; top: .62em; width: 11px; height: 11px;
  background: var(--accent); border-radius: 60% 10% 60% 10%; transform: rotate(-12deg);
}
.prose ol { padding-left: 1.2rem; }
.prose ol li { margin-bottom: .6rem; }

/* ---------- Escenas y significados ---------- */
.escena {
  position: relative; background: var(--card); border-radius: var(--r-md);
  padding: 1.4rem 1.5rem 1.2rem 1.5rem; margin: 1.4rem 0;
  box-shadow: var(--shadow); border-left: 7px solid var(--accent);
}
.escena .blob { position: absolute; left: -22px; top: 18px; width: 44px; height: 44px; }
.escena .blob svg { width: 100%; height: 100%; }
.escena .blob span {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--display); font-weight: 700; color: #fff; font-size: 1.1rem;
}
.escena h3 { margin: 0 0 .1rem; color: var(--ink); font-size: 1.22rem; }
.escena .cuando { font-style: italic; color: var(--ink-faint); font-size: .92rem; margin-bottom: .7rem; }
.escena .lectura {
  margin-top: .9rem; padding: .85rem 1rem; border-radius: 14px 3px 14px 3px;
  background: var(--wash); font-size: 1rem;
}
.escena .lectura b { color: var(--accent); }
@media (max-width: 620px) { .escena { padding-left: 1.1rem; } .escena .blob { left: -18px; width: 36px; height: 36px; } }

/* ---------- Curiosidades ---------- */
.curios { display: grid; gap: .9rem; }
.curio {
  background: var(--card); border-radius: var(--r-md); padding: 1rem 1.2rem;
  box-shadow: var(--shadow); display: flex; gap: .9rem; align-items: flex-start;
}
.curio .n {
  flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-3);
  color: #2a2013; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: .95rem;
}
.curio p { margin: 0; font-size: 1rem; }

/* ---------- Símbolos ---------- */
.simbolos { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.simbolo { background: var(--card-2); border-radius: var(--r-md); padding: 1.1rem 1.2rem; }
.simbolo h4 { font-size: 1.06rem; margin-bottom: .3rem; color: var(--accent); }
.simbolo p { margin: 0; font-size: .98rem; color: var(--ink-soft); }

/* ---------- Cita ---------- */
.cita {
  margin: 2.2rem 0; padding: 1.6rem 1.8rem 1.4rem; border-radius: var(--r-lg);
  background: var(--ink); color: var(--paper); position: relative;
}
.cita p {
  font-family: var(--display); font-size: clamp(1.2rem, 2.6vw, 1.55rem);
  font-style: italic; line-height: 1.4; margin: 0 0 .6rem;
  font-variation-settings: "SOFT" 60, "WONK" 1;
}
.cita cite { font-style: normal; font-size: .94rem; opacity: .72; }
.cita::before {
  content: "\201C"; position: absolute; top: -.15em; right: .25em;
  font-family: var(--display); font-size: 6rem; color: var(--accent); opacity: .55; line-height: 1;
}

/* ---------- Cajas destacadas ---------- */
.nota {
  background: var(--wash); border-radius: var(--r-md); padding: 1.1rem 1.3rem; margin: 1.6rem 0;
  font-size: 1rem;
}
.nota h4 { margin-bottom: .3rem; color: var(--accent); font-size: 1.05rem; }
.nota p:last-child { margin-bottom: 0; }

/* ---------- Índice lateral ---------- */
.toc { background: var(--card); border-radius: var(--r-md); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); }
.toc h4 { font-size: 1rem; margin-bottom: .5rem; color: var(--ink-faint); font-style: italic; font-family: var(--prose); font-weight: 400; }
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: t; }
.toc li { margin-bottom: .3rem; }
.toc a { text-decoration: none; font-size: .97rem; color: var(--ink-soft); }
.toc a:hover { color: var(--accent); }

/* ---------- Noticias ---------- */
.news-list { display: grid; gap: 1.1rem; }
.news-item {
  background: var(--card); border-radius: var(--r-md); padding: 1.3rem 1.5rem;
  box-shadow: var(--shadow); display: grid; grid-template-columns: 116px 1fr; gap: 1.2rem;
}
@media (max-width: 640px) { .news-item { grid-template-columns: 1fr; gap: .4rem; } }
.news-item .fecha { font-style: italic; color: var(--accent); font-size: .95rem; }
.news-item h3 { font-size: 1.22rem; margin-bottom: .35rem; }
.news-item p { margin: 0; color: var(--ink-soft); font-size: 1rem; }
.news-item .fuente { font-size: .86rem; color: var(--ink-faint); margin-top: .5rem; }
.news-item .fuente a { color: var(--ink-faint); }

/* ---------- Personas ---------- */
.people { display: grid; gap: 1.6rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.person {
  background: var(--card); border-radius: var(--r-lg); padding: 1.4rem 1.5rem; box-shadow: var(--shadow);
}
.person .face { width: 74px; height: 74px; margin-bottom: .8rem; }
.person h3 { font-size: 1.3rem; margin-bottom: .1rem; }
.person .rol { font-style: italic; color: var(--accent); font-size: .96rem; margin-bottom: .7rem; }
.person p { font-size: 1rem; color: var(--ink-soft); }

/* ---------- Cronología ---------- */
.timeline { position: relative; padding-left: 1.6rem; }
.timeline::before { content: ""; position: absolute; left: 5px; top: .6rem; bottom: .6rem; width: 3px; background: var(--line); border-radius: 3px; }
.tl-item { position: relative; margin-bottom: 1.3rem; }
.tl-item::before {
  content: ""; position: absolute; left: -1.6rem; top: .5em; width: 13px; height: 13px;
  border-radius: 60% 15% 60% 15%; background: var(--accent); transform: rotate(-10deg);
}
.tl-item b { font-family: var(--display); font-size: 1.05rem; }
.tl-item p { margin: .1rem 0 0; color: var(--ink-soft); font-size: 1rem; }

/* ---------- Tabla ---------- */
.tabla-wrap { overflow-x: auto; margin: 1.6rem 0; border-radius: var(--r-md); box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; background: var(--card); font-size: .98rem; }
th, td { text-align: left; padding: .7rem .9rem; }
thead th { background: var(--ink); color: var(--paper); font-family: var(--display); font-weight: 600; }
tbody tr:nth-child(even) { background: var(--card-2); }

/* ---------- Siguiente / anterior ---------- */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3rem; }
@media (max-width: 620px) { .pager { grid-template-columns: 1fr; } }
.pager a {
  background: var(--card); border-radius: var(--r-md); padding: 1rem 1.2rem;
  text-decoration: none; box-shadow: var(--shadow);
}
.pager a:hover { box-shadow: var(--shadow-lift); }
.pager .dir { font-style: italic; color: var(--ink-faint); font-size: .9rem; display: block; }
.pager .t { font-family: var(--display); font-size: 1.1rem; }
.pager .next { text-align: right; }

/* ---------- Pie ---------- */
.foot { background: var(--ink); color: var(--paper); padding: 3rem 0 2rem; margin-top: 0; }
.foot a { color: var(--paper); }
.foot-grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.foot h4 { color: var(--paper); font-size: 1.05rem; margin-bottom: .6rem; }
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { margin-bottom: .3rem; }
.foot li a { text-decoration: none; opacity: .78; font-size: .97rem; }
.foot li a:hover { opacity: 1; }
.foot .legal { margin-top: 2.2rem; font-size: .88rem; opacity: .6; max-width: 70ch; }

/* ---------- Utilidades ---------- */
.hidden { display: none !important; }
.center { text-align: center; }
.mt0 { margin-top: 0; }
.lead { font-size: 1.16rem; color: var(--ink-soft); }
.tag {
  display: inline-block; background: var(--wash); color: var(--accent);
  border-radius: 999px; padding: .18rem .7rem; font-size: .86rem; margin: 0 .3rem .3rem 0;
  font-style: italic;
}
.skip {
  position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--paper);
  padding: .6rem 1rem; z-index: 200;
}
.skip:focus { left: .5rem; top: .5rem; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ---------- Portada: transición de colinas ---------- */
.hero-hills { margin-top: clamp(2rem, 6vw, 4rem); }
.hero .wrap { position: relative; z-index: 2; }

/* ---------- Chips de preguntas ---------- */
.q-chips { display: flex; flex-wrap: wrap; gap: .7rem; }
.q-chip {
  background: var(--card); border-radius: 999px; padding: .7rem 1.25rem;
  text-decoration: none; box-shadow: var(--shadow); font-size: 1rem;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.q-chip:hover { transform: translateY(-2px) rotate(-.4deg); box-shadow: var(--shadow-lift); background: var(--wash); }

/* ---------- Temas ---------- */
.temas { display: grid; gap: 1.3rem; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.tema-card {
  background: var(--card); border-radius: var(--r-md); overflow: hidden; text-decoration: none;
  box-shadow: var(--shadow); transition: transform .2s ease, box-shadow .2s ease;
  display: flex; flex-direction: column;
}
.tema-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.tema-ico { height: 118px; overflow: hidden; }
.tema-ico svg { width: 100%; height: 100%; }
.tema-card h3 { font-size: 1.16rem; margin: 1rem 1.2rem .25rem; }
.tema-card p { margin: 0 1.2rem 1.2rem; color: var(--ink-soft); font-size: .98rem; }

/* ---------- Buscador de significados ---------- */
.qa-grupos { display: grid; gap: 2.2rem; }
.qa-grupo h3 { font-size: 1.5rem; color: var(--accent); margin-bottom: .8rem; }
.qa-grupo h3 .anio { font-family: var(--prose); font-style: italic; font-size: 1rem; color: var(--ink-faint); font-weight: 400; }
.qa-lista { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.qa-item {
  display: block; text-decoration: none; background: var(--card); border-radius: var(--r-md);
  padding: .95rem 1.15rem; box-shadow: var(--shadow); border-left: 5px solid var(--accent);
}
.qa-item:hover { box-shadow: var(--shadow-lift); }
.qa-item b { display: block; font-family: var(--display); font-size: 1.04rem; margin-bottom: .2rem; font-variation-settings: "SOFT" 40, "WONK" 1; }
.qa-item span { font-size: .93rem; color: var(--ink-soft); }

/* ---------- Significados ocultos ---------- */
.sigs { display: grid; gap: 1.1rem; }
.sig {
  background: var(--card); border-radius: var(--r-md); padding: 1.15rem 1.35rem;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.sig::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 6px; background: var(--accent-3); }
.sig h3 { font-size: 1.15rem; margin: 0 0 .35rem; color: var(--ink); }
.sig p { margin: 0; font-size: 1rem; color: var(--ink-soft); }

/* ---------- FAQ ---------- */
.faqs { display: grid; gap: .7rem; }
.faq {
  background: var(--card); border-radius: var(--r-md); box-shadow: var(--shadow);
  padding: .2rem 1.2rem; overflow: hidden;
}
.faq summary {
  cursor: pointer; list-style: none; padding: .95rem 0; font-family: var(--display);
  font-size: 1.08rem; font-variation-settings: "SOFT" 40, "WONK" 1; display: flex; gap: .6rem; align-items: flex-start;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before {
  content: "?"; flex: none; width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); color: #fff; display: grid; place-items: center;
  font-size: .9rem; margin-top: .15rem;
}
.faq[open] summary { color: var(--accent); }
.faq > div { padding: 0 0 1.1rem 2.1rem; color: var(--ink-soft); font-size: 1rem; }

/* ---------- Lugares ---------- */
.lugares { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.lugar { background: var(--card); border-radius: var(--r-md); padding: 1.3rem 1.5rem; box-shadow: var(--shadow); }
.lugar h3 { font-size: 1.25rem; margin: .4rem 0 .4rem; }
.lugar p { margin: 0; color: var(--ink-soft); font-size: 1rem; }

/* ---------- Página única ---------- */
.page > section:first-child, .page > article:first-child { display: block; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .86em; background: rgba(0,0,0,.06); padding: .1em .35em; border-radius: 4px; }
:root[data-theme="dark"] code { background: rgba(255,255,255,.08); }

/* ---------- Portada v2: arco ---------- */
.hero { padding: clamp(2.2rem, 6vw, 4.5rem) 0 clamp(2rem, 5vw, 3.5rem); background: var(--paper); }
.hero-in { display: grid; grid-template-columns: 1.02fr .98fr; gap: clamp(1.6rem, 4vw, 3.4rem); align-items: center; }
.hero-txt { position: relative; z-index: 2; }
.hero h1 { font-size: clamp(2.5rem, 5.4vw, 4.4rem); max-width: 13ch; }
.hero .entradilla { max-width: 42ch; }
.hero-arco {
  position: relative; aspect-ratio: 4 / 4.6;
  border-radius: 50% 50% 26px 26px / 34% 34% 26px 26px;
  overflow: hidden; box-shadow: var(--shadow-lift);
  transform: rotate(1deg);
}
.hero-arco::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 0 8px var(--paper), inset 0 0 0 10px var(--line);
  border-radius: inherit;
}
.hero-arco svg { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 860px) {
  .hero-in { grid-template-columns: 1fr; }
  .hero-arco { aspect-ratio: 5 / 3.4; border-radius: 40% 40% 20px 20px / 26% 26% 20px 20px; }
}

/* ---------- Subrayado dibujado en los títulos de sección ---------- */
.sec-head h2 { position: relative; display: inline-block; }
.sec-head h2::after {
  content: ""; display: block; height: 10px; margin-top: .28rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='10' viewBox='0 0 240 10'%3E%3Cpath d='M2 7C40 2 78 9 118 5c40-4 78 3 120-1' stroke='%23c2582f' stroke-width='3' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-size: 100% 100%;
  opacity: .55;
}
.sec-head { max-width: 62ch; }

/* ---------- Huecos de imagen que se rellenan solos ---------- */
.poster { position: relative; overflow: hidden; }
.poster .real, .ph .real {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 2;
}
.ph { position: relative; }
.ph .ph-note { z-index: 3; transition: opacity .2s ease; }
.ph.lleno .ph-note { opacity: 0; pointer-events: none; }

/* ---------- Cabecera de ficha: menos aire ---------- */
.film-hero { padding-bottom: clamp(1.5rem, 4vw, 2.6rem); }
.film-hero-in { align-items: center; }
.film-hero + .band { padding-top: clamp(1.6rem, 4vw, 2.6rem); }
.poster-frame { max-width: 300px; margin-left: auto; }
@media (max-width: 860px) { .poster-frame { max-width: 240px; margin: 0 auto; } }
.film-hero .tagline { margin-bottom: .4rem; }

/* ---------- Detalles ---------- */
.band + .band { padding-top: clamp(2.4rem, 5vw, 4rem); }
.crumbs { margin-bottom: .6rem; }
.people .person { transition: transform .18s ease, box-shadow .18s ease; }
.people .person:hover { transform: translateY(-4px) rotate(-.4deg); box-shadow: var(--shadow-lift); }
.hero h1 { font-size: clamp(2.35rem, 4.8vw, 4rem); max-width: 12ch; }

/* ---------- Ficha de película v2 ---------- */
.film-hero { background: var(--wash); padding-bottom: 0; position: relative; }
.film-hero::after { display: none; }
.film-hills { margin-top: clamp(1.4rem, 3vw, 2.2rem); }
.film-hills svg { display: block; }
.film-hero-in { align-items: center; padding-bottom: .5rem; }
.nota-hero { background: color-mix(in oklab, var(--card) 82%, transparent); margin-top: 1.4rem; max-width: 52ch; }
.poster-frame { position: relative; }
.poster-frame .real { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
:root[data-theme="dark"] .film-hero { background: color-mix(in oklab, var(--accent) 16%, var(--paper-deep)); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .film-hero { background: color-mix(in oklab, var(--accent) 16%, var(--paper-deep)); }
}
.film-hills { margin-top: clamp(.8rem, 2vw, 1.4rem); }
.film-hills svg { height: clamp(26px, 3.6vw, 52px); }
.film-hero + .band { padding-top: clamp(.6rem, 2vw, 1.4rem); }

/* ---------- Galería de fotogramas oficiales ---------- */
.galeria { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.galeria img {
  width: 100%; aspect-ratio: 16 / 9; object-fit: cover;
  border-radius: var(--r-md); box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease;
}
.galeria img:hover { transform: translateY(-3px) rotate(-.4deg); box-shadow: var(--shadow-lift); }
.galeria-wrap[hidden] { display: none; }

/* ---------- Cartel oficial en las tarjetas ---------- */
.film-card .poster { aspect-ratio: 5 / 7; }
.poster .real.cartel, .poster-frame .real.cartel {
  object-fit: contain;
  background: color-mix(in oklab, var(--accent) 14%, var(--card));
}
.poster-frame { background: var(--card); }

/* ---------- Proporción exacta del cartel japonés B2 ---------- */
.film-card .poster { aspect-ratio: 750 / 1061; }
.poster-frame svg { aspect-ratio: 750 / 1061; }
.film-card .meta { padding-top: .95rem; }
.film-card .sub { font-variant-numeric: tabular-nums; }

/* ---------- Fotogramas entre secciones ---------- */
.prose .foto { margin: 2.4rem 0; }
.prose .foto img {
  width: 100%; border-radius: var(--r-md); box-shadow: var(--shadow-lift);
  aspect-ratio: 16 / 9; object-fit: cover;
}
@media (min-width: 1100px) {
  .prose .foto { margin-inline: -1.2rem; }
}

/* ---------- Tira y mosaico de carteles ---------- */
.tira { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .5rem; scrollbar-width: thin; }
.tira-item { flex: none; width: 86px; border-radius: 10px 3px 10px 3px; overflow: hidden;
  box-shadow: var(--shadow); transition: transform .16s ease, box-shadow .16s ease; }
.tira-item:hover { transform: translateY(-4px) rotate(-1deg); box-shadow: var(--shadow-lift); }
.tira-item img { width: 100%; aspect-ratio: 750 / 1061; object-fit: cover; }
.tira.mosaico { flex-wrap: wrap; overflow: visible; gap: .6rem; margin-bottom: 2.4rem; }
.tira.mosaico .tira-item { width: 104px; }

/* ---------- Fotogramas fuera de las fichas ---------- */
.prose .foto figcaption, .foto-lugar figcaption {
  font-size: .88rem; color: var(--ink-faint); font-style: italic; margin-top: .45rem;
}
.prose .foto figcaption a { background-size: 100% 1px; }
.foto-lugar { margin: 0 0 1rem; }
.foto-lugar img {
  width: 100%; aspect-ratio: 16 / 9; object-fit: cover;
  border-radius: var(--r-md); box-shadow: var(--shadow);
}
.lugar { display: flex; flex-direction: column; }

/* ---------- Tarjetas de tema con fotograma ---------- */
.tema-ico { position: relative; }
.tema-ico img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---------- Pies de foto de la galería ---------- */
.galeria figure { margin: 0; }
.galeria figcaption { font-size: .84rem; color: var(--ink-faint); font-style: italic; margin-top: .35rem; line-height: 1.35; }
.prose .foto figcaption { font-size: .9rem; }

/* ---------- Dónde verlas ---------- */
.nota-revision { border-left: 5px solid var(--accent); }
.plataformas { display: grid; gap: 1.4rem; }
@media (min-width: 900px) { .plataformas { grid-template-columns: 1fr 1fr; } }
.plat {
  background: var(--card); border-radius: var(--r-lg); padding: 1.4rem 1.6rem;
  box-shadow: var(--shadow);
}
.plat-cab { display: flex; flex-wrap: wrap; align-items: baseline; gap: .6rem 1rem; margin-bottom: .7rem; }
.plat-cab h3 { font-size: 1.5rem; margin: 0; color: var(--accent); }
.plat-meta { display: flex; gap: .4rem; flex-wrap: wrap; }
.plat-que { font-family: var(--display); font-size: 1.08rem; line-height: 1.45; margin-bottom: .9rem; }
.plat p { font-size: .99rem; }
.plat p:last-child { margin-bottom: 0; }
.plat .nota { margin: 1rem 0 0; font-size: .95rem; }
.td-anio { color: var(--ink-faint); font-style: italic; font-weight: 400; }
.td-nota {
  font-family: var(--prose); font-weight: 400; font-size: .89rem; color: var(--ink-faint);
  margin-top: .3rem; line-height: 1.4; max-width: 52ch;
}
tbody th[scope="row"] { font-family: var(--display); font-weight: 600; vertical-align: top; }
tbody th[scope="row"] a { text-decoration: none; }
.plataformas { align-items: start; }
.disp {
  display: inline-block; font-family: var(--display); font-size: .9rem; font-weight: 600;
  padding: .28rem .7rem; border-radius: 999px; line-height: 1.3;
}
.disp.sub { background: color-mix(in oklab, var(--accent) 20%, transparent); color: var(--accent); }
.disp.alq {
  background: color-mix(in oklab, var(--ink) 8%, transparent); color: var(--ink-soft);
  font-weight: 500; font-family: var(--prose); font-style: italic;
}

/* ---------- La ventana de la portada ---------- */
.hero-arco img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 62% center;
}
@media (max-width: 860px) { .hero-arco img { object-position: 60% center; } }
.ventana-pie {
  margin-top: .7rem; font-size: .84rem; font-style: italic; color: var(--ink-faint);
  text-align: center; line-height: 1.4;
}
.ventana-pie a { color: inherit; }
.hero-col { display: flex; flex-direction: column; }
.hero-col .hero-arco { flex: 1 1 auto; }

/* ---------- Retratos reales de los creadores ---------- */
.retrato { display: block; margin-bottom: .9rem; }
.retrato img.face {
  width: 74px; height: 74px; object-fit: cover; object-position: center 26%;
  border-radius: 50%; box-shadow: var(--shadow); margin-bottom: .35rem;
}
.retrato img.face.grande { width: 112px; height: 112px; }
.retrato .credito {
  display: block; font-size: .68rem; line-height: 1.35; color: var(--ink-faint);
  font-style: italic; max-width: 30ch;
}
.retrato .credito a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; }

/* ---------- Documentos: legal y «Sobre esta web» ---------- */
.foot-legal {
  display: flex; flex-wrap: wrap; gap: .3rem .9rem; margin: 2rem 0 .9rem;
  font-size: .92rem; padding-top: 1.2rem; border-top: 1px solid var(--line);
}
.foot-legal a { color: var(--ink-soft); text-decoration: none; }
.foot-legal a:hover { color: var(--accent); text-decoration: underline; }
.prose .firma {
  margin-top: 2.4rem; padding-top: 1.2rem; border-top: 1px solid var(--line);
  font-family: var(--display); font-size: 1.15rem;
}
.prose .firma span { font-family: var(--prose); font-size: .92rem; color: var(--ink-faint); font-style: italic; }
mark.hueco {
  background: #ffe9a8; color: #6b4d00; padding: .05em .35em; border-radius: 4px;
  font-style: normal; font-weight: 600; font-size: .94em;
}
:root[data-theme="dark"] mark.hueco { background: #6b5300; color: #ffeab5; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) mark.hueco { background: #6b5300; color: #ffeab5; }
}
.prose code {
  background: var(--card-2); padding: .1em .4em; border-radius: 5px;
  font-size: .92em; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
