:root {
  --bg: #0a0a0b;
  --bg-soft: #111113;
  --ink: #1a1a1c;
  --ink-dim: rgba(26, 26, 28, 0.62);
  --ink-faint: rgba(26, 26, 28, 0.36);
  --accent: #8b6914;
  --rule: rgba(26, 26, 28, 0.12);
  --hero-vh: 680vh;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

body {
  /* matches the video's cool studio backdrop so the lifted head leaves no seam */
  background: #ecedee;
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
h1, h2 { font-weight: 600; letter-spacing: -0.02em; line-height: 1.02; }

/* ============ LAYER z-0 : fixed video ============ */
.hero-video-wrap {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: transparent;
  transition: opacity 0.7s var(--ease);
}
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
}
.hero-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 120% at 50% 45%, transparent 35%, rgba(255,255,255,0.35) 100%),
    linear-gradient(180deg, rgba(255,255,255,0.3) 0%, transparent 22%, transparent 60%, rgba(255,255,255,0.4) 100%);
}

/* ============ LAYER z-3 : selected work (emerges from the cavity) ============ */
.work-reveal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%); /* dead-center in the viewport */
  z-index: 3;
  width: min(640px, 90vw);
  pointer-events: none;
}
.work-reveal__eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6rem;
  padding-left: 0.1rem;
  opacity: 0;            /* hidden until the cascade fires */
  will-change: transform, opacity;
}
.work-list { list-style: none; }
.work-item {
  opacity: 0;            /* hidden until it falls out of the head */
  border-top: 1px solid var(--rule);
  will-change: transform, opacity;
  counter-increment: work;
}

