/* ==========================================================
   Melissa Toh — Creative Lead · Film & Storytelling
   Design language from her deck: warm paper, heavy lowercase
   grotesque, mono credit lines, film grain — staged as a
   three-act page: paper intro → dark screening room → paper.
   ========================================================== */

:root {
  /* committed brand surfaces (pre-existing identity) */
  --paper: #e9e6e0;
  --paper-deep: #dedad2;
  --ink: #161412;
  --ink-soft: #3b3833;
  --ink-mute: #55514a;
  --screen: #131110;          /* the screening-room black */
  --screen-2: #1b1815;
  --on-screen: #ece9e3;
  --on-screen-soft: #b9b3aa;
  --line: #c9c4ba;
  --line-screen: #33302b;

  /* the record light */
  --red: oklch(63% 0.19 32);        /* on dark */
  --red-deep: oklch(45% 0.17 30);   /* on paper, 4.5:1+ */

  --max: 1240px;
  --pad: clamp(20px, 5vw, 72px);

  --font-display: "Archivo Black", "Archivo", sans-serif;
  --font-body: "Archivo", sans-serif;
  --font-mono: "Space Mono", monospace;

  /* semantic z scale */
  --z-nav: 40;
  --z-grain: 50;
  --z-skip: 60;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* Film grain over everything, very subtle */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: url("assets/img/grain.png") repeat;
  background-size: 480px;
  opacity: 0.05;
  pointer-events: none;
  z-index: var(--z-grain);
  transform: translateZ(0);
}

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

::selection { background: var(--red); color: var(--paper); }

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: color 180ms var(--ease-out), text-decoration-color 180ms var(--ease-out);
}
a:hover { color: var(--red-deep); }
.screening a:hover, .site-footer a:hover { color: var(--red); }

a:focus-visible, button:focus-visible {
  outline: 3px solid var(--red-deep);
  outline-offset: 3px;
}
.screening a:focus-visible, .screening button:focus-visible {
  outline-color: var(--red);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 18px;
  z-index: var(--z-skip);
}
.skip-link:focus { left: 12px; top: 12px; }

.meta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--ink-mute);
}

h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }

/* ============ NAV ============ */
.site-nav {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px var(--pad);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  text-decoration: none;
  letter-spacing: -0.02em;
}
.nav-name:hover { color: var(--ink); }
.site-nav ul {
  display: flex;
  gap: clamp(14px, 3vw, 34px);
  list-style: none;
}
.site-nav ul a {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  text-decoration: none;
  padding: 8px 2px; /* comfortable touch target */
}
@media (max-width: 620px) {
  .site-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding-top: 12px;
    padding-bottom: 10px;
  }
  .site-nav ul { flex-wrap: wrap; gap: 4px 18px; }
}

/* ============ HERO ============ */
.hero {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 61px);
}
.hero-plate {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  gap: clamp(18px, 3.5vh, 36px);
  padding: clamp(48px, 9vh, 110px) var(--pad);
}
.credit-line {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.rec {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--red-deep);
  flex: none;
  margin-top: 0.55em;
}
@media (prefers-reduced-motion: no-preference) {
  .rec { animation: rec-pulse 2.4s ease-in-out infinite; }
  @keyframes rec-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
  }
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(3.2rem, 10vw, 6rem);
  line-height: 0.92;
  letter-spacing: -0.03em;
  font-weight: 400;
}
.hero-tagline {
  font-weight: 500;
  font-size: clamp(1.05rem, 1.8vw, 1.3rem);
  line-height: 1.5;
  max-width: 44ch;
  color: var(--ink-soft);
}
.hero-tagline strong { color: var(--ink); font-weight: 600; }
.hero-band {
  height: clamp(240px, 46vh, 560px);
  background: url("assets/img/hero-ocean.jpg") center 58% / cover no-repeat;
  border-top: 1px solid var(--line);
}

/* one-time entrance; elements are visible without it */
@media (prefers-reduced-motion: no-preference) {
  .hero-plate > * {
    animation: hero-in 800ms var(--ease-out) both;
  }
  .hero-plate > :nth-child(2) { animation-delay: 80ms; }
  .hero-plate > :nth-child(3) { animation-delay: 170ms; }
  @keyframes hero-in {
    from { opacity: 0; transform: translateY(16px); }
  }
}

/* ============ SCROLL-DRIVEN RISE ============
   Deterministic: resolves from scroll position, never gated
   on JS. Unsupported browsers simply see static content. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .rise {
      animation: rise both;
      animation-timeline: view();
      animation-range: entry 0% cover 15%;
    }
    @keyframes rise {
      from { opacity: 0.15; transform: translateY(24px); }
      to   { opacity: 1; transform: none; }
    }
  }
}

/* ============ SECTIONS ============ */
.section { padding-top: clamp(72px, 10vw, 136px); }

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6.5vw, 5rem);
  line-height: 0.94;
  letter-spacing: -0.03em;
  font-weight: 400;
  padding: 0 var(--pad);
  max-width: var(--max);
  margin: 0 auto clamp(36px, 5vw, 64px);
}

/* ============ ABOUT ============ */
.about-grid {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
  display: grid;
  grid-template-columns: minmax(220px, 350px) 1fr;
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
}
.about-photo img { width: 100%; }
.about-copy { display: grid; gap: 16px; max-width: 60ch; }
.about-copy .meta { margin-top: 8px; }
@media (max-width: 700px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-photo { max-width: 320px; }
}

.services {
  max-width: var(--max);
  margin: clamp(48px, 7vw, 88px) auto 0;
  padding: 0 var(--pad) clamp(72px, 10vw, 136px);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(24px, 4vw, 56px);
}
.service {
  border-top: 2px solid var(--ink);
  padding-top: 18px;
}
.service h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}
.service p { font-size: 0.98rem; color: var(--ink-soft); }
@media (max-width: 640px) { .services { grid-template-columns: 1fr; } }

