/* ============================================================
   EVAN GRAINGER — Director / Producer portfolio
   Shared stylesheet (converted from Claude design handoff)
   ============================================================ */

:root {
  --bg: #0a0a0a;
  --panel: #141414;
  --tile: #151515;
  --text: #f2ede4;
  --text-2: #c9c2b4;
  --muted: #8a8478;
  --accent: #3772ff;
  --ease: cubic-bezier(.65, 0, .35, 1);
  --pad: 36px;         /* default page side padding */
  --pad-wide: 56px;    /* wider padding used on work/about */
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Space Mono', monospace;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--text); text-decoration: none; }

img { display: block; }

/* ---------- Film grain overlay (homepage) ---------- */
.grain {
  position: fixed;
  inset: -30px;
  z-index: 100;
  pointer-events: none;
  opacity: .05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%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");
  animation: grainMove .5s steps(2) infinite;
}
@keyframes grainMove {
  0%{transform:translate(0,0)} 10%{transform:translate(-2%,-4%)} 20%{transform:translate(-6%,2%)}
  30%{transform:translate(3%,-8%)} 40%{transform:translate(-3%,5%)} 50%{transform:translate(-8%,2%)}
  60%{transform:translate(6%,6%)} 70%{transform:translate(0,3%)} 80%{transform:translate(2%,-3%)}
  90%{transform:translate(-2%,4%)} 100%{transform:translate(0,0)}
}

/* ---------- Loader (homepage) ---------- */
.loader {
  position: fixed; inset: 0; z-index: 200;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  opacity: 1; transition: opacity 1.6s var(--ease);
}
.loader.is-exiting { opacity: 0; pointer-events: none; }
.loader.is-done { display: none; }
.loader-orbit { position: relative; width: 96px; height: 96px; }
.loader-orbit span {
  position: absolute; top: 50%; left: 50%;
  width: 40px; height: 40px; margin: -20px 0 0 -20px;
  display: flex; align-items: center; justify-content: center;
}
.loader-orbit span:nth-child(1){ animation: orbitA 5s var(--ease) forwards; }
.loader-orbit span:nth-child(2){ animation: orbitB 5s var(--ease) forwards; }
.loader-orbit span:nth-child(3){ animation: orbitC 5s var(--ease) forwards; }
@keyframes orbitA{0%{transform:rotate(0deg) translateX(30px) rotate(0deg);opacity:1}55%{transform:rotate(430deg) translateX(34px) rotate(-430deg);opacity:1}80%{transform:rotate(640deg) translateX(26px) rotate(-640deg);opacity:1}100%{transform:rotate(760deg) translateX(30px) rotate(-760deg);opacity:0}}
@keyframes orbitB{0%{transform:rotate(120deg) translateX(30px) rotate(-120deg);opacity:1}55%{transform:rotate(550deg) translateX(24px) rotate(-550deg);opacity:1}80%{transform:rotate(760deg) translateX(36px) rotate(-760deg);opacity:1}100%{transform:rotate(880deg) translateX(30px) rotate(-880deg);opacity:0}}
@keyframes orbitC{0%{transform:rotate(240deg) translateX(30px) rotate(-240deg);opacity:1}55%{transform:rotate(670deg) translateX(36px) rotate(-670deg);opacity:1}80%{transform:rotate(880deg) translateX(24px) rotate(-880deg);opacity:1}100%{transform:rotate(1000deg) translateX(30px) rotate(-1000deg);opacity:0}}

/* ---------- Header ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  display: flex; justify-content: space-between; align-items: center;
  padding: 24px var(--pad); background: transparent;
}
.site-header.header-end { justify-content: flex-end; }
.wordmark {
  font-family: 'Archivo', sans-serif; font-size: 16px; font-weight: 900;
  letter-spacing: .04em; color: var(--text);
}
.menu-btn {
  background: none; border: none; color: var(--text);
  font-family: 'Space Mono', monospace; font-size: 12px; font-weight: 700;
  letter-spacing: .15em; cursor: pointer;
  display: flex; align-items: center; gap: 10px; padding: 6px 0;
}
.menu-btn .bars { display: flex; flex-direction: column; gap: 4px; width: 22px; }
.menu-btn .bars span { height: 2px; background: currentColor; width: 100%; }

/* Header scrim on project/hero pages for small screens */
.site-header.has-scrim::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to bottom, rgba(10,10,10,.5), transparent);
  pointer-events: none; opacity: 0;
}