/* ---- the wizardry: entries fall out of the cavity and settle ---- */
@keyframes work-eyebrow-in {
  0%   { opacity: 0; transform: translateY(-34px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes work-fall {
  /* drop from up near the cavity, accelerating like gravity... */
  0%   { opacity: 0; transform: translateY(-230px) rotate(-2.4deg);
         animation-timing-function: cubic-bezier(0.5, 0, 0.9, 0.45); }
  /* ...land just past the resting line (overshoot)... */
  56%  { opacity: 1; transform: translateY(15px) rotate(0.8deg);
         animation-timing-function: cubic-bezier(0.22, 0.85, 0.32, 1); }
  /* ...bounce back up... */
  76%  { transform: translateY(-7px) rotate(-0.35deg); }
  /* ...and settle. */
  100% { opacity: 1; transform: translateY(0) rotate(0deg); }
}
.work-reveal.is-falling .work-reveal__eyebrow {
  animation: work-eyebrow-in 0.45s var(--ease) both;
}
.work-reveal.is-falling .work-item {
  animation: work-fall 0.92s both;
}
.work-reveal.is-falling .work-item:nth-child(1) { animation-delay: 0.16s; }
.work-reveal.is-falling .work-item:nth-child(2) { animation-delay: 0.28s; }
.work-reveal.is-falling .work-item:nth-child(3) { animation-delay: 0.40s; }
.work-reveal.is-falling .work-item:nth-child(4) { animation-delay: 0.52s; }
.work-reveal.is-falling .work-item:nth-child(5) { animation-delay: 0.64s; }
.work-reveal.is-falling .work-item:nth-child(6) { animation-delay: 0.76s; }
.work-reveal.is-falling .work-item:nth-child(7) { animation-delay: 0.88s; }
.work-list .work-item:last-child { border-bottom: 1px solid var(--rule); }
.work-item a {
  position: relative;
  display: grid;
  /* explicit columns + rows so the number, title, descriptor and arrow each own
     a cell and can never overlap (auto-placement broke when the desc wrapped) */
  grid-template-columns: 2.6rem 1fr 1.4rem;
  grid-template-rows: auto auto;
  align-items: baseline;
  column-gap: 0.4rem;
  padding: 0.8rem 0.1rem 0.85rem;
  color: var(--ink);
  pointer-events: inherit;
  transition: padding-left 0.45s var(--ease), color 0.3s var(--ease);
}
.work-item a::before {
  content: counter(work, decimal-leading-zero);
  grid-column: 1;
  grid-row: 1 / span 2;
  align-self: start;
  padding-top: 0.4rem;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
  transition: color 0.3s var(--ease);
}
.work-item__title {
  grid-column: 2;
  grid-row: 1;
  font-size: clamp(1.15rem, 2.1vw, 1.55rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.1;
}
.work-item__desc {
  grid-column: 2;
  grid-row: 2;
  font-size: 0.84rem;
  color: var(--ink-dim);
  margin-top: 0.2rem;
  max-width: 42ch;
}
.work-item__arrow {
  grid-column: 3;
  grid-row: 1 / span 2;
  align-self: center;
  justify-self: end;
  font-size: 1.05rem;
  color: var(--ink-faint);
  transition: transform 0.35s var(--ease), color 0.3s var(--ease);
}
.work-item a:hover {
  padding-left: 0.7rem;
  color: var(--accent);
}
.work-item a:hover::before { color: var(--accent); }
.work-item a:hover .work-item__title { color: var(--accent); }
.work-item a:hover .work-item__arrow {
  transform: translate(3px, -3px);
  color: var(--accent);
}
.work-list { counter-reset: work; }

/* ============ LAYER z-1 : film grain ============ */
.grain::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: multiply;
  z-index: 1;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 180px 180px;
}

/* ============ LAYER z-50 : nav ============ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem clamp(1.25rem, 4vw, 3.5rem);
}
.nav__brand {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.22em;
}
.nav__links { display: flex; gap: 2rem; }
.nav__links a {
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.85;
  transition: opacity 0.3s var(--ease);
}
.nav__links a:hover { opacity: 1; }

/* ============ LAYER z-2 : hero ============ */
.hero {
  position: relative;
  z-index: 2;
  height: var(--hero-vh);
  display: flex;
  align-items: flex-start;
}
.hero__columns {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 46rem); /* single column since the meta column was removed */
  padding: 0 clamp(1.25rem, 4vw, 3.5rem);
  align-items: center;
  will-change: transform;
}
.hero__col {
  display: flex;
  flex-direction: column;
  gap: 70vh;
  will-change: transform;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 14%, #000 82%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 14%, #000 82%, transparent 100%);
}

.hero__stage h1 {
  font-size: clamp(2.6rem, 7vw, 6.2rem);
  letter-spacing: -0.035em;
  line-height: 0.98;
}
.hero__stage h2 {
  font-size: clamp(1.9rem, 4.6vw, 4rem);
  margin-bottom: 1.1rem;
  max-width: 22ch;
}
.hero__stage p {
  color: var(--ink-dim);
  max-width: 34ch;
  font-size: clamp(0.98rem, 1.2vw, 1.1rem);
}

.eyebrow {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.1rem;
}

.hero__meta { max-width: 30ch; }
.hero__meta dl { display: grid; grid-template-columns: auto 1fr; gap: 0.45rem 1.25rem; }
.hero__meta dt { color: var(--ink-faint); font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; }
.hero__meta dd { font-size: 0.92rem; color: var(--ink-dim); }
.hero__meta .lede { color: var(--ink); font-size: clamp(1.05rem, 1.5vw, 1.4rem); line-height: 1.4; }
.hero__meta--end p { font-size: clamp(1.4rem, 2.6vw, 2.2rem); font-style: italic; color: var(--ink); }

/* ============ scroll indicator ============ */
.scroll-indicator {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  color: var(--ink-dim);
  z-index: 3;
  transition: opacity 0.5s var(--ease);
}
.scroll-indicator__line {
  width: 1px;
  height: 46px;
  background: linear-gradient(var(--ink-dim), transparent);
  animation: pulse 2.2s var(--ease) infinite;
}
@keyframes pulse {
  0%, 100% { transform: scaleY(0.4); transform-origin: top; opacity: 0.4; }
  50% { transform: scaleY(1); opacity: 1; }
}

/* ============ content sections ============ */
.content {
  position: relative;
  z-index: 2;
  background: var(--bg);
  padding: clamp(6rem, 14vh, 11rem) clamp(1.25rem, 4vw, 3.5rem);
}
.content--alt { background: var(--bg-soft); }
.content__inner { max-width: 980px; margin: 0 auto; }
.content__inner h2 {
  font-size: clamp(2rem, 5vw, 4rem);
  margin: 1.2rem 0 1.5rem;
  max-width: 18ch;
}
.content__inner .lede {
  color: var(--ink-dim);
  font-size: clamp(1.05rem, 1.4vw, 1.3rem);
  max-width: 52ch;
}
.content__inner a:hover { color: var(--accent); }

/* ============ responsive ============ */
@media (max-width: 820px) {
  :root { --hero-vh: 520vh; }
  .hero__columns { grid-template-columns: 1fr; align-items: start; padding-top: 24vh; }
}

/* phones */
@media (max-width: 640px) {
  .work-reveal { width: 92vw; }
  .work-item a {
    grid-template-columns: 1.9rem 1fr 1.1rem;
    column-gap: 0.5rem;
    padding: 0.72rem 0.05rem 0.78rem;
  }
  .work-item a::before { font-size: 0.62rem; padding-top: 0.28rem; }
  .work-item__title { font-size: 1.12rem; letter-spacing: -0.01em; }
  .work-item__desc { font-size: 0.78rem; max-width: none; }
  .work-item__arrow { font-size: 0.95rem; }
  .work-reveal__eyebrow { font-size: 0.66rem; letter-spacing: 0.22em; }

  /* headlines: a touch tighter so long lines don't overflow narrow screens */
  .hero__stage h1 { font-size: clamp(2.4rem, 12vw, 3.4rem); }
  .hero__stage h2 { font-size: clamp(1.7rem, 8vw, 2.6rem); }
  .hero__stage p { font-size: 0.98rem; }
  .nav { padding: 1.1rem 1.25rem; }
}

/* On a portrait phone, cover-fit blows the landscape head up huge (only the
   centre ~25% is visible). Contain shows the whole split, sized to fit; a small
   scale keeps it bold without the extreme zoom. */
@media (max-width: 640px) and (orientation: portrait) {
  .hero-video { object-fit: contain; transform: scale(2.4); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .scroll-indicator__line { animation: none; }
  .hero-video-wrap { opacity: 0.5; }
  /* no fall — just present the work index statically */
  .work-reveal__eyebrow, .work-item {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
}
