/* josieford.com
   Light, warm, typography-led. The work is the hero; everything else stands back.
   One family (General Sans variable), one accent, sharp edges throughout.
   Home: full-viewport name the work slides over (sticky hero), inverted nav that
   returns on scroll-up, masked row reveals, hover previews, client logo wall.
   Project pages: locked full-screen stage, bottom bar (prev / client + title / next),
   slide navigation between projects, info drawer, film carousel. */

@view-transition { navigation: auto; }

/* Project-to-project slide (direction set via pageswap/pagereveal types in site.js). */
@keyframes vt-out-left { to { transform: translateX(-30vw); } }
@keyframes vt-in-right { from { transform: translateX(100vw); } }
@keyframes vt-out-right { to { transform: translateX(30vw); } }
@keyframes vt-in-left { from { transform: translateX(-100vw); } }

html:active-view-transition-type(slide-next)::view-transition-old(root) {
  animation: vt-out-left 0.6s cubic-bezier(0.65, 0, 0.35, 1) both;
}
html:active-view-transition-type(slide-next)::view-transition-new(root) {
  animation: vt-in-right 0.6s cubic-bezier(0.65, 0, 0.35, 1) both;
}
html:active-view-transition-type(slide-prev)::view-transition-old(root) {
  animation: vt-out-right 0.6s cubic-bezier(0.65, 0, 0.35, 1) both;
}
html:active-view-transition-type(slide-prev)::view-transition-new(root) {
  animation: vt-in-left 0.6s cubic-bezier(0.65, 0, 0.35, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; }
}

