/* =========================================================
   PABLO MAZZOLA · capa de tema sobre Rider7
   ========================================================= */

@font-face {
  font-family: "PM Hurricane";
  src: url("fonts/hurricane.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}
/* La misma fuente con el nombre de Google Fonts: los títulos (config.txt) no dependen de que cargue Google */
@font-face {
  font-family: "Hurricane";
  src: local("Hurricane"), local("Hurricane-Regular"), url("fonts/hurricane.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --pm-bg: #0d0b0a;
  --pm-cycle: 40s;
  --pm-name-scale: 1;
  --pm-ink: #f1e9dc;
  /* Etiquetas chicas (número de sección, menú): la tipografía de texto de config.txt */
  --pm-ui: var(--font-body);
}

/* ---------- Portada (nombre) ---------- */
body.pm-home { overflow: hidden; }
body.pm-home .site-header,
body.pm-home main,
body.pm-home .site-footer,
body.pm-home .wa-float { visibility: hidden; }

.pm-landing {
  position: fixed; inset: 0; z-index: 80;
  background: var(--pm-bg);
  color: var(--pm-ink);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .6s var(--ease), visibility 0s linear .6s;
  overflow: hidden;
}
.pm-landing.is-on { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity .6s var(--ease), visibility 0s; }

.pm-bg { position: absolute; inset: 0; background: var(--pm-bg); }
.pm-landing.has-cycle .pm-bg { animation: pmCycle var(--pm-cycle) ease-in-out infinite alternate; }
.pm-bg::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 90% at 85% 100%, rgba(233, 180, 95, .06), transparent 55%);
}

/* Portada de la sección señalada, muy desenfocada, de fondo */
.pm-preview { position: absolute; inset: 0; }
.pm-preview img {
  position: absolute; inset: -10%; width: 120%; height: 120%; max-width: none; object-fit: cover;
  filter: blur(50px) saturate(1.1) brightness(.6);
  opacity: 0; transform: scale(1.06);
  transition: opacity 1.6s var(--ease), transform 6s linear;
}
.pm-preview img.on { opacity: .32; transform: scale(1); }
.pm-preview::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 30% 40%, transparent 10%, rgba(0, 0, 0, .55) 85%);
}

/* Grano de película, apenas */
.pm-grain {
  position: absolute; inset: -50%; pointer-events: none; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1.1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: pmGrain .9s steps(6) infinite;
  mix-blend-mode: overlay;
}
body.pm-no-grain .pm-grain { display: none; }
@keyframes pmGrain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-6%, 4%); } 40% { transform: translate(5%, -7%); }
  60% { transform: translate(-3%, 8%); } 80% { transform: translate(7%, 2%); } 100% { transform: translate(0, 0); }
}

/* ---------- Proyector (solo al pasar el mouse por una sílaba) ---------- */
.pm-screen {
  position: absolute; margin: 0;
  left: clamp(24px, 7vw, 120px); top: clamp(32px, 11vh, 120px);
  width: min(40vw, calc(44vh * 16 / 9)); aspect-ratio: 16 / 9;
  background: #030303; overflow: hidden;
  opacity: 0; transform: scale(.99);
  transition: opacity .8s var(--ease), transform 1.2s var(--ease);
  box-shadow: 0 40px 80px rgba(0, 0, 0, .5);
}
.pm-screen.on { opacity: .92; transform: none; }
.pm-screen img {
  position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover;
  filter: sepia(.12) brightness(.95);
  opacity: 0; transform: scale(1.03);
  transition: opacity .9s var(--ease), transform 7s linear;
}
.pm-screen img.on { opacity: 1; transform: scale(1); }
.pm-screen::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, .45) 100%);
}
.pm-screen-cap {
  position: absolute; left: 16px; bottom: 12px; z-index: 2;
  font-family: var(--pm-ui); font-size: .78rem; letter-spacing: .2em; text-transform: uppercase;
  color: rgba(255, 245, 228, .75);
}
.pm-beam {
  position: absolute; inset: 0; pointer-events: none;
  filter: blur(12px); opacity: 0; mix-blend-mode: screen;
  transition: opacity .8s var(--ease);
}
.pm-beam.on { opacity: 1; }
.pm-beam-in {
  position: absolute; inset: 0;
  background: radial-gradient(circle at var(--bx, 80%) var(--by, 90%), rgba(255, 228, 176, .16), rgba(255, 228, 176, .05) 30%, rgba(255, 228, 176, .015) 65%, transparent 85%);
}

