/* ============================================================
   Studio template — shared styles
   Inspired by the layout & feel of a dark motion/VFX studio site.
   Replace fonts, colours and content with your own.
   ============================================================ */

/* ---- Fonts (swap for licensed brand fonts) ---- */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;1,400&family=Archivo:wght@400;500;600&display=swap');

/* ---- Design tokens ---- */
:root {
  --bg: #0e0e0e;
  --bg-elevated: #141414;
  --text: #f2f2f2;
  --text-muted: #8c8c8c;
  --text-dim: #565656;
  --accent: #d40000;          /* logo red — active nav + menu underlines */
  --line: rgba(255, 255, 255, 0.14);
  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --header-h: 64px;
  --maxw: 1240px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  /* Reusable film-grain noise (tiled SVG) */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Global film grain over every surface — disabled (set display:block + opacity to re-enable) */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  background-image: var(--grain);
  background-size: 180px 180px;
  opacity: 0.09;
  display: block;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

/* ---- Logo mark ---- */
.logo-mark {
  width: 34px;
  height: 34px;
  display: inline-block;
  flex: none;
}
.logo-mark svg { width: 100%; height: 100%; fill: var(--text); }

/* ============================================================
   HOMEPAGE — full-screen centred menu
   ============================================================ */
.landing {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 24px 40px;
  /* Flat grey backdrop; hover tint (--plate) still shows through */
  background-color: var(--plate, #202020);
  transition: background-color 0.55s var(--ease);
}
/* Resting backdrop — a faint, heavily darkened image (like the Explore overlay) */
.landing__base {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #0e0e0e url('images/image%206.png') center / cover no-repeat;
}
.landing__base::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(8, 8, 8, 0.94);
}
/* Full-bleed image revealed on menu hover */
.landing__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-position: center;
  background-size: cover;
  opacity: 0;
  transition: opacity 0.5s var(--ease);
}
.landing__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}
.landing__bg.show { opacity: 1; }
/* Gradients are already dark by design — skip the photo-dimming scrim */
.landing__bg.no-scrim::after { background: transparent; }
/* Full-bleed video revealed on menu hover */
.landing__video {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  filter: brightness(0.45);
  transition: opacity 0.5s var(--ease);
}
.landing__video.show { opacity: 1; }
/* Opt-out of the heavy dimming for clips that are already dark */
.landing__video.undimmed { filter: brightness(1); }
/* Bouncing-pixel animation — overlaid ABOVE the menu, transparent */
.landing__canvas {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s var(--ease);
}
.landing__canvas.show { opacity: 1; }
/* Keep content above the backplate media */
.landing__logo,
.landing__menu,
.landing__secondary,
.landing__foot { position: relative; z-index: 1; }

.landing__logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
/* Logo builds from pixels flying in from the browser edges and stays pixel-built */
.landing__logo .tag {
  height: 58px;
  width: auto;
  opacity: 0;                       /* used for sampling + layout only */
  transition: opacity 0.4s var(--ease);
}
.landing__logo.assembled .tag { opacity: 1; }   /* fallback if pixels can't be read */
.landing__logo .tag-canvas {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}
.logo-intro {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  transition: opacity 0.4s var(--ease);
}
.logo-intro.done { opacity: 0; }

