/* ── Desktop: JS owns all scroll, no browser scroll ── */
html, body { height: 100%; overflow: hidden; }

.v-viewport { position: fixed; inset: 0; overflow: hidden; z-index: 10; }
.v-track    { width: 100%; will-change: transform; position: relative; z-index: 10; }

.v-section {
  width: 100%;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ── Intro ── */
.section-intro {
  justify-content: center;
  padding: 72px 50px 0;
  position: relative;
  height: 60vh; /* 60/40 split: first project peeks below */
  z-index: 10;
}
/* Muted sub-label on print page (bg.css base is rgba 0.45, sub even more muted) */
.section-sub { color: rgba(255,255,255,0.35); }

.intro-arrow {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  opacity: 0.45;
  transition: opacity 0.3s cubic-bezier(0.7,0,0.3,1);
  z-index: 5;
}
.intro-arrow:hover { opacity: 1; }
.intro-arrow svg {
  width: 40px; height: 40px;
  stroke: #fff; fill: none;
  stroke-width: 1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── Project section ── */
.h-proj { padding-top: 0; padding-bottom: 50px; }

/* ── Left edge gradient ──
   Single element inside v-track, counter-transformed each RAF frame so it stays
   visually fixed at viewport top regardless of vertical scroll position.
   z-index 5 within v-track's stacking context: above images (z:auto) but below
   sidebar text (z:20). height:100vh covers the full visible window. */
#left-grad {
  position: absolute;
  left: 0; top: 0;
  width: 20vw;
  height: 100vh;
  background: linear-gradient(to right, rgba(20,20,21,0.96) 5%, transparent 100%);
  z-index: 5;
  pointer-events: none;
  will-change: transform;
}

/* Row: sidebar info + gallery side by side */
.h-proj__body {
  flex: 1;
  min-height: 0;
  display: flex;
  position: relative;
}

/* Left: project meta — overlaid on gallery, sits above slides */
.h-proj__sidebar {
  position: absolute;
  left: 50px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  width: 200px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  pointer-events: none;
}
.h-proj__num {
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: rgba(255,255,255,0.35);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.h-proj__name {
  font-family: 'DM Sans', sans-serif;
  font-weight: 900;
  font-size: clamp(32px, 3vw, 52px);
  letter-spacing: -0.04em;
  color: #fff;
  line-height: 1;
}
.h-proj__sub {
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  line-height: 1.6;
}
.h-proj__sub a {
  pointer-events: auto;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(255,255,255,0.2);
}
.h-proj__sub a:hover { text-decoration-color: rgba(255,255,255,0.55); }
.h-proj__tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  white-space: nowrap;
  background: rgba(20,20,21,0.52);
  border: 1px solid rgba(255,255,255,0.18);
  padding: 7px 14px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
}

/* ── Captioned thumb slides: image + label below, no crop ── */
.h-proj__slide--captioned {
  flex-direction: column;
  justify-content: center;
  gap: 1.5vw;
}
.h-proj__slide--captioned > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  cursor: zoom-in;
}
.h-proj__slide--captioned > div img {
  height: calc(min(55vh, 1000px) / 2 - 0.75vw);
  width: auto;
  max-width: none;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
.h-proj__slide--captioned .logo-credit {
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  text-align: center;
  pointer-events: none;
  user-select: none;
}

/* ── No-sidebar variant: gallery fills from left edge ── */
.h-proj--nosidebar .h-proj__sidebar { display: none; }
.h-proj--nosidebar .h-proj__track   { padding-left: 50px; }
html.is-touch .h-proj--nosidebar .h-proj__track { padding-left: 24px; }

/* ── Paired-thumbnail slides: two images stacked vertically in one slide ── */
.h-proj__slide--pair {
  flex-direction: column;
  justify-content: center;
  gap: 1.5vw;
}

/* ── Video slides ── */
.h-proj__slide--video video {
  display: block;
  height: min(55vh, 1000px);
  width: auto;
  max-width: none;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

/* ── Duo slides: two images side by side at full/hero size ── */
.h-proj__slide--duo {
  flex-direction: row;
  align-items: center;
  gap: 2vw;
}
.h-proj__slide--duo img {
  max-height: min(55vh, 1000px);
  height: min(55vh, 1000px);
  width: auto;
  max-width: none;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

/* Right: image track — clipped, scrolled by JS on desktop */
.h-proj__gallery {
  flex: 1;
  overflow: hidden;
  position: relative;
  cursor: default;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.h-proj__track {
  flex-shrink: 0;
  height: min(55vh, 1000px);
  display: flex;
  align-items: center;
  gap: 3vw;
  padding-left: 270px;
  will-change: transform;
}
.h-proj__slide {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  position: relative;
}
.h-proj__slide img {
  display: block;
  height: auto;
  width: auto;
  max-height: min(55vh, 1000px);
  max-width: none;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
/* Pair thumbnails: fixed size, crop to fit */
.h-proj__slide--pair > div {
  height: calc(min(55vh, 1000px) / 2 - 0.75vw);
  aspect-ratio: 1 / 1;
  overflow: hidden;
  flex-shrink: 0;
}
.h-proj__slide--pair > div img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  max-height: none;
  max-width: none;
}

/* Play button on video slides */
.slide-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(20,20,21,0.52);
  border: 1px solid rgba(255,255,255,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: opacity 0.3s cubic-bezier(0.7,0,0.3,1), background 0.3s cubic-bezier(0.7,0,0.3,1), border-color 0.3s cubic-bezier(0.7,0,0.3,1);
}
.slide-play:hover { background: rgba(20,20,21,0.78); border-color: rgba(255,255,255,0.38); }
.slide-play svg { width: 14px; height: 14px; fill: rgba(255,255,255,0.72); margin-left: 3px; }
.slide-play.hidden { opacity: 0; pointer-events: none; }

/* Zoom */
.slide-zoom {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: rgba(20,20,21,0.52);
  border: 1px solid rgba(255,255,255,0.18);
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-in;
  transition: border-color 0.3s cubic-bezier(0.7,0,0.3,1), background 0.3s cubic-bezier(0.7,0,0.3,1);
}
.slide-zoom:hover { background: rgba(20,20,21,0.78); border-color: rgba(255,255,255,0.38); }
.slide-zoom svg { width: 14px; height: 14px; stroke: rgba(255,255,255,0.72); fill: none; stroke-width: 1; stroke-linecap: round; }


/* Footer — in normal flow, 30px below gallery, 50% wide centered */
.h-proj__footer {
  flex-shrink: 0;
  padding: 25px 0 24px;
  width: 50%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
/* Thin line with dots sitting on top */
.h-proj__dotline {
  width: 100%;
  position: relative;
  height: 20px;
  display: flex;
  align-items: center;
}
.h-proj__dotline::before {
  content: '';
  position: absolute;
  left: 0; right: 0;
  top: 50%; transform: translateY(-50%);
  height: 1px;
  background: rgba(255,255,255,0.08);
}
.h-proj__dots {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.h-proj__dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.h-proj__dot::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  transition: background 0.3s cubic-bezier(0.7,0,0.3,1);
}
.h-proj__dot.active::before {
  background: rgba(255,255,255,0.85);
}
.h-proj__counter {
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #fff;
  white-space: nowrap;
  text-align: center;
}

/* ── Next-project / next-section button — fixed bottom-left ── */
.h-proj__next {
  position: fixed;
  left: 36px;
  bottom: 40px;
  z-index: 190;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  color: rgba(255,255,255,0.38);
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: color 0.3s cubic-bezier(0.7,0,0.3,1);
}
.h-proj__next:hover { color: rgba(255,255,255,0.8); }
.h-proj__next svg {
  width: 36px; height: 22px;
  stroke: currentColor; fill: none;
  stroke-width: 1; stroke-linecap: round; stroke-linejoin: round;
}

/* ── Category header: compact divider in the feed ── */
.v-section.h-cat {
  height: auto;
  min-height: 0;
  padding-top: 50px;
  padding-bottom: 0;
  position: relative;
  z-index: 10;
}

/* ── Section nav — full-width timeline with 4 category anchors + sliding ball ── */
#v-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: 50%;
  bottom: 38px;
  z-index: 200;
  height: 50px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s cubic-bezier(0.7, 0, 0.3, 1);
}
#v-nav.visible { opacity: 1; pointer-events: auto; }
/* Timeline line */
#v-nav::before {
  content: '';
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  height: 1px;
  background: rgba(255,255,255,0.08);
  transform: translateY(-50%);
}
/* Category anchor dots — positioned absolutely by JS */
.v-nav__stop {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.v-nav__stop::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  transition: background 0.3s cubic-bezier(0.7,0,0.3,1);
}
.v-nav__stop.active::before { background: rgba(255,255,255,0.5); }
/* Category number — above dot */
.v-nav__num {
  position: absolute;
  bottom: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%);
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  font-size: 9px;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.18);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  transition: color 0.3s cubic-bezier(0.7,0,0.3,1);
}
.v-nav__stop.active .v-nav__num { color: rgba(255,255,255,0.45); }
/* Category label — below dot */
.v-nav__label {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.14);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  transition: color 0.3s cubic-bezier(0.7,0,0.3,1);
}
.v-nav__stop.active .v-nav__label { color: rgba(255,255,255,0.42); }
/* Sliding ball — tracks current section across the full timeline */
.v-nav__ball {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  z-index: 3;
  cursor: ew-resize;
  transition: left 0.6s cubic-bezier(0.7, 0, 0.3, 1);
  will-change: left;
}