/* ---------- Fullscreen menu overlay ---------- */
.menu-overlay {
  position: fixed; inset: 0; z-index: 40;
  background: #fff; color: var(--bg);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: var(--pad);
  visibility: hidden; pointer-events: none;
}
.menu-overlay.is-open {
  visibility: visible; pointer-events: auto;
  animation: menuIn .7s var(--ease);
}
@keyframes menuIn {
  from { clip-path: circle(0% at 100% 0%); }
  to   { clip-path: circle(150% at 100% 0%); }
}
.menu-top { display: flex; justify-content: space-between; align-items: center; }
.menu-top .wordmark { color: var(--bg); }
.menu-close {
  background: none; border: none; color: var(--bg);
  font-family: 'Space Mono', monospace; font-size: 12px; font-weight: 700;
  letter-spacing: .15em; cursor: pointer; padding: 0; transition: color .3s var(--ease);
}
.menu-close:hover { color: var(--accent); }
.menu-links { display: flex; flex-direction: column; gap: 14px; }
.menu-links a {
  font-family: 'Archivo', sans-serif; font-size: 64px; font-weight: 900;
  line-height: 1; color: var(--bg); transition: color .4s var(--ease);
}
.menu-links a:hover { color: var(--accent); }
.menu-foot {
  display: flex; gap: 24px; flex-wrap: wrap;
  font-family: 'Space Mono', monospace; font-size: 12px; letter-spacing: .05em; color: var(--bg);
}
.menu-foot a { color: var(--bg); transition: color .3s var(--ease); }
.menu-foot a:hover { color: var(--accent); }

/* ---------- Footer ---------- */
.site-footer {
  padding: 56px var(--pad);
  border-top: 1px solid rgba(242,237,228,.15);
  background: var(--panel);
  display: flex; align-items: flex-end; justify-content: space-between;
  flex-wrap: wrap; gap: 24px;
}
.site-footer .wordmark { font-size: 16px; }
.footer-glyph { position: relative; width: 56px; height: 56px; }
.footer-glyph span { position: absolute; top: 50%; left: 50%; width: 24px; height: 24px; margin: -12px 0 0 -12px; }
.footer-glyph span:nth-child(1){ transform: rotate(0deg)   translate(20px) rotate(0deg); }
.footer-glyph span:nth-child(2){ transform: rotate(120deg) translate(20px) rotate(-120deg); }
.footer-glyph span:nth-child(3){ transform: rotate(240deg) translate(20px) rotate(-240deg); }
.footer-contact { display: flex; flex-direction: column; gap: 6px; font-family: 'Space Mono', monospace; font-size: 12px; color: var(--text-2); }
.footer-contact a { color: var(--text-2); transition: color .3s var(--ease), transform .3s var(--ease); display: inline-block; }
.footer-contact a.email:hover { color: var(--accent); transform: translateX(4px); }
.footer-social { display: flex; gap: 10px; }
.footer-social a:hover { color: var(--accent); }

/* ============================================================
   HOMEPAGE
   ============================================================ */
.hero {
  position: relative; height: 100vh;
  display: flex; align-items: flex-end; padding: 0 var(--pad) 56px;
}
.hero-media { position: absolute; inset: 0; overflow: hidden; }
.hero-media iframe {
  position: absolute; top: 50%; left: 50%;
  width: 106vw; height: 60.5vw; min-width: 194vh; min-height: 109vh;
  transform: translate(-50%, -50%); border: none; pointer-events: none;
}
.hero-scrim { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(10,10,10,.85), rgba(10,10,10,.1) 45%); }
.hero-content { position: relative; z-index: 2; }
.hero-title {
  margin: 0; font-family: 'Archivo', sans-serif;
  font-size: clamp(36px, 7vw, 100px); font-weight: 900;
  line-height: .86; letter-spacing: -.02em; color: #fff;
}
.hero-title span { display: block; opacity: 0; }
.hero-title .l1 { animation: heroFadeUp .8s var(--ease) 5.05s forwards; }
.hero-title .l2 { animation: heroFadeUp .8s var(--ease) 5.35s forwards; }
.hero-tag {
  margin: 18px 0 0; font-family: 'Space Mono', monospace; font-size: 14px;
  color: var(--text-2); letter-spacing: .05em; width: 360px; max-width: 90vw;
  opacity: 0; animation: heroFadePara .8s var(--ease) 5.75s forwards;
}
/* If no loader on page, don't hide hero text waiting for the 5s delay */
body.no-loader .hero-title span,
body.no-loader .hero-tag { opacity: 1; animation: none; }
@keyframes heroFadeUp { from{opacity:0;transform:translateY(28px)} to{opacity:1;transform:translateY(0)} }
@keyframes heroFadePara { from{opacity:0;transform:translateY(12px)} to{opacity:1;transform:translateY(0)} }