/* Pulsing "send pixels home" arrow, bottom-right at the base of the pile */
.logo-recall {
  position: fixed;
  right: 12px;          /* JS repositions this to hug the pile's right edge */
  bottom: 12px;
  z-index: 41;
  width: 30px;
  height: 40px;
  display: grid;
  place-items: center;
  color: var(--accent);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.4s var(--ease), visibility 0s linear 0.4s;
}
.logo-recall.show {
  visibility: visible;
  pointer-events: auto;
  animation: recall-pulse 1.5s ease-in-out infinite;
}
.logo-recall svg {
  width: 16px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: square;
  stroke-linejoin: miter;
}
.logo-recall:hover { color: #ff3b3b; }
@keyframes recall-pulse {
  0%, 100% { transform: translateY(0);    opacity: 0.5; }
  50%      { transform: translateY(-7px); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .logo-recall.show { animation: none; opacity: 0.85; }
}

/* Mobile-only cue above the menu (no hover on touch, so spell it out) */
.menu-cue {
  display: none;                 /* shown on touch devices only */
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-bottom: 20px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--accent);
  transition: opacity 0.45s var(--ease);
}
.menu-cue span { font-size: 0.95rem; line-height: 1; animation: cue-bob 1.6s ease-in-out infinite; }
.menu-cue.hide { opacity: 0; pointer-events: none; }
@keyframes cue-bob {
  0%, 100% { transform: translateY(0);   opacity: 0.5; }
  50%      { transform: translateY(4px); opacity: 1; }
}
@media (hover: none), (pointer: coarse) { .menu-cue { display: flex; } }
@media (prefers-reduced-motion: reduce) { .menu-cue span { animation: none; } }

/* One-time hint arrow that points at each menu item */
.menu-hint {
  position: fixed;
  z-index: 41;
  width: 30px;
  height: 18px;
  color: var(--accent);
  transform: translateY(-50%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s var(--ease), left 0.45s var(--ease), top 0.45s var(--ease);
}
.menu-hint.show { opacity: 1; visibility: visible; }
.menu-hint svg {
  width: 100%; height: 100%;
  fill: none; stroke: currentColor; stroke-width: 2.4;
  stroke-linecap: square; stroke-linejoin: miter;
}
.menu-hint.left-point svg { transform: scaleX(-1); }   /* flip to point left */
.menu-hint.right-point.show { animation: hint-right 1.5s ease-in-out infinite; }
.menu-hint.left-point.show  { animation: hint-left  1.5s ease-in-out infinite; }
@keyframes hint-right {
  0%, 100% { transform: translateY(-50%) translateX(0);   opacity: 0.45; }
  50%      { transform: translateY(-50%) translateX(5px);  opacity: 1; }
}
@keyframes hint-left {
  0%, 100% { transform: translateY(-50%) translateX(0);   opacity: 0.45; }
  50%      { transform: translateY(-50%) translateX(-5px); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .menu-hint.show { animation: none; }
}
.landing__logo .wordmark-img { width: 230px; height: auto; margin-top: 18px; }

.landing__menu {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2px;
  text-align: center;
  padding: 40px 0;
}
.landing__menu a {
  position: relative;
  display: inline-block;
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3.2vw, 2.35rem);
  line-height: 1.35;
  color: var(--text-muted);
  transition: color 0.3s var(--ease);
}
/* Hover only where a real pointer exists — otherwise touch leaves items stuck lit */
@media (hover: hover) {
  .landing__menu a:hover { color: var(--text); }
  .landing__menu a:hover .label { opacity: 0; }
  .landing__menu a:hover .desc { opacity: 1; }
  .landing__menu a:hover::after { transform: scaleX(1); }
}
/* Same reveal, driven by tap on touch devices */
.landing__menu a.is-active { color: var(--text); }
.landing__menu a.is-active .label { opacity: 0; }
.landing__menu a.is-active .desc { opacity: 1; }
.landing__menu a.is-active::after { transform: scaleX(1); }
/* Hover description — swaps in over the label, in mono, without shifting layout */
.landing__menu .label { transition: opacity 0.3s var(--ease); }
.landing__menu .desc {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  /* same as the footer line */
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  word-spacing: -0.14em;   /* tighten the wide mono spaces */
  color: var(--text);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}
/* Underline that grows left-to-right on hover */
.landing__menu a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0.08em;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.85s var(--ease);
}

.landing__secondary {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 34px;
  margin-bottom: 34px;
}
.landing__secondary a {
  font-size: 0.95rem;
  color: var(--text-muted);
  transition: color 0.25s var(--ease);
}
.landing__secondary a:hover { color: var(--text); }

.landing__foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  /* lifted clear of the floor so the pixel pile doesn't collect on top of it */
  margin-bottom: clamp(30px, 9vh, 86px);
}
.social {
  display: flex;
  gap: 22px;
}
.social a {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  transition: color 0.25s var(--ease);
}
.social a:hover { color: var(--text); }
.copyright {
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}
.copyright a { color: var(--text-dim); }
.copyright a:hover { color: var(--text-muted); }
/* Homepage copyright + email in brand red, monospace to match the code */
.landing__foot .copyright,
.landing__foot .copyright a {
  color: var(--accent);
  font-family: ui-monospace, Menlo, Consolas, monospace;
  letter-spacing: 0.06em;
}
.landing__foot .copyright a:hover { color: #ff3b3b; }

/* ---- "Say hello" contact form ---- */
/* visually-hidden label text (kept for screen readers) */
.vh {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.hello-form {
  /* absolutely placed so revealing it never shifts the menu */
  position: absolute;
  left: 50%;
  /* JS centres this in the gap between the menu and the footer (see positionHelloForm) */
  top: 68%;
  transform: translate(-50%, -50%);
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 5px;
  width: min(680px, 92vw);
  /* hidden until the menu item is hovered/tapped */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s var(--ease), visibility 0s linear 0.35s;
}
.hello-form.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.35s var(--ease);
}
.hello-form__hp { display: none; }   /* honeypot */

.hello-form__field { flex: 1 1 150px; display: block; }
.hello-form__field--msg { flex: 1 1 200px; }
.hello-form input[type="text"],
.hello-form input[type="email"] {
  width: 100%;
  height: 40px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.94);   /* white, dialled down a touch */
  border: none;
  border-radius: 0;
  color: var(--accent);                     /* red type */
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  /* each field reveals in a blocky left-to-right wipe */
  clip-path: inset(0 100% 0 0);
}
.hello-form input::placeholder { color: rgba(212, 0, 0, 0.5); }
.hello-form input:focus { outline: 1px solid var(--accent); outline-offset: 2px; }