/* ── Page nav ── */
.page-nav-section {
  justify-content: center;
  padding: 0 50px;
  position: relative;
  z-index: 10;
}
.page-nav { display: flex; flex-direction: column; gap: 16px; }
.page-nav-label {
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
}
.page-nav-link {
  font-family: 'DM Sans', sans-serif;
  font-weight: 900;
  font-size: clamp(48px, 8vw, 120px);
  letter-spacing: -0.07em;
  line-height: 0.92;
  color: #fff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.18em;
  transition: opacity 0.3s cubic-bezier(0.7, 0, 0.3, 1);
}
.page-nav-link:hover { opacity: 0.55; }
.page-nav-link svg { width: 0.46em; height: 0.46em; flex-shrink: 0; }

/* ══════════════════════════════════════════════
   TOUCH (phone + iPad) — native scroll, no JS snap
   html.is-touch set by head script: navigator.maxTouchPoints > 0
══════════════════════════════════════════════ */
html.is-touch,
html.is-touch body { height: auto; overflow: visible; }
html.is-touch { overflow-x: hidden; overflow-y: auto; }

html.is-touch .v-viewport { position: relative; overflow: visible; }
html.is-touch .v-track    { transform: none !important; }
html.is-touch .v-section  { height: auto; min-height: 100svh; overflow: visible; }