@font-face {
  font-family: "General Sans";
  src: url("/assets/fonts/GeneralSans-Variable.woff2") format("woff2");
  font-weight: 200 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "General Sans";
  src: url("/assets/fonts/GeneralSans-VariableItalic.woff2") format("woff2");
  font-weight: 200 700;
  font-style: italic;
  font-display: swap;
}
/* Display serif (Recoleta-adjacent soft serif) for the name and all titles. */
@font-face {
  font-family: "Fraunces";
  src: url("/assets/fonts/Fraunces-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("/assets/fonts/Fraunces-VariableItalic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
/* Alternative delicate serif (Cochin-adjacent) - swap --font-display to use. */
@font-face {
  font-family: "Cormorant";
  src: url("/assets/fonts/Cormorant-Variable.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f2f1ec;
  --paper-deep: #e9e7e0;
  --ink: #1b1c1e;
  --ink-soft: #61605b;
  --hairline: #d8d5cc;
  --accent: #d43d18;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --nav-h: 4.6rem;
  --tab-h: 4.4rem;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  /* One characterful serif for name + all titles; clean sans for UI/body. */
  --font-display: "Cormorant", Georgia, serif;
}

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

body {
  font-family: "General Sans", system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-size: 1.125rem;
  line-height: 1.55;
  font-weight: 430;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Project pages without stills are a single locked screen. */
@media (min-width: 768px) {
  .page-lock { height: 100dvh; overflow: hidden; }
}

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

img, video { display: block; max-width: 100%; }

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

.skip {
  position: absolute;
  left: -100vw;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 1rem;
  z-index: 50;
}
.skip:focus { left: 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ------------------------------------------------ intro loader (home, first paint) */

.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  background: var(--paper);
  overflow: hidden;
}
.js .loader { display: block; }
.seen .loader { display: none !important; }
.ldr {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(92vw, 60rem);
  text-align: center;
  opacity: 0;
  transform: translate(-50%, -50%);
}
.ldr-1 {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 8.5vw, 6rem);
  font-weight: 600;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  animation: ldrStep 1.05s var(--ease) 0.15s both;
}
.ldr-2 {
  font-size: clamp(1.3rem, 2.8vw, 2.1rem);
  font-weight: 500;
  line-height: 1.3;
  animation: ldrStep 1.05s var(--ease) 1.05s both;
}
.ldr-3 {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  animation: ldrIn 0.7s var(--ease) 2s both;
}
.ldr-row {
  font-size: clamp(0.92rem, 1.7vw, 1.4rem);
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.ldr-row:nth-child(2) { color: var(--ink-soft); }
.loader.wipe { animation: ldrWipe 0.8s cubic-bezier(0.7, 0, 0.2, 1) forwards; }
@keyframes ldrStep {
  0% { opacity: 0; transform: translate(-50%, -42%); }
  22% { opacity: 1; transform: translate(-50%, -50%); }
  74% { opacity: 1; transform: translate(-50%, -50%); }
  100% { opacity: 0; transform: translate(-50%, -58%); }
}
@keyframes ldrIn {
  0% { opacity: 0; transform: translate(-50%, -42%); }
  100% { opacity: 1; transform: translate(-50%, -50%); }
}
@keyframes ldrWipe { to { transform: translateY(-100%); } }
@media (prefers-reduced-motion: reduce) {
  .loader { display: none !important; }
}

/* ------------------------------------------------ cursor companion */

.cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 70;
  pointer-events: none;
  transform: translate(-50%, -50%);
  opacity: 0;
}
.cursor span {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 0.42rem 0.85rem;
  white-space: nowrap;
  transform: scale(0.4);
  transition: transform 0.35s var(--ease);
}
.cursor.on { opacity: 1; }
.cursor.on span { transform: scale(1); }
@media (hover: none), (prefers-reduced-motion: reduce) {
  .cursor { display: none; }
}

/* ------------------------------------------------ nav (inverted, returns on scroll-up) */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: var(--nav-h);
  padding: 0 var(--gutter);
  /* Solid paper bar so the nav stays readable over any content;
     hides scrolling down, returns scrolling up. */
  background: var(--paper);
  color: var(--ink);
  border-bottom: 1px solid var(--hairline);
  transition: transform 0.5s var(--ease);
}
.nav.nav-hidden { transform: translateY(-102%); }
.nav-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: 0;
  perspective: 500px;
  display: inline-block;
}
/* Hover: the name cube-spins to the role. Faster than the hero and the opposite
   way (positive rotateX shows the underside of the cube). */
.nav-cube {
  position: relative;
  display: inline-block;
  transform-style: preserve-3d;
  transition: transform 0.42s var(--ease);
}
.nav-name:hover .nav-cube, .nav-name:focus-visible .nav-cube { transform: rotateX(90deg); }
.nav-face { display: block; backface-visibility: hidden; }
/* Josie Ford reads bold; the role it flips to reads as a lighter cut of the serif. */
.nav-face-f { transform: translateZ(0.62em); font-weight: 600; }
.nav-face-b {
  position: absolute;
  top: 0;
  left: 0;
  white-space: nowrap;
  font-weight: 400;
  transform: rotateX(-90deg) translateZ(0.62em);
}
@media (prefers-reduced-motion: reduce) {
  .nav-cube { transition: none; }
  .nav-name:hover .nav-cube { transform: none; }
  .nav-face-b { display: none; }
}
.nav-links { display: flex; gap: clamp(1.2rem, 3vw, 2.4rem); }
.nav-links a {
  font-size: 0.95rem;
  font-weight: 480;
  position: relative;
  transition: transform 0.35s var(--ease);
}
.nav-links a:hover { transform: scale(1.08); }
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 1.5px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease);
}
.nav-links a:hover::after { transform: scaleX(1); transform-origin: left; }

/* ------------------------------------------------ intro (home landing) */

/* Sticky under the page: the work section slides over the name,
   so the name reads as scrolling slower and the gap closes fast. */
/* Height leaves room for the Selected work tab peeking at the bottom of the fold. */
.intro {
  position: sticky;
  top: 0;
  height: calc(100dvh - var(--tab-h));
  z-index: 1;
  display: flex;
  flex-direction: column;
  padding: var(--nav-h) var(--gutter) clamp(1.2rem, 3vh, 2.4rem);
}
.intro-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* A touch above true centre. */
  margin-top: -4vh;
}
.intro-name {
  font-family: var(--font-display);
  font-size: clamp(3.8rem, 17.5vw, 17.5rem);
  line-height: 0.9;
  font-weight: 600;
  letter-spacing: 0.005em;
  text-transform: uppercase;
}
/* The name is the About doorway: it drifts fluidly with the cursor
   and the cursor chip reads "About". */