.hello-form__send {
  flex: 0 0 auto;
  height: 40px;                              /* matches the fields exactly */
  padding: 0 24px;
  background: var(--accent);                 /* red button by default */
  color: #fff;                               /* white type */
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
  clip-path: inset(0 100% 0 0);
}
/* red button; inverts to white-fill / red-type on rollover */
.hello-form__send:hover { background: rgba(255, 255, 255, 0.94); color: var(--accent); }

/* Pixely staggered wipe-in once the form is open */
.hello-form.open input[type="text"],
.hello-form.open input[type="email"],
.hello-form.open .hello-form__send {
  animation: hello-wipe 0.45s steps(10, end) forwards;
}
.hello-form.open .hello-form__field:nth-child(3) input { animation-delay: 0.08s; }
.hello-form.open .hello-form__field:nth-child(4) input { animation-delay: 0.16s; }
.hello-form.open .hello-form__send { animation-delay: 0.24s; }
@keyframes hello-wipe { to { clip-path: inset(0 0 0 0); } }

.hello-form__status {
  flex-basis: 100%;
  text-align: center;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--accent);
  min-height: 1em;
  margin-top: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .hello-form.open input, .hello-form.open .hello-form__send { animation: none; clip-path: none; }
}

/* ============================================================
   INNER PAGE — fixed header + work grid
   ============================================================ */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding: 0 26px;
  z-index: 50;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  background: rgba(14, 14, 14, 0.96);
  border-bottom-color: var(--line);
}

.header__left,
.header__right {
  display: flex;
  align-items: center;
  gap: 26px;
  flex: 1;
}
.header__right { justify-content: flex-end; }
.header__center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.explore-btn {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 0.98rem;
  letter-spacing: 0.01em;
}
.explore-btn .bars { display: inline-flex; flex-direction: column; gap: 4px; }
.explore-btn .bars span {
  width: 22px; height: 2px; background: var(--text);
  transition: transform 0.3s var(--ease);
}

/* Filter sub-nav — hidden until scrolled */
.filters {
  display: flex;
  gap: 24px;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.is-scrolled .filters { opacity: 1; transform: none; pointer-events: auto; }
.filters a {
  font-size: 0.92rem;
  color: var(--text-muted);
  transition: color 0.25s var(--ease);
}
.filters a:hover { color: var(--text); }
.filters a.active { color: var(--accent); }

.showreel {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.is-scrolled .showreel { opacity: 1; transform: none; pointer-events: auto; }
.showreel__play {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line);
  display: grid; place-items: center;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
}
.showreel:hover .showreel__play { border-color: var(--text); }
.showreel__play svg { width: 11px; height: 11px; fill: var(--text); margin-left: 2px; }
.showreel span { font-size: 0.92rem; color: var(--text-muted); }

/* ---- Hero ---- */
.hero {
  height: 100vh;
  min-height: 560px;
  position: relative;
  background: #1a1a1a center/cover no-repeat;
  display: flex;
  align-items: flex-end;
}
.hero::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.35) 0%, transparent 30%, transparent 60%, rgba(0,0,0,0.6) 100%);
}
.hero__caption {
  position: relative;
  z-index: 2;
  padding: 0 40px 48px;
  max-width: var(--maxw);
}
.hero__eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.hero__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1.05;
}

