/* ============================================
   Tokens
   ============================================ */
:root {
  --c-white: #ffffff;
  --c-ink: #0a0a0a;
  --c-graphite: #1a1a1a;
  --c-charcoal: #3a3a3a;
  --c-stone: #6b6b6b;
  --c-ash: #9a9a9a;
  --c-mist: #c8c8c8;
  --c-fog: #e6e6e6;
  --c-canvas: #fafafa;
  --c-whisper: #f4f4f4;

  --f-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --f-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --max-w: 1440px;
  --pad-x: clamp(1.5rem, 5vw, 5rem);

  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--f-sans);
  background: var(--c-white);
  color: var(--c-graphite);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'kern', 'liga', 'calt';
  overflow-x: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: var(--c-ink);
  color: var(--c-white);
}

/* ============================================
   Hero
   ============================================ */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}

/* --- Text area: left 50% of viewport, fixed-size text-block scales to fit --- */

.hero-text-area {
  position: absolute;
  left: 0;
  top: 0;
  width: 50vw;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

/* Fixed-aspect text block. Whole block has fixed size + fixed fonts.
   Stays at natural size on large viewports; only scales DOWN when the
   50vw × 100vh area minus 10% margins can't fit it (object-fit:contain).
   flex-shrink: 0 is critical — without it the flex parent shrinks the layout
   width below 480px when 50vw < 480px and the inner text re-wraps. */
.text-block {
  flex-shrink: 0;
  width: 480px;
  height: 620px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 40px;
  transform-origin: center center;
  transform: scale(min(
    calc((50vw * 0.8) / 480px),
    calc((100vh * 0.8) / 620px)
  ));
}

.hero-name {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: 4.5rem;
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--c-ink);
}

.hero-name-line {
  display: block;
}

.hero-name-line:last-child {
  font-weight: 300;
  color: var(--c-graphite);
  padding-left: 0.5em;
}

.hero-subtitle {
  margin-top: 1.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  font-family: var(--f-mono);
  font-weight: 500;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--c-stone);
}

.hero-subtitle::before {
  content: '';
  width: 2.5rem;
  height: 1px;
  background: var(--c-mist);
}

.hero-bio {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: 0.95rem;
  color: var(--c-charcoal);
  line-height: 1.65;
}

.hero-bio p {
  text-wrap: pretty;
}

.bio-aside {
  color: var(--c-stone);
  font-family: var(--f-mono);
  font-size: 0.85em;
  letter-spacing: 0.01em;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  align-self: flex-start;
  padding: 1rem 1.75rem;
  background: var(--c-ink);
  color: var(--c-white);
  border: 1px solid var(--c-ink);
  font-family: var(--f-mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background 0.45s var(--ease-out),
    color 0.45s var(--ease-out);
}

.hero-cta:hover,
.hero-cta:focus-visible {
  background: var(--c-white);
  color: var(--c-ink);
  outline: none;
}

.hero-cta-arrow {
  display: inline-block;
  font-size: 1rem;
  transition: transform 0.45s var(--ease-out);
}

.hero-cta:hover .hero-cta-arrow,
.hero-cta:focus-visible .hero-cta-arrow {
  transform: translateY(4px);
}

.hero-secondary-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.1rem;
  align-self: flex-start;
  padding: 0.15rem 0;
  font-family: var(--f-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-stone);
  border-bottom: 1px solid transparent;
  transition:
    color 0.4s var(--ease-out),
    border-color 0.4s var(--ease-out);
}

.hero-secondary-link:hover,
.hero-secondary-link:focus-visible {
  color: var(--c-ink);
  border-bottom-color: var(--c-ink);
  outline: none;
}

/* --- Photo area: right 50% of viewport. Image stays at full vh, centered on
       the area's vertical axis. Edges are allowed to spill — left into text
       (white shoulder is fine), right gets clipped by .hero overflow. --- */