html.is-touch .section-intro { padding: 120px 24px 60px; }

/* Project section: don't stretch to full viewport, just wrap content */
html.is-touch .h-proj         { overflow: visible; min-height: 0; padding-bottom: 40px; }
html.is-touch .h-proj__body   { flex: none; flex-direction: column; padding-left: 0; }
html.is-touch .h-proj__sidebar {
  position: relative;
  left: auto; top: auto; transform: none;
  width: auto;
  padding: 24px 24px 16px;
  justify-content: flex-start;
}
html.is-touch .h-proj__name { font-size: clamp(44px, 11vw, 72px); }
html.is-touch .h-proj__num  { width: 44px; height: 44px; }
html.is-touch .h-proj__gallery {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  cursor: default;
  height: 55vh;
  flex: none;
  justify-content: flex-start;
  touch-action: pan-x pan-y;
}
html.is-touch .h-proj__gallery::-webkit-scrollbar { display: none; }
html.is-touch .h-proj__track  { height: 100%; gap: 2vw; padding: 0 24px; align-items: center; }
html.is-touch .h-proj__next   { display: none; }
html.is-touch .h-proj__slide  { height: 100%; }

/* Video slides: fill gallery height */
html.is-touch .h-proj__slide--video video {
  height: 100%; width: auto; max-height: none; max-width: none;
}

/* Hero image slides: fixed screen width, image fits within — no cropping */
html.is-touch .h-proj__slide:not(.h-proj__slide--pair):not(.h-proj__slide--video) {
  width: calc(100vw - 48px);
}
html.is-touch .h-proj__slide:not(.h-proj__slide--pair) img {
  width: 100%;
  height: auto;
  max-height: 55vh;
  max-width: none;
}

/* Pair slides: square thumbs — let desktop aspect-ratio:1/1 rule do the work */
html.is-touch .h-proj__slide--pair {
  height: 100%; flex-direction: column; justify-content: center; gap: 1vw; align-items: flex-start;
}
html.is-touch .h-proj__slide--pair img {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
}
html.is-touch .h-proj__footer { padding: 8px 24px 0; }
html.is-touch #v-nav          { display: none; }
html.is-touch .v-viewport::before   { display: none; }
html.is-touch .h-proj__gallery::before { display: none; }
html.is-touch .slide-zoom { display: none; }
html.is-touch #left-grad  { display: none; }

html.is-touch .page-nav-section { min-height: 60svh; padding: 60px 24px; }
