/* The videos page: the film, the walkthrough library and the player. Built on styles.css tokens. */

.vid-hero { position: relative; padding: 72px 0 40px; overflow: hidden; }
.vid-hero::before {
  content: ""; position: absolute; inset: -30% -10% auto; height: 620px; pointer-events: none;
  background: radial-gradient(60% 55% at 50% 45%, rgba(var(--apricot-rgb), 0.16), transparent 70%),
              radial-gradient(40% 40% at 20% 20%, rgba(var(--ink-rgb), 0.05), transparent 70%);
}
.vid-hero-head { position: relative; max-width: 760px; margin: 0 auto 40px; text-align: center; }
.vid-hero-head h1 { font-size: clamp(44px, 7vw, 84px); line-height: 1; font-weight: 780; letter-spacing: -0.045em; }
.vid-hero-head .lede { margin: 20px auto 0; max-width: 560px; font-size: 18px; color: var(--muted); }

.film { position: relative; margin: 0 auto; max-width: 1040px; }
.film-frame {
  position: relative; aspect-ratio: 16 / 9; max-width: 100%; border-radius: 22px; overflow: hidden; background: #0b1416;
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--line), 0 40px 120px -30px rgba(var(--apricot-rgb), 0.45);
}
.film-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #0b1416; }
.film-play {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  border: 0; cursor: pointer; color: #fff; font: 600 17px/1.2 var(--font);
  background: radial-gradient(circle at 50% 45%, rgba(8, 18, 20, 0.35), rgba(8, 18, 20, 0.15) 45%, rgba(8, 18, 20, 0.05));
  transition: background .3s ease;
}
.film-play:hover { background: radial-gradient(circle at 50% 45%, rgba(8, 18, 20, 0.25), transparent 60%); }
.film-play-ring {
  flex: none; width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.14); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35), 0 0 0 14px rgba(var(--apricot-rgb), 0.18);
  transition: transform .25s ease, box-shadow .25s ease;
  animation: film-breathe 2.6s ease-in-out infinite;
}
.film-play-ring svg { width: 28px; height: 28px; fill: #fff; margin-left: 4px; }
.film-play:hover .film-play-ring { transform: scale(1.06); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5), 0 0 0 18px rgba(var(--apricot-rgb), 0.24); }
.film-play-label { display: inline-flex; align-items: baseline; gap: 10px; padding: 8px 16px; border-radius: 99px; background: rgba(8, 18, 20, 0.55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); font-size: 16px; letter-spacing: .01em; text-shadow: 0 2px 16px rgba(0, 0, 0, 0.5); }
.film-play-label small { font: 500 13px var(--mono); opacity: .8; letter-spacing: .04em; }
.film.is-playing .film-play { opacity: 0; pointer-events: none; }
.film figcaption { margin-top: 16px; text-align: center; font-size: 14px; color: var(--muted); }
@keyframes film-breathe { 0%, 100% { box-shadow: 0 0 0 1px rgba(255,255,255,.35), 0 0 0 12px rgba(var(--apricot-rgb), .16); } 50% { box-shadow: 0 0 0 1px rgba(255,255,255,.35), 0 0 0 20px rgba(var(--apricot-rgb), .08); } }

/* ── Library ─────────────────────────────────────────────────────────────── */
.vid-library { padding: 56px 0 96px; }
.vid-library-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.vid-library-head h2 { font-size: clamp(30px, 4vw, 46px); line-height: 1.08; font-weight: 740; letter-spacing: -0.03em; }
.vid-count { font: 500 13px var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }

.vid-chips {
  position: sticky; top: 72px; z-index: 5; display: flex; gap: 8px; flex-wrap: wrap;
  padding: 12px 0; margin-bottom: 20px; background: linear-gradient(var(--base) 75%, transparent);
}
.vid-chips a {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--raised); font-size: 14px; font-weight: 600; color: var(--text);
  transition: border-color .2s ease, color .2s ease, background .2s ease;
}
.vid-chips a small { font: 500 12px var(--mono); color: var(--muted); }
.vid-chips a:hover, .vid-chips a.is-on { border-color: var(--accent-hover); color: var(--accent-hover); }

.vid-group { padding-top: 36px; scroll-margin-top: 130px; }
.vid-group-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.vid-group-head h3 { font-size: 24px; font-weight: 720; letter-spacing: -0.02em; }
.vid-group-head h3 em { font-size: 1.12em; }
.vid-group-head p { color: var(--muted); font-size: 15px; }