.scroll-hint { display: flex; justify-content: flex-end; padding: 0 var(--pad); margin-bottom: 80px; }
.scroll-hint span { font-family: 'Space Mono', monospace; font-size: 11px; color: var(--muted); letter-spacing: .1em; margin-top: 20px; }

/* Homepage featured 2-col staggered grid */
.featured { padding: 0 var(--pad); display: grid; grid-template-columns: 1fr 1fr; column-gap: 48px; }
.featured .col { display: flex; flex-direction: column; gap: 20px; }
.featured .col.offset-1 { padding-top: 180px; }
.featured .col.offset-2 { padding-top: 64px; }
.featured .col.offset-3 { padding-top: 200px; }
.featured-label { font-family: 'Archivo', sans-serif; font-size: 28px; font-weight: 400; color: #e8e4d8; }
.featured-label i, .featured-label .sub { font-style: italic; font-weight: 400; color: var(--muted); }
.featured-tile {
  position: relative; aspect-ratio: 16/9; overflow: hidden; display: block;
}
.featured-tile:hover { outline: 2px solid var(--accent); }
.featured-parallax { position: absolute; inset: -30px 0; transition: transform .2s linear; will-change: transform; }
.spacer-120 { height: 120px; }

/* ============================================================
   WORK GRID (shared media tile)
   ============================================================ */
.work-intro { padding: 140px var(--pad-wide) 32px; }
.work-intro h1 {
  margin: 0 0 8px; font-family: 'Space Mono', monospace; font-size: 13px; font-weight: 400;
  letter-spacing: .1em; color: var(--text-2); line-height: 1;
}
.work-intro h1 .arrow { font-weight: 300; margin-left: 6px; }
.work-grid {
  padding: 0 var(--pad-wide) 100px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
}
.work-tile {
  position: relative; aspect-ratio: 16/9; display: block; overflow: hidden; background: var(--tile);
}
.work-tile:hover { outline: 2px solid var(--accent); }
.tile-media { position: absolute; inset: 0; width: 100%; height: 100%; }
.tile-cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile-gif { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s ease; }
.work-tile:hover .tile-gif, .featured-tile:hover .tile-gif { opacity: 1; }
.tile-caption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 14px;
  background: linear-gradient(to top, rgba(0,0,0,.8), transparent); pointer-events: none;
}
.tile-caption .t { font-family: 'Archivo', sans-serif; font-size: 13px; font-weight: 700; letter-spacing: .02em; }
.tile-caption .s { font-family: 'Space Mono', monospace; font-size: 11px; color: var(--text-2); margin-top: 2px; }

/* ============================================================
   ABOUT
   ============================================================ */
.about-grid {
  padding: 160px var(--pad-wide) 120px;
  display: grid; grid-template-columns: 1fr 1fr; column-gap: 96px;
  align-items: start; max-width: 1200px;
}
.about-photo { aspect-ratio: 4/5; overflow: hidden; background: var(--panel); }
.about-photo img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1); }
.about-copy { display: flex; flex-direction: column; justify-content: center; gap: 40px; padding-top: 24px; }
.about-copy .kicker { margin: 0; font-family: 'Space Mono', monospace; font-size: 12px; color: var(--muted); letter-spacing: .1em; }
.about-copy h1 { margin: 0; font-family: 'Archivo', sans-serif; font-weight: 800; font-size: clamp(24px, 3vw, 36px); line-height: 1.05; color: var(--accent); max-width: 520px; }
.about-copy p { margin: 0; font-family: 'Space Mono', monospace; font-size: 15px; line-height: 1.7; color: var(--text-2); max-width: 460px; }
.about-stills-wrap { padding: 0 var(--pad-wide) 120px; }
.about-stills-wrap .kicker { margin: 0 0 24px; font-family: 'Space Mono', monospace; font-size: 12px; color: var(--muted); letter-spacing: .1em; }
.stills-pile { position: relative; height: 620px; user-select: none; }
.still {
  position: absolute; width: 260px; height: 340px; cursor: grab;
  box-shadow: 0 20px 40px rgba(0,0,0,.5); background: var(--panel);
  transition: box-shadow .2s ease;
}
.still:active { cursor: grabbing; }
.still img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }

