/* shared museum styles — typography, mute toggle, back link */
@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;1,400;1,500&family=JetBrains+Mono:wght@300;400&display=swap');

:root {
  --paper: #ede4d3;
  --paper-warm: #f5ecd9;
  --ink: #5a2a2a;
  --ink-soft: #8a4a4a;
  --accent: #d4a574;
  --serif: 'EB Garamond', Georgia, serif;
  --mono: 'JetBrains Mono', 'Courier New', monospace;
}

/* navigation links — top-left back to museum, top-right title */
.museum-back {
  position: fixed;
  top: calc(20px + env(safe-area-inset-top));
  left: calc(22px + env(safe-area-inset-left));
  z-index: 1000;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 3px;
  text-decoration: none;
  padding: 7px 13px;
  text-transform: uppercase;
  border: 1px dotted currentColor;
  transition: opacity .25s, transform .25s;
  opacity: 0.55;
}
.museum-back:hover { opacity: 1; transform: translateX(-2px); }

.museum-room-label {
  position: fixed;
  top: calc(20px + env(safe-area-inset-top));
  right: calc(22px + env(safe-area-inset-right));
  z-index: 1000;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  padding: 7px 13px;
  opacity: 0.5;
  pointer-events: none;
}

/* mute toggle */
.museum-mute {
  position: fixed;
  bottom: calc(22px + env(safe-area-inset-bottom));
  right: calc(22px + env(safe-area-inset-right));
  z-index: 1000;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  padding: 8px 12px;
  border: 1px dotted currentColor;
  background: transparent;
  cursor: pointer;
  color: inherit;
  transition: opacity .25s;
  opacity: 0.45;
}
.museum-mute:hover { opacity: 1; }
.museum-mute[data-muted="true"]::before { content: "♪̸ "; }
.museum-mute[data-muted="false"]::before { content: "♪ "; }

/* page-load fade-in overlay (starts opaque, fades to clear) */
.museum-fade {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--paper);
  pointer-events: none;
  opacity: 1;
  animation: museumFadeOut 1.1s ease forwards;
}
@keyframes museumFadeOut {
  0% { opacity: 1; }
  100% { opacity: 0; }
}
/* fade-out overlay used by the back link before navigating */
.museum-fade-out {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: var(--paper);
  pointer-events: none;
  opacity: 0;
  animation: museumFadeIn 0.85s ease forwards;
}
@keyframes museumFadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

/* mobile — reduce padding, tighten font sizes */
@media (max-width: 600px) {
  .museum-back, .museum-room-label, .museum-mute {
    font-size: 10px;
    letter-spacing: 2px;
    padding: 6px 10px;
  }
  .museum-back { top: calc(14px + env(safe-area-inset-top)); left: calc(14px + env(safe-area-inset-left)); }
  .museum-room-label { top: calc(14px + env(safe-area-inset-top)); right: calc(14px + env(safe-area-inset-right)); }
  .museum-mute { bottom: calc(14px + env(safe-area-inset-bottom)); right: calc(14px + env(safe-area-inset-right)); }
}

/* prevent text-size-adjust on iOS */
html { -webkit-text-size-adjust: 100%; }

/* =========================================================
   PROGRESS — bottom-left, persistent across pages
   ========================================================= */
.museum-progress {
  position: fixed;
  bottom: calc(22px + env(safe-area-inset-bottom));
  left: calc(22px + env(safe-area-inset-left));
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 3px;
  color: inherit;
  text-transform: uppercase;
  opacity: 0.5;
  pointer-events: none;
}
.museum-progress .lbl { white-space: nowrap; }
.museum-progress .dots {
  display: flex;
  gap: 4px;
  align-items: center;
}
.museum-progress .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.22;
  transition: opacity 0.4s ease;
}
.museum-progress .dot.done { opacity: 1; }
.museum-progress .dot.me {
  outline: 2px solid currentColor;
  outline-offset: 2px;
  opacity: 1;
}

/* =========================================================
   COMPLEMENT — extra romantic text + artwork credit
   shown at the end of each obra, above the navigation
   ========================================================= */
