/* ============================================================
   Birdies & Bogies Studios — V2 "Through the Glass"
   Deep navy world, liquid gold optics.
   ============================================================ */

:root {
  --ink: #0d141a;
  --navy: #1e3653;
  --navy-deep: #14263c;
  --gold: #ffd700;
  --gold-hi: #f7d477;
  --gold-lo: #9a7416;
  --silver: #b9bec4;
  --emerald: #1de982;
  --display: "Bebas Neue", sans-serif;
  --mono: "IBM Plex Mono", monospace;
  --body: "Inter", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: auto; }

body {
  background: radial-gradient(120% 100% at 50% 0%, var(--navy) 0%, var(--navy-deep) 45%, var(--ink) 100%);
  color: var(--silver);
  font-family: var(--body);
  overflow-x: hidden;
}

#scroll-space { height: 900vh; pointer-events: none; }

/* ==================== CANVAS ==================== */
#gl {
  position: fixed; inset: 0;
  width: 100vw; height: 100vh;
  display: block;
  z-index: 0;
}

/* ==================== LOADER ==================== */
#loader {
  position: fixed; inset: 0; z-index: 100;
  background: radial-gradient(100% 100% at 50% 50%, var(--navy) 0%, var(--ink) 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 22px;
  transition: clip-path 0.9s cubic-bezier(0.7, 0, 0.2, 1);
  clip-path: circle(150% at 50% 50%);
}
#loader.open { clip-path: circle(0% at 50% 50%); pointer-events: none; }
.leader-ring {
  width: 130px; height: 130px; border-radius: 50%;
  border: 1px solid rgba(185, 190, 196, 0.35);
  display: grid; place-items: center;
  position: relative;
}
.leader-ring::before {
  content: ""; position: absolute; inset: -1px; border-radius: 50%;
  background: conic-gradient(var(--gold) var(--sweep, 0%), transparent 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
}
.leader-num {
  font-family: var(--display); font-size: 64px; color: #fff; line-height: 1;
}
.leader-line { font-family: var(--mono); font-size: 12px; letter-spacing: 0.35em; color: var(--silver); }
.leader-pct { font-family: var(--mono); font-size: 12px; color: var(--gold); }

/* ==================== FIXED CHROME ==================== */
#chrome-top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px;
  mix-blend-mode: normal;
}
#chrome-top .brand img { height: 44px; display: block; }
#chrome-top nav { display: flex; gap: 26px; }
#chrome-top nav a {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.3em;
  color: var(--silver); text-decoration: none; position: relative;
  padding-bottom: 3px;
}
#chrome-top nav a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 0;
  background: var(--gold); transition: width 0.35s ease;
}
#chrome-top nav a:hover { color: #fff; }
#chrome-top nav a:hover::after, #chrome-top nav a.active::after { width: 100%; }
#chrome-top nav a.active { color: var(--gold); }

#chrome-bottom {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  display: flex; align-items: center; gap: 18px;
  padding: 14px 28px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.25em;
  color: var(--silver);
}
#hud-bar { flex: 1; height: 1px; background: rgba(185, 190, 196, 0.25); position: relative; }
#hud-bar i {
  position: absolute; left: 0; top: -1px; height: 3px; width: 0;
  background: linear-gradient(90deg, var(--gold-lo), var(--gold), var(--gold-hi));
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.7);
}
#hud-fstop { color: var(--gold); }

#scroll-hint {
  position: fixed; bottom: 52px; left: 50%; transform: translateX(-50%); z-index: 40;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.4em; color: var(--silver);
  opacity: 0.85; transition: opacity 0.6s ease;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
#scroll-hint.gone { opacity: 0; }
#scroll-hint .tick { animation: hintbob 1.6s ease-in-out infinite; color: var(--gold); }
@keyframes hintbob { 50% { transform: translateY(6px); } }

/* ==================== PANELS ==================== */
.panel {
  position: fixed; inset: 0; z-index: 20;
  display: flex; flex-direction: column; justify-content: center;
  padding: 0 8vw;
  opacity: 0; visibility: hidden;
  pointer-events: none;
}
/* dark scrim behind the text side so copy reads over the 3D scene */
.panel::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(7, 12, 18, 0.82) 0%, rgba(7, 12, 18, 0.55) 42%, rgba(7, 12, 18, 0) 72%);
  pointer-events: none;
}
.panel > * { position: relative; z-index: 1; }
.panel.live { opacity: 1; visibility: visible; }
.panel.live .lede, .panel.live #film-list button, .panel.live a { pointer-events: auto; }
.panel.live #film-list li, .panel.live #service-rings li, .panel.live #crew-list li { pointer-events: auto; }
.panel.live .phone { pointer-events: auto; }

.kicker {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.4em;
  color: #e3e8ee; margin-bottom: 26px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
}
.kicker.emerald { color: var(--emerald); }

.display {
  font-family: var(--display);
  font-size: clamp(56px, 9.5vw, 150px);
  line-height: 0.92;
  color: #f6f9fb;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  text-shadow: 0 3px 26px rgba(0, 0, 0, 0.65);
}
.gold-text { filter: drop-shadow(0 4px 18px rgba(0, 0, 0, 0.65)); }
.display .thin { display: block; font-size: 0.36em; letter-spacing: 0.55em; color: var(--silver); margin-top: 14px; }