/* ============================================================
   CONTACT
   ============================================================ */
.contact-shell { min-height: 100vh; display: flex; flex-direction: column; }
.contact-hero { padding: 160px var(--pad) 48px; max-width: 760px; }
.contact-hero h1 { margin: 0 0 24px; font-family: 'Archivo', sans-serif; font-weight: 800; font-size: clamp(24px, 4vw, 44px); line-height: 1.2; }
.contact-hero .kicker { margin: 0 0 6px; font-family: 'Space Mono', monospace; font-size: 13px; color: var(--muted); letter-spacing: .05em; }
.contact-hero .big-email { font-family: 'Archivo', sans-serif; font-size: 22px; font-weight: 700; }
.contact-hero .big-email:hover { color: var(--accent); }
.contact-meta { padding: 0 var(--pad) 100px; display: flex; flex-wrap: wrap; gap: 48px; font-family: 'Space Mono', monospace; font-size: 13px; color: var(--text-2); }
.contact-meta .label { margin: 0 0 6px; color: var(--muted); letter-spacing: .05em; }
.contact-meta p { margin: 0; }
.contact-shell .site-footer { margin-top: auto; }

/* ============================================================
   PROJECT PAGES
   ============================================================ */
.project-hero {
  position: relative; height: 88vh; display: flex; align-items: flex-end;
  padding: 0 var(--pad) 48px; overflow: hidden;
}
.project-hero > img.cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.project-hero .hero-iframe { position: absolute; inset: 0; width: 100%; height: 100%; }
.project-hero .hero-iframe iframe { position: absolute; top: 50%; left: 50%; width: 177.78vh; min-width: 100%; height: 56.25vw; min-height: 100%; transform: translate(-50%, -50%); border: 0; pointer-events: none; }
.project-hero .scrim { position: absolute; inset: 0; background: linear-gradient(to top, rgba(10,10,10,.85), rgba(10,10,10,.1) 45%); }
.project-hero .titles { position: relative; z-index: 2; }
.project-hero .client { margin: 0 0 12px; font-family: 'Space Mono', monospace; font-size: 12px; color: var(--text-2); letter-spacing: .1em; }
.project-hero h1 { margin: 0; font-family: 'Archivo', sans-serif; font-weight: 900; font-size: clamp(32px, 6vw, 80px); line-height: 1; }