.hero-photo {
  position: absolute;
  right: 0;
  top: 0;
  width: 50vw;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 1;
  /* overflow visible so the photo can bleed past the area when narrow */
}

.hero-photo img {
  height: 100vh;
  height: 100svh;
  width: auto;
  /* override the global `img { max-width: 100% }` reset — otherwise the
     image gets capped to the 60vw container and, with height pinned to
     100vh, its aspect ratio breaks (looks like a tall thin straw). */
  max-width: none;
  display: block;
  flex-shrink: 0;
  user-select: none;
}

/* ============================================
   Works
   ============================================ */
.works {
  position: relative;
  padding-top: clamp(5rem, 10vh, 8rem);
  padding-bottom: clamp(3rem, 6vh, 5rem);
  background: var(--c-white);
}

/* Soft drop-shadow that reads like the hero block is casting a shadow onto
   the works section. Concentrated at the very top, fades out within ~70px. */
.works::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 70px;
  background: linear-gradient(
    to bottom,
    rgba(15, 15, 15, 0.10) 0%,
    rgba(15, 15, 15, 0.04) 35%,
    rgba(15, 15, 15, 0) 100%
  );
  pointer-events: none;
  z-index: 1;
}

.works-header {
  margin: 0 var(--pad-x) clamp(3rem, 6vh, 5rem);
  padding-bottom: clamp(1.5rem, 3vh, 2.5rem);
  border-bottom: 1px solid var(--c-fog);
  display: flex;
  align-items: baseline;
  gap: 2rem;
  justify-content: space-between;
  flex-wrap: wrap;
}

.works-eyebrow {
  font-family: var(--f-mono);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--c-stone);
}

.works-title {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--c-ink);
}

.card {
  margin: 0 var(--pad-x);
  padding: clamp(3rem, 6vh, 5rem) 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  border-bottom: 1px solid var(--c-fog);
  /* Card is at least 50vh tall — short cards lock to 50vh, long ones grow
     to fit text. Image is independently capped at 50vh via .card-image. */
  min-height: 50vh;
  min-height: 50svh;
}

.card:last-of-type {
  border-bottom: none;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 32rem;
}

.card-num {
  font-family: var(--f-mono);
  font-weight: 500;
  font-size: 0.78rem;
  color: var(--c-stone);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.card-title {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(1.85rem, 3.4vw, 2.85rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--c-ink);
  text-wrap: balance;
  margin-bottom: 0.25rem;
}

.card-desc {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.card-desc p {
  color: var(--c-charcoal);
  font-size: 0.975rem;
  line-height: 1.7;
  text-wrap: pretty;
}

.card-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.5rem;
  font-family: var(--f-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid;
  transition:
    background 0.4s var(--ease-out),
    color 0.4s var(--ease-out),
    border-color 0.4s var(--ease-out);
  white-space: nowrap;
  user-select: none;
}

.btn-primary {
  background: var(--c-ink);
  color: var(--c-white);
  border-color: var(--c-ink);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--c-white);
  color: var(--c-ink);
  outline: none;
}

.btn-arrow {
  display: inline-block;
  font-size: 0.95rem;
  transition: transform 0.4s var(--ease-out);
}

.btn-primary:hover .btn-arrow,
.btn-primary:focus-visible .btn-arrow {
  transform: translate(2px, -2px);
}

.btn-secondary {
  background: transparent;
  color: var(--c-ink);
  border-color: var(--c-mist);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  background: var(--c-ink);
  color: var(--c-white);
  border-color: var(--c-ink);
  outline: none;
}

.btn-secondary:hover .btn-arrow,
.btn-secondary:focus-visible .btn-arrow {
  transform: translate(2px, -2px);
}

.card-image {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  /* explicit height (not max-height) so the img's height: 100% resolves.
     50vh minus the card's vertical padding == image area inside one
     50vh-tall card. */
  height: calc(50vh - 2 * clamp(3rem, 6vh, 5rem));
  height: calc(50svh - 2 * clamp(3rem, 6vh, 5rem));
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* anchor visible content to the right so the artwork stays pinned to the
     viewport edge on very wide aspect ratios instead of floating in the
     middle of an oversized column */
  object-position: right center;
  transition: transform 0.8s var(--ease-out);
}

.card:hover .card-image img {
  transform: scale(1.02);
}

/* ============================================
   VFX section + media
   ============================================ */
.vfx {
  position: relative;
  padding-bottom: clamp(3rem, 6vh, 5rem);
  background: var(--c-white);
}

.vfx .works-header {
  margin-top: clamp(2rem, 4vh, 3.5rem);
}

.card-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.meta-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.85rem;
  font-family: var(--f-mono);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-stone);
  border: 1px solid var(--c-fog);
  white-space: nowrap;
}

