/* ============================================================
   THE ARCHIVE — UI: opening screen, transport, index, invitation
   ============================================================ */

/* ---------- opening screen (the gesture that unlocks sound) ---------- */
.gate {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 24px;
  text-align: center;
  /* the dark projector shows faintly through, waiting */
  background: radial-gradient(80% 70% at 50% 45%, rgba(14,10,7,0.80), rgba(6,4,3,0.96) 80%);
  cursor: pointer;
  transition: opacity 1.2s var(--ease-soft), visibility 0s linear 1.2s;
}
.gate.gone { opacity: 0; visibility: hidden; pointer-events: none; }
.gate-names {
  margin: 0;
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(50px, 11vw, 132px);
  line-height: 1; letter-spacing: 0.01em;
  color: var(--ivory);
  text-shadow: 0 4px 40px rgba(255,170,80,0.2);
  opacity: 0; animation: fadeUp 1.8s 0.2s var(--ease-soft) forwards;
}
.gate-names em { font-style: italic; color: var(--champagne); padding: 0 0.12em; }
.gate-title {
  margin: clamp(16px, 3vh, 26px) 0 0;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.46em;
  text-transform: uppercase; color: var(--gold);
  padding-left: 0.46em;
  opacity: 0; animation: fadeUp 1.5s 0.7s var(--ease-soft) forwards;
}
.gate-sub {
  margin: 12px 0 0;
  font-family: var(--serif); font-style: italic; font-size: clamp(18px, 2.4vw, 24px);
  color: var(--ivory-dim);
  white-space: pre-line;
  opacity: 0; animation: fadeUp 1.5s 1s var(--ease-soft) forwards;
}
.gate-begin {
  margin-top: clamp(30px, 6vh, 54px);
  min-height: 48px;
  padding: 14px 30px;
  border: 1px solid rgba(216,192,138,0.55);
  border-radius: 999px;
  background: rgba(58,38,22,0.4);
  color: var(--ivory);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.3em;
  text-transform: uppercase;
  transition: background 0.35s var(--ease-soft), border-color 0.35s var(--ease-soft), box-shadow 0.35s var(--ease-soft);
  opacity: 0; animation: fadeUp 1.5s 1.4s var(--ease-soft) forwards;
}
.gate:hover .gate-begin { background: rgba(88,58,32,0.6); border-color: var(--champagne); box-shadow: 0 0 34px rgba(255,170,80,0.22); }

