/* CJ Kemble - Cinematic direction
   Palette (locked): bg #0a0a0b / text #efe9df / accent gold #c9a227 */

:root {
  --bg: #0a0a0b;
  --ink: #efe9df;
  --ink-muted: #a49b8d;
  --gold: #c9a227;
  --gold-dim: rgba(201, 162, 39, 0.35);
  --hairline: rgba(239, 233, 223, 0.14);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --caps: 0.18em;
  --ease-slow: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

a { color: inherit; }

::selection { background: var(--gold); color: #0a0a0b; }

/* ---------- skip link ---------- */

.skip-link {
  position: absolute;
  top: -3rem;
  left: 1rem;
  z-index: 60;
  padding: 0.6rem 1rem;
  background: var(--gold);
  color: #0a0a0b;
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: var(--caps);
  text-transform: uppercase;
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 0.75rem; }

/* ---------- film grain ---------- */

.grain {
  position: fixed;
  inset: -100px;
  z-index: 50;
  pointer-events: none;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 300px 300px;
}

@media (prefers-reduced-motion: no-preference) {
  .grain { animation: grain-shift 0.9s steps(4) infinite; }
}

@keyframes grain-shift {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-34px, 22px); }
  50%  { transform: translate(18px, -40px); }
  75%  { transform: translate(-26px, -14px); }
  100% { transform: translate(0, 0); }
}

/* ---------- header ---------- */

.site-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 1.6rem clamp(1.25rem, 4vw, 3.5rem);
  background: #000;
}

.wordmark {
  font-family: var(--serif);
  font-size: 1.35rem;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--ink);
}

.site-header nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.9rem;
  list-style: none;
}

.site-header nav a {
  font-size: 0.7rem;
  letter-spacing: var(--caps);
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-muted);
  padding-bottom: 0.35rem;
  border-bottom: 1px solid transparent;
  transition: color 0.3s ease, border-color 0.3s ease;
}

.site-header nav a:hover,
.site-header nav a:focus-visible { color: var(--ink); border-color: var(--gold); }

.site-header nav a[aria-current="page"] { color: var(--ink); border-color: var(--gold-dim); }

/* ====================================================================
   HOMEPAGE-ONLY BELOW THIS LINE (hero + work grid)
   Category pages (Tasks 3-6) link this file for the shared shell
   (tokens, header/nav, footer, grain, .video-frame, reveal) but do not
   use the hero or grid rules below.
   ==================================================================== */

/* ---------- hero ---------- */

.hero { background: #000; }

.letterbox {
  height: clamp(1.5rem, 4.5vw, 4rem);
  background: #000;
  position: relative;
}

.hero-frame {
  position: relative;
  aspect-ratio: 2.39 / 1;
  min-height: 340px;
  overflow: hidden;
  border-top: 1px solid rgba(201, 162, 39, 0.28);
  border-bottom: 1px solid rgba(201, 162, 39, 0.28);
}

.hero-still {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 42%;
  filter: brightness(0.5) saturate(0.85);
}

@media (prefers-reduced-motion: no-preference) {
  .hero-still { animation: hero-drift 24s var(--ease-slow) both; }
  @keyframes hero-drift {
    from { transform: scale(1.08); }
    to   { transform: scale(1); }
  }
}

.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 42%;
  filter: brightness(0.5) saturate(0.85);
}

.hero-scrim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 62% 70% at 50% 52%, rgba(5, 5, 6, 0.82) 0%, rgba(5, 5, 6, 0.34) 55%, transparent 78%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.6), transparent 30%, transparent 70%, rgba(0, 0, 0, 0.65));
}

.hero-titles {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: clamp(0.8rem, 2vw, 1.4rem);
  padding: 1rem;
}

.hero-titles h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.1rem, 6.2vw, 5rem);
  line-height: 1.05;
  letter-spacing: 0.04em;
  text-wrap: balance;
}

.hero-roles {
  display: inline-flex;
  align-items: center;
  gap: 1.1rem;
  font-size: clamp(0.62rem, 1vw, 0.8rem);
  letter-spacing: var(--caps);
  text-transform: uppercase;
  color: var(--ink);
}