.card-media {
  /* override existing .card-image fixed height — media blocks size themselves */
  height: auto;
  align-self: stretch;
  justify-content: stretch;
}

.media-trigger {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--c-ink);
  cursor: pointer;
  overflow: hidden;
  font: inherit;
  color: inherit;
}

.media-trigger:focus-visible {
  outline: 2px solid var(--c-ink);
  outline-offset: 4px;
}

.media-trigger img,
.media-trigger video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease-out);
}

.media-trigger:hover img,
.media-trigger:hover video {
  transform: scale(1.03);
}

.media-trigger-wide {
  aspect-ratio: 16 / 9;
}

/* Large centered play button — for the 1 September video.
   Always visible, gently pulses to invite a click, scales on hover. */
.media-play-center {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5.25rem;
  height: 5.25rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(10, 10, 10, 0.55);
  color: var(--c-white);
  pointer-events: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 2;
  transform: translate(-50%, -50%);
  transition:
    background 0.4s var(--ease-out),
    box-shadow 0.4s var(--ease-out);
}

.media-play-center::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  animation: media-play-pulse 2.4s var(--ease-out) infinite;
  pointer-events: none;
}

.media-play-center svg {
  margin-left: 4px;
  position: relative;
  z-index: 1;
  transition: transform 0.4s var(--ease-out);
}

.media-trigger:hover .media-play-center,
.media-trigger:focus-visible .media-play-center {
  background: rgba(10, 10, 10, 0.78);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.media-trigger:hover .media-play-center svg,
.media-trigger:focus-visible .media-play-center svg {
  transform: scale(1.12);
}

@keyframes media-play-pulse {
  0% {
    transform: scale(0.88);
    opacity: 0.85;
  }
  100% {
    transform: scale(1.45);
    opacity: 0;
  }
}

/* Expand badge — always visible on Spark thumbnails (bottom-right). */
.media-expand {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  font-family: var(--f-mono);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-ink);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
  z-index: 2;
  transition:
    background 0.3s var(--ease-out),
    transform 0.3s var(--ease-out);
}

.media-expand svg {
  display: block;
}

.media-trigger:hover .media-expand,
.media-trigger:focus-visible .media-expand {
  background: var(--c-white);
  transform: translateY(-2px);
}

@media (prefers-reduced-motion: reduce) {
  .media-play-center::before {
    animation: none;
  }
}

/* Spark composite: vertical video + 3 horizontal thumbs stacked right */
.spark-composite {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.65rem;
  align-items: stretch;
  height: clamp(380px, 65vh, 620px);
}

.spark-video {
  height: 100%;
  width: auto;
  aspect-ratio: 9 / 16;
}

.spark-stack {
  display: grid;
  grid-template-rows: 1fr 1fr 1fr;
  gap: 0.65rem;
  height: 100%;
}

.spark-stack .media-trigger {
  height: 100%;
}

