:root {
  /* palette: deep navy · warm white · antique gold */
  --bg: #0e1a2b;
  --bg-2: #14243a;
  --ink: #f2eee6;
  --muted: #9aa6b6;
  --line: rgba(242, 238, 230, 0.13);
  --accent: #b8964f;   /* antique gold — UI accent */
  --tint: #b8964f;     /* per-project glow, set from data.js */
  --paper: #efeae0;    /* light section */
  --navy-ink: #13233a; /* text on light section */
  --gold-deep: #8a6c2f;/* gold text on light section */
  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --sans: "Be Vietnam Pro", system-ui, sans-serif;
  --pad: clamp(20px, 5vw, 72px);
  --max: 1440px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 300 16px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* film grain */
body::after {
  content: ""; position: fixed; inset: -50%; pointer-events: none; z-index: 100; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }

.eyebrow {
  font: 400 11px/1.4 var(--sans);
  letter-spacing: 0.28em; text-transform: uppercase; color: var(--muted);
}
em { font-style: italic; color: var(--accent); }

/* ---------- animated background ---------- */
.bg-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; pointer-events: none; }
body > *:not(.bg-canvas):not(.nav):not(.ruler) { position: relative; z-index: 1; }

/* looping logo animation in the hero */
.hero__logo {
  position: absolute; z-index: 1; pointer-events: none;
  /* sits in the empty upper-right of the hero, clear of the big title */
  right: calc(var(--pad) + 5vw); top: max(14vh, 140px);
  width: clamp(150px, 26vw, 460px); aspect-ratio: 1;
}
.hero__logo svg { width: 100%; height: 100%; overflow: visible; }
@media (max-width: 900px) {
  .hero__logo { right: 50%; top: 15%; transform: translateX(50%); width: min(52vw, 300px); }
}
@media (max-height: 700px) and (max-width: 900px) { .hero__logo { width: 34vw; top: 12%; } }

/* viewfinder overlay in hero */
.viewfinder { position: absolute; inset: 92px var(--pad) 28px; pointer-events: none; z-index: 1;
  font: 400 11px/1 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; letter-spacing: 0.14em; color: rgba(242,238,230,.55); }
.vf-c { position: absolute; width: 26px; height: 26px; border-color: rgba(184,150,79,.7); border-style: solid; border-width: 0; }
.vf-c.tl { top: 0; left: 0; border-top-width: 1px; border-left-width: 1px; }
.vf-c.tr { top: 0; right: 0; border-top-width: 1px; border-right-width: 1px; }
.vf-c.bl { bottom: 0; left: 0; border-bottom-width: 1px; border-left-width: 1px; }
.vf-c.br { bottom: 0; right: 0; border-bottom-width: 1px; border-right-width: 1px; }
.vf-rec { position: absolute; top: 14px; left: 40px; display: flex; align-items: center; gap: 8px; }
.vf-rec b { width: 7px; height: 7px; border-radius: 50%; background: #b5473a; animation: blink 1.6s steps(1) infinite; }
.vf-tc { position: absolute; top: 14px; right: 40px; font-variant-numeric: tabular-nums; color: rgba(184,150,79,.9); }
.vf-spec { position: absolute; bottom: 12px; right: 40px; }
@keyframes blink { 50% { opacity: 0; } }

/* timeline scrub bar fixed at the bottom of the screen */
.ruler { position: fixed; left: 0; right: 0; bottom: 0; height: 26px; z-index: 40; pointer-events: none;
  background: linear-gradient(to top, rgba(14,26,43,.85), rgba(14,26,43,0)); }
.ruler__ticks { position: absolute; left: var(--pad); right: var(--pad); bottom: 0; height: 100%; }
.ruler__ticks i { position: absolute; bottom: 0; width: 1px; height: 5px; background: rgba(242,238,230,.18); }
.ruler__ticks i.M { height: 10px; background: rgba(184,150,79,.55); }
.ruler__ticks em { position: absolute; bottom: 12px; left: 4px; font: normal 400 9px ui-monospace, Menlo, Consolas, monospace; color: rgba(242,238,230,.35); letter-spacing: .08em; white-space: nowrap; }
.ruler__head { position: absolute; bottom: 0; width: 1px; height: 22px; background: var(--accent); box-shadow: 0 0 10px rgba(184,150,79,.7);
  transform: translateX(0); }
.ruler__head::before { content: ""; position: absolute; top: -4px; left: -4px; border: 4.5px solid transparent; border-top-color: var(--accent); }
@media (max-width: 640px) { .ruler__ticks em { display: none; } .viewfinder { inset: 78px 16px 18px; } .vf-spec { display: none; } }
@media (prefers-reduced-motion: reduce) { .vf-rec b { animation: none; } }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 50;
  display: flex; justify-content: space-between; align-items: center;
  padding: 22px var(--pad);
  transition: background 0.4s, padding 0.4s;
}
.nav.is-scrolled, .nav--solid { background: rgba(14, 26, 43, 0.85); backdrop-filter: blur(10px); padding-block: 14px; }
.nav__brand { display: inline-flex; align-items: center; gap: 12px; font: 500 13px var(--sans); letter-spacing: 0.22em; text-transform: uppercase; }
.nav__brand img { width: 34px; height: 34px; }
.nav__links { display: flex; gap: clamp(16px, 3vw, 40px); }
.nav__links a { font-size: 13px; color: var(--muted); transition: color 0.3s; }
.nav__links a:hover { color: var(--ink); }
.nav__links { align-items: center; }
.lang { display: flex; align-items: center; gap: 6px; margin-left: clamp(4px, 1vw, 12px); padding-left: clamp(14px, 2vw, 24px); border-left: 1px solid var(--line); }
.lang span { color: var(--line); font-size: 12px; }
.lang button {
  background: none; border: 0; cursor: pointer; padding: 4px 2px;
  font: 500 12px var(--sans); letter-spacing: 0.16em; color: var(--muted); transition: color 0.3s;
}
.lang button:hover { color: var(--ink); }
.lang button[aria-pressed="true"] { color: var(--ink); border-bottom: 1px solid var(--accent); }