.play-btn {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 88px; height: 88px; border-radius: 50%; background: rgba(255,255,255,.9);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: transform .2s ease; border: none; z-index: 3;
}
.play-btn:hover { transform: translate(-50%, -50%) scale(1.08); }
.play-btn .tri { width: 0; height: 0; border-style: solid; border-width: 15px 0 15px 25px; border-color: transparent transparent transparent #0a0a0a; margin-left: 4px; }
.play-btn.sm { width: 64px; height: 64px; }
.play-btn.sm .tri { border-width: 11px 0 11px 19px; margin-left: 3px; }

.project-info {
  padding: 64px var(--pad) 96px; display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 64px; max-width: 1200px;
}
.project-info .kicker { margin: 0 0 12px; font-family: 'Space Mono', monospace; font-size: 12px; color: var(--muted); letter-spacing: .1em; }
.project-info .overview { margin: 0; font-family: 'Space Mono', monospace; font-size: 15px; line-height: 1.7; color: var(--text-2); }
.project-info .overview i { color: var(--muted); }
.credits { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; font-family: 'Space Mono', monospace; font-size: 13px; }
.credits .label { margin: 0 0 4px; color: var(--muted); letter-spacing: .05em; }
.credits .val { margin: 0; color: var(--text); }

.cutdowns { padding: 32px var(--pad) 100px; display: grid; grid-template-columns: 1fr 1fr; column-gap: 48px; row-gap: 48px; max-width: 1200px; }
.cutdown { display: flex; flex-direction: column; gap: 20px; }
.cutdown .clip-label { font-family: 'Space Mono', monospace; font-size: 12px; color: var(--text-2); letter-spacing: .08em; }
.clip-thumb { position: relative; aspect-ratio: 16/10; overflow: hidden; cursor: pointer; background: var(--tile); }
.clip-thumb:hover { outline: 2px solid var(--accent); }
.clip-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.clip-thumb .dim { position: absolute; inset: 0; background: rgba(0,0,0,.25); }

/* Full-bleed image blocks (project galleries) */
.fullbleed { display: flex; flex-direction: column; gap: 2px; }
.fullbleed .block { position: relative; height: 75vh; overflow: hidden; }
.fullbleed .block img { width: 100%; height: 100%; object-fit: cover; }
.stills-row { padding: 56px var(--pad) 100px; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; max-width: 1200px; }
.stills-row .cell { position: relative; aspect-ratio: 4/5; overflow: hidden; background: var(--tile); }
.stills-row .cell img { width: 100%; height: 100%; object-fit: cover; }

.back-to-work { padding: 0 var(--pad) 100px; }
.back-to-work a { display: inline-flex; align-items: center; gap: 10px; font-family: 'Archivo', sans-serif; font-size: 14px; font-weight: 700; letter-spacing: .05em; }
.back-to-work a:hover { color: var(--accent); }

/* ---------- Lightbox (shared) ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 50; background: rgba(10,10,10,.95);
  display: none; align-items: center; justify-content: center; padding: 5vw;
}
.lightbox.is-open { display: flex; }
.lightbox-close {
  position: absolute; top: 24px; right: 36px; background: none; border: none;
  color: var(--text); font-family: 'Space Mono', monospace; font-size: 13px; font-weight: 700;
  letter-spacing: .1em; cursor: pointer;
}
.lightbox-close:hover { color: var(--accent); }
.lightbox-frame { position: relative; width: 100%; max-width: 1400px; aspect-ratio: 16/9; }
.lightbox-frame.vertical { aspect-ratio: 9/16; max-width: min(48vh, 90vw); }
.lightbox-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: none; }

/* ============================================================
   RESPONSIVE — folds in the dedicated mobile designs
   ============================================================ */
@media (max-width: 768px) {
  :root { --pad: 24px; --pad-wide: 24px; }

  .menu-links a { font-size: 40px; }
  .menu-foot { gap: 14px; }

  /* Homepage hero */
  .hero { padding: 0 24px 40px; }
  .hero-media iframe { width: 115vw; height: 65vw; min-width: 115vh; min-height: 115vh; }
  .hero-title { font-size: clamp(34px, 12vw, 60px); }
  .hero-tag { width: 100%; }

  /* Homepage featured -> single column, no stagger */
  .featured { grid-template-columns: 1fr; row-gap: 40px; }
  .featured .col.offset-1,
  .featured .col.offset-2,
  .featured .col.offset-3 { padding-top: 0; }
  .featured-parallax { position: absolute; inset: 0; transform: none !important; }
  .scroll-hint { margin-bottom: 40px; }

  /* Work grid -> single column, caption always visible */
  .work-intro { padding: 120px 24px 24px; }
  .work-grid { grid-template-columns: 1fr; gap: 36px; }

  /* About -> stacked */
  .about-grid { grid-template-columns: 1fr; column-gap: 0; row-gap: 40px; padding: 120px 24px 80px; }
  .about-copy { gap: 24px; padding-top: 0; }

  /* Draggable pile -> simple overlapping collage that fits mobile */
  .stills-pile { height: auto; display: flex; flex-direction: column; align-items: center; gap: 0; }
  .still {
    position: relative !important; left: auto !important; top: auto !important;
    width: 62%; height: auto; aspect-ratio: 3/4; margin-top: -40px; cursor: default;
    transform: rotate(var(--r, 0deg)) !important;
  }
  .still:first-child { margin-top: 0; }
  .still:nth-child(odd) { align-self: flex-start; --r: -4deg; }
  .still:nth-child(even) { align-self: flex-end; --r: 4deg; }

  /* Project pages */
  .project-hero { height: 70vh; padding: 0 24px 40px; }
  .project-info { grid-template-columns: 1fr; gap: 40px; padding: 48px 24px 64px; }
  .credits { grid-template-columns: 1fr 1fr; }
  .cutdowns { grid-template-columns: 1fr; row-gap: 32px; padding: 24px 24px 64px; }
  .fullbleed .block { height: 50vh; }

  /* Footer stacks */
  .site-footer { flex-direction: column; align-items: flex-start; gap: 28px; }
}

@media (max-width: 420px) {
  .hero-title { font-size: 34px; }
  .menu-links a { font-size: 32px; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .grain { animation: none; }
  .hero-title span, .hero-tag { opacity: 1 !important; animation: none !important; }
}