/* ============ THE SCREENING ROOM ============ */
.screening {
  background: var(--screen);
  color: var(--on-screen);
  padding-bottom: clamp(48px, 7vw, 96px);
}
.screening .section-title { color: var(--on-screen); }
.screening .meta { color: var(--on-screen-soft); }

.room-note {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--on-screen-soft);
  padding: 0 var(--pad);
  max-width: var(--max);
  margin: calc(-1 * clamp(20px, 3vw, 40px)) auto clamp(48px, 7vw, 88px);
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.room-note .rec { background: var(--red); }

.project {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
}
.project + .project {
  margin-top: clamp(64px, 9vw, 120px);
}
.project-inner {
  border-top: 1px solid var(--line-screen);
  padding-top: clamp(28px, 4vw, 48px);
}
.project-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px 40px;
  margin-bottom: clamp(20px, 3vw, 32px);
}
.project h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.8rem, 4.2vw, 3.2rem);
  letter-spacing: -0.02em;
  line-height: 1;
}
.project h3 span { white-space: nowrap; color: var(--on-screen-soft); }

/* film-credit table */
.credits {
  display: flex;
  flex-wrap: wrap;
  gap: 10px clamp(24px, 3vw, 44px);
  font-family: var(--font-mono);
}
.credits div { min-width: 0; }
.credits dt {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
}
.credits dd {
  font-size: 0.82rem;
  color: var(--on-screen-soft);
  margin-top: 2px;
}

.project-copy {
  max-width: 66ch;
  display: grid;
  gap: 14px;
  margin-bottom: clamp(28px, 4vw, 44px);
}
.project-copy p { font-size: 1rem; color: var(--on-screen-soft); line-height: 1.7; }
.project-copy strong { color: var(--on-screen); }

/* Video grids */
.video-grid { display: grid; gap: clamp(18px, 2.5vw, 28px); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(2, 1fr); } /* 4-up reads too small; 2×2 */
@media (max-width: 900px) {
  .cols-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; }
}

.video-frame { min-width: 0; }
.video-poster {
  position: relative;
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  cursor: pointer;
  background: #000;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.video-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms var(--ease-out), opacity 500ms var(--ease-out);
}
.video-poster:hover img { transform: scale(1.035); opacity: 0.82; }
.play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--screen) 78%, transparent);
  transition: transform 250ms var(--ease-out), background 250ms var(--ease-out);
}
.play::after {
  content: "";
  position: absolute;
  left: 55%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-left: 18px solid var(--paper);
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
}
.video-poster:hover .play,
.video-poster:focus-visible .play {
  transform: scale(1.1);
  background: var(--red);
}
.video-frame iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  display: block;
  background: #000;
}
.video-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  margin-top: 12px;
  color: var(--on-screen-soft);
}

/* Zespri stills */
.still-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(14px, 2vw, 22px);
}
.still-grid img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 5; }
@media (max-width: 900px) { .still-grid { grid-template-columns: repeat(2, 1fr); } }

/* ============ PHOTOGRAPHY (still in the dark) ============ */
.photo-section {
  background: var(--screen);
  color: var(--on-screen);
  padding-bottom: clamp(72px, 10vw, 136px);
}
.photo-intro {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--on-screen-soft);
  padding: 0 var(--pad);
  max-width: var(--max);
  margin: calc(-1 * clamp(16px, 2.5vw, 36px)) auto clamp(40px, 6vw, 64px);
}
.photo-grid {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
  columns: 3;
  column-gap: 20px;
}
.photo-grid img {
  width: 100%;
  margin-bottom: 20px;
  break-inside: avoid;
}
@media (max-width: 900px) { .photo-grid { columns: 2; } }
@media (max-width: 560px) { .photo-grid { columns: 1; } }

/* ============ TESTIMONIALS ============ */
.testimonials-section {
  background: var(--paper-deep);
  padding-bottom: clamp(72px, 10vw, 136px);
}
.testimonials {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
}
.testimonial blockquote {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--ink);
  text-wrap: pretty;
}
.testimonial figcaption {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
}
.testimonial img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 50%;
  filter: grayscale(1);
  flex: none;
}
.t-name {
  font-family: var(--font-display);
  font-size: 0.98rem;
  line-height: 1.3;
}
.t-role {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-mute);
  margin-top: 2px;
}
@media (max-width: 800px) { .testimonials { grid-template-columns: 1fr; max-width: 620px; } }

/* ============ CONTACT ============ */
.contact-section {
  padding-bottom: clamp(80px, 11vw, 152px);
}
.contact-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
}
.contact-section .credit-line { margin-bottom: 14px; }
.contact-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.8rem, 9vw, 6rem);
  letter-spacing: -0.03em;
  line-height: 0.95;
  margin-bottom: clamp(36px, 6vw, 64px);
}
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: clamp(28px, 4vw, 48px);
  border-top: 2px solid var(--ink);
  padding-top: clamp(24px, 3vw, 36px);
}
.contact-grid .meta { margin-bottom: 6px; }
.contact-grid a, .contact-grid p:not(.meta) {
  font-weight: 600;
  font-size: 1.02rem;
  overflow-wrap: anywhere;
}

/* ============ FOOTER ============ */
.site-footer { background: var(--screen); color: var(--on-screen-soft); }
.cat-band {
  height: clamp(120px, 18vw, 240px);
  background: url("assets/img/cat.jpg") center / cover no-repeat;
}
.site-footer p {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-align: center;
  padding: 26px var(--pad);
}

/* ============ REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {
  .video-poster img, .play, a { transition: none; }
}