/* ---------- Esquina inferior derecha ---------- */
.pm-corner {
  position: absolute;
  right: max(clamp(18px, 4vw, 64px), env(safe-area-inset-right));
  bottom: max(clamp(10px, 3.2vh, 44px), env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: flex-end;
  max-width: calc(100vw - 32px);
}
.pm-name {
  font-family: var(--pm-name-font, "PM Hurricane"), "PM Hurricane", cursive;
  font-weight: 400;
  font-size: calc(clamp(4rem, 10.5vw, 11.5rem) * var(--pm-name-scale));
  line-height: .95;
  white-space: nowrap;
  text-align: right;
  color: var(--pm-ink);
  transform-origin: 50% 50%;
  transition: transform 1.3s cubic-bezier(.65, 0, .25, 1);
  will-change: transform;
  -webkit-font-smoothing: antialiased;
  padding: 0 .08em;
}
.pm-word { display: inline-block; }
.pm-part {
  color: inherit; text-decoration: none; cursor: pointer; outline: none;
  transition: color .45s var(--ease), opacity .45s var(--ease), text-shadow .6s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.pm-part.is-idle { cursor: default; }
.pm-name.has-hot .pm-part { opacity: .3; }
.pm-name.has-hot .pm-part.pm-hot,
.pm-part.pm-hot { opacity: 1; color: var(--accent); text-shadow: 0 0 .35em rgba(233, 180, 95, .4); }
.pm-part.pm-tour { color: color-mix(in srgb, var(--accent) 55%, var(--pm-ink)); }
.pm-part:focus-visible { outline: 1px dashed color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: 4px; }

/* Nombre dibujado (SVG): cada sílaba es un enlace con su área para tocar */
.pm-svgw { display: inline-block; vertical-align: bottom; overflow: visible; fill: currentColor; stroke: none; stroke-width: 0; }
.pm-svgw .pm-hit { fill: transparent; stroke: none; }
.pm-svgw .pm-g { fill: currentColor; stroke: currentColor; stroke-width: 0; stroke-linejoin: round; stroke-linecap: round; }
.pm-svgw .pm-part { transition: color .45s var(--ease), opacity .45s var(--ease); }
.pm-svgw .pm-part:focus-visible { outline: none; }
.pm-svgw .pm-part:focus-visible .pm-hit { stroke: var(--accent); stroke-width: 3; stroke-dasharray: 12 10; }

/* Escritura con trazo: primero el contorno de cada letra, después la tinta */
.pm-writing .pm-name.is-svg .pm-g {
  fill-opacity: 0;
  stroke-width: 9;
  stroke-dasharray: 1 1;
  stroke-dashoffset: 1;
  animation:
    pmDraw .75s cubic-bezier(.55, .1, .35, 1) var(--d) forwards,
    pmInk .5s ease-out calc(var(--d) + .45s) forwards;
}
@keyframes pmDraw { to { stroke-dashoffset: 0; } }
@keyframes pmInk { to { fill-opacity: 1; stroke-width: 0; } }

/* Si el nombre es texto común, se escribe con un barrido de izquierda a derecha */
.pm-writing .pm-name:not(.is-svg) {
  -webkit-mask-image: linear-gradient(90deg, #000 45%, transparent 55%);
  mask-image: linear-gradient(90deg, #000 45%, transparent 55%);
  -webkit-mask-size: 220% 100%; mask-size: 220% 100%;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  animation: pmWrite 2s cubic-bezier(.45, .05, .35, 1) forwards;
}
.pm-moving .pm-name { -webkit-mask-image: none; mask-image: none; }
@keyframes pmWrite {
  from { -webkit-mask-position: 100% 0; mask-position: 100% 0; }
  to { -webkit-mask-position: 0 0; mask-position: 0 0; }
}

/* Etiqueta: número y nombre de la sección */
.pm-label {
  font-family: var(--pm-ui);
  font-size: clamp(.8rem, 1.1vw, .95rem); font-weight: 500;
  letter-spacing: .24em; text-transform: uppercase;
  display: flex; gap: 1em; align-items: baseline;
  margin-bottom: .3em; margin-right: .5em;
  opacity: 0; transform: translateY(6px);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.pm-label.on { opacity: .85; transform: none; }
.pm-label-n { color: var(--accent); }
.pm-hint {
  font-family: var(--pm-ui); font-style: italic;
  font-size: .9rem; letter-spacing: .06em;
  margin: .3em .6em 0 0; opacity: .5;
  transition: opacity .8s var(--ease);
}
.pm-hint.gone, .pm-hint:empty { opacity: 0; }

/* Antes de la intro: nada a la vista */
.pm-landing:not(.pm-ready):not(.pm-writing) .pm-name { opacity: 0; }
.pm-landing:not(.pm-ready) .pm-label,
.pm-landing:not(.pm-ready) .pm-hint { opacity: 0; }
.pm-landing.pm-ready .pm-hint:not(.gone) { animation: pmHint 1.2s var(--ease) both .4s; }
@keyframes pmHint { from { opacity: 0; } to { opacity: .5; } }

/* Celular vertical: el nombre en dos renglones, más grande */
@media (max-aspect-ratio: 4/5) {
  .pm-name { font-size: calc(clamp(4.2rem, 25vw, 10rem) * var(--pm-name-scale)); line-height: .82; }
  .pm-word { display: block; }
  .pm-svgw { display: inline-block; margin-top: -.08em; }
  .pm-label { margin-bottom: .6em; }
}

/* ---------- Transición de iris con cartel ---------- */
.pm-iris {
  position: fixed; inset: 0; z-index: 90; pointer-events: none;
  background: #050404; visibility: hidden;
  clip-path: circle(0 at var(--x, 50%) var(--y, 50%));
}
.pm-iris img {
  position: absolute; inset: -10%; width: 120%; height: 120%; max-width: none; object-fit: cover;
  filter: blur(30px) brightness(.5) saturate(1.1);
}
.pm-iris.open {
  visibility: visible; pointer-events: auto;
  clip-path: circle(150vmax at var(--x, 50%) var(--y, 50%));
  transition: clip-path .75s cubic-bezier(.7, 0, .3, 1);
}
.pm-iris.fade { opacity: 0; transition: clip-path .75s, opacity .7s var(--ease); }
.pm-iris-t {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .4em; text-align: center; padding: 0 6vw;
  opacity: 0; transform: translateY(10px);
}
.pm-iris.open .pm-iris-t { opacity: 1; transform: none; transition: opacity .6s var(--ease) .35s, transform .9s var(--ease) .35s; }
.pm-iris-t small { font-family: var(--pm-ui); font-size: .85rem; letter-spacing: .3em; color: var(--accent); }
.pm-iris-t span {
  font-family: var(--pm-name-font, "PM Hurricane"), "PM Hurricane", cursive;
  font-size: clamp(3.4rem, 11vw, 9rem); line-height: 1; color: var(--pm-ink);
  border-top: 1px solid rgba(241, 233, 220, .22); border-bottom: 1px solid rgba(241, 233, 220, .22);
  padding: .1em .5em .05em;
}

/* ---------- Secciones (Rider7 con este tema) ---------- */
.brand-text {
  font-family: var(--pm-name-font, "PM Hurricane"), var(--font-title);
  font-size: calc(2.4rem * var(--pm-name-scale));
  font-weight: 400; line-height: 1; letter-spacing: 0;
  padding: 0 .1em;
}
.brand:hover .brand-text { color: var(--accent); }
.nav-list a { font-family: var(--pm-ui); font-size: .82rem; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; }
.nav-list a.active { background: transparent; color: var(--accent); box-shadow: inset 0 -1px 0 var(--accent); border-radius: 0; }
.book-title { font-family: var(--pm-ui); letter-spacing: .18em; text-transform: uppercase; font-size: .8rem; font-weight: 500; }
.book-holder { filter: drop-shadow(0 30px 50px rgba(0, 0, 0, .6)); }

/* Texto y video de cada sección */
.pm-extra {
  scroll-margin-top: calc(var(--header-h) + 20px);
  width: 100%; max-width: 62ch; margin: clamp(48px, 9vh, 96px) auto clamp(56px, 10vh, 110px);
  padding: 0 22px;
}
.pm-video {
  position: relative; aspect-ratio: 16 / 9; margin: 0 auto 56px;
  background: #000; border-radius: 4px; overflow: hidden;
  box-shadow: 0 30px 60px rgba(0, 0, 0, .5);
}
.pm-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.pm-text { font-size: 1.22rem; line-height: 1.7; }
.pm-text h2 {
  font-size: calc(clamp(2.6rem, 6vw, 4.2rem) * var(--title-scale) * .6);
  color: var(--accent); margin: 0 0 .35em; line-height: 1;
}
.pm-text h3 {
  font-family: var(--pm-ui); font-size: .85rem; font-weight: 600; letter-spacing: .22em; text-transform: uppercase;
  margin: 2.2em 0 .8em; color: var(--muted);
}
.pm-text p { margin: 0 0 1.1em; }
.pm-text ul { list-style: none; padding: 0; margin: 0 0 1.3em; }
.pm-text li { position: relative; padding-left: 1.4em; margin-bottom: .6em; }
.pm-text li::before {
  content: ""; position: absolute; left: .2em; top: .75em;
  width: .4em; height: 1px; background: var(--accent);
}
.pm-text a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; overflow-wrap: anywhere; }

/* Cabecera lateral en celular: el menú bien a la derecha */
body:not(.header-centered).nav-compact .hdr-left { margin-left: auto; }

/* Pie */
.footer-inner h2 { font-size: calc(clamp(2.2rem, 5vw, 3.2rem) * var(--title-scale) * .7); font-weight: 400; }
.footer-text { font-size: 1.1rem; }
.contact-list a { font-size: 1rem; }

@media (prefers-reduced-motion: reduce) {
  .pm-grain, .pm-landing.has-cycle .pm-bg { animation: none !important; }
}
