/* Hallmark v2.0.0 · theme: midnight (manual pick, no Node) · accent: the logo's gold, by the school's own mark · shape: an auto-playing camera move (crest recedes on white → aerial facade at night → the entrance → the stage being set) that closes on the welcome words; the programme and the farewell follow on scroll · signature: one continuous dolly into the Teatro Biobío, from frames of the user's own video */
/* critique: a slideshow would kill it, so each frame starts whole and far and the camera pushes toward one point until the next takes over. Audience is parents on phones: 18px body, big targets, one button to jump ahead, nothing to learn. */
/* waive 44b: the user asked for the crest and an automatic film before the page. waive 27: the user asked that the film play on every phone, so it ignores reduced motion; the jump button stays on screen the whole time. */

:root {
  --color-paper: oklch(17% 0.05 262);
  --color-paper-2: oklch(21% 0.055 262);
  --color-paper-3: oklch(26% 0.058 262);
  --color-ink: oklch(97% 0.01 250);
  --color-ink-2: oklch(89% 0.03 250);
  --color-muted: oklch(76% 0.035 256);
  --color-rule: oklch(33% 0.058 262);
  --color-rule-2: oklch(45% 0.06 262);
  --color-accent: oklch(82% 0.11 85);
  --color-accent-2: oklch(70% 0.11 80);
  --color-accent-ink: oklch(18% 0.05 262);
  --color-accent-wash: oklch(82% 0.11 85 / 0.1);
  --color-focus: oklch(88% 0.12 85);
  --color-white: oklch(100% 0 0);
  --color-glow: oklch(85% 0.12 85 / 0.55);
  --color-sheen-0: oklch(100% 0 0 / 0);
  --color-shade-soft: oklch(12% 0.045 262 / 0.6);
  --color-shade-0: oklch(12% 0.045 262 / 0);
  --color-glass: oklch(14% 0.045 262 / 0.72);
  --color-night: oklch(9% 0.03 262);
  --color-panel: oklch(14% 0.045 262 / 0.9);

  --font-display: "Mona Sans", ui-sans-serif, system-ui, sans-serif;
  --font-body: var(--font-display);

  --text-s: 1rem;
  --text-m: 1.125rem;
  --text-l: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  --text-display-s: clamp(1.9rem, 1.4rem + 2.2vw, 3rem);
  --text-display: clamp(2.7rem, 1.6rem + 5vw, 5.5rem);

  --space-xs: 0.5rem; --space-sm: 0.75rem; --space-md: 1.25rem;
  --space-lg: 2rem; --space-xl: 3.5rem; --space-2xl: clamp(4.5rem, 3rem + 6vw, 8rem);

  --container: 46rem;
  --dur-short: 180ms;
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-m);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.is-playing body { overflow: hidden; }
img { display: block; max-width: 100%; }
h1, h2, p { margin: 0; }
h1, h2 {
  font-family: var(--font-display);
  font-weight: 300;
  font-stretch: 125%;
  letter-spacing: -0.015em;
  line-height: 1.08;
  overflow-wrap: break-word;
  min-width: 0;
}
a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 4px; transition: none; }

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

.crest { aspect-ratio: 1; border-radius: 50%; background: var(--color-white); padding: 1.5%; overflow: hidden; }
.crest img { width: 100%; height: 100%; object-fit: contain; }

/* =========================================================
   PRESENTACIÓN AUTOMÁTICA (la mueve el script cuadro a cuadro)
   ========================================================= */
.cine {
  position: fixed; inset: 0;
  height: 100vh; height: 100dvh;
  z-index: 50;
  background: var(--color-night);
  overflow: hidden;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.9s ease, visibility 0s linear 0.9s;
}
.is-playing .cine { opacity: 1; visibility: visible; pointer-events: auto; transition: none; }

.cine__white { position: absolute; inset: 0; background: var(--color-white); z-index: 4; }