/* ---------- hero ---------- */
.hero { position: relative; height: 100svh; min-height: 560px; display: flex; align-items: flex-end; overflow: hidden; }
.hero__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero__shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(14,26,43,.5) 0%, rgba(14,26,43,.08) 35%, rgba(14,26,43,.9) 100%);
}
.no-reel .hero__shade { background: linear-gradient(180deg, transparent 60%, rgba(14,26,43,.6) 100%); }
.hero__content { position: relative; padding: 0 var(--pad) clamp(48px, 9vh, 110px); max-width: var(--max); width: 100%; margin: 0 auto; }
.hero__title {
  font: 400 clamp(52px, 10vw, 152px)/0.95 var(--serif);
  letter-spacing: -0.01em; margin: 18px 0 26px;
}
.hero__alt { font: italic 400 clamp(20px, 2.2vw, 30px) var(--serif); color: var(--accent); margin: -8px 0 24px; letter-spacing: .02em; }
.hero__intro { max-width: 560px; color: rgba(242,238,230,.8); font-size: clamp(15px, 1.2vw, 17px); }
.hero__cta {
  display: inline-flex; gap: 10px; margin-top: 34px;
  font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase;
  border-bottom: 1px solid var(--accent); padding-bottom: 6px;
}

/* ---------- sections ---------- */
.work, .process { padding: clamp(80px, 12vw, 160px) var(--pad); max-width: var(--max); margin: 0 auto; }
.section-head { margin-bottom: clamp(40px, 6vw, 80px); }
.section-title { font: 400 clamp(36px, 5vw, 68px)/1.05 var(--serif); margin-top: 14px; max-width: 900px; }

/* ---------- project grid ---------- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(28px, 4vw, 56px) clamp(20px, 3vw, 40px); }
.card:nth-child(4n+1), .card:nth-child(4n+4) { grid-column: span 2; }
.card__media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-2); }
.card:nth-child(4n+2) .card__media, .card:nth-child(4n+3) .card__media { aspect-ratio: 4 / 3; }
.card__media img, .card__media video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: transform 1.2s cubic-bezier(.2,.7,.2,1), opacity 0.6s;
}
.card__media video { opacity: 0; }
.card.is-playing video { opacity: 1; }
.card:hover .card__media img { transform: scale(1.035); }
.card__ph {
  position: absolute; inset: 0; display: none; place-items: center;
  background:
    radial-gradient(90% 90% at 70% 20%, color-mix(in srgb, var(--tint) 34%, transparent), transparent 65%),
    linear-gradient(160deg, #182a44, #0c1626);
}
.card__ph span { font: 400 clamp(40px, 6vw, 96px) var(--serif); letter-spacing: 0.2em; opacity: 0.85; }
.card.is-missing .card__ph { display: grid; }
.card.is-missing img { display: none; }
.card__body { display: flex; gap: 22px; padding-top: 22px; border-top: 1px solid transparent; }
.card__no { font: 400 13px var(--sans); color: var(--accent); padding-top: 10px; }
.card__title { font: 400 clamp(28px, 3vw, 42px)/1.1 var(--serif); }
.card__title span { font-style: italic; color: var(--muted); font-size: 0.7em; margin-left: 6px; }
.card__meta { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); margin: 8px 0 10px; }
.card__line { color: var(--muted); max-width: 560px; }

/* ---------- about ---------- */
.about {
  max-width: var(--max); margin: 0 auto; padding: clamp(80px, 12vw, 160px) var(--pad);
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(36px, 7vw, 110px); align-items: center;
  border-top: 1px solid var(--line);
}
.about__photo { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: var(--bg-2); }
.about__photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
/* thin gold frame offset */
.about__photo::after { content: ""; position: absolute; inset: 14px; border: 1px solid rgba(184,150,79,.45); pointer-events: none; }
.about.no-photo { grid-template-columns: 1fr; }
.about.no-photo .about__photo { display: none; }
.about__body { margin-top: 26px; max-width: 600px; }
.about__body p { color: rgba(242,238,230,.8); }
.about__body p + p { margin-top: 16px; }
.about__body .about__lead { font: 400 clamp(22px, 2.2vw, 30px)/1.3 var(--serif); color: var(--ink); }
.about__label { font: 400 11px var(--sans); letter-spacing: 0.28em; text-transform: uppercase; color: var(--accent); margin: 38px 0 12px; }
.about__skills { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; max-width: 600px; }
.about__skills li { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; }