/* ---- Work grid ---- */
.work {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 26px 20px 90px;
}
.work__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 26px;
}
.tile {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-elevated);
}
.tile img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease), filter 0.4s var(--ease);
  filter: saturate(0.92);
}
.tile__overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 22px 24px;
  background: linear-gradient(180deg, transparent 45%, rgba(0,0,0,0.72) 100%);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}
.tile:hover img { transform: scale(1.05); filter: saturate(1.05); }
.tile:hover .tile__overlay { opacity: 1; }
.tile__client {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.tile__name {
  font-family: var(--serif);
  font-size: 1.4rem;
  line-height: 1.15;
}

/* ---- Footer (inner pages) ---- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 46px 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
}
.site-footer .foot-nav { display: flex; flex-wrap: wrap; gap: 24px; }
.site-footer .foot-nav a { font-size: 0.9rem; color: var(--text-muted); }
.site-footer .foot-nav a:hover { color: var(--text); }
.site-footer .copyright { order: 3; width: 100%; }

/* ============================================================
   Slide-out "Explore" panel (shared)
   ============================================================ */
.overlay-nav {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  visibility: hidden;
  /* stay visible while the wipe retracts on close */
  transition: visibility 0s linear 0.5s;
}
/* Black backplate that wipes in from the left */
.overlay-nav::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(10, 10, 10, 0.98);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.45s var(--ease);
}
.overlay-nav.open {
  visibility: visible;
  transition-delay: 0s;
}
.overlay-nav.open::before { transform: scaleX(1); }

.overlay-nav a {
  position: relative;
  z-index: 1;
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  color: var(--text-muted);
  /* hidden until the wipe finishes; entrance handled by animation below */
  opacity: 0;
  transform: translateY(16px);
  transition: color 0.25s var(--ease);
}
/* Entrance via animation (keeps :hover transitions instant) */
.overlay-nav.open a { animation: ovnav-in 0.3s var(--ease) forwards; }
.overlay-nav.open a:nth-child(2) { animation-delay: 0.40s; }
.overlay-nav.open a:nth-child(3) { animation-delay: 0.44s; }
.overlay-nav.open a:nth-child(4) { animation-delay: 0.48s; }
.overlay-nav.open a:nth-child(5) { animation-delay: 0.52s; }
.overlay-nav.open a:nth-child(6) { animation-delay: 0.56s; }
.overlay-nav.open a:nth-child(7) { animation-delay: 0.60s; }
.overlay-nav.open a:nth-child(8) { animation-delay: 0.64s; }
.overlay-nav.open a:nth-child(9) { animation-delay: 0.68s; }
@keyframes ovnav-in { to { opacity: 1; transform: none; } }

.overlay-nav a:hover { color: var(--text); }
/* Underline that grows left-to-right, matching the main menu */
.overlay-nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0.02em;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.6s var(--ease);
}
.overlay-nav a:hover::after { transform: scaleX(1); }
.overlay-nav .close { z-index: 1; }
.overlay-nav .close {
  position: absolute;
  top: 22px; right: 30px;
  font-size: 2rem;
  line-height: 1;
  color: var(--text-muted);
}
.overlay-nav .close:hover { color: var(--text); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 860px) {
  .filters, .showreel span { display: none; }
  .work__grid { grid-template-columns: 1fr; gap: 18px; }
  .header__center { display: none; }
  .site-header { justify-content: space-between; }
}

/* Contact form stacks on narrow screens */
@media (max-width: 600px) {
  .hello-form { flex-direction: column; gap: 5px; width: 88vw; }
  .hello-form__field, .hello-form__send { flex: none; width: 100%; }
  .hello-form__send { padding: 13px 22px; }
}