.shot { position: absolute; inset: 0; overflow: hidden; opacity: 0; z-index: 1; }
.shot__back {
  position: absolute; inset: -10%;
  width: 120%; height: 120%; max-width: none;
  object-fit: cover;
  filter: blur(28px) brightness(0.4);
}
.shot__img {
  position: absolute; left: 0; top: 0;
  max-width: none;
  transform-origin: 0 0;
  will-change: transform;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.cine__vignette {
  position: absolute; inset: 0; z-index: 5;
  background: radial-gradient(ellipse at center, var(--color-shade-0) 50%, var(--color-shade-soft) 100%);
  opacity: 0;
  pointer-events: none;
}
.cine__dim { position: absolute; inset: 0; z-index: 5; background: var(--color-night); opacity: 0; }

.cine__crest {
  position: absolute;
  top: 50%; left: 50%;
  z-index: 6;
  width: min(80vw, 62vh);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--color-white);
  padding: 1.5%;
  overflow: hidden;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.82);
  will-change: transform, opacity;
}
.cine__crest img { width: 100%; height: 100%; object-fit: contain; }
.cine__crest::after {
  content: "";
  position: absolute; inset: -20%;
  background: linear-gradient(105deg, var(--color-sheen-0) 40%, var(--color-glow) 50%, var(--color-sheen-0) 60%);
  transform: translateX(-120%);
}
.cine__crest.is-shine::after { animation: sheen 1.5s ease-in-out both; }
@keyframes sheen { to { transform: translateX(120%); } }

/* Interior: fragmentos del video */
.clip { position: absolute; inset: 0; z-index: 0; overflow: hidden; opacity: 0; background: var(--color-night); }
#shotDron, #shotIn1, #shotIn2 { z-index: 2; }
#shotDron .shot__back { display: none; }
.clip video { width: 100%; height: 100%; object-fit: cover; object-position: 32% 50%; display: block; transform-origin: 50% 55%; will-change: transform; }
#shotSala { z-index: 3; }

/* Bienvenida dentro de la presentación: frase por frase, palabra por palabra */
.cine__welcome {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  z-index: 6;
  display: flex; align-items: center; justify-content: center;
  padding: 1.25rem 1.25rem 6.5rem;
  pointer-events: none;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}
/* Panel oscuro para que el texto se lea sobre la foto */
.card {
  position: absolute;
  left: 50%; top: 46%;
  width: min(100% - 2.5rem, 34rem);
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  gap: 0.6rem;
  padding: 2rem 1.5rem;
  text-align: center;
  background: var(--color-panel);
  border: 1px solid var(--color-accent-2);
  border-radius: 20px;
  box-shadow: 0 24px 60px -12px var(--color-night);
  opacity: 0;
  transform: translate(-50%, -46%) scale(0.96);
  transition: opacity 0.8s ease, transform 0.9s var(--ease-out);
}
.card.on { opacity: 1; transform: translate(-50%, -50%); }
.card.out { opacity: 0; transform: translate(-50%, -56%); transition-duration: 0.7s; }
.card > p { max-width: 100%; }
.word {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.6em);
  transition: opacity 0.6s ease, transform 0.8s var(--ease-out);
  transition-delay: var(--d, 0s);
}
.card.on .word { opacity: 1; transform: none; }
.card__pre { font-size: 1.25rem; font-weight: 500; color: var(--color-ink-2); }
.card__title { font-size: clamp(2.6rem, 2rem + 4vw, 4.5rem); font-weight: 400; font-stretch: 112%; line-height: 1.05; color: var(--color-ink); }
.card__gen { font-size: clamp(1.6rem, 1.3rem + 2vw, 2.5rem); font-weight: 500; color: var(--color-accent); line-height: 1.15; }
.card__date { font-size: 1.125rem; font-weight: 500; color: var(--color-ink); margin-top: 0.25rem; padding-top: 0.75rem; border-top: 1px solid var(--color-rule-2); }
.card__text { font-size: clamp(1.35rem, 1.15rem + 1vw, 1.85rem); font-weight: 500; line-height: 1.45; color: var(--color-ink); }
.card__text .word:first-child { color: var(--color-accent); }

.cine__dark { position: absolute; inset: 0; z-index: 7; background: var(--color-paper); opacity: 0; }

.cine__bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; z-index: 8; }
.cine__bar span { display: block; height: 100%; background: var(--color-accent); transform: scaleX(0); transform-origin: left; }

.skip { display: none; }
.is-playing .skip {
  display: block;
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 1.5rem);
  transform: translateX(-50%);
  min-height: 3.25rem;
  padding: 0 1.75rem;
  border: 1px solid var(--color-rule-2);
  border-radius: 999px;
  background: var(--color-glass);
  color: var(--color-ink);
  font: 500 var(--text-s) / 1 var(--font-body);
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out);
}
.skip:hover { background: var(--color-paper-3); border-color: var(--color-accent); }
.skip:active { background: var(--color-paper-2); }

/* =========================================================
   PÁGINA
   ========================================================= */
