/* ==========================================================
   JAMESATPOST — style.css
   Edit colours / spacing in :root below.
   ========================================================== */

:root {
  color-scheme: dark;
  --bg: #08090b;
  --bg-raised: #0f1114;
  --text: #f2f2f0;
  --text-dim: #a3a6ab;
  --text-faint: #6e7278;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.22);
  --accent: #5fd38d;          /* availability dot */

  --maxw: 1440px;
  --gutter: clamp(16px, 4vw, 48px);
  --nav-h: 64px;

  --font: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 36px); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.no-scroll { overflow: hidden; }

img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }

/* ---------- NAV ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  transition: background-color .3s ease, backdrop-filter .3s ease;
}
.nav.scrolled, .nav.open {
  background: rgba(8, 9, 11, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-brand {
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .28em;
  font-weight: 500;
  font-size: 1rem;
}
.nav-links {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  gap: clamp(20px, 3vw, 40px);
}
.nav-links a {
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .75rem;
  font-weight: 500;
  color: var(--text-dim);
  padding: 6px 0;
  border-bottom: 1px solid transparent;
  transition: color .2s, border-color .2s;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--text); border-bottom-color: var(--text); }

.nav-toggle {
  display: none;
  background: none; border: 0; padding: 10px; margin-right: -10px;
  cursor: pointer;
}
.nav-toggle span {
  display: block; width: 22px; height: 1.5px; background: var(--text);
  transition: transform .25s;
}
.nav-toggle span + span { margin-top: 6px; }
.nav.open .nav-toggle span:first-child { transform: translateY(3.75px) rotate(45deg); }
.nav.open .nav-toggle span:last-child  { transform: translateY(-3.75px) rotate(-45deg); }

/* Availability bar */
.status-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 32px;
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text);
  background: rgba(95, 211, 141, 0.10);
  border-top: 1px solid rgba(95, 211, 141, 0.18);
  border-bottom: 1px solid rgba(95, 211, 141, 0.18);
}
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(95, 211, 141, .6);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(95, 211, 141, .55); }
  70%  { box-shadow: 0 0 0 8px rgba(95, 211, 141, 0); }
  100% { box-shadow: 0 0 0 0 rgba(95, 211, 141, 0); }
}

/* ---------- HERO ---------- */
.hero {
  position: relative;
  min-height: 0;
  display: flex;
  align-items: flex-end;
  padding: calc(var(--nav-h) + 32px + 28px) 0 clamp(24px, 3vw, 36px);
  background:
    linear-gradient(90deg, rgba(8,9,11,.85) 0%, rgba(8,9,11,.35) 55%, rgba(8,9,11,.05) 100%),
    linear-gradient(0deg, var(--bg) 0%, rgba(8,9,11,0) 40%),
    url("../images/hero.jpg") center / cover no-repeat,
    radial-gradient(ellipse at 70% 30%, #2a2c30 0%, var(--bg) 70%);
}
.hero-content {
  position: relative;
}

/* Showreel */
.reel {
  margin: 0;
  animation: rise-in .9s cubic-bezier(.2,.7,.2,1) .4s both;
}
.reel-thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 2.4 / 1;        /* crops the letterbox bars off the thumbnail */
  padding: 0; border: 0;
  overflow: hidden;
  border-radius: 3px;
  background: var(--bg-raised);
  cursor: pointer;
  box-shadow: 0 20px 50px rgba(0,0,0,.55);
}
.reel-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: brightness(.9);
  transition: filter .4s ease, transform .6s cubic-bezier(.2,.7,.2,1);
}
.reel-thumb:hover img, .reel-thumb:focus-visible img { filter: brightness(1.05); transform: scale(1.03); }
.reel-thumb:hover .play { transform: scale(1.1); background: rgba(0,0,0,.5); }
.reel .play--lg { width: 64px; height: 64px; margin: -32px 0 0 -32px; border-width: 2px; }
.reel .play--lg::after { margin: -10px 0 0 -6px; border-left-width: 18px; border-top-width: 10px; border-bottom-width: 10px; }
.reel figcaption {
  display: flex;
  gap: 14px;
  align-items: baseline;
  margin-top: 12px;
  font-size: .78rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.reel figcaption span { color: var(--text); font-weight: 600; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: .3em;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 14px;
}
.hero h1 {
  text-transform: uppercase;
  font-weight: 700;
  font-size: clamp(2rem, 4.4vw, 3.5rem);
  line-height: 1;
  letter-spacing: .005em;
  max-width: 14ch;
}
.hero-sub {
  margin-top: 16px;
  max-width: 46ch;
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  color: var(--text-dim);
}

.hero .eyebrow, .hero h1, .hero-sub {
  opacity: 0;
  transform: translateY(14px);
  animation: rise .9s cubic-bezier(.2,.7,.2,1) forwards;
}
.hero h1   { animation-delay: .12s; }
.hero-sub  { animation-delay: .28s; }
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(14px); } }