/* ---------- services ---------- */
.services {
  max-width: var(--max); margin: 0 auto; padding: 0 var(--pad) clamp(80px, 12vw, 160px);
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: clamp(36px, 7vw, 110px); align-items: center;
}
.services.no-photo { grid-template-columns: 1fr; }
.services.no-photo .services__photo { display: none; }
.svc { list-style: none; margin-top: 30px; border-top: 1px solid var(--line); max-width: 640px; }
.svc li { display: flex; gap: 22px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.svc__n { font: italic 400 20px var(--serif); color: var(--accent); padding-top: 2px; }
.svc h3 { font: 400 clamp(24px, 2.2vw, 30px)/1.2 var(--serif); }
.svc p { color: var(--muted); font-size: 15px; margin-top: 4px; }
.tools { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; max-width: 640px; }
.tools li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.tools strong { display: block; font: 500 15px var(--sans); color: var(--ink); }
.tools span { font-size: 13px; color: var(--muted); }

/* ---------- process ---------- */
.process-wrap { background: var(--paper); color: var(--navy-ink); }
.process-wrap .eyebrow { color: #5d6b7e; }
.process-wrap em { color: var(--gold-deep); }
.process { --line: rgba(19, 35, 58, 0.16); }
.process .step__n { color: var(--gold-deep); }
.process .step p { color: #4f5d70; }
.steps { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.step { padding: 34px 28px 40px 0; border-bottom: 1px solid var(--line); }
.step:not(:nth-child(3n+1)) { padding-left: 28px; border-left: 1px solid var(--line); }
.step__n { font: italic 400 22px var(--serif); color: var(--accent); }
.step h3 { font: 400 26px/1.2 var(--serif); margin: 10px 0 8px; }
.step p { color: var(--muted); font-size: 15px; }

/* ---------- contact ---------- */
.contact {
  text-align: center; padding: clamp(90px, 14vw, 180px) var(--pad) 40px;
  border-top: 1px solid var(--line);
  background: radial-gradient(60% 50% at 50% 0%, rgba(184,150,79,.10), transparent 70%);
}
.contact--small { padding-top: 100px; }
.contact__title { font: 400 clamp(40px, 6vw, 84px)/1.05 var(--serif); margin: 16px 0 28px; }
.contact__mail {
  font: 400 clamp(18px, 2vw, 24px) var(--serif); font-style: italic;
  border-bottom: 1px solid var(--accent); padding-bottom: 4px; word-break: break-all;
}
.contact__meta { margin-top: 26px; color: var(--muted); font-size: 14px; }
.contact__meta .dot { margin: 0 12px; opacity: 0.5; }
.contact__meta a:hover { color: var(--ink); }
.fineprint { margin-top: clamp(70px, 10vw, 120px); font-size: 12px; color: rgba(154,166,182,.7); }

/* ---------- project page ---------- */
.project main { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }
.p-head { padding-top: clamp(120px, 16vw, 200px); padding-bottom: clamp(36px, 5vw, 60px); }
.p-head .eyebrow { color: var(--accent); }
.p-title { font: 400 clamp(56px, 11vw, 168px)/0.92 var(--serif); margin-top: 18px; letter-spacing: 0.02em; }
.p-title span { display: block; font-style: italic; font-size: 0.36em; color: var(--muted); letter-spacing: 0; margin-top: 12px; }
.p-tagline { font: italic 400 clamp(20px, 2.2vw, 28px) var(--serif); color: var(--accent); margin-top: 22px; }

.player { position: relative; aspect-ratio: 16 / 9; background: #000; }
.player video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.player__ph {
  position: absolute; inset: 0; display: none; place-items: center; align-content: center; gap: 14px; text-align: center;
  background:
    radial-gradient(70% 80% at 70% 20%, color-mix(in srgb, var(--tint) 28%, transparent), transparent 65%),
    linear-gradient(160deg, #182a44, #0b1524);
}
.player__ph span { font: 400 clamp(44px, 8vw, 120px) var(--serif); letter-spacing: 0.22em; }
.player__ph small { font-size: 11px; letter-spacing: 0.28em; text-transform: uppercase; color: var(--muted); }
.player.is-missing .player__ph { display: grid; }
.player.is-missing video { visibility: hidden; }

.p-body { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: clamp(36px, 7vw, 120px); padding: clamp(60px, 9vw, 120px) 0; }
.p-logline { font: 400 clamp(26px, 2.8vw, 38px)/1.25 var(--serif); margin-bottom: 30px; }
.p-story p + p { margin-top: 18px; }
.p-story p:not(.p-logline) { color: rgba(242,238,230,.8); max-width: 640px; }
.p-credits { border-top: 1px solid var(--line); padding-top: 22px; align-self: start; }
.p-credits h4 { font: 400 11px var(--sans); letter-spacing: 0.28em; text-transform: uppercase; color: var(--accent); margin: 0 0 12px; }
.p-credits ul { list-style: none; margin-bottom: 30px; }
.p-credits li { padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 15px; }

.stills { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(12px, 2vw, 24px); }
.still:first-child { grid-column: span 2; }
.still img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

.next {
  display: block; margin: clamp(80px, 12vw, 160px) 0 0; padding: 50px 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.next__title { display: block; font: 400 clamp(40px, 7vw, 100px)/1 var(--serif); margin-top: 14px; transition: color 0.4s, transform 0.6s; }
.next__title span { font-style: italic; color: var(--muted); font-size: 0.45em; }
.next:hover .next__title { color: var(--accent); transform: translateX(12px); }

/* ---------- reveal ---------- */
.card, .step, .p-body, .still, .next, .section-head, .about__photo, .about__text, .services__text { opacity: 0; transform: translateY(24px); transition: opacity 1s ease, transform 1s cubic-bezier(.2,.7,.2,1); }
.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .card, .step, .p-body, .still, .next, .section-head, .about__photo, .about__text, .services__text { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .steps { grid-template-columns: 1fr 1fr; }
  .step, .step:not(:nth-child(3n+1)) { padding: 28px 18px 32px 0; border-left: 0; }
  .step:nth-child(even) { padding-left: 18px; border-left: 1px solid var(--line); }
  .p-body { grid-template-columns: 1fr; }
  .about, .services { grid-template-columns: 1fr; }
  .services__photo { order: -1; }
  .about__photo { max-width: 460px; }
}
@media (max-width: 640px) {
  .grid { grid-template-columns: 1fr; }
  .card:nth-child(n) { grid-column: auto; }
  .card:nth-child(n) .card__media { aspect-ratio: 16 / 9; }
  .steps { grid-template-columns: 1fr; }
  .step:nth-child(n) { padding: 26px 0; border-left: 0; }
  .home .nav__links a:not([href="#contact"]) { display: none; }
  .lang { margin-left: 0; }
  .stills { grid-template-columns: 1fr; }
  .about__skills, .tools { grid-template-columns: 1fr; }
  .still:first-child { grid-column: auto; }
}

/* hero entrance */
.hero__content > * { opacity: 0; transform: translateY(18px); animation: rise 1.2s cubic-bezier(.2,.7,.2,1) forwards; }
.hero__content > :nth-child(1) { animation-delay: .2s; }
.hero__content > :nth-child(2) { animation-delay: .35s; letter-spacing: .04em; animation-name: rise-title; }
.hero__content > :nth-child(3) { animation-delay: .5s; }
.hero__content > :nth-child(4) { animation-delay: .65s; }
.hero__content > :nth-child(5) { animation-delay: .85s; }
.viewfinder { opacity: 0; animation: fade 1.6s ease .9s forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes rise-title { to { opacity: 1; transform: none; letter-spacing: -0.01em; } }
@keyframes fade { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .hero__content > *, .viewfinder { opacity: 1; transform: none; animation: none; }
}