.vid-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 22px; }
.vid-card {
  display: flex; flex-direction: column; gap: 12px; padding: 0; border: 0; background: none; text-align: left;
  color: var(--text); font: inherit; cursor: pointer;
}
.vid-thumb {
  position: relative; aspect-ratio: 16 / 9; max-width: 100%; border-radius: 14px; overflow: hidden; background: var(--soft);
  box-shadow: var(--shadow); outline: 1px solid var(--line); outline-offset: -1px;
  transition: transform .25s ease, box-shadow .25s ease;
}
.vid-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.vid-thumb::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(8, 18, 20, 0.55));
}
.vid-dur {
  position: absolute; right: 10px; bottom: 10px; z-index: 1; padding: 3px 8px; border-radius: 7px;
  font: 500 12px var(--mono); color: #fff; background: rgba(8, 18, 20, 0.7); font-variant-numeric: tabular-nums;
}
.vid-glyph {
  position: absolute; left: 50%; top: 50%; z-index: 1; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(255, 255, 255, 0.92); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  opacity: 0; transform: scale(.85); transition: opacity .25s ease, transform .25s ease;
}
.vid-glyph svg { width: 20px; height: 20px; fill: #0f2a30; margin-left: 3px; }
.vid-card:hover .vid-thumb, .vid-card:focus-visible .vid-thumb { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.vid-card:hover .vid-thumb img, .vid-card:focus-visible .vid-thumb img { transform: scale(1.045); }
.vid-card:hover .vid-glyph, .vid-card:focus-visible .vid-glyph { opacity: 1; transform: scale(1); }
.vid-card:focus-visible { outline: none; }
.vid-card:focus-visible .vid-thumb { outline: 2px solid var(--apricot); outline-offset: 3px; }
.vid-meta { display: flex; flex-direction: column; gap: 4px; padding: 0 2px; }
.vid-meta strong { font-size: 16.5px; font-weight: 680; letter-spacing: -0.01em; }
.vid-meta span { font-size: 14.5px; line-height: 1.5; color: var(--muted); }

/* ── CTA ─────────────────────────────────────────────────────────────────── */
.vid-cta { padding: 0 0 110px; }
.vid-cta-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  padding: 40px 44px; border-radius: 24px; background: var(--raised); box-shadow: var(--shadow); outline: 1px solid var(--line); outline-offset: -1px;
}
.vid-cta-inner h2 { font-size: clamp(26px, 3.2vw, 38px); line-height: 1.1; font-weight: 740; letter-spacing: -0.03em; max-width: 560px; }
.vid-cta-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ── Player ──────────────────────────────────────────────────────────────── */
.player {
  width: min(1120px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 32px); padding: 0; border: 0;
  border-radius: 22px; background: #0d1719; color: #e8efee; box-shadow: 0 40px 140px rgba(0, 0, 0, 0.6); overflow: auto;
}
.player::backdrop { background: rgba(6, 12, 14, 0.78); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.player[open] { animation: player-in .28s cubic-bezier(.2,.8,.2,1); }
@keyframes player-in { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.player-box { display: flex; flex-direction: column; }
.player-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 18px 20px 14px 24px; }
.player-group { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: rgb(var(--apricot-rgb)); margin-bottom: 4px; }
.player-top h3 { color: #fff; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.player-close {
  flex: none; width: 40px; height: 40px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06); color: #fff; cursor: pointer; display: grid; place-items: center;
}
.player-close svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; fill: none; }
.player-close:hover { background: rgba(255, 255, 255, 0.12); }
.player-frame { position: relative; aspect-ratio: 16 / 9; max-width: 100%; background: #000; }
.player-frame video { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; }
.player-foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 16px 20px 20px 24px; }
.player-foot p { color: #a9b8b6; font-size: 15px; max-width: 62ch; }
.player-nav { display: flex; gap: 8px; }
.player .btn-ghost { color: #e8efee; border-color: rgba(255, 255, 255, 0.18); background: rgba(255, 255, 255, 0.04); }
.player .btn-ghost:hover { border-color: rgba(255, 255, 255, 0.4); }
.player-nav svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.player-nav button:disabled { opacity: .35; cursor: default; }

.player-next {
  position: absolute; right: 18px; bottom: 64px; z-index: 2; width: min(320px, calc(100% - 36px)); padding: 16px 18px;
  border-radius: 16px; background: rgba(13, 23, 25, 0.9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 20px 60px rgba(0, 0, 0, 0.5);
  display: flex; flex-direction: column; gap: 6px;
}
.player-next[hidden] { display: none; }
.player-next p { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: rgb(var(--apricot-rgb)); }
.player-next strong { color: #fff; font-size: 16px; }
.player-next-bar { height: 3px; border-radius: 3px; background: rgba(255, 255, 255, 0.14); overflow: hidden; margin: 6px 0 8px; }
.player-next-bar i { display: block; height: 100%; width: 0; background: rgb(var(--apricot-rgb)); }
.player-next-actions { display: flex; gap: 8px; }

@media (max-width: 720px) {
  .vid-hero { padding: 44px 0 24px; }
  .film-frame { border-radius: 16px; }
  .film-play-ring { width: 58px; height: 58px; }

  .vid-chips { top: 64px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .vid-cta-inner { padding: 28px 22px; }
  .player { width: calc(100vw - 16px); border-radius: 16px; }
  .player-next { bottom: 56px; right: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .film-play-ring { animation: none; }
  .player[open] { animation: none; }
  .vid-thumb, .vid-thumb img, .vid-glyph { transition: none; }
}