/* ---------- STUDIO SECTIONS ---------- */
.credits { padding-top: 8px; }
.studio + .studio { margin-top: clamp(28px, 3vw, 40px); }

.studio-head {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.4vw, 28px);
  margin-bottom: 10px;
}
.studio-brand { flex: none; display: flex; align-items: center; }
.studio-logo { height: 36px; width: auto; }
.studio-logo--lightvfx { height: 38px; }
.studio-logo--invert { filter: invert(1); }
.studio-wordmark {
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.studio-rule { flex: 0 1 64px; height: 1px; background: var(--line-strong); }
.studio-label {
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: .72rem;
  font-weight: 500;
  color: var(--text-dim);
}

/* ---------- CREDIT ROWS ---------- */
.credit-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }

.credit {
  display: grid;
  grid-template-columns: minmax(280px, 1.05fr) 1.3fr minmax(220px, 1fr);
  gap: clamp(16px, 2.2vw, 32px);
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}

.credit-info { display: flex; align-items: center; gap: 18px; min-width: 0; }
.credit-poster {
  flex: none;
  width: 86px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 2px;
  background: var(--bg-raised);
}
.credit-title {
  text-transform: uppercase;
  font-weight: 700;
  font-size: clamp(1rem, 1.35vw, 1.2rem);
  line-height: 1.12;
  letter-spacing: .01em;
}
.credit-meta {
  margin-top: 8px;
  font-size: .82rem;
  color: var(--text-dim);
  white-space: pre;
}

.credit-still {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 4.2;
  padding: 0; border: 0;
  overflow: hidden;
  border-radius: 2px;
  background: var(--bg-raised);
  cursor: pointer;
}
.credit-still img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: brightness(.9) saturate(1);
  transform: scale(1.01);
  transition: filter .4s ease, transform .6s cubic-bezier(.2,.7,.2,1);
}
.credit:hover .credit-still img,
.credit-still:focus-visible img { filter: brightness(1.05) saturate(1.05); transform: scale(1.04); }

.play {
  position: absolute;
  left: 50%; top: 50%;
  width: 44px; height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.85);
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: transform .3s ease, background-color .3s ease;
}
.play::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  margin: -7px 0 0 -4px;
  border-left: 12px solid #fff;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
}
.credit:hover .play { transform: scale(1.1); background: rgba(0,0,0,.5); }

.role-title {
  text-transform: uppercase;
  font-weight: 700;
  font-size: .92rem;
  letter-spacing: .06em;
}
.role-desc {
  margin-top: 6px;
  font-size: .85rem;
  color: var(--text-dim);
  max-width: 30ch;
}

/* ---------- ABOUT / CONTACT ---------- */
.section { padding-top: clamp(56px, 6vw, 80px); }
.section-title {
  text-transform: uppercase;
  letter-spacing: .3em;
  font-size: .8rem;
  font-weight: 500;
  color: var(--text-dim);
  padding-bottom: 18px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--line);
}
.about-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: clamp(32px, 6vw, 96px);
}
.about-lead {
  font-size: clamp(1.25rem, 2.1vw, 1.7rem);
  font-weight: 300;
  line-height: 1.4;
  max-width: 36ch;
}
.about-label {
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: .72rem;
  color: var(--text-faint);
  margin-bottom: 12px;
}
.tools { list-style: none; margin: 0; padding: 0; }
.tools li { padding: 9px 0; border-bottom: 1px solid var(--line); color: var(--text-dim); }

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.contact-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: clamp(24px, 3.5vw, 40px);
  background: var(--bg);
  text-decoration: none;
  transition: background-color .25s;
}
.contact-card:hover { background: var(--bg-raised); }
.contact-label {
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: .72rem;
  color: var(--text-faint);
}
.contact-value {
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  font-weight: 500;
  overflow-wrap: anywhere;
}

/* ---------- FOOTER ---------- */
.footer {
  margin-top: clamp(56px, 6vw, 80px);
  border-top: 1px solid var(--line);
  padding: 32px 0 40px;
  font-size: .85rem;
  color: var(--text-faint);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 32px;
}
.footer-links { display: flex; gap: 24px; }
.footer-links a { text-decoration: none; color: var(--text-dim); }
.footer-links a:hover { color: var(--text); }
.footer-note { font-size: .75rem; }

