/* ============================================================
   ZAEEM IQBAL — v2 BASE
   Tokens, fonts, reset, navigation, menu, curtain, grain,
   media placeholders and footer. Shared by every new page.
   ============================================================ */

@font-face {
  font-family: "Urbanist";
  src: url("../fonts/urbanist-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Urbanist";
  src: url("../fonts/urbanist-latin-wght-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "League Gothic";
  src: url("../fonts/league-gothic-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ---------- TOKENS ---------- */
:root {
  /* palette taken from the design PDF */
  --ink: #121212;
  --ink-2: #1a1a1a;
  --ink-3: #232323;
  --paper: #f4efe9;
  --red: #ff3434;
  --salmon: #ff6f6b;
  --dust: #e09e9e;
  --blush: #f9d3d4;
  --oxblood: #221515;
  --orange: #ff5c35;
  --stone: #8f8f8f;
  --fog: #dddddd;
  --slate: #616f75;
  --rose: #ff88c6;
  --teal: #66c4c2;
  --cream: #ebe7dc;
  --cream-card: #fdf8ee;
  --maroon: #5b1a18;

  /* theme (dark by default; the 3D path swaps these) */
  --bg: var(--ink);
  --fg: var(--paper);
  --fg-dim: rgba(244, 239, 233, 0.62);
  --fg-faint: rgba(244, 239, 233, 0.16);
  --accent: var(--red);
  --line: rgba(244, 239, 233, 0.14);

  --font: "Urbanist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "League Gothic", "Arial Narrow", Impact, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  --gutter: clamp(16px, 4.2vw, 64px);
  --max: 1480px;
  --nav-h: 76px;
  --radius: clamp(18px, 2vw, 30px);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.76, 0, 0.24, 1);

  color-scheme: dark;
}

/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: clip; }
body {
  margin: 0;
  min-height: 100svh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-weight: 400;
  font-size: clamp(16px, 1.05vw, 18px);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overflow-x: clip;
  transition: background-color 0.9s var(--ease-in-out), color 0.9s var(--ease-in-out);
}
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
::selection { background: var(--accent); color: var(--bg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip {
  position: fixed; top: 12px; left: 12px; z-index: 200;
  padding: 10px 16px; background: var(--accent); color: #fff; border-radius: 99px;
  transform: translateY(-150%); transition: transform 0.3s var(--ease-out);
}
.skip:focus { transform: none; }

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

/* Small section labels: "Artist statement" */
.slate {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--fg-dim);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.slate::before {
  content: "";
  width: 22px; height: 1px;
  background: var(--accent);
  flex: none;
}

/* ---------- FILM GRAIN (static, very light) ---------- */
.grain {
  position: fixed; inset: 0;
  z-index: 90; pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* ---------- PAGE CURTAIN (enter / leave) ---------- */
.curtain {
  position: fixed; inset: 0; z-index: 150;
  background: var(--accent);
  pointer-events: none;
  transform-origin: 50% 0%;
  animation: curtain-out 0.85s var(--ease-in-out) 0.05s both;
}
.curtain::after {
  content: ""; position: absolute; inset: 0;
  background: var(--bg);
  transform-origin: 50% 0%;
  animation: curtain-out 0.85s var(--ease-in-out) both;
}
html.is-leaving .curtain,
html.is-leaving .curtain::after {
  animation: curtain-in 0.6s var(--ease-in-out) both;
  transform-origin: 50% 100%;
}
html.is-leaving .curtain::after { animation-delay: 0.08s; }
@keyframes curtain-out { from { transform: scaleY(1); } to { transform: scaleY(0); } }
@keyframes curtain-in { from { transform: scaleY(0); } to { transform: scaleY(1); } }

/* ---------- NAVIGATION ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  padding-top: env(safe-area-inset-top);
  transition: transform 0.6s var(--ease-out), background-color 0.6s, backdrop-filter 0.6s;
}
.nav.is-hidden { transform: translateY(-100%); }
.nav.is-solid {
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
}
.nav__inner {
  height: var(--nav-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
}
.nav__group { display: flex; align-items: center; gap: clamp(18px, 2.2vw, 38px); }
.nav__group--right { justify-content: flex-end; }
.nav__link {
  position: relative;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-dim);
  padding-block: 8px;
  transition: color 0.35s;
}
.nav__link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 1px;
  background: currentColor;
  transform: scaleX(0); transform-origin: right;
  transition: transform 0.5s var(--ease-out);
}
.nav__link:hover, .nav__link[aria-current="page"] { color: var(--fg); }
.nav__link:hover::after { transform: scaleX(1); transform-origin: left; }
.nav__link--hire { color: var(--accent); }
.nav__link--hire:hover { color: var(--accent); }

/* Logo: typed in Urbanist Thin so it follows the theme colour. The third letter is a mirrored E. */
.logo {
  display: inline-flex; flex-direction: column; align-items: center;
  line-height: 1; color: var(--fg);
}
.logo__word {
  display: flex; gap: 0.42em;
  font-size: 22px; font-weight: 250; letter-spacing: 0;
}
.logo__word .flip { display: inline-block; transform: scaleX(-1); }
.logo__sub {
  margin-top: 5px;
  font-size: 6.5px; font-weight: 400; letter-spacing: 1.05em;
  margin-right: -1.05em;
  color: var(--fg-dim);
}

/* Patreon: the dark-red pill from the design */
.patreon {
  display: inline-flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 15px 0 12px;
  border-radius: 99px;
  background: #5b1818;
  color: #f4efe9;
  transition: background-color 0.4s, transform 0.5s var(--ease-out);
}
.patreon svg { width: 13px; height: 13px; flex: none; transition: transform 0.5s var(--ease-out); }
.patreon span { font-size: 11.5px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; white-space: nowrap; }
.patreon:hover, .patreon:focus-visible { background: #7a2020; }
.patreon:hover svg, .patreon:focus-visible svg { transform: rotate(-12deg) scale(1.1); }

.nav__toggle {
  display: none;
  justify-self: end;
  align-items: center; gap: 10px;
  height: 40px; padding: 0 4px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
}
.nav__toggle i { position: relative; width: 22px; height: 8px; }
.nav__toggle i::before, .nav__toggle i::after {
  content: ""; position: absolute; left: 0; right: 0; height: 1.5px; background: currentColor;
  transition: transform 0.5s var(--ease-out), top 0.5s var(--ease-out);
}
.nav__toggle i::before { top: 0; }
.nav__toggle i::after { top: 6.5px; }
.nav__toggle[aria-expanded="true"] i::before { top: 3.25px; transform: rotate(45deg); }
.nav__toggle[aria-expanded="true"] i::after { top: 3.25px; transform: rotate(-45deg); }

@media (max-width: 980px) {
  :root { --nav-h: 64px; }
  .nav__inner { grid-template-columns: 1fr auto; }
  .nav__group { display: none; }
  .logo { align-items: flex-start; }
  .nav__toggle { display: inline-flex; }
}

/* ---------- MOBILE MENU ---------- */
.menu {
  position: fixed; inset: 0; z-index: 99;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: calc(var(--nav-h) + env(safe-area-inset-top) + 24px) var(--gutter) calc(28px + env(safe-area-inset-bottom));
  background: var(--bg);
  clip-path: inset(0 0 100% 0);
  visibility: hidden;
  transition: clip-path 0.7s var(--ease-in-out), visibility 0s linear 0.7s;
}
.menu.is-open { clip-path: inset(0 0 0 0); visibility: visible; transition: clip-path 0.7s var(--ease-in-out); }
.menu__list { display: flex; flex-direction: column; gap: 2px; }
.menu__list a {
  display: flex; align-items: baseline; gap: 14px;
  font-size: clamp(36px, 10vw, 64px); font-weight: 300; line-height: 1.08; letter-spacing: -0.01em;
  text-transform: uppercase;
  opacity: 0; transform: translateY(30px);
  transition: opacity 0.5s, transform 0.7s var(--ease-out);
}
.menu__list a.is-hire { color: var(--accent); font-weight: 600; }
.menu.is-open .menu__list a { opacity: 1; transform: none; }
.menu.is-open .menu__list li:nth-child(2) a { transition-delay: 0.05s; }
.menu.is-open .menu__list li:nth-child(3) a { transition-delay: 0.1s; }
.menu.is-open .menu__list li:nth-child(4) a { transition-delay: 0.15s; }
.menu.is-open .menu__list li:nth-child(5) a { transition-delay: 0.2s; }
.menu.is-open .menu__list li:nth-child(6) a { transition-delay: 0.25s; }
.menu__foot { display: flex; flex-wrap: wrap; gap: 12px 22px; font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-dim); }
.menu__foot a:hover { color: var(--fg); }

/* ---------- MEDIA SLOTS (placeholder until a real file exists) ---------- */
.media {
  position: relative;
  overflow: hidden;
  background: var(--ph, var(--ink-3));
  isolation: isolate;
}
.media > video, .media > img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.8s var(--ease-out);
}
.media.is-loaded > video, .media.is-loaded > img { opacity: 1; }.media.is-loaded .media__ph { opacity: 0; }
.media__ph {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  padding: 12px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase;
  color: transparent;
  transition: opacity 0.6s, color 0.6s;
}
/* the label only shows once we know the file isn't there, never while it's still loading */
.media.is-missing .media__ph { color: var(--ph-ink, rgba(0, 0, 0, 0.55)); }

/* ---------- FOOTER ---------- */
.foot {
  position: relative;
  padding: clamp(64px, 9vw, 120px) 0 calc(32px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}
.foot__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
}
.foot__sign { font-size: clamp(26px, 3vw, 40px); font-weight: 300; line-height: 1.15; max-width: 14ch; }
.foot__sign b { font-weight: 800; color: var(--accent); }
.foot__sign small { display: block; margin-top: 14px; font-size: 14px; line-height: 1.6; color: var(--fg-dim); max-width: 30ch; }
.foot h3 { margin-bottom: 18px; }
.foot__list { display: flex; flex-direction: column; gap: 8px; }
.foot__list a { display: inline-flex; gap: 8px; color: var(--fg-dim); transition: color 0.3s, transform 0.4s var(--ease-out); }
.foot__list a:hover { color: var(--fg); transform: translateX(4px); }
.foot__base {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  margin-top: clamp(48px, 7vw, 96px);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--fg-dim);
}
@media (max-width: 760px) {
  .foot__grid { grid-template-columns: 1fr 1fr; }
  .foot__sign { grid-column: 1 / -1; }
}

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .curtain { display: none; }
}

/* links to clients and credits: quiet, a hairline underline and a small arrow, never blue */
.xlink {
  color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.22em;
  text-decoration-color: color-mix(in srgb, currentColor 32%, transparent);
  transition: color 0.3s, text-decoration-color 0.3s;
}
.xlink::after { content: "\2197"; display: inline-block; margin-left: 0.18em; font-size: 0.72em; font-weight: 400; opacity: 0.55; transform: translateY(-0.12em); transition: transform 0.35s var(--ease-out), opacity 0.3s; }
.xlink:hover, .xlink:focus-visible { color: var(--accent, var(--red)); text-decoration-color: currentColor; }
.xlink:hover::after, .xlink:focus-visible::after { opacity: 1; transform: translate(0.12em, -0.24em); }
.marquee .xlink { text-decoration: none; }

/* ---------- BOTTOM NAVIGATION (phones and tablets in portrait) ----------
   replaces the menu button there; the desktop navigation is unchanged */
:root { --bnav-h: 0px; }
.bnav { display: none; }
@media (max-width: 980px) {
  :root { --bnav-h: 62px; }
  .has-bnav .nav__toggle { display: none; }
  .has-bnav body { padding-bottom: calc(var(--bnav-h) + env(safe-area-inset-bottom)); }
  .bnav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
    height: calc(var(--bnav-h) + env(safe-area-inset-bottom));
    padding: 0 max(6px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(6px, env(safe-area-inset-left));
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2);
    border-top: 1px solid var(--line);
    transition: background-color 0.5s, border-color 0.5s;
  }
  .bnav__item {
    position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    color: var(--fg-dim);
    font-size: 10px; font-weight: 600; letter-spacing: 0.04em; line-height: 1;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.3s;
  }
  .bnav__item svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.4s var(--ease-out); }
  .bnav__item span { white-space: nowrap; }
  .bnav__item:active svg { transform: scale(0.9); }
  .bnav__item[aria-current="page"] { color: var(--fg); }
  .bnav__item[aria-current="page"]::before {
    content: ""; position: absolute; top: 0; left: 50%; width: 22px; height: 2px; margin-left: -11px;
    border-radius: 0 0 2px 2px; background: var(--accent);
  }
  .bnav__item[aria-current="page"] svg { stroke-width: 2; }
  .bnav__item--hire { color: var(--accent); }
  /* things that sit at the bottom of the screen move up above the bar */
  .yearbar { bottom: calc(14px + var(--bnav-h) + env(safe-area-inset-bottom)) !important; }
}