.intro-name-link {
  display: flex;
  flex-direction: row;
  gap: 0.26em;
  white-space: nowrap;
  width: max-content;
  will-change: transform;
}
.intro-word { display: inline-block; }

.intro-meta {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  margin-top: clamp(1.4rem, 3.5vh, 2.6rem);
  font-size: clamp(1.15rem, 1.9vw, 1.7rem);
  font-weight: 500;
  letter-spacing: -0.01em;
}
.intro-dot { color: var(--ink-soft); }
.intro-line {
  margin-top: 0.7rem;
  max-width: 44ch;
  font-size: clamp(0.98rem, 1.2vw, 1.15rem);
  color: var(--ink-soft);
  line-height: 1.45;
}

/* Everything after the hero rides above it. */
.work, .trusted, .footer, .about, .notfound {
  position: relative;
  z-index: 2;
  background: var(--paper);
}

/* ------------------------------------------------ work rows */

/* The work section leads with a clickable "Selected work" tab that peeks above
   the fold (its hairline top edge is the line the name tucks behind). It bobs
   gently until the visitor scrolls or clicks. */
.work {
  padding: 0 var(--gutter) clamp(2rem, 6vh, 4rem);
  border-top: 1px solid var(--hairline);
}
.js .work.tab-bounce { animation: tabBob 2.4s ease-in-out infinite; }
@keyframes tabBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}
@media (prefers-reduced-motion: reduce) {
  .js .work.tab-bounce { animation: none; }
}
.work-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: var(--tab-h);
  cursor: pointer;
}
.work-head .work-title { transition: transform 0.35s var(--ease); transform-origin: left center; }
.work-head:hover .work-title { transform: scale(1.04); }
.work-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.3vw, 2.7rem);
  font-weight: 600;
  letter-spacing: 0;
}
.work-count { font-size: 0.95rem; color: var(--ink-soft); }

.row {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(1.4rem, 4vw, 4rem);
  align-items: center;
  padding: clamp(1.6rem, 4vh, 3rem) 0;
  border-top: 1px solid var(--hairline);
}

/* Masked wipe reveal as each row arrives (subtle, opos-style). */
.js .row .row-media {
  clip-path: inset(100% 0 0 0);
  transition: clip-path 1.1s var(--ease), transform 0.55s var(--ease);
}
.js .row.in .row-media { clip-path: inset(0 0 0 0); }
.js .row .row-info > * {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s var(--ease);
}
.js .row.in .row-info > * { opacity: 1; transform: none; }
.js .row.in .row-client { transition-delay: 0.12s; }
.js .row.in .row-title { transition-delay: 0.2s; }
.js .row.in .row-disc { transition-delay: 0.28s; }
.js .row.in .row-cta { transition-delay: 0.38s; }
@media (prefers-reduced-motion: reduce) {
  .js .row .row-media { clip-path: none; transition: none; }
  .js .row .row-info > * { opacity: 1; transform: none; transition: none; }
}

.row-media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--paper-deep);
  /* The whole player scales up on hover (never a zoom-crop of the frame). */
  transition: transform 0.55s var(--ease);
  transform-origin: center;
}
.row:hover .row-media { transform: scale(1.03); }
@media (prefers-reduced-motion: reduce) {
  .row-media { transition: none; }
  .row:hover .row-media { transform: none; }
}
.row-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* 9:16 work sits centred over a blurred fill of itself - never cropped. */
.row-media-tall .row-thumb {
  left: 50%;
  width: auto;
  transform: translateX(-50%);
  object-fit: contain;
  z-index: 2;
}
.row-blur {
  position: absolute;
  inset: -8%;
  width: 116%;
  height: 116%;
  object-fit: cover;
  filter: blur(26px) brightness(0.82) saturate(1.05);
}
.row-media video.row-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.45s ease;
  z-index: 3;
}
.row-media-tall video.row-preview {
  left: 50%;
  width: auto;
  transform: translateX(-50%);
  object-fit: contain;
}
.row-media video.row-preview.playing { opacity: 1; }

.row-media-pending {
  display: grid;
  place-items: center;
  border: 1px solid var(--hairline);
  background: var(--paper-deep);
}
.row-media-pending span {
  font-size: clamp(1rem, 1.6vw, 1.3rem);
  font-weight: 480;
  color: var(--ink-soft);
  text-align: center;
  line-height: 1.35;
  letter-spacing: 0.01em;
}