@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- top bar ---------- */
.controls {
  position: fixed; top: 0; left: 0; right: 0; z-index: 90;
  display: flex; align-items: center; justify-content: space-between;
  padding: max(6px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 0 max(18px, env(safe-area-inset-left));
  pointer-events: none;
  opacity: 0;
  transition: opacity 1s var(--ease-soft);
}
.controls.show { opacity: 1; }
.controls > * { pointer-events: auto; }

.brand-mark {
  font-family: var(--serif); font-style: italic; font-size: 18px;
  color: var(--ivory-dim);
  white-space: nowrap;
  transition: opacity 0.6s var(--ease-soft);
}
.stage[data-finale="on"] .brand-mark { opacity: 0; }

.transport { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.round-btn {
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
  background: none;
  border: 1px solid transparent;
  border-radius: 50%;
  color: var(--ivory-dim);
  transition: color 0.3s, border-color 0.3s, background 0.3s, opacity 0.3s;
  -webkit-tap-highlight-color: transparent;
}
.round-btn svg { width: 22px; height: 22px; display: block; }
.round-btn:disabled { opacity: 0.25; cursor: default; }
@media (hover: hover) {
  .round-btn:not(:disabled):hover { color: var(--ivory); border-color: rgba(216,192,138,0.45); background: rgba(40,28,16,0.55); }
}

/* ---------- index beside the screen (wide screens only) ---------- */
.archive-index {
  position: fixed; z-index: 28;
  top: 28%; right: clamp(16px, 2.6vw, 34px);
  transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 2px;
  opacity: 0; visibility: hidden;
  transition: opacity 0.8s var(--ease-soft), visibility 0s linear 0.8s;
}
.archive-index.show { opacity: 1; visibility: visible; transition-delay: 0s; }
.idx-item {
  display: flex; align-items: center; gap: 12px;
  padding: 7px 4px; background: none; border: none;
  text-align: right; justify-content: flex-end;
  transition: opacity 0.35s var(--ease-soft);
  opacity: 0.45;
}
.idx-item:hover { opacity: 0.9; }
.idx-item.active { opacity: 1; }
.idx-num {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em;
  color: var(--ivory-dim); transition: color 0.35s;
}
.idx-item.active .idx-num { color: var(--gold); }
.idx-name {
  font-family: var(--serif); font-style: italic; font-size: 15px;
  color: var(--ivory-dim); max-width: 0; overflow: hidden; white-space: nowrap;
  transition: max-width 0.5s var(--ease-soft), color 0.35s, opacity 0.35s; opacity: 0;
}
.idx-item:hover .idx-name, .idx-item.active .idx-name { max-width: 240px; opacity: 1; }
.idx-item.active .idx-name { color: var(--ivory); }
.idx-tick {
  width: 22px; height: 1px; background: rgba(180,140,80,0.35);
  transition: width 0.35s, background 0.35s; flex: 0 0 auto;
}
.idx-item.active .idx-tick { width: 34px; background: var(--gold); }

/* ---------- the invitation ---------- */
.finale-card {
  --top-gap: clamp(12px, 2.2vh, 30px);
  position: fixed; z-index: 25;
  left: 0; right: 0; margin-inline: auto;
  top: var(--top-gap);
  bottom: calc(var(--tray-h, 130px) - 6px);
  width: min(94vw, calc((100vh - var(--tray-h, 130px) - var(--top-gap) + 6px) * 1.5));
  width: min(94vw, calc((100svh - var(--tray-h, 130px) - var(--top-gap) + 6px) * 1.5));
  padding: 14px;
  border-radius: 6px;
  background: linear-gradient(180deg, #2a2018 0%, #160f09 100%);
  box-shadow:
    inset 0 2px 3px rgba(255,210,150,0.18),
    0 0 90px rgba(255,180,100,0.28),
    0 30px 60px rgba(0,0,0,0.6);
  visibility: hidden;
}
.finale-card.on { visibility: visible; }
.finale-surface {
  position: relative;
  width: 100%; height: 100%;
  border-radius: 3px;
  overflow: hidden;
  container-type: size;
  /* the same warm light as the blank screen it grew from */
  background: radial-gradient(80% 80% at 50% 45%, #f6ecd6, #e4d5b0 62%, #bfaa7c 100%);
  box-shadow: inset 0 0 70px rgba(70,40,10,0.28);
  color: #33210f;
}
.finale-inner {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 4cqh 6cqw;
  text-align: center;
}
.fc-title {
  margin: 0 0 0.5em;
  font-family: var(--serif); font-style: italic;
  font-size: clamp(16px, 4.2cqh, 30px);
  color: #5a3d1e;
}
.fc-kicker {
  margin: 0;
  padding-left: 0.42em;
  font-family: var(--mono);
  font-size: clamp(10px, 2.2cqh, 15px);
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: #6f4c20;
}
.fc-names {
  margin: clamp(8px, 2.4cqh, 20px) 0 0;
  font-family: var(--script); font-weight: 400;
  font-size: clamp(44px, min(15cqh, 16cqw), 124px);
  line-height: 1.08;
  color: #2b1a0b;
}
/* Pinyon's own ampersand barely reads as one */
.fc-names em { font-family: var(--serif); font-style: italic; font-weight: 300; font-size: 0.68em; padding: 0 0.14em; color: #8a5f25; }
.fc-rule {
  width: clamp(48px, 12cqw, 110px); height: 1px;
  margin: clamp(10px, 2.6cqh, 22px) 0;
  background: linear-gradient(90deg, transparent, #8a5f25, transparent);
}
.fc-date {
  margin: 0;
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(21px, min(5.6cqh, 6.6cqw), 42px);
  line-height: 1.15;
  text-wrap: balance;
}
.fc-loc {
  margin: clamp(4px, 1cqh, 8px) 0 0;
  font-family: var(--serif); font-style: italic;
  font-size: clamp(16px, min(3.4cqh, 4.6cqw), 25px);
  color: #5a3d1e;
  text-wrap: balance;
}
.fc-cal {
  margin-top: clamp(14px, 3.4cqh, 30px);
  display: inline-flex; align-items: center;
  min-height: 44px;
  padding: 0 24px;
  border: 1px solid rgba(51,33,15,0.6);
  border-radius: 999px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.22em;
  text-transform: uppercase; text-decoration: none;
  color: #33210f;
  transition: background 0.3s, color 0.3s;
}
@media (hover: hover) { .fc-cal:hover { background: #33210f; color: #f6ecd6; } }
.fc-hint {
  margin: clamp(10px, 2.6cqh, 22px) 0 0;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0 14px;
  font-family: var(--serif); font-style: italic;
  font-size: clamp(14px, 2.6cqh, 17px);
  color: #6a4f2c;
}
.fc-again {
  min-height: 36px;
  padding: 0 4px;
  background: none; border: 0;
  font: inherit; color: #33210f;
  text-decoration: underline; text-underline-offset: 3px;
}

/* the title card pulls into focus, a line at a time */
.finale-card .reveal {
  opacity: 0;
  transform: translateY(8px);
  filter: blur(6px);
}
.finale-card.seated .reveal {
  opacity: 1;
  transform: none;
  filter: blur(0);
  transition: opacity 1s var(--ease-soft), transform 1.1s var(--ease-soft), filter 1.1s var(--ease-soft);
}
.finale-card.seated .r2 { transition-delay: 0.25s; }
.finale-card.seated .r3 { transition-delay: 0.6s; }
.finale-card.seated .r4 { transition-delay: 0.8s; }
.finale-card.seated .r5 { transition-delay: 1.1s; }
.finale-card.seated .r6 { transition-delay: 1.5s; }