.hero-roles::before,
.hero-roles::after {
  content: "";
  display: block;
  width: clamp(1.5rem, 4vw, 3.25rem);
  height: 1px;
  background: var(--gold);
}

/* staggered title entrance */
@media (prefers-reduced-motion: no-preference) {
  .hero-titles h1, .hero-roles {
    opacity: 0;
    transform: translateY(14px);
    animation: rise 1.1s var(--ease-slow) forwards;
  }
  .hero-titles h1 { animation-delay: 0.25s; }
  .hero-roles { animation-delay: 0.7s; }
  @keyframes rise {
    to { opacity: 1; transform: none; }
  }
}

.hero-corner {
  position: absolute;
  width: 26px;
  height: 26px;
  border: 1px solid var(--gold-dim);
}
.hero-corner.tl { top: 14px; left: 14px; border-right: 0; border-bottom: 0; }
.hero-corner.br { bottom: 14px; right: 14px; border-left: 0; border-top: 0; }

/* ---------- work section ---------- */

.work {
  max-width: 78rem;
  margin: 0 auto;
  padding: clamp(3.5rem, 7vw, 6.5rem) clamp(1.25rem, 4vw, 3.5rem) clamp(3rem, 6vw, 5rem);
}

.section-head {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2rem);
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.section-head .rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--hairline));
}
.section-head .rule:last-child {
  background: linear-gradient(to left, transparent, var(--hairline));
}

.section-head h2 {
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(0.72rem, 1.1vw, 0.82rem);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  white-space: nowrap;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(2.25rem, 4vw, 3.25rem) clamp(1.5rem, 2.5vw, 2.25rem);
}

/* ---------- project cards ---------- */

.project { display: flex; flex-direction: column; }

.video-embed {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--hairline);
  outline-offset: 4px;
}

.video-embed img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.88) saturate(0.92);
  transition: transform 1.4s var(--ease-slow), filter 0.6s ease;
}

.video-embed::after {
  /* bottom scrim so the play control always sits on dark */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.45), transparent 45%);
  transition: opacity 0.6s ease;
}

.video-embed .play {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  z-index: 1;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1px solid rgba(239, 233, 223, 0.75);
  background: rgba(10, 10, 11, 0.5);
  backdrop-filter: blur(2px);
  transition: border-color 0.4s ease, background 0.4s ease, transform 0.4s var(--ease-slow);
}

.video-embed .play::before {
  content: "";
  position: absolute;
  left: 53%;
  top: 50%;
  translate: -50% -50%;
  border-style: solid;
  border-width: 8px 0 8px 13px;
  border-color: transparent transparent transparent var(--ink);
}

.video-embed:hover img,
.video-embed:focus-visible img { transform: scale(1.045); filter: brightness(1) saturate(1); }

.video-embed:hover .play,
.video-embed:focus-visible .play {
  border-color: var(--gold);
  background: rgba(10, 10, 11, 0.72);
  transform: scale(1.08);
}

.video-embed:focus-visible { outline: 2px solid var(--gold); }

/* swapped-in player */
.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid var(--gold-dim);
}

.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- captions ---------- */

.caption { padding-top: 1.1rem; }

.caption .meta {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  font-size: 0.64rem;
  letter-spacing: var(--caps);
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.5rem;
}

.caption .index {
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.caption .index::after {
  content: "";
  display: inline-block;
  width: 1.4rem;
  height: 1px;
  background: var(--gold-dim);
  vertical-align: 0.22em;
  margin-left: 0.9rem;
}

.caption h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.32rem;
  line-height: 1.25;
  letter-spacing: 0.015em;
  margin-bottom: 0.45rem;
  text-wrap: balance;
}

.caption .excerpt {
  font-size: 0.86rem;
  line-height: 1.65;
  color: var(--ink-muted);
  max-width: 34ch;
}

/* ====================================================================
   END HOMEPAGE-ONLY BLOCK (hero + work grid above)
   Rules below (about, scroll reveal, footer, responsive) are shared
   shell and safe to reuse on category pages.
   ==================================================================== */

/* ---------- about ---------- */

.about {
  max-width: 78rem;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 3.5rem) clamp(3rem, 6vw, 5.5rem);
}

.about .section-head { margin-bottom: clamp(2.25rem, 4.5vw, 3.5rem); }