.gold-text {
  background: linear-gradient(105deg, #8a6a12 0%, var(--gold-hi) 28%, #fff3c4 42%, var(--gold) 55%, #8a6a12 78%, var(--gold-hi) 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: goldflow 7s linear infinite;
}
@keyframes goldflow { to { background-position: 200% 0; } }

.emerald-text { color: var(--emerald); }
.emerald-link { color: var(--emerald); text-decoration: none; border-bottom: 1px solid var(--emerald); }
.emerald-link:hover { color: #fff; border-color: #fff; }

.lede {
  max-width: 520px; margin-top: 30px;
  font-size: 15px; line-height: 1.75; color: #dde3e9;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.8);
}

.hint-inline {
  margin-top: 28px; font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.35em; color: rgba(220, 227, 233, 0.85);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
}

/* ==================== WORK LIST ==================== */
.panel.wide { padding-right: 46vw; }
#film-list { list-style: none; }
#film-list button {
  display: flex; align-items: baseline; gap: 18px; width: 100%;
  background: none; border: 0; border-bottom: 1px solid rgba(185, 190, 196, 0.16);
  padding: 13px 4px; cursor: pointer; text-align: left;
  font-family: var(--display); font-size: clamp(22px, 2.6vw, 38px);
  color: #dfe5ea; letter-spacing: 0.04em;
  transition: color 0.25s ease, padding-left 0.25s ease;
}
#film-list button em { font-family: var(--mono); font-style: normal; font-size: 11px; color: var(--gold-lo); }
#film-list button span { margin-left: auto; font-family: var(--mono); font-size: 10px; letter-spacing: 0.25em; color: rgba(214, 221, 228, 0.85); }
#film-list button:hover, #film-list button.hot { color: var(--gold); padding-left: 14px; }
#film-list button:hover em, #film-list button.hot em { color: var(--gold); }

/* ==================== SERVICES ==================== */
#service-rings { list-style: none; max-width: 620px; }
#service-rings li {
  display: grid; grid-template-columns: 84px 1fr; grid-template-rows: auto auto;
  column-gap: 22px; padding: 20px 0;
  border-bottom: 1px solid rgba(185, 190, 196, 0.16);
}
#service-rings b {
  grid-row: 1 / span 2; align-self: center;
  font-family: var(--mono); font-weight: 500; font-size: 13px; color: var(--gold);
  border: 1px solid rgba(255, 215, 0, 0.35); border-radius: 50%;
  width: 66px; height: 66px; display: grid; place-items: center;
}
#service-rings strong { font-family: var(--display); font-size: 30px; letter-spacing: 0.05em; color: #eef2f5; font-weight: 400; }
#service-rings span { font-size: 13px; color: #d5dbe2; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8); }

/* ==================== CREW ==================== */
#crew-list { list-style: none; margin-top: 26px; }
#crew-list li {
  display: flex; justify-content: space-between; align-items: baseline;
  max-width: 480px; padding: 10px 0;
  border-bottom: 1px solid rgba(185, 190, 196, 0.16);
}
#crew-list strong { font-family: var(--display); font-size: 24px; font-weight: 400; letter-spacing: 0.06em; color: #eef2f5; }
#crew-list span { font-family: var(--mono); font-size: 10px; letter-spacing: 0.25em; color: #d5dbe2; }
.phone {
  display: inline-block; margin-top: 30px;
  font-family: var(--display); font-size: clamp(40px, 5vw, 72px);
  text-decoration: none; letter-spacing: 0.04em;
}
.fineprint { margin-top: 26px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.25em; line-height: 2; color: rgba(214, 221, 228, 0.8); }
.fineprint a { color: var(--emerald); text-decoration: none; }

/* ==================== LIGHTBOX ==================== */
#lightbox[hidden] { display: none; }
#lightbox {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(7, 11, 15, 0.92);
  backdrop-filter: blur(10px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
}
#lightbox-frame { width: min(1080px, 88vw); aspect-ratio: 16 / 9; box-shadow: 0 0 80px rgba(255, 215, 0, 0.15), 0 0 0 1px rgba(255, 215, 0, 0.3); }
#lightbox-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
#lightbox-close {
  position: absolute; top: 24px; right: 28px;
  background: none; border: 1px solid rgba(255, 215, 0, 0.4); color: var(--gold);
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.3em;
  padding: 10px 18px; cursor: pointer;
}
#lightbox-close:hover { background: rgba(255, 215, 0, 0.12); }
#lightbox-title { font-family: var(--mono); font-size: 12px; letter-spacing: 0.35em; color: var(--silver); }

/* ==================== FLAT FALLBACK (no WebGL / reduced motion) ==================== */
body.flat #gl, body.flat #chrome-bottom, body.flat #scroll-hint, body.flat #scroll-space, body.flat .panel::before { display: none; }
body.flat { overflow-y: auto; }
body.flat .panel {
  position: static; opacity: 1; visibility: visible; pointer-events: auto;
  min-height: 70vh; padding-top: 12vh; padding-bottom: 8vh;
}
body.flat .panel.wide { padding-right: 8vw; }
body.flat #sections { padding-top: 90px; }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 820px) {
  #chrome-top nav { gap: 14px; }
  #chrome-top nav a { font-size: 10px; letter-spacing: 0.2em; }
  #chrome-top .brand img { height: 34px; }
  .panel { padding: 0 7vw; }
  .panel.wide { padding-right: 7vw; }
  #film-list button span { display: none; }
  .lede { font-size: 14px; }
}