.js:not(.is-done) .enter { opacity: 0; }
.is-done .enter { animation: enter 1s var(--ease-out) calc(var(--i, 0) * 160ms + 200ms) both; }
@keyframes enter { from { opacity: 0; transform: translateY(1.5rem); } }

.reveal { opacity: 0; transform: translateY(1.75rem); transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out); }
.reveal.is-in { opacity: 1; transform: none; }

/* Encabezado */
.top {
  position: relative;
  isolation: isolate;
  min-height: 100vh; min-height: 100svh;
  display: grid;
  align-items: center;
  padding: var(--space-xl) 0 var(--space-lg);
  overflow: hidden;
  text-align: center;
}
.top__bg { position: absolute; inset: 0; z-index: -1; }
.top__bg img { width: 100%; height: 100%; object-fit: cover; opacity: 0.5; }
.is-done .top__bg img { animation: drift 18s ease-out both; }
@keyframes drift { from { transform: scale(1.35); } to { transform: scale(1.08); } }
.top__bg::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, var(--color-shade-soft), var(--color-shade-0) 35%, var(--color-paper) 100%);
}
.top__inner { width: min(100% - 2.5rem, var(--container)); margin-inline: auto; display: grid; justify-items: center; gap: var(--space-md); }
.crest--top { width: clamp(8rem, 32vw, 11rem); box-shadow: 0 0 0 6px var(--color-shade-soft), 0 0 56px 6px var(--color-glow); }
.top__title { font-size: var(--text-display); display: grid; gap: var(--space-xs); }
.top__title > span { display: block; }
.top__sub { font-size: var(--text-display-s); color: var(--color-accent); }
.top__date {
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--color-accent-2);
  border-radius: 999px;
  font-weight: 500;
  font-size: var(--text-s);
  line-height: 1.3;
}
.hint {
  margin-top: var(--space-lg);
  display: grid;
  justify-items: center;
  gap: 0.25rem;
  padding: var(--space-sm) var(--space-md);
  text-decoration: none;
  color: var(--color-accent);
  font-weight: 500;
  -webkit-tap-highlight-color: transparent;
}
.hint:hover span { text-decoration: underline; text-underline-offset: 4px; }
.is-done .hint__arrow { animation: nudge 1.6s ease-in-out 2s infinite; }
@keyframes nudge { 50% { transform: translateY(8px); } }

/* Programa */
.program { padding: var(--space-xl) 0 var(--space-2xl); }
.program__head { text-align: center; display: grid; gap: var(--space-xs); margin-bottom: var(--space-xl); }
.program__head h2 { font-size: var(--text-display); }
.program__head p { color: var(--color-accent); font-weight: 500; }

.steps { list-style: none; margin: 0; padding: 0; position: relative; display: grid; gap: var(--space-sm); }
.steps::before {
  content: "";
  position: absolute;
  left: 1.75rem; top: 2rem; bottom: 2rem;
  width: 2px;
  background: linear-gradient(to bottom, var(--color-accent), var(--color-rule-2) 50%, var(--color-accent));
}
.step {
  position: relative;
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr);
  align-items: center;
  gap: var(--space-md);
}
.step__icon {
  width: 3.5rem; height: 3.5rem;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--color-paper);
  border: 2px solid var(--color-rule-2);
  color: var(--color-ink-2);
  position: relative;
  z-index: 1;
}
.step__icon svg { width: 1.6rem; height: 1.6rem; }
.step__body {
  display: grid;
  gap: 0.125rem;
  padding: var(--space-md) var(--space-md);
  background: var(--color-paper-2);
  border-radius: 14px;
  min-width: 0;
}
.step__n { font-size: var(--text-s); font-weight: 600; color: var(--color-muted); font-variant-numeric: tabular-nums; }
.step__t { font-size: 1.1875rem; line-height: 1.3; font-weight: 500; }
.step__course { font-size: var(--text-display-s); font-weight: 300; font-stretch: 125%; line-height: 1.1; color: var(--color-accent); }

.step--key .step__icon { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-ink); }
.step--key .step__body { background: var(--color-accent-wash); box-shadow: inset 0 0 0 1px var(--color-accent-2); }
.step--key .step__n { color: var(--color-accent); }

.step--flag .step__icon svg { width: 2.2rem; height: 2.2rem; }
.step--logo .step__icon { border-color: var(--color-accent-2); padding: 3px; overflow: hidden; }
.step--logo .step__icon img { width: 100%; height: 100%; object-fit: contain; }
.step--slep .step__icon { padding: 0 5px; }
.step__logo { width: 7.5rem; max-width: 100%; height: auto; margin-top: var(--space-xs); }

