@font-face {
  font-family: "Fraunces";
  src: url("../assets/fonts/fraunces-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Fraunces";
  src: url("../assets/fonts/fraunces-500-italic.woff2") format("woff2");
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Fraunces";
  src: url("../assets/fonts/fraunces-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Work Sans";
  src: url("../assets/fonts/work-sans-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Work Sans";
  src: url("../assets/fonts/work-sans-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

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

html {
  background: var(--cream);
  color: var(--ink);
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.55;
  background:
    linear-gradient(180deg, rgba(166, 124, 78, 0.05), transparent 220px),
    var(--cream);
  color: var(--ink);
  visibility: hidden;
}

body.ready {
  visibility: visible;
}

body.experience:not(.is-open) {
  overflow: hidden;
}

body.is-locked {
  overflow: hidden;
}

img {
  max-width: 100%;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 3px solid var(--burgundy);
  outline-offset: 3px;
}

.book {
  width: min(40rem, 100%);
  margin: 0 auto;
  padding-bottom: calc(6.5rem + env(safe-area-inset-bottom));
}

/* Portada: la foto entera, sin recortar caras, y el título debajo. */

.cover {
  position: fixed;
  inset: 0;
  z-index: 20;
  overflow: auto;
  background: var(--cream);
  color: var(--ink);
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

body.is-open .cover {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.cover-inner {
  width: min(40rem, 100%);
  min-height: 100%;
  min-height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(1.25rem + env(safe-area-inset-bottom));
}

.cover-bar {
  height: 8px;
  background: var(--burgundy);
  flex: none;
}

.cover-school {
  margin: 1.1rem 1.25rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--navy);
}

.cover-photo {
  display: block;
  width: 100%;
  height: auto;
  background: var(--celeste);
}

.cover-copy {
  padding: 1.15rem 1.25rem 0;
}

.cover-kind {
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.35rem;
  color: var(--burgundy);
}

.cover-year {
  margin: 0.05rem 0 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(3.6rem, 18vw, 4.6rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: var(--navy);
}

.cover-course {
  margin: 0.65rem 0 0;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--celeste-deep);
}

.enter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(100% - 2.5rem);
  min-height: 58px;
  margin: auto 1.25rem 0;
  border: 0;
  border-radius: 999px;
  background: var(--navy);
  color: var(--cream);
  font: 600 1.15rem/1 var(--font-body);
  cursor: pointer;
}

.enter:active {
  transform: scale(0.985);
}

.cover-hint {
  margin: 0.75rem 1.5rem 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Interior */

.intro {
  padding: 1.7rem 1.25rem 0.4rem;
}

.eyebrow,
.kicker {
  margin: 0 0 0.35rem;
  color: var(--burgundy);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--navy);
}

h1 {
  font-size: clamp(2.15rem, 8vw, 2.8rem);
  line-height: 1.05;
}

h2 {
  font-size: 1.85rem;
  line-height: 1.15;
}

.lede,
.section-lede,
.help,
.signoff {
  color: var(--ink);
}

.lede {
  margin: 0.9rem 0 0;
  font-size: 1.08rem;
}

.contents {
  display: flex;
  flex-direction: column;
  margin: 1.25rem 0 0;
  border-top: 1px solid var(--line);
}

.contents a {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  min-height: 48px;
  align-items: center;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--navy);
  font-weight: 600;
  text-decoration: none;
}

.contents a span {
  color: var(--burgundy);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
}

.spread {
  padding-top: 2.4rem;
}

.spread-head {
  padding: 0 1.25rem 0.9rem;
}

.rule {
  width: 2.4rem;
  height: 3px;
  margin: 0 0 0.7rem;
  background: var(--burgundy);
  border: 0;
}

.section-lede {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.bleed {
  margin: 0;
}

.bleed img,
.print img {
  display: block;
  width: 100%;
  height: auto;
}

.bleed figcaption,
.print figcaption {
  margin: 0;
  padding: 0.7rem 1.25rem 0;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.05rem;
  line-height: 1.35;
  color: var(--ink);
}

.prints {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  padding: 1.2rem 1.15rem 0;
}

.print {
  margin: 0;
  padding: 0.55rem 0.55rem 0.75rem;
  background: var(--white);
  box-shadow: 0 10px 26px rgba(28, 43, 68, 0.08);
}

.print figcaption {
  padding: 0.6rem 0.25rem 0;
}

.print--snap {
  width: min(18rem, 86%);
  margin-right: auto;
  margin-left: auto;
}

.plate {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.colophon {
  margin: 2.4rem 1.25rem 0;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.95rem;
}

.colophon p {
  margin: 0 0 0.5rem;
}

.colophon a {
  color: var(--celeste-deep);
}

.quiet {
  padding: 1.5rem 1.25rem 2rem;
}

.quiet h1 {
  margin-top: 0.3rem;
}

.quiet .lede {
  margin-top: 0.8rem;
}

.quiet a.back {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  margin-top: 1rem;
  color: var(--navy);
  font-weight: 600;
}

/* Índice de las dos muestras */

.gate {
  width: min(40rem, 100%);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
}

.gate-body {
  padding: 1.6rem 1.25rem 2rem;
}

.gate-links {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 1.4rem;
}

.gate-link {
  display: flex;
  align-items: center;
  min-height: 64px;
  padding: 0.85rem 1.05rem;
  background: var(--white);
  color: var(--navy);
  text-decoration: none;
  border-radius: 14px;
  box-shadow: 0 8px 22px rgba(28, 43, 68, 0.08);
}

.gate-link strong {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 600;
}

/* Fotos en bucle */

.loop-cover {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: var(--loop-bg, var(--navy));
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

body.is-open .loop-cover {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loop-cover > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.loop-start {
  position: absolute;
  left: 50%;
  bottom: max(1.4rem, calc(1.1rem + env(safe-area-inset-bottom)));
  z-index: 2;
  transform: translateX(-50%);
  min-height: 48px;
  padding: 0.7rem 1.75rem;
  border: 1px solid rgba(244, 236, 222, 0.38);
  border-radius: 999px;
  background: rgba(28, 43, 68, 0.46);
  color: #f6f0e6;
  font: 600 1.05rem/1 var(--font-body);
  letter-spacing: 0.02em;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(12, 18, 28, 0.28);
}

.loop-start:active {
  transform: translateX(-50%) scale(0.98);
}

.loop-panel {
  position: relative;
  z-index: 1;
  padding: 2.5rem 1.25rem calc(1.15rem + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(28, 43, 68, 0) 0%, rgba(28, 43, 68, 0.92) 28%, var(--loop-bg, var(--navy)) 100%);
  color: var(--cream);
  text-align: center;
}

.loop-school {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--celeste);
}

.loop-title {
  margin: 0.35rem 0 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.4rem, 10vw, 3.2rem);
  line-height: 1;
  letter-spacing: -0.03em;
}

.loop-line {
  margin: 0.45rem 0 0;
  font-size: 1.05rem;
}

.enter--light {
  background: var(--cream);
  color: var(--navy);
}

.loop-stage {
  position: fixed;
  inset: 0;
  background: var(--loop-bg, var(--navy));
  opacity: 0;
  visibility: hidden;
}

body.is-open .loop-stage {
  opacity: 1;
  visibility: visible;
}

.loop-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.9s ease;
}

.loop-slide.is-on {
  opacity: 1;
}

/* Música */

.mute {
  display: none;
  position: fixed;
  z-index: 50;
  right: 0.9rem;
  bottom: calc(0.9rem + env(safe-area-inset-bottom));
  align-items: center;
  gap: 0.45rem;
  min-height: 48px;
  padding: 0.4rem 0.95rem 0.4rem 0.7rem;
  border: 0;
  border-radius: 999px;
  background: var(--white);
  color: var(--navy);
  font: 600 0.98rem/1 var(--font-body);
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(28, 43, 68, 0.18);
}

body.is-open .mute {
  display: inline-flex;
}

.mute svg {
  display: block;
}

/* Visor */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  background: #172033;
  color: var(--cream);
}

.lightbox[hidden] {
  display: none;
}

.lightbox-top {
  display: flex;
  justify-content: flex-end;
  padding: calc(0.7rem + env(safe-area-inset-top)) 0.7rem 0;
}

.close-photo,
.nav-photo {
  border: 0;
  background: rgba(255, 252, 248, 0.14);
  color: var(--cream);
  cursor: pointer;
}

.close-photo {
  min-height: 48px;
  padding: 0 1rem;
  border-radius: 999px;
  font: 600 1rem/1 var(--font-body);
}

.lightbox-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}

.lightbox-stage img {
  max-width: calc(100% - 0.6rem);
  max-height: 100%;
  object-fit: contain;
}

.nav-photo {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 1.8rem;
  line-height: 1;
}

.nav-photo.prev { left: 0.4rem; }
.nav-photo.next { right: 0.4rem; }

.lightbox-caption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 0;
  padding: 0.8rem 1rem calc(5.2rem + env(safe-area-inset-bottom));
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.02rem;
}

.lightbox-caption span:last-child {
  flex: none;
  font-family: var(--font-body);
  font-style: normal;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  color: var(--celeste);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