.row-info { min-width: 0; }
.row-client {
  font-size: 0.82rem;
  font-weight: 540;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.9rem;
}
.row-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.3vw, 2.85rem);
  line-height: 1.06;
  font-weight: 600;
  letter-spacing: 0;
  margin-bottom: 0.7rem;
}
.row-disc { color: var(--ink-soft); font-size: 1.05rem; }
.row-cta {
  display: inline-block;
  margin-top: 1.6rem;
  font-size: 0.92rem;
  font-weight: 520;
  letter-spacing: 0.03em;
  position: relative;
  padding-bottom: 3px;
}
.row-cta::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1.5px;
  background: var(--accent);
  transform: scaleX(0.35);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}
.row:hover .row-cta::after { transform: scaleX(1); }

/* ------------------------------------------------ trusted by (logo wall) */

.trusted { padding: clamp(3rem, 9vh, 6.5rem) var(--gutter); border-top: 1px solid var(--hairline); }
.trusted-eyebrow {
  font-size: 0.82rem;
  font-weight: 540;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 2.4rem;
}
.logo-wall {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  row-gap: clamp(2rem, 4vw, 3.5rem);
  column-gap: 1rem;
}
.logo-cell {
  display: grid;
  place-items: center;
  min-height: 5rem;
  padding: 0 1rem;
}
/* Height-normalised so mixed marks (icons, wordmarks, crest) sit optically even. */
.logo-cell img {
  max-height: 2.5rem;
  max-width: min(100%, 8.5rem);
  width: auto;
  height: auto;
  filter: grayscale(1) opacity(0.5);
  transition: filter 0.45s ease, transform 0.45s var(--ease);
}
.logo-cell:hover img { filter: grayscale(0) opacity(1); transform: scale(1.12); }
/* The Celsius wordmark is much wider than the boxed marks - cap it so it sits even. */
.logo-cell img[src*="celsius"] { max-width: 5.4rem; }
.logo-type {
  font-size: clamp(0.95rem, 1.3vw, 1.15rem);
  font-weight: 540;
  letter-spacing: -0.01em;
  color: var(--ink-soft);
  transition: color 0.45s ease, transform 0.45s var(--ease);
}
.logo-cell:hover .logo-type { color: var(--ink); transform: scale(1.08); }
@media (prefers-reduced-motion: reduce) {
  .logo-cell img, .logo-type { transition: none; }
  .logo-cell:hover img { transform: none; filter: grayscale(0) opacity(1); }
  .logo-cell:hover .logo-type { transform: none; }
}

/* ------------------------------------------------ project page: stage */