.museum-complement {
  position: fixed;
  bottom: calc(135px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  z-index: 9;
  width: min(620px, 90vw);
  text-align: center;
  color: inherit;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.8s ease 0.4s, transform 1.8s ease 0.4s;
}
.museum-complement.show {
  opacity: 0.92;
  transform: translateX(-50%) translateY(0);
}
.museum-complement .ctext {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(13px, 2.4vw, 18px);
  line-height: 1.55;
  letter-spacing: 0.01em;
}
.museum-complement .cref {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 3px;
  text-transform: uppercase;
  opacity: 0.65;
}
.museum-complement .cref em {
  font-family: var(--serif);
  font-style: italic;
  text-transform: none;
  letter-spacing: 0;
}

@media (max-width: 600px) {
  .museum-complement {
    bottom: calc(125px + env(safe-area-inset-bottom));
    width: 88vw;
  }
  .museum-complement .ctext { font-size: 13px; line-height: 1.5; }
  .museum-complement .cref { font-size: 8px; letter-spacing: 2px; }
}

/* =========================================================
   NEXT OBRA LINK — stacked above #continue, primary CTA
   ========================================================= */
.museum-next {
  position: fixed;
  bottom: calc(72px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 11;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 4px;
  color: inherit;
  text-decoration: none;
  text-transform: uppercase;
  padding: 9px 16px;
  border: 1px solid currentColor;
  background: transparent;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.2s ease, transform 0.25s ease;
  white-space: nowrap;
  max-width: 90vw;
  text-overflow: ellipsis;
  overflow: hidden;
}
.museum-next.show {
  opacity: 0.95;
  pointer-events: auto;
}
.museum-next:hover {
  opacity: 1;
  transform: translateX(-50%) translateY(-2px);
}

/* =========================================================
   INTRO CARD — first-load dedication
   ========================================================= */
.museum-intro {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: #ede4d3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px;
  cursor: pointer;
  opacity: 0;
}
.museum-intro.in {
  animation: introIn 5.2s ease forwards;
}
@keyframes introIn {
  0%   { opacity: 0; }
  10%  { opacity: 1; }
  88%  { opacity: 1; }
  100% { opacity: 0; }
}
.museum-intro .preface {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: #8a4a4a;
  margin-bottom: 28px;
  opacity: 0;
  animation: introFadeIn 1.6s ease 0.5s forwards;
}
.museum-intro .dedication {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(30px, 6.8vw, 64px);
  color: #5a2a2a;
  line-height: 1.1;
  opacity: 0;
  animation: introFadeIn 1.9s ease 1.0s forwards;
}
.museum-intro .meta {
  margin-top: 38px;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(13px, 2.6vw, 16px);
  color: rgba(90, 42, 42, 0.65);
  opacity: 0;
  animation: introFadeIn 1.6s ease 2.0s forwards;
}
.museum-intro .skip {
  position: absolute;
  bottom: calc(32px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: rgba(90, 42, 42, 0.4);
  opacity: 0;
  animation: introFadeIn 1.4s ease 3.2s forwards, hintPulseIntro 2s ease-in-out 3.2s infinite;
}
@keyframes introFadeIn {
  to { opacity: 1; }
}
@keyframes hintPulseIntro {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.85; }
}

/* =========================================================
   Mobile adjustments for progress + next
   ========================================================= */
@media (max-width: 600px) {
  .museum-progress {
    font-size: 9px;
    letter-spacing: 2px;
    gap: 7px;
  }
  .museum-progress .dot { width: 4px; height: 4px; }
  .museum-next {
    font-size: 9px;
    letter-spacing: 1.5px;
    padding: 8px 12px;
    bottom: calc(66px + env(safe-area-inset-bottom));
    white-space: normal;
    line-height: 1.3;
    max-width: 86vw;
  }
  .museum-intro .dedication { font-size: clamp(28px, 12vw, 48px); }
  .museum-intro .meta { font-size: 12px; padding: 0 16px; }
  /* avoid progress colliding with mute toggle in very narrow screens */
  .museum-progress .dots { display: none; }
}
