/* SONDER · components
   Reusable bits: site header chrome, buttons, player bar, reel modal, toast.
   The site header markup is static in index.html; styles live in sections.css.
   This file only houses cross-section components (player + modals + toasts). */

/* ── BUTTONS ───────────────────────────────────────
   One canonical button. Hero vocabulary, full stop:
   - transparent shell, 1px solid var(--fg) border
   - Bebas Neue, uppercase, 0.04em letter-spacing
   - generous padding (sized via --btn-pad-y / --btn-pad-x at the call site)
   - leading icon in --accent (gold), label in --fg
   - hover: invert (fg fill, bg text) — icon flips to bg too

   Modifiers:
   - .btn--lg   → hero-scale (24–28px text, 22×32 padding)
   - .btn--sm   → inline / row scale (14–16px text, 12×18 padding)
   - .btn--ghost→ no border, just an underlined hairline (use for tertiary)
*/
.btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 16px 24px;
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--fg);
  font-family: var(--cond);
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
  font-weight: 400;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--t-base), color var(--t-base), border-color var(--t-base);
}
.btn:hover { background: var(--fg); color: var(--bg); }
.btn .ico {
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent);
  transition: color var(--t-base);
}
.btn:hover .ico { color: var(--bg); }
.btn .ico svg { display: block; }

.btn--lg {
  padding: 22px 32px;
  font-size: 1.6rem;
  gap: 14px;
}
.btn--sm {
  padding: 12px 18px;
  font-size: 0.9rem;
  gap: 10px;
}

.btn--ghost {
  border: 0;
  border-bottom: 1px solid var(--rule-hi);
  padding: 10px 0;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.btn--ghost:hover { background: transparent; color: var(--fg); border-color: var(--fg); }

/* ── PLAYER BAR ─────────────────────────────────────
   Persistent bottom bar. Same vocabulary as the rest of the site:
   thin top hairline, mono micro-labels, tabular numerals. */

.player-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  background: rgba(13,12,9,0.94);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
  border-top: 1px solid var(--rule);
  padding: 14px var(--pad);
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 24px;
  align-items: center;
  transform: translateY(100%);
  transition: transform var(--t-slow);
}
.player-bar.visible { transform: translateY(0); }

.player-controls { display: flex; align-items: center; gap: 8px; }
.player-btn {
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--rule-hi);
  border-radius: 50%;
  color: var(--fg);
  transition: border-color var(--t-base), color var(--t-base);
}
.player-btn:hover { border-color: var(--accent); color: var(--accent); }
.player-btn svg { width: 12px; height: 12px; fill: currentColor; }

.player-info {
  display: flex; flex-direction: column; min-width: 0; gap: 4px;
}
.player-track {
  font-family: var(--cond);
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--fg);
}
.player-project {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-mute);
}

.waveform {
  display: none; align-items: center; gap: 2px;
  width: 80px; height: 24px;
}
body.player-active .waveform { display: inline-flex; }
.wave-bar {
  flex: 1; height: 30%;
  background: var(--fg-mute);
  border-radius: 1px;
  transition: height 200ms ease, background 200ms ease;
}
body.now-playing .wave-bar {
  background: var(--accent-hi);
  animation: wave-beat 0.8s ease-in-out infinite;
}
.wave-bar:nth-child(1) { animation-delay: 0s; }
.wave-bar:nth-child(2) { animation-delay: 0.1s; }
.wave-bar:nth-child(3) { animation-delay: 0.2s; }
.wave-bar:nth-child(4) { animation-delay: 0.3s; }
.wave-bar:nth-child(5) { animation-delay: 0.4s; }
.wave-bar:nth-child(6) { animation-delay: 0.15s; }
.wave-bar:nth-child(7) { animation-delay: 0.25s; }
@keyframes wave-beat {
  0%, 100% { height: 30%; }
  50%      { height: 90%; }
}

.player-progress {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  color: var(--fg-mute);
  font-variant-numeric: tabular-nums;
}
.progress-track {
  flex: 1; min-width: 120px;
  height: 1px; background: var(--rule-hi);
  position: relative; cursor: pointer;
}
.progress-fill {
  position: absolute; inset: 0 auto 0 0;
  background: var(--fg);
  width: 0%;
  transition: background var(--t-base);
}
body.now-playing .progress-fill { background: var(--accent-hi); }

#player-close {
  background: transparent;
  border: 0;
  color: var(--fg-mute);
  font-size: 18px;
  line-height: 1;
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  margin-left: 6px;
  transition: color var(--t-base);
}
#player-close:hover { color: var(--fg); }

@media (max-width: 820px) {
  .player-bar {
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    gap: 8px 16px;
    padding: 12px 16px;
  }
  .player-progress { grid-column: 1 / -1; }
  .waveform { display: none !important; }
}

body.player-active { padding-bottom: 76px; }

/* ── REEL / TRAILER MODAL ─────────────────────────── */

.reel-modal {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.94);
  display: flex; align-items: center; justify-content: center;
  padding: clamp(1rem, 4vw, 4rem);
  opacity: 0; visibility: hidden;
  transition: opacity var(--t-base), visibility var(--t-base);
}
.reel-modal.open { opacity: 1; visibility: visible; }
.reel-modal-inner {
  width: 100%; max-width: 1280px;
  aspect-ratio: 16/9;
  background: #000;
  position: relative;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
}
/* The iframe is wrapped in #reel-mount (so we can swap clips without
   rebuilding the modal). The wrapper itself has no intrinsic size, which
   used to leave the iframe at its Vimeo default (640×360) pinned to the
   top of the modal. Force the mount to fill the inner box so the iframe
   inherits the right %-sized parent. */
.reel-modal #reel-mount {
  position: absolute;
  inset: 0;
}
.reel-modal video, .reel-modal iframe {
  display: block;
  width: 100%; height: 100%;
  object-fit: contain;
  border: 0;
}
.reel-modal-close {
  position: absolute;
  top: 1.5rem; right: 1.5rem;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(232,220,193,0.1);
  color: var(--fg);
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
  transition: background var(--t-base);
}
.reel-modal-close:hover { background: rgba(232,220,193,0.25); }
.reel-modal-close svg { width: 18px; height: 18px; fill: currentColor; }
body.modal-open { overflow: hidden; }

/* ── CLIP-ON-REQUEST TOAST ────────────────────────── */

.clip-toast {
  position: fixed; bottom: 90px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-2);
  border: 1px solid var(--rule-hi);
  padding: 14px 20px;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg);
  display: flex; align-items: center; gap: 18px;
  z-index: 220;
  opacity: 0;
  transition: opacity var(--t-base), transform var(--t-base);
  pointer-events: none;
}
.clip-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.clip-toast em {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  letter-spacing: -0.005em;
  text-transform: none;
  color: var(--fg);
}
.clip-toast a {
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
}