.stage {
  position: relative;
  height: 100dvh;
  display: grid;
  /* Media fills the top row; the title bar is a footer band below it,
     so titles never sit over the film or its controls. */
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  row-gap: 0.4rem;
  background: var(--paper-deep);
  overflow: hidden;
  padding: calc(var(--nav-h) + 0.9rem) clamp(2rem, 5vw, 4.5rem) clamp(1rem, 2.2vh, 1.6rem);
}
.stage-blur {
  position: absolute;
  inset: -8%;
  width: 116%;
  height: 116%;
  object-fit: cover;
  filter: blur(34px) brightness(0.8) saturate(1.05);
}
.stage-tall { background: #101012; }

.carousel { position: relative; width: 100%; height: 100%; display: grid; grid-template-rows: minmax(0, 1fr); grid-template-columns: minmax(0, 1fr); }
/* Films stack vertically: wheel/swipe moves down the stack, the rail jumps. */
.carousel-track {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  overscroll-behavior: contain;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-slide {
  flex: 0 0 100%;
  min-height: 100%;
  width: 100%;
  scroll-snap-align: center;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  position: relative;
}
.carousel-slide > .stage-media { max-height: 100%; }
.slide-label {
  position: absolute;
  top: 0.7rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 7;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  background: rgb(20 20 22 / 0.55);
  padding: 0.25rem 0.7rem;
  backdrop-filter: blur(6px);
  white-space: nowrap;
}

.stage-media {
  max-width: 100%;
  max-height: 100%;
  background: #000;
  position: relative;
  z-index: 2;
}
.stage-media-wide {
  aspect-ratio: 16 / 9;
  height: auto;
  width: min(100%, calc((100dvh - var(--nav-h) - 10rem) * 16 / 9));
}
.stage-media-tall { height: 100%; width: auto; aspect-ratio: 9 / 16; }
video.stage-media { object-fit: contain; }
.stage-embed { position: relative; }
.stage-embed iframe { width: 100%; height: 100%; border: 0; position: absolute; inset: 0; }

/* Announced-but-undelivered films inside a carousel. */
.pending-slide {
  display: grid;
  place-items: center;
  border: 1px solid var(--hairline);
  background: var(--paper);
  max-height: 100%;
}
.pending-slide span {
  font-size: clamp(1rem, 1.6vw, 1.35rem);
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

.stage-pending {
  display: grid;
  place-items: center;
  width: min(100%, 900px);
  aspect-ratio: 16 / 9;
  border: 1px solid var(--hairline);
  background: var(--paper);
  position: relative;
  z-index: 2;
}
.stage-pending span {
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  color: var(--ink-soft);
  text-align: center;
  line-height: 1.35;
}

/* Footer band under the media: previous / [client / TITLE / meta / info] / next.
   Ink on the light stage, white on the dark 9:16 stage. */
.stage-bar {
  grid-row: 2;
  width: 100%;
  z-index: 6;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: clamp(1rem, 3vw, 3rem);
  padding: 0.6rem 0 0.2rem;
  color: var(--ink);
}
.stage-tall .stage-bar { color: #fff; }
.stage-id {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.35rem;
  min-width: 0;
}
.stage-client {
  font-size: 0.8rem;
  font-weight: 540;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: currentColor;
  opacity: 0.65;
}
.stage-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 2.9vw, 2.5rem);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.05;
  text-wrap: balance;
}
.stage-meta {
  font-size: clamp(0.88rem, 1.1vw, 1rem);
  color: currentColor;
  opacity: 0.65;
  letter-spacing: 0.01em;
}
.info-toggle {
  margin-top: 0.4rem;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 540;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: none;
  border: 1.5px solid currentColor;
  color: inherit;
  padding: 0.5rem 1.3rem;
  cursor: pointer;
  transition: transform 0.3s var(--ease), background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
.info-toggle:hover, .info-toggle:focus-visible, .info-toggle[aria-expanded="true"] {
  transform: scale(1.06);
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.stage-tall .info-toggle:hover, .stage-tall .info-toggle:focus-visible, .stage-tall .info-toggle[aria-expanded="true"] {
  background: #fff;
  color: var(--ink);
  border-color: #fff;
}
.info-hint {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  opacity: 0.6;
  padding-left: 0.55rem;
  border-left: 1px solid currentColor;
}
/* The scroll-to-open hint only applies where a wheel exists. */
@media (hover: none) {
  .info-hint { display: none; }
}

.stage-link {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  font-size: clamp(0.92rem, 1.2vw, 1.1rem);
  font-weight: 520;
  letter-spacing: -0.01em;
  transition: transform 0.35s var(--ease);
}
.stage-link:hover { transform: scale(1.05); }
.stage-link-next { justify-self: end; text-align: right; align-items: flex-end; }
.sl-label {
  font-size: 0.72rem;
  font-weight: 540;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: currentColor;
  opacity: 0.6;
}
.sl-row { display: flex; align-items: center; gap: 0.6rem; min-width: 0; }
.sl-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 22ch;
}
.sl-arrow { font-size: 1.1rem; transition: transform 0.3s var(--ease); }
.stage-link-prev:hover .sl-arrow { transform: translateX(-4px); }
.stage-link-next:hover .sl-arrow { transform: translateX(4px); }
@media (prefers-reduced-motion: reduce) {
  .stage-link:hover, .info-toggle:hover { transform: none; }
}

/* Right-hand rail: one tile per film, active highlighted, click to jump. */
.car-rail {
  position: absolute;
  right: clamp(0.7rem, 1.6vw, 1.4rem);
  top: 50%;
  transform: translateY(-50%);
  z-index: 7;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.rail-item {
  width: clamp(3.6rem, 5vw, 4.8rem);
  aspect-ratio: 16 / 9;
  padding: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: rgb(20 20 22 / 0.55);
  border: 1.5px solid rgb(255 255 255 / 0.4);
  color: #fff;
  cursor: pointer;
  opacity: 0.6;
  backdrop-filter: blur(6px);
  transition: opacity 0.3s ease, transform 0.3s var(--ease), border-color 0.3s ease;
}
.rail-item img { width: 100%; height: 100%; object-fit: cover; }
.rail-item .rail-num {
  font-size: 0.78rem;
  font-weight: 540;
  letter-spacing: 0.08em;
}
.rail-item:hover { opacity: 1; transform: scale(1.06); }
.rail-item.active { opacity: 1; border-color: #fff; }
@media (prefers-reduced-motion: reduce) {
  .rail-item:hover { transform: none; }
}

/* ------------------------------------------------ project info drawer */

.project-info {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  background: var(--paper);
  border-top: 1px solid var(--hairline);
  transform: translateY(103%);
  transition: transform 0.6s var(--ease);
  max-height: 72dvh;
  overflow: auto;
}
.project-info.open { transform: translateY(0); }
html:not(.js) .project-info { position: static; transform: none; max-height: none; }
.project-info-inner {
  position: relative;
  padding: clamp(1.8rem, 4.5vh, 3rem) var(--gutter) clamp(2rem, 5vh, 3.2rem);
}
.info-close {
  position: absolute;
  top: 1.2rem;
  right: var(--gutter);
  font-family: inherit;
  font-size: 1.6rem;
  line-height: 1;
  background: none;
  border: 0;
  color: var(--ink);
  cursor: pointer;
  padding: 0.3rem;
}
.info-close:hover { color: var(--accent); }
html:not(.js) .info-close { display: none; }

.project-summary {
  max-width: 58ch;
  font-size: clamp(1.1rem, 1.7vw, 1.4rem);
  line-height: 1.5;
  margin-bottom: 2rem;
}
.project-meta { display: flex; gap: clamp(2rem, 6vw, 5rem); flex-wrap: wrap; }
.project-meta dt {
  font-size: 0.78rem;
  font-weight: 540;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.3rem;
}
.project-meta dd { font-size: 1.02rem; }
.project-note { margin-top: 2rem; color: var(--ink-soft); font-style: italic; }

.project-stills {
  position: relative;
  z-index: 2;
  background: var(--paper);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1rem, 2.5vw, 2rem);
  padding: clamp(2rem, 5vh, 4rem) var(--gutter);
}
.still-full { grid-column: 1 / -1; }
.still img { width: 100%; }

/* ------------------------------------------------ about */

.about { padding: calc(var(--nav-h) + clamp(2.5rem, 8vh, 6rem)) 0 0; }

/* Headline and photo locked together as one balanced pair;
   the bio sits below as a wide centred block. Everything fluid - no sticky. */
.about-hero {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(1.5rem, 4.5vw, 4.5rem);
  align-items: center;
  padding: 0 var(--gutter);
}
.about-headline {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.4vw, 3.5rem);
  line-height: 1.18;
  font-weight: 540;
  letter-spacing: 0;
}
.about-headline .w { color: #b6b3a9; }
html:not(.js) .about-headline .w { color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .about-headline .w { color: var(--ink); } }

.about-photo { min-width: 0; }
.about-photo img { width: 100%; height: auto; }

.about-body {
  max-width: 68ch;
  margin: 0 auto;
  padding: clamp(2.8rem, 8vh, 5.5rem) var(--gutter) 0;
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  font-size: clamp(1.1rem, 1.5vw, 1.3rem);
  line-height: 1.6;
}
.about-cta { font-weight: 540; }

/* Contact buttons: label above, icon tile below - same style everywhere. */
.c-links {
  list-style: none;
  display: flex;
  gap: clamp(1.2rem, 3vw, 2.2rem);
  margin-top: 0.6rem;
}
.c-links a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.cl-label {
  font-size: 0.72rem;
  font-weight: 540;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  transition: color 0.3s ease;
}
.cl-icon {
  width: 2.9rem;
  height: 2.9rem;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--ink);
  color: var(--ink);
  transition: background 0.3s ease, color 0.3s ease, transform 0.3s var(--ease);
}
.cl-icon svg { width: 1.15rem; height: 1.15rem; }
.c-links a:hover .cl-icon { background: var(--ink); color: var(--paper); transform: scale(1.07); }
.c-links a:hover .cl-label { color: var(--ink); }
@media (prefers-reduced-motion: reduce) {
  .c-links a:hover .cl-icon { transform: none; }
}

/* Compact footer version, sitting in line with the copyright. */
.c-links-sm { margin-top: 0; gap: 1.1rem; }
.c-links-sm .cl-icon { width: 2.3rem; height: 2.3rem; border-width: 1px; }
.c-links-sm .cl-icon svg { width: 0.95rem; height: 0.95rem; }
.c-links-sm .cl-label { font-size: 0.62rem; }

/* ------------------------------------------------ footer */

.footer {
  padding: clamp(3rem, 9vh, 6rem) var(--gutter) 2rem;
  border-top: 1px solid var(--hairline);
}
.footer-line {
  font-size: 0.82rem;
  font-weight: 540;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 1rem;
}
.footer-mail {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5.2vw, 4.2rem);
  font-weight: 560;
  letter-spacing: 0;
  line-height: 1.05;
  display: inline-block;
  border-bottom: 2px solid transparent;
  transition: border-color 0.3s ease, color 0.3s ease;
  white-space: nowrap;
  max-width: 100%;
}
.footer-mail:hover { color: var(--accent); border-color: var(--accent); }
.footer-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-top: clamp(2rem, 6vh, 4rem);
  font-size: 0.92rem;
  color: var(--ink-soft);
}

/* ------------------------------------------------ reveals (about etc) */

.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.8s ease, transform 0.8s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* ------------------------------------------------ 404 */

.notfound {
  min-height: 70dvh;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 1rem;
  padding: 0 var(--gutter);
}
.notfound a { border-bottom: 1.5px solid var(--accent); }

/* ------------------------------------------------ mobile */

@media (max-width: 767px) {
  .intro { position: relative; height: calc(100svh - var(--tab-h)); }
  .intro-name { font-size: clamp(4rem, 23vw, 8rem); }
  .intro-name-link {
    flex-direction: column;
    gap: 0;
    white-space: normal;
    align-items: flex-start;
  }
  .intro-meta { font-size: 1.1rem; }

  .row { grid-template-columns: 1fr; gap: 1.2rem; align-items: start; }
  .row-cta { margin-top: 1rem; }

  /* Mobile: the bar sits below the media (page scrolls here), so the title
     never covers the video controls; ink on paper instead of blend-over-media. */
  .stage {
    height: auto;
    grid-template-rows: minmax(0, 1fr) auto;
    padding: calc(var(--nav-h) + 0.4rem) 0.8rem 0.6rem;
  }
  .stage-tall .carousel, .stage-tall .carousel-track, .stage-tall .carousel-slide { height: 72svh; }
  .stage:not(.stage-tall) .carousel,
  .stage:not(.stage-tall) .carousel-track,
  .stage:not(.stage-tall) .carousel-slide { height: auto; }
  .stage-media-tall { height: 100%; }
  .stage-media-wide { width: 100%; }
  .stage-bar {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "id id" "prev next";
    row-gap: 1.1rem;
    padding: 1.2rem 0.4rem 0.4rem;
  }
  .stage-id { grid-area: id; }
  .stage-link-prev { grid-area: prev; }
  .stage-link-next { grid-area: next; }
  .sl-title { max-width: 14ch; }
  .car-rail { right: 0.5rem; gap: 0.4rem; }
  .rail-item { width: 2.9rem; }
  .slide-label { display: none; }

  /* Single column: headline, then photo, then the bio block. */
  .about-hero { grid-template-columns: 1fr; gap: 1.6rem; }

  .logo-wall { grid-template-columns: repeat(2, 1fr); }
  .project-stills { grid-template-columns: 1fr; }

  /* Email fits one line on a phone. */
  .footer-mail { font-size: clamp(1rem, 6vw, 1.7rem); }
}