.step--light .step__icon { border-color: var(--color-accent); color: var(--color-accent); }
.step--light .step__icon::after {
  content: "";
  position: absolute; inset: -6px;
  border-radius: 50%;
  box-shadow: 0 0 20px 6px var(--color-glow);
  opacity: 0.4;
  animation: candle 2.6s ease-in-out infinite alternate;
}
.step--light .step__t { color: var(--color-accent); }
@keyframes candle { to { opacity: 1; transform: scale(1.08); } }

.step.reveal { transform: translateX(-1.5rem); }
.step.reveal.is-in { transform: none; }
.step.reveal.is-in .step__icon { animation: pop 0.7s var(--ease-out) 0.15s both; }
@keyframes pop { from { transform: scale(0.4); opacity: 0; } }

/* Despedida */
.farewell {
  position: relative;
  isolation: isolate;
  min-height: 100vh; min-height: 100svh;
  display: grid;
  align-items: center;
  overflow: hidden;
  padding: var(--space-2xl) 0;
}
.farewell__bg { position: absolute; inset: 0; z-index: -2; }
.farewell__bg img { width: 100%; height: 100%; object-fit: cover; opacity: 0.4; }
.farewell__bg::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, var(--color-paper), var(--color-shade-soft) 40%, var(--color-paper) 100%);
}
.farewell__glow { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.farewell__glow span {
  position: absolute;
  bottom: 10%;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 16px 4px var(--color-glow);
  opacity: 0;
  animation: rise 7s ease-out infinite;
}
.farewell__glow span:nth-child(1) { left: 12%; animation-delay: 0s; }
.farewell__glow span:nth-child(2) { left: 28%; animation-delay: 2.2s; }
.farewell__glow span:nth-child(3) { left: 46%; animation-delay: 1s; }
.farewell__glow span:nth-child(4) { left: 62%; animation-delay: 3.4s; }
.farewell__glow span:nth-child(5) { left: 78%; animation-delay: 1.6s; }
.farewell__glow span:nth-child(6) { left: 90%; animation-delay: 4.2s; }
@keyframes rise {
  0% { opacity: 0; transform: translateY(0); }
  20% { opacity: 0.9; }
  100% { opacity: 0; transform: translateY(-80vh); }
}
.farewell__inner { display: grid; gap: var(--space-md); text-align: center; font-size: var(--text-l); line-height: 1.55; color: var(--color-ink-2); }
.farewell__inner h2 { font-size: var(--text-display-s); color: var(--color-ink); margin-bottom: var(--space-sm); }

/* Pie */
.foot {
  padding: var(--space-xl) 1.25rem calc(var(--space-xl) + env(safe-area-inset-bottom, 0px));
  display: grid;
  justify-items: center;
  gap: var(--space-xs);
  text-align: center;
  border-top: 1px solid var(--color-rule);
}
.foot__logos { display: flex; align-items: center; justify-content: center; gap: var(--space-md); margin-bottom: var(--space-md); }
.foot__escudo { width: 6rem; height: auto; }
.foot__slep { width: 9.5rem; height: auto; }
.foot__sep { width: 1px; align-self: stretch; background: var(--color-rule-2); }
.foot__name { font-size: var(--text-l); font-weight: 500; }
.foot__meta { color: var(--color-muted); }
.foot__actions { margin-top: var(--space-lg); display: grid; gap: var(--space-sm); width: min(100%, 22rem); }
.btn {
  display: flex; align-items: center; justify-content: center;
  min-height: 3.25rem;
  padding: 0 var(--space-lg);
  border: 1px solid var(--color-rule-2);
  border-radius: 999px;
  background: none;
  color: var(--color-ink);
  font: 500 var(--text-s) / 1.2 var(--font-body);
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out);
}
.btn:hover { background: var(--color-paper-2); }
.btn:active { background: var(--color-paper-3); }
.btn--primary { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-ink); }
.btn--primary:hover { background: var(--color-focus); }
.btn--primary:active { background: var(--color-accent-2); }

@media (min-width: 48rem) {
  .steps::before { left: 2rem; }
  .step { grid-template-columns: 4rem minmax(0, 1fr); gap: var(--space-lg); }
  .step__icon { width: 4rem; height: 4rem; }
  .step__body { padding: var(--space-md) var(--space-lg); }
  .step__t { font-size: var(--text-l); }
}