.about-inner {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2.25rem, 5vw, 4.5rem);
  align-items: start;
}

.about-lede {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.25rem, 2.1vw, 1.65rem);
  line-height: 1.5;
  letter-spacing: 0.01em;
  margin-bottom: 1.3rem;
}

.about-copy {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--ink-muted);
  max-width: 58ch;
  margin-bottom: 1rem;
}

.about-copy a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--gold-dim);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.3s ease;
}

.about-copy a:hover,
.about-copy a:focus-visible { text-decoration-color: var(--gold); }

.about-imdb {
  display: inline-block;
  margin-top: 0.6rem;
  font-size: 0.68rem;
  letter-spacing: var(--caps);
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--gold-dim);
  padding: 0.65rem 1.15rem;
  transition: border-color 0.3s ease, color 0.3s ease;
}

.about-imdb:hover,
.about-imdb:focus-visible { border-color: var(--gold); color: var(--gold); }

.facts-label {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  border-top: 1px solid var(--hairline);
  padding-top: 0.85rem;
  margin-bottom: 0.6rem;
}

.facts-label + .facts-label,
.about-awards + .facts-label { margin-top: 1.8rem; }

.about-awards,
.about-clients { list-style: none; }

.about-awards li {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 0.74rem;
  line-height: 1.55;
  color: var(--ink-muted);
}

.about-awards li strong {
  display: block;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.about-clients {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1.5rem;
}

.about-clients li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}

/* ---------- scroll reveal ---------- */

.reveal { opacity: 1; }

@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.9s var(--ease-slow), transform 0.9s var(--ease-slow);
  }
  .js .reveal.is-visible { opacity: 1; transform: none; }
  /* gentle column stagger */
  .grid .project:nth-child(3n + 2) { transition-delay: 0.12s; }
  .grid .project:nth-child(3n + 3) { transition-delay: 0.24s; }
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--hairline);
  background: #000;
  margin-top: clamp(2rem, 5vw, 4rem);
}

.footer-inner {
  max-width: 78rem;
  margin: 0 auto;
  padding: 2.4rem clamp(1.25rem, 4vw, 3.5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem 2.5rem;
  flex-wrap: wrap;
}

.footer-name {
  font-family: var(--serif);
  font-size: 1.05rem;
  letter-spacing: 0.04em;
}

.footer-roles {
  font-size: 0.6rem;
  letter-spacing: var(--caps);
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: 0.3rem;
}

.footer-links {
  display: flex;
  gap: 2rem;
}

.footer-links a {
  font-size: 0.68rem;
  letter-spacing: var(--caps);
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-muted);
  padding-bottom: 0.3rem;
  border-bottom: 1px solid transparent;
  transition: color 0.3s ease, border-color 0.3s ease;
}

.footer-links a:hover,
.footer-links a:focus-visible { color: var(--ink); border-color: var(--gold); }

/* littleoceans credit: keep the uppercase footer from shouting the "Site by" */
.site-footer .lo-siteby { text-transform: none; }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) and (prefers-reduced-motion: no-preference) {
  .grid .project:nth-child(3n + 2),
  .grid .project:nth-child(3n + 3) { transition-delay: 0s; }
  .grid .project:nth-child(2n) { transition-delay: 0.12s; }
}

@media (max-width: 640px) {
  .site-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.1rem;
    padding-top: 1.4rem;
  }
  .site-header nav ul { justify-content: center; gap: 0.65rem 1.35rem; }

  .hero-frame {
    aspect-ratio: auto;
    min-height: 0;
    height: min(72vw, 30rem);
  }
  .hero-still, .hero-video { object-position: 50% 45%; }

  .grid { grid-template-columns: 1fr; gap: 2.75rem; }
  .caption { text-align: center; }
  .caption .meta { justify-content: center; }
  .caption .excerpt { margin: 0 auto; }

  .about-inner { grid-template-columns: 1fr; gap: 2.5rem; }
  .about-bio { text-align: center; }
  .about-copy { margin-left: auto; margin-right: auto; }
  .about-facts { text-align: center; }
  .about-awards li strong { text-wrap: balance; }
  .about-clients { grid-template-columns: 1fr; }

  .footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 1.4rem;
  }
}
