/* ---------- Tokens ---------- */
:root {
  
  --pad: 20px;
  --pitch: 3.6rem;                       /* vertical distance between list items */
  --ease: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: .5s;                             /* background crossfade */
  --dur-list: 0.5s;                      /* list movement */
  --font: "Geist", sans-serif;
  
}

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

html, body {
  margin: 0;
  height: 100%;
  background: #000;
  color: #777;
  font-family: var(--font);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;                      /* scroll is hijacked by script.js */
  overscroll-behavior: none;
}

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

/* ---------- Background stage ---------- */
.stage {
  position: fixed;
  inset: 0;
  background: #000;
}

.bg {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur) var(--ease);
  cursor: pointer;
}

.bg--placeholder {
  background: linear-gradient(135deg, #35302c, #111 62%, #514638);
}

.bg img,
.bg video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.06);
  transition: transform calc(var(--dur) * 3) var(--ease-out);
}

.bg.is-active {
  opacity: 1;
  pointer-events: auto;
  z-index: 1;
}

.bg.is-active img {
  transform: scale(1);                   /* slow settle on entry */
}

.bg.is-active video {
  transform: scale(1.06);
}

/* Darkens the image so type stays legible, heavier on the left + bottom */
.scrim {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,.15) 40%, rgba(0,0,0,0) 65%),
    linear-gradient(180deg, rgba(0,0,0,.45) 0%, rgba(0,0,0,0) 22%, rgba(0,0,0,0) 65%, rgba(0,0,0,.55) 100%),
    rgba(0,0,0,.18);
}

/* ---------- Header ---------- */
.header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: var(--pad);
  pointer-events: none;
}

.header a { pointer-events: auto; }

.nav {
  display: flex;
  gap: clamp(32px, 7vw, 100px);
  font-size: 14px;
  font-weight: 300;
  text-transform: uppercase;
  color: #fff;
}

.nav a:hover {

  transition: opacity 0.3s var(--ease);
  opacity: 0.8;
}

  

.nav--right { justify-content: flex-end; gap: clamp(24px, 3vw, 56px); }

.nav a {
  position: relative;
  opacity: 1;
  transition: opacity 0.3s var(--ease);
  color: #fff;
}


/* ---------- Project list ---------- */
.projects {
  position: fixed;
  z-index: 10;
  left: var(--pad);
  top: 50%;
  width: min(30rem, 44vw);
  height: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  color: #fff;
}

.project {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  /* --o = signed distance from the active item, set by script.js */
  transform: translateY(calc(-50% + var(--o, 0) * var(--pitch)));
  transition:
    transform var(--dur-list) var(--ease),
    opacity var(--dur-list) var(--ease);
  will-change: transform, opacity;
}

.project a {
  display: block;
  width: max-content;
  max-width: 100%;
}

.project__title { font-weight: 400; }
.project__genre { font-weight: 300; }
.project__year  { display: block; font-weight: 300; font-size: 12px; }

/* Fade by distance from the active row */
.project[data-d="0"]  { opacity: 1;    pointer-events: auto; }
.project[data-d="1"]  { opacity: 0.55; pointer-events: auto; }
.project[data-d="2"]  { opacity: 0.25; pointer-events: auto; }
.project[data-d="3"]  { opacity: 0; }

.project a { transition: opacity .3s var(--ease); }
.projects:hover .project:not([data-d="0"]) a { opacity: .8; }
.projects .project:not([data-d="0"]) a:hover { opacity: 1; }

.project.is-wrapping { transition: none; opacity: 0; }

/* ---------- Tagline ---------- */
.tagline {
  position: fixed;
  z-index: 10;
  right: var(--pad);
  bottom: var(--pad);
  max-width: 274px;
  margin: 0;
  font-size: 14px;
  font-weight: 300;
  color: #fff;
}

.scroll-hint {
  position: fixed;
  z-index: 10;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
  font-size: 13px;  /* same size as the project list */
  font-weight: 300;
  text-transform: uppercase;
  color: #fff;
}

/* ---------- Page-load intro ---------- */
.header, .projects, .tagline {
  animation: rise 1.2s var(--ease-out) both;
}
.projects { animation-delay: .15s; }
.tagline  { animation-delay: .3s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}


/* ---------- Mobile ---------- */
@media (max-width: 720px) {
  .header { grid-template-columns: 1fr 1fr; row-gap: 20px; }
  .logo { grid-column: 1/-1; grid-row: 1; justify-self: center; }
  .nav--left  { grid-row: 2; }
  .nav--right { grid-row: 2; }
  .nav { 
    gap: 20px;
    font-size: 12px; 
   }

  .projects { 
    position: fixed;
    top: 50%; 
    bottom: calc(var(--pad) + 5.5rem); 
    width: 70vw; }
  .tagline {
    left: var(--pad);
    right: var(--pad);
    max-width: none;
    font-size: .85rem;
    text-align: center;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  :root { --dur: .01s; --dur-list: .01s; }
  .bg img { transform: none !important; transition: none; }
  .bg video { transform: scale(1.06) !important; transition: none; }
  .header, .projects, .tagline { animation: none; }
}