/* ---------- LIGHTBOX ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--gutter);
  background: rgba(0, 0, 0, .9);
  animation: fade .25s ease;
}
.lightbox[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }

.lightbox-panel { width: min(1100px, 100%); }
.lightbox-video {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
}
.lightbox-video iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0;
}
.lightbox-info { padding-top: 18px; }
.lightbox-info h2 {
  text-transform: uppercase;
  font-weight: 700;
  font-size: 1.3rem;
}
.lightbox-meta {
  margin: 6px 0 8px;
  font-size: .78rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: pre-wrap;
}
#lightbox-desc { color: var(--text-dim); font-size: .95rem; }

.lightbox-close {
  position: absolute;
  top: 12px; right: 16px;
  width: 44px; height: 44px;
  font-size: 2rem; line-height: 1;
  color: var(--text);
  background: none; border: 0;
  cursor: pointer;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 980px) {
  .credit { grid-template-columns: 1fr 1.4fr; }
  .credit-role { grid-column: 1 / -1; display: flex; gap: 16px; align-items: baseline; flex-wrap: wrap; }
  .role-desc { margin-top: 0; max-width: none; }
}

@media (max-width: 768px) {
  :root { --nav-h: 56px; }

  .nav-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: var(--nav-h); left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    padding: 8px var(--gutter) 20px;
    background: rgba(8, 9, 11, 0.96);
    border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav.open .nav-links { display: flex; }
  .nav-links a { display: block; padding: 14px 0; font-size: .85rem; border-bottom: 1px solid var(--line); }
  .nav-links a.active { border-bottom-color: var(--line); }
  .nav.open .status-bar { display: none; }

  .status-bar { font-size: .64rem; letter-spacing: .14em; }

  .hero { min-height: 0; }

  .studio-head { flex-wrap: wrap; row-gap: 8px; }
  .studio-rule { display: none; }
  .studio-label { flex-basis: 100%; }

  .credit {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px 0 16px;
  }
  .credit-poster { width: 68px; }
  .credit-still { aspect-ratio: 16 / 6; }
  .credit-role { display: block; }
  .role-desc { margin-top: 4px; }

  .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .hero .eyebrow, .hero h1, .hero-sub { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ---------- EPISODE BUTTONS (series credits) ---------- */
.episodes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ep {
  font: inherit;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .12em;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  padding: 4px 8px;
  cursor: pointer;
  transition: color .2s, border-color .2s, background-color .2s;
}
.ep:hover, .ep:focus-visible { color: var(--bg); background: var(--text); border-color: var(--text); }

/* ---------- REEL SECTION (after the credits) ---------- */
.reel-section .reel { max-width: 960px; }

/* ---------- FOOTER LEGAL LINE ---------- */
.footer-legal {
  flex-basis: 100%;
  font-size: .72rem;
  line-height: 1.5;
  color: var(--text-faint);
  max-width: 80ch;
}

/* ---------- PHONES: each credit as a card ---------- */
@media (max-width: 768px) {
  .credit-list { border-top: 0; display: grid; gap: 14px; }
  .credit {
    gap: 0;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--bg-raised);
    overflow: hidden;
  }
  .credit-still {               /* trailer still first, flush to the card edges */
    order: -1;
    border-radius: 0;
    aspect-ratio: 16 / 7;
  }
  .credit-info { padding: 14px 14px 0; gap: 14px; }
  .credit-poster { width: 54px; }
  .credit-role { padding: 10px 14px 16px; }
  .role-title { font-size: .82rem; color: var(--text-dim); }
  .role-desc { color: var(--text-faint); }
  .studio + .studio { margin-top: 44px; }
  .studio-head { margin-bottom: 14px; }
}

/* ---------- iOS FIXES: solid menu icon + play buttons ---------- */
button { -webkit-appearance: none; appearance: none; -webkit-tap-highlight-color: transparent; }

.nav-toggle { color: #fff; opacity: 1; }
.nav-toggle span { height: 2px; background: #fff; border-radius: 1px; }
.nav.open .nav-toggle span:first-child { transform: translateY(4px) rotate(45deg); }
.nav.open .nav-toggle span:last-child  { transform: translateY(-4px) rotate(-45deg); }

.play {
  z-index: 2;                          /* always above the still image */
  border: 2px solid #fff;
  background: rgba(0, 0, 0, .55);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .45);
}
.play::after { border-left-color: #fff; }
.credit:hover .play, .reel-thumb:hover .play { background: rgba(0, 0, 0, .7); }

/* ---------- NAV NAME: hidden while the hero name is on screen ---------- */
.nav-brand { opacity: 0; pointer-events: none; transition: opacity .25s ease; }
.nav.show-brand .nav-brand,
.nav.open .nav-brand { opacity: 1; pointer-events: auto; }