/* ============================================
   Lightbox
   ============================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(8, 8, 8, 0.94);
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 3rem);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s var(--ease-out);
}

/* Class specificity (0,1,0) of .lightbox above overrides UA's [hidden]
   { display: none }, leaving an invisible (opacity:0) fixed overlay that
   eats all clicks. Bump specificity to (0,2,0) so [hidden] actually hides. */
.lightbox[hidden] {
  display: none;
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-content {
  max-width: min(1500px, 95vw);
  max-height: 88vh;
  display: grid;
  place-items: center;
  transform: scale(0.96);
  transition: transform 0.35s var(--ease-out);
}

.lightbox.is-open .lightbox-content {
  transform: scale(1);
}

.lightbox-content video,
.lightbox-content img {
  max-width: min(1500px, 95vw);
  max-height: 88vh;
  width: auto;
  height: auto;
  display: block;
  background: var(--c-ink);
}

.lightbox-close {
  position: absolute;
  top: clamp(1rem, 2.5vh, 1.75rem);
  right: clamp(1rem, 2.5vw, 1.75rem);
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: transparent;
  color: var(--c-white);
  cursor: pointer;
  font: inherit;
  transition:
    background 0.3s var(--ease-out),
    border-color 0.3s var(--ease-out);
}

.lightbox-close:hover,
.lightbox-close:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--c-white);
  outline: none;
}

/* ============================================
   Footer
   ============================================ */
.page-footer {
  margin: 0 var(--pad-x);
  padding: 2.5rem 0;
  border-top: 1px solid var(--c-fog);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--f-mono);
  font-size: 0.7rem;
  color: var(--c-stone);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-footer-aside {
  color: var(--c-graphite);
}

/* ============================================
   Reveal animation
   ============================================ */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.9s var(--ease-out),
    transform 0.9s var(--ease-out);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ============================================
   Responsive
   ============================================ */

/* --- Responsive (cards section only — hero is fully self-scaling) --- */

@media (max-width: 1199px) {
  .card {
    grid-template-columns: 1fr;
    gap: clamp(2rem, 5vh, 3rem);
    /* drop the fixed card height in stacked mode — image and text take
       their natural sizes vertically */
    height: auto;
    overflow: visible;
  }

  .card-image {
    order: -1;
    height: auto;
  }

  .card-image img {
    max-height: 50vh;
    height: auto;
    object-position: center center;
  }

  .card-body {
    max-width: 100%;
  }
}

@media (max-width: 1199px) {
  .spark-composite {
    grid-template-columns: 1fr;
    height: auto;
    gap: 0.85rem;
  }

  .spark-video {
    height: auto;
    width: 100%;
    max-width: 360px;
    justify-self: center;
  }

  .spark-stack {
    grid-template-rows: auto;
    grid-template-columns: 1fr 1fr 1fr;
    height: auto;
  }

  .spark-stack .media-trigger {
    aspect-ratio: 16 / 9;
    height: auto;
  }
}

@media (max-width: 720px) {
  /* Hero: drop the photo, stretch text area to full width, center everything */
  .hero-photo {
    display: none;
  }

  .hero-text-area {
    width: 100vw;
  }

  .text-block {
    text-align: center;
    transform: scale(min(
      calc((100vw * 0.9) / 480px),
      calc((100vh * 0.9) / 620px)
    ));
  }

  .hero-name-line:last-child {
    padding-left: 0;
  }

  .hero-subtitle,
  .hero-cta,
  .hero-secondary-link {
    align-self: center;
  }

  .card {
    padding: clamp(2.5rem, 5vh, 4rem) var(--pad-x);
  }

  .spark-stack {
    grid-template-columns: 1fr;
  }

  .card-title {
    font-size: clamp(1.65rem, 6.5vw, 2.25rem);
  }

  .page-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
}

@media (max-width: 480px) {
  .card-actions {
    width: 100%;
  }

  .card-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
    font-size: 0.65rem;
    padding: 0.85rem 1rem;
    letter-spacing: 0.12em;
  }
}
