/* ── Category and project pages (drawn by js/pages.js) ──────
   Each page is a full-screen layer with its own scroll, laid over the homepage.
   Layers: pages 42 / 44 · travelling image 45 · logo 46 · menu 50 · menu button 60 */

/* The homepage steps back while a page is open */
.hero { transition: opacity 0.6s var(--ease); }
.is-away .hero { opacity: 0; }
.is-away-instant .hero { transition: none; }
.is-away .chip { opacity: 0; }
.is-away .surface { opacity: 0; transition: none; }

.page {
  position: fixed; inset: 0; z-index: 42;
  overflow-x: hidden; overflow-y: auto;
  overscroll-behavior: contain;
  background-color: var(--cream);
  transition: background-color 0.6s var(--ease);
}
.page[hidden] { display: none; }
.page--project { z-index: 44; }
/* Arriving: see-through until the image lands. Leaving: the content fades as the image travels back */
.page.is-before, .page.is-after { background-color: transparent; }
.page.is-after { pointer-events: none; }
.page.is-after > * { opacity: 0; transition: opacity 0.35s var(--ease); }
.page.is-morphing [data-hero] { visibility: hidden; }

/* Text and images rise in as they scroll into view */
.page [data-reveal] {
  transition: opacity 0.9s var(--ease), transform 1.1s var(--ease);
  transition-delay: calc(var(--d, 0) * 80ms);
}
.page [data-reveal]:not(.is-in), .page.is-before [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
}

/* A category page arriving over another holds its text back until the wipe has crossed */
.page.is-entering [data-reveal] { opacity: 0; transform: translate3d(0, 28px, 0); }

/* Category bar: every category, as small white type to the left of the logo */
.cat-nav {
  /* Just left of the logo */
  position: fixed; top: var(--gutter); right: calc(var(--gutter) + clamp(36px, 2.6vw, 48px) + 36px); z-index: 46;
  max-width: calc(100% - 2 * var(--gutter) - clamp(36px, 2.6vw, 48px) - 36px);
  overflow-x: auto; scrollbar-width: none;
  color: #fff;
  opacity: 0; visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease), visibility 0s 0.5s;
}
.cat-nav::-webkit-scrollbar { display: none; }
.cat-nav[data-cat='package-design'] { color: #111; } /* Package Design's wall and page are light behind the bar */
.cat-nav.is-on {
  opacity: 1; visibility: visible;
  transform: none;
  transition-delay: 0.35s, 0.35s, 0s;
}
.cat-nav ul { display: flex; }
.cat-nav a {
  display: flex; align-items: center;
  height: clamp(36px, 2.6vw, 48px);
  padding: 0 0.8em;
  font: 500 max(8px, 0.5vw) / 1 var(--label);
  letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none; white-space: nowrap;
  transition: opacity 0.3s;
}
.cat-nav a:not([aria-current]):hover { opacity: 0.6; }
.cat-nav a:focus-visible { outline-color: currentColor; outline-offset: -6px; box-shadow: none; }
/* A thin underline glides to the current category with the same easing as the pages */
.cat-nav__mark {
  position: absolute; left: 0; bottom: calc(50% - 1em);
  height: 1px; background: currentColor;
  transition: transform 1.05s cubic-bezier(0.76, 0, 0.24, 1), width 1.05s cubic-bezier(0.76, 0, 0.24, 1);
}
.cat-nav.is-instant .cat-nav__mark { transition: none; }
@media (max-width: 960px) {
  /* Below the back button, scrolling sideways */
  .cat-nav { right: var(--gutter); max-width: calc(100% - 2 * var(--gutter)); top: calc(var(--gutter) + clamp(36px, 2.6vw, 48px) + 4px); }
}

/* The logo is a link home */
.mark-link .mark { pointer-events: auto; cursor: pointer; transition: transform 0.4s var(--ease); }
.mark-link:hover .mark { transform: scale(1.06); }
.mark-link:focus-visible { outline: none; }
.mark-link:focus-visible .mark { outline: 2px solid var(--ink); outline-offset: 3px; box-shadow: 0 0 0 6px var(--accent); }

/* The travelling image */
.morph-layer { position: fixed; inset: 0; z-index: 45; pointer-events: none; }
.morph {
  position: absolute; left: 0; top: 0;
  overflow: hidden;
  background: var(--cream-2);
  will-change: transform, width, height;
}
.morph img { width: 100%; height: 100%; max-width: none; object-fit: cover; }
.morph img + img { position: absolute; inset: 0; } /* the picture it arrives as, fading in on top */
/* The shutter: the category's picture in full-screen strips that lift away */
.shutter, .shutter__over { position: absolute; inset: 0; overflow: hidden; }
.shutter__strip { position: absolute; top: 0; height: 100%; overflow: hidden; will-change: transform; }
.shutter__face { position: absolute; top: 0; height: 100%; will-change: transform; }
.shutter__face > img { width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 50% 35%; }
.shutter__name {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 0.9em;
  padding: var(--gutter);
  color: var(--cream);
  background: linear-gradient(to top, rgb(0 0 0 / 0.55), rgb(0 0 0 / 0) 55%);
}
.shutter__count {
  font: 500 clamp(12px, 0.9vw, 16px) / 1 var(--label);
  letter-spacing: 0.08em; text-transform: uppercase;
}
.shutter__title { display: block; overflow: hidden; padding-bottom: 0.04em; }
.shutter__title > span {
  display: block; margin-left: -0.04em;
  font: 700 clamp(56px, 13vw, 280px) / 0.82 var(--display);
  letter-spacing: -0.055em; text-transform: uppercase;
}
/* Over the growing picture the name rises into view */
.shutter__over .shutter__name { animation: shutter-fade 0.5s var(--ease) both; }
.shutter__over .shutter__title > span { animation: shutter-rise 0.75s var(--ease) both; }
.shutter__over .shutter__count { animation: shutter-rise-small 0.6s var(--ease) 0.08s both; }
@keyframes shutter-fade { from { background-color: transparent; opacity: 0.001; } to { opacity: 1; } }
@keyframes shutter-rise { from { transform: translate3d(0, 105%, 0); } to { transform: none; } }
@keyframes shutter-rise-small { from { opacity: 0; transform: translate3d(0, 12px, 0); } to { opacity: 1; transform: none; } }

/* The tile or thumbnail it left from stays empty until it returns */
.card.is-source .card__media img, .thumb.is-source .thumb__media img { visibility: hidden; }

/* ── Shared ──────────────────────────────────────────────── */
.page__back {
  position: fixed; top: var(--gutter); left: var(--gutter); z-index: 3;
  display: inline-flex; align-items: center; gap: 0.6em;
  height: clamp(36px, 2.6vw, 48px); /* level with the logo */
  padding: 0 1.1em 0 0.85em;
  background: var(--ink); color: var(--cream);
  border-radius: 4px;
  font: 500 var(--bar-size) / 1 var(--label);
  letter-spacing: 0.04em; text-transform: uppercase; text-decoration: none;
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.page__back svg { width: 1.15em; height: 1.15em; transition: transform 0.4s var(--ease); }
.page__back:hover svg { transform: translateX(-3px); }
.page.is-before .page__back { opacity: 0; transform: translateY(-8px); }
/* Close (×) on a project: always in the same place on every page — top right,
   level with the back button, the logo's size, just to the logo's left */
.page__close {
  --size: clamp(36px, 2.6vw, 48px);
  position: fixed; z-index: 3; top: var(--gutter);
  right: calc(var(--gutter) + var(--size) + 10px);
  display: grid; place-items: center;
  width: var(--size); height: var(--size);
  background: var(--ink); color: var(--cream); border-radius: 4px;
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease), background-color 0.3s;
}
.page__close svg { width: 46%; height: 46%; transition: transform 0.4s var(--ease); }
.page__close:hover svg { transform: rotate(90deg); }
.page.is-before .page__close { opacity: 0; transform: translateY(-8px); }

.page img { width: 100%; }
.page img:not(.is-loaded) { min-height: 30vh; background: var(--cream-2); }

/* The link at the foot of a page: text on the left, an optional thumbnail on the right,
   the two centred on each other */
.page__next {
  display: flex; align-items: center; justify-content: space-between; gap: var(--gutter);
  margin-top: clamp(64px, 8vw, 140px);
  padding: clamp(28px, 3vw, 48px) var(--gutter) calc(var(--gutter) + 72px); /* clear of the menu button */
  border-top: 1px solid rgb(15 15 13 / 0.15);
  text-decoration: none;
}
.page__next-text { display: flex; flex-direction: column; align-items: flex-start; gap: clamp(10px, 1vw, 18px); min-width: 0; }
.page__next-label, .cat__count, .proj__kicker, .proj__meta dt, .thumb__meta {
  font: 500 clamp(11px, 0.72vw, 13px) / 1.3 var(--label);
  letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--ink-soft);
}
.page__next .page__next-label { font-size: clamp(13px, 0.95vw, 17px); }
.page__next-title {
  display: block;
  font: 700 clamp(28px, 3.4vw, 68px) / 0.95 var(--display);
  letter-spacing: -0.035em; text-transform: uppercase;
  transition: transform 0.7s var(--ease);
}
.page__next-title::after { content: ' →'; }
.page__next:hover .page__next-title { transform: translateX(0.6vw); }
.page__next-meta { font: 400 clamp(14px, 1vw, 18px) / 1.35 var(--text); color: var(--ink-soft); }
.page__next-media { flex: none; width: clamp(160px, 16vw, 300px); aspect-ratio: 4 / 3; overflow: hidden; background: var(--cream-2); border-radius: 10px; }
.page__next-media img { height: 100%; min-height: 0; object-fit: cover; transition: transform 1s var(--ease); }
.page__next:hover .page__next-media img { transform: scale(1.05); }

/* ── Category ────────────────────────────────────────────── */
.cat__hero { position: relative; height: var(--hero-h, 64svh); overflow: hidden; background: var(--cream-2); }
.cat__hero img { height: 100%; object-fit: cover; object-position: 50% 35%; }
.cat__film { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }

.cat__head {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  align-items: end; gap: 0 var(--gutter);
  padding: clamp(28px, 4vw, 72px) var(--gutter) clamp(32px, 3.6vw, 64px);
}
.cat__title {
  margin-left: -0.04em;
  font: 700 clamp(56px, 11vw, 230px) / 0.82 var(--display);
  letter-spacing: -0.055em; text-transform: uppercase;
}
.cat__count { padding-bottom: 0.4em; }
.cat__intro { grid-column: 1 / -1; max-width: 32em; margin-top: 1.6em; font-size: max(15px, 1.08vw); line-height: 1.3; }

.cat__grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(32px, 3.4vw, 64px) var(--grid-gap);
  padding: 0 var(--gutter);
}
.thumb { display: block; color: inherit; text-decoration: none; }
.thumb__media { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--cream-2); border-radius: 14px; }
.thumb__media img { height: 100%; min-height: 0; object-fit: cover; transition: transform 1.1s var(--ease); }
.thumb:hover .thumb__media img { transform: scale(1.04); }
.thumb__title {
  display: block; margin-top: 14px;
  font: 700 clamp(16px, 1.3vw, 26px) / 1 var(--label);
  letter-spacing: -0.01em; text-transform: uppercase;
}
.thumb__meta { display: block; margin-top: 6px; }

/* The moving cover: two rows of work gliding continuously in opposite directions
   (built in js/pages.js). It fades in once the page has settled and holds still
   whenever the cover is out of view or the page is changing. */
.cat__wall {
  position: absolute; inset: 0;
  display: grid; grid-template-rows: 1fr 1fr; gap: 6px;
  background: #fff; /* white lines between the pictures */
  opacity: 0; visibility: hidden;
  transition: opacity 1.1s var(--ease), visibility 0s 1.1s;
}
.cat__hero.is-live .cat__wall { opacity: 1; visibility: visible; transition: opacity 1.1s var(--ease); }
.cat__wall-row { overflow: hidden; min-height: 0; }
.cat__wall-track {
  display: flex; gap: 6px; height: 100%; width: max-content;
  animation: wall-glide var(--dur, 60s) linear infinite;
  animation-play-state: paused;
  will-change: transform;
}
.cat__wall-row + .cat__wall-row .cat__wall-track { animation-direction: reverse; }
.cat__hero.is-playing .cat__wall-track { animation-play-state: running; }
/* Three copies of each row: moving by one copy brings it back to where it began */
@keyframes wall-glide { to { transform: translate3d(calc(-100% / 3 - 2px), 0, 0); } }
.page .cat__wall img {
  height: 100%; width: auto; min-height: 0; max-width: none;
  object-fit: cover; object-position: 50% 35%; flex: none;
}
.page .cat__wall img.is-landing { visibility: hidden; } /* the flying tile is about to take this place */
@media (prefers-reduced-motion: reduce) {
  .cat__wall-track { animation: none; }
}

/* ── Experience ──────────────────────────────────────────── */
/* A cream band behind the back button and logo; the page scrolls away beneath it */
.page--info::before {
  content: '';
  position: fixed; top: 0; left: 0; right: 0; z-index: 2;
  height: var(--band);
  background: var(--cream);
  pointer-events: none;
}
/* One grid for the whole page: when | what | detail. The detail column lines up
   with the intro, every role's points and the competencies */
.xp__head, .xp__row, .xp__skills {
  display: grid;
  grid-template-columns: minmax(0, 0.45fr) minmax(0, 1.15fr) minmax(0, 1fr);
  column-gap: 4vw;
  align-items: start;
}
.xp__head {
  row-gap: clamp(28px, 3vw, 56px);
  padding: calc(var(--gutter) + clamp(36px, 2.6vw, 48px) + clamp(48px, 7vw, 140px)) var(--gutter) clamp(48px, 6vw, 112px);
}
.xp__title {
  grid-column: 1 / -1;
  margin-left: -0.04em;
  font: 700 clamp(56px, 11vw, 230px) / 0.82 var(--display);
  letter-spacing: -0.055em; text-transform: uppercase;
}
.xp__lede { grid-column: 3; font-size: clamp(15px, 1.05vw, 20px); line-height: 1.45; }

.xp__list { margin: 0 var(--gutter); border-top: 1px solid rgb(15 15 13 / 0.15); }
.xp__row { padding: clamp(40px, 4.4vw, 88px) 0; border-bottom: 1px solid rgb(15 15 13 / 0.15); }
.xp__when { display: flex; flex-direction: column; gap: 0.5em; padding-top: 0.35em; }
.xp__index, .xp__years, .xp__company {
  font: 500 clamp(11px, 0.78vw, 15px) / 1.3 var(--label); letter-spacing: 0.06em; text-transform: uppercase;
}
.xp__index { color: var(--ink); }
.xp__years { color: var(--ink-soft); }
/* Role titles and the competencies heading share one size */
.xp__role {
  margin-left: -0.03em;
  font: 700 clamp(28px, 3vw, 64px) / 0.95 var(--display);
  letter-spacing: -0.04em; text-transform: uppercase;
}
.xp__company { margin-top: 1.1em; color: var(--ink-soft); }
.xp__points { font: 400 clamp(15px, 1.05vw, 20px) / 1.45 var(--text); }
.xp__points li { position: relative; padding-left: 1.4em; }
.xp__points li + li { margin-top: 0.75em; }
.xp__points li::before { content: '—'; position: absolute; left: 0; color: var(--ink-soft); }

.xp__skills { margin: 0 var(--gutter); padding: clamp(64px, 8vw, 160px) 0 0; }
.xp__skills .xp__role { grid-column: 2; }
.xp__skills ul { grid-column: 3; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2em; }
.xp__skills li {
  padding: 0.6em 0;
  border-bottom: 1px solid rgb(15 15 13 / 0.12);
  font: 500 clamp(11px, 0.85vw, 16px) / 1.3 var(--label); letter-spacing: 0.05em; text-transform: uppercase;
}
.xp__skills li:nth-child(-n + 2) { padding-top: 0; } /* first line level with the heading */

/* ── Experience: numbers, timeline, roles ────────────────── */
.page--info { --band: calc(var(--gutter) * 2 + clamp(36px, 2.6vw, 48px)); } /* height of the header band */
/* A dark page: ink, cream type and the green accent for what matters */
.page--info.is-dark {
  --soft: rgb(238 235 225 / 0.58);
  --line: rgb(238 235 225 / 0.14);
  background-color: var(--ink); color: var(--cream);
}
.page--info.is-dark::before { background: var(--ink); }
.page--info.is-dark .page__back { background: var(--cream); color: var(--ink); }
.page--info.is-dark .page__next { border-top-color: var(--line); }
.page--info.is-dark .page__next-label { color: var(--soft); }
html:has(.page--info.is-dark:not([hidden])) .menu-btn { box-shadow: 0 0 0 1px rgb(238 235 225 / 0.35); }

.xp4__head {
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  align-items: end; gap: 32px 4vw;
  padding: calc(var(--band) + clamp(40px, 6vw, 120px)) var(--gutter) clamp(48px, 5vw, 96px);
}
.xp4__title {
  grid-column: 1 / -1; /* full width; the intro sits under it on the right */
  margin-left: -0.04em;
  font: 700 clamp(56px, 11vw, 230px) / 0.82 var(--display);
  letter-spacing: -0.055em; text-transform: uppercase;
}
.xp4__lede { grid-column: 2; max-width: 30em; color: var(--soft); font-size: clamp(15px, 1.05vw, 20px); line-height: 1.45; }

.xp4__when, .xp4__org span {
  font: 500 clamp(11px, 0.78vw, 15px) / 1.3 var(--label); letter-spacing: 0.06em; text-transform: uppercase;
}

/* Each role: who, where and when on the left (held in view while reading), what on the right */
.xp4__roles { margin: 0 var(--gutter); } /* follows the header directly */
.xp4__role {
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 32px 4vw; align-items: start;
  padding: clamp(48px, 5vw, 104px) 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: var(--band);
}
.xp4__info { position: sticky; top: calc(var(--band) + 24px); }
.xp4__index { display: block; color: transparent; -webkit-text-stroke: 1px var(--accent); font: 700 clamp(40px, 4vw, 88px) / 1 var(--display); letter-spacing: -0.04em; }
.xp4__when { display: flex; flex-wrap: wrap; gap: 0.4em 1.4em; margin-top: clamp(16px, 1.6vw, 28px); color: var(--soft); }
.xp4__when span + span { color: var(--accent); }
.xp4__role-title {
  margin: 0.25em 0 0 -0.03em;
  font: 700 clamp(36px, 4.6vw, 104px) / 0.9 var(--display);
  letter-spacing: -0.045em; text-transform: uppercase;
}
.xp4__org { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.3em 1em; margin-top: clamp(14px, 1.4vw, 24px); }
.xp4__org strong { font: 700 clamp(17px, 1.4vw, 28px) / 1.1 var(--display); letter-spacing: -0.02em; text-transform: uppercase; color: var(--accent); }
.xp4__org span { color: var(--soft); }
.xp4__points { counter-reset: none; }
.xp4__points li {
  display: grid; grid-template-columns: 2.6em minmax(0, 1fr); gap: 0 0.6em;
  padding: clamp(14px, 1.2vw, 22px) 0;
  border-bottom: 1px solid var(--line);
}
.xp4__points li:first-child { padding-top: 0.2em; }
.xp4__n { padding-top: 0.25em; color: var(--accent); font: 500 clamp(11px, 0.78vw, 15px) / 1.3 var(--label); letter-spacing: 0.06em; }
.xp4__points p { font: 400 clamp(15px, 1.08vw, 21px) / 1.45 var(--text); }

/* Competencies drift in two rows, in opposite directions; pointing pauses them */
.xp2__skills { padding-top: clamp(80px, 10vw, 200px); overflow: hidden; }
.xp2__label {
  margin: 0 var(--gutter) clamp(20px, 2.4vw, 44px); color: var(--ink-soft);
  font: 500 clamp(11px, 0.78vw, 15px) / 1.3 var(--label); letter-spacing: 0.06em; text-transform: uppercase;
}
.xp2__ticker { overflow: hidden; padding: 0.15em 0; }
.xp2__track {
  display: flex; width: max-content;
  animation: xp2-drift 70s linear infinite;
  animation-direction: normal;
}
.xp2__ticker[style*="--dir:1"] .xp2__track { animation-direction: reverse; }
.xp2__skills:hover .xp2__track { animation-play-state: paused; }
@keyframes xp2-drift { to { transform: translate3d(-50%, 0, 0); } }
.xp2__word {
  display: inline-flex; align-items: center; white-space: nowrap;
  font: 700 clamp(34px, 5vw, 110px) / 1.05 var(--display);
  letter-spacing: -0.04em; text-transform: uppercase;
}
.xp2__word.is-outline { color: transparent; -webkit-text-stroke: 1.5px var(--ink); }
.xp2__dot {
  display: inline-block; width: 0.22em; height: 0.22em; margin: 0 0.45em;
  border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px var(--ink);
}

/* A quiet "View work" at the end of this page */
.page--info.is-dark .page__next { margin-top: clamp(64px, 7vw, 128px); padding-top: clamp(20px, 2vw, 36px); }
.page--info.is-dark .page__next-title { font-size: clamp(20px, 1.8vw, 36px); letter-spacing: -0.02em; }
.page--info.is-dark .page__next-title::after { color: var(--accent); }
.page--info.is-dark .page__next:hover .page__next-title { transform: translateX(0.5vw); }

/* The ticker on the dark page */
.page--info.is-dark .xp2__label { color: var(--soft); }
.page--info.is-dark .xp2__word.is-outline { -webkit-text-stroke-color: var(--cream); }
.page--info.is-dark .xp2__dot { box-shadow: none; }

@media (max-width: 1024px) {
  .xp4__head, .xp4__role { grid-template-columns: minmax(0, 1fr); }
  .xp4__lede { grid-column: auto; }
  .xp4__info { position: static; }
}
@media (prefers-reduced-motion: reduce) {
  .xp2__track { animation: none; flex-wrap: wrap; width: auto; padding: 0 var(--gutter); }
}

/* ── Contact: the accent green, each way in touch as a large row ── */
.page--info.is-accent { --line: rgb(15 15 13 / 0.22); background-color: var(--accent); color: var(--ink); }
.page--info.is-accent::before { background: var(--accent); }
.ct__head {
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: end; gap: 20px 4vw;
  padding: calc(var(--band) + clamp(40px, 6vw, 120px)) var(--gutter) clamp(48px, 5vw, 96px);
}
.ct__kicker, .ct__label {
  font: 500 clamp(11px, 0.8vw, 15px) / 1.3 var(--label); letter-spacing: 0.06em; text-transform: uppercase;
}
.ct__kicker { grid-column: 1 / -1; }
.ct__title {
  grid-column: 1 / -1; margin-left: -0.04em;
  font: 700 clamp(64px, 13vw, 270px) / 0.82 var(--display);
  letter-spacing: -0.055em; text-transform: uppercase;
}
.ct__lede { grid-column: 2; font-size: clamp(15px, 1.05vw, 20px); line-height: 1.45; }
.ct__list { margin: 0 var(--gutter); padding-bottom: calc(var(--gutter) + 96px); border-top: 1px solid var(--ink); }
.ct__row {
  display: grid; grid-template-columns: minmax(0, 0.45fr) minmax(0, 2.15fr) auto;
  align-items: center; gap: 12px 4vw;
  padding: clamp(18px, 2vw, 36px) 0;
  border-bottom: 1px solid var(--line);
}
.ct__value {
  display: inline-flex; align-items: baseline; gap: 0.35em; justify-self: start; min-width: 0;
  font: 700 clamp(22px, 3vw, 60px) / 1.05 var(--display); letter-spacing: -0.035em;
  color: inherit; text-decoration: none; overflow-wrap: anywhere;
}
.ct__arrow { font-size: 0.6em; transition: transform 0.5s var(--ease); }
.ct__value:hover .ct__arrow { transform: translate(0.15em, -0.15em); }
.ct__value:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.12em; }
.ct__copy {
  height: 36px; padding: 0 14px; border: 1px solid var(--ink); border-radius: 4px;
  font: 500 var(--bar-size) / 1 var(--label); letter-spacing: 0.04em; text-transform: uppercase;
  transition: background-color 0.3s, color 0.3s;
}
.ct__copy:hover { background: var(--ink); color: var(--accent); }
@media (max-width: 720px) {
  .ct__head { grid-template-columns: minmax(0, 1fr); }
  .ct__lede { grid-column: auto; }
  .ct__row { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .ct__copy { justify-self: start; }
}

/* ── Project (a Behance-style case study) ────────────────── */
.page--project { --col: min(100% - 2 * var(--gutter), 2400px); } /* the work fills the screen */
.proj__head {
  width: var(--col); margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  align-items: end; gap: 32px 4vw;
  padding: calc(var(--gutter) + clamp(36px, 2.6vw, 48px) + clamp(40px, 6vw, 120px)) 0 clamp(28px, 3vw, 56px);
}
.proj__head.is-stacked { grid-template-columns: minmax(0, 1fr); } /* long names: details move below */
.proj__head.is-stacked .proj__side { max-width: 44em; }
.proj__kicker { margin-bottom: 1.4em; }
.proj__title {
  margin-left: -0.04em;
  font: 700 clamp(48px, 7.5vw, 160px) / 0.85 var(--display);
  letter-spacing: -0.05em; text-transform: uppercase;
}
.proj__subtitle { margin-top: 0.8em; font: 500 clamp(17px, 1.4vw, 26px) / 1.2 var(--display); }
.proj__meta { display: flex; flex-wrap: wrap; gap: 16px 32px; margin: 0; }
.proj__meta dd { margin: 4px 0 0; font: 500 max(14px, 0.95vw) / 1.3 var(--text); }
.proj__summary { margin-top: 1.4em; font-size: max(15px, 1.08vw); line-height: 1.3; max-width: 30em; }

.proj__cover { width: var(--col); margin: 0 auto; aspect-ratio: 16 / 9; overflow: hidden; background: var(--cream-2); }
.proj__cover img { height: 100%; min-height: 0; object-fit: cover; }
/* A poster shows whole, at its own shape, sized to fit the screen (`whole: true` in its entry) */
.proj__cover--whole { aspect-ratio: auto !important; background: none; display: flex; justify-content: center; }
.proj__cover--whole img { width: auto; max-width: 100%; height: auto; max-height: 92svh; object-fit: contain; }

/* Modules stack edge to edge, like Behance; a project can set a gap (`gap` in its entry) */
.proj__modules {
  width: var(--col); margin: var(--gap, 0px) auto 0;
  display: flex; flex-direction: column; gap: var(--gap, 0px);
}
.mod { margin: 0; }
.mod video { display: block; width: 100%; height: auto; }
.mod--video.is-portrait video { width: auto; max-width: 100%; height: min(86vh, 1100px); margin: 0 auto; background: #000; } /* a tall video fits the screen, centred */
.mod--row { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: var(--gap, 0px); }
.mod--row img { height: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
/* Text sections share the header's two columns: a large heading on the left,
   the text in the right-hand column under the project details */
.mod--text {
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  align-items: start; gap: 24px 4vw;
  padding: clamp(64px, 9vw, 180px) 0;
}
.mod--text h2 {
  margin-left: -0.03em;
  font: 700 clamp(36px, 4.6vw, 104px) / 0.9 var(--display);
  letter-spacing: -0.045em; text-transform: uppercase;
}
.mod--text p { max-width: 32em; padding-top: 0.3em; font: 400 clamp(17px, 1.3vw, 26px) / 1.35 var(--text); }
.mod--credits { grid-template-columns: minmax(0, 1fr); gap: clamp(14px, 1.4vw, 24px); } /* the credit line sits right under its heading */
.mod--credits p { padding-top: 0; }
.mod--embed { aspect-ratio: var(--ratio); }
/* ── Brand-coloured presentation blocks ──────────────────────
   chapter / section / split / cards / palette take the project's `theme` colours;
   duo sets two images side by side at their own shapes */
.mod--th {
  --th-pad-x: clamp(24px, 5.5vw, 120px);
  background: var(--th-bg, var(--ink)); color: var(--th-ink, var(--cream));
}
.th__label {
  display: flex; align-items: baseline; gap: 0.9em;
  color: var(--th-accent, var(--accent));
  font: 500 clamp(12px, 0.85vw, 15px) / 1 var(--label); letter-spacing: 0.08em; text-transform: uppercase;
}
.th__num { font-variant-numeric: tabular-nums; }
.th__num::after { content: ''; display: inline-block; width: 2.4em; height: 1px; margin-left: 0.9em; vertical-align: 0.3em; background: currentColor; opacity: 0.6; }
.th__heading {
  margin-left: -0.03em;
  font: 700 clamp(36px, 4.8vw, 104px) / 0.92 var(--display);
  letter-spacing: -0.04em; text-wrap: balance;
}
.th__heading--sm { font-size: clamp(30px, 3.1vw, 64px); line-height: 0.98; }
.th__copy, .th__body p, .th__card-copy {
  color: var(--th-soft, inherit);
  font: 400 clamp(16px, 1.2vw, 22px) / 1.45 var(--text); text-wrap: pretty;
}

/* Chapter: number and label on the left, a large heading and two columns of text */
.mod--chapter {
  display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); gap: 32px clamp(24px, 3vw, 64px);
  padding: clamp(72px, 10vw, 200px) var(--th-pad-x);
}
.th__aside { padding-top: 0.6em; }
.th__body { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22em), 1fr)); gap: 1em clamp(24px, 3vw, 64px); margin-top: clamp(32px, 4vw, 72px); max-width: 66em; }

/* Section: a slim band that opens each group of images */
.mod--section {
  display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); align-items: baseline; gap: 16px clamp(24px, 3vw, 64px);
  padding: clamp(40px, 5vw, 96px) var(--th-pad-x);
}
.th__line { max-width: 34em; font: 500 clamp(20px, 1.9vw, 38px) / 1.2 var(--display); letter-spacing: -0.015em; text-wrap: balance; }

/* Split: an image beside its text, alternating sides */
.mod--split { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.mod--split.is-reverse .th__media { order: 2; }
.th__media { margin: 0; min-height: clamp(320px, 36vw, 760px); }
.th__media img { width: 100%; height: 100%; object-fit: cover; }
.th__media--contain { display: flex; align-items: center; padding: clamp(24px, 3vw, 64px); } /* a diagram shows whole */
.th__media--contain img { height: auto; object-fit: contain; }
.th__text {
  display: flex; flex-direction: column; justify-content: center; gap: clamp(18px, 1.8vw, 32px);
  padding: clamp(48px, 6vw, 128px) var(--th-pad-x);
}
.th__text .th__copy { max-width: 28em; }

/* Cards: a header, then pictures with a short line each */
.mod--cards, .mod--palette { padding: clamp(72px, 9vw, 180px) var(--th-pad-x); }
.th__head {
  display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); gap: 20px clamp(24px, 3vw, 64px);
  margin-bottom: clamp(40px, 5vw, 96px);
}
.th__head .th__label { grid-row: span 2; padding-top: 0.6em; }
.th__head .th__copy { max-width: 36em; }
.th__cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: clamp(32px, 3vw, 56px) clamp(16px, 1.8vw, 32px); }
.th__card-media { position: relative; margin: 0; aspect-ratio: 4 / 3; overflow: hidden; }
.th__card-media > img:first-child { width: 100%; height: 100%; object-fit: cover; }
.mod--cards .th__card-media .th__card-icon {
  position: absolute; left: 0; bottom: 0;
  width: 28%; height: auto; aspect-ratio: 1; object-fit: cover;
}
.th__card-title { margin-top: 18px; font: 700 clamp(17px, 1.3vw, 24px) / 1.1 var(--display); letter-spacing: -0.01em; }
.th__card-copy { margin-top: 8px; font-size: clamp(14px, 1vw, 18px); }
.mod--cards[style*='--cols:5'] .th__card-media { aspect-ratio: 4 / 5; }

/* Palette: the brand colours as tall swatches */
.th__swatches { list-style: none; margin: 0; padding: 0; display: flex; }
.th__swatch {
  flex: 1 1 0; min-height: clamp(220px, 26vw, 520px);
  display: flex; flex-direction: column; justify-content: flex-end; gap: 6px;
  padding: clamp(14px, 1.4vw, 28px);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.22); /* keeps a swatch the colour of the panel visible */
}
.th__swatch-name { font: 700 clamp(15px, 1.2vw, 22px) / 1.1 var(--display); }
.th__swatch-code { font: 500 clamp(11px, 0.8vw, 14px) / 1.3 var(--label); letter-spacing: 0.06em; opacity: 0.85; }

/* Duo: two pictures in one row, each at its own shape, the row's heights equal */
.mod--duo { display: flex; gap: var(--gap, 0px); }
.mod--duo figure { margin: 0; min-width: 0; }
.mod--duo img { width: 100%; height: auto; display: block; }

/* ── IndSoft-style blocks: dark, rounded, gradient-lit ─────────
   statement / anatomy / gradient / bento / closing, in the theme's colours and font */
.mod--statement, .mod--anatomy, .mod--gradient, .mod--bento, .mod--closing {
  --r: clamp(14px, 1.4vw, 28px); /* the rounded corners of the brand's lockups */
  --pad-x: clamp(24px, 5.5vw, 120px);
  background: var(--th-bg, #000); color: var(--th-ink, #fff);
  font-family: var(--th-font, var(--text));
}
.st__kicker {
  color: var(--th-accent);
  font: 500 clamp(11px, 0.8vw, 14px) / 1.3 ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: 0.06em; text-transform: uppercase;
}
.is-grad { background: var(--th-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Statement: one big line, then the problem and the answer side by side */
.mod--statement { padding: clamp(80px, 11vw, 220px) var(--pad-x) clamp(56px, 7vw, 140px); }
.st__title {
  max-width: 15em; margin-top: clamp(20px, 2vw, 36px);
  font: 600 clamp(40px, 6.4vw, 140px) / 0.98 var(--th-font, var(--display)); letter-spacing: -0.035em; text-wrap: balance;
}
.st__pair {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(16px, 1.6vw, 28px);
  margin-top: clamp(56px, 7vw, 140px);
}
.st__half { padding: clamp(24px, 2.6vw, 48px); border-radius: var(--r); background: rgb(255 255 255 / 0.05); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.1); }
.st__half:last-child { background: var(--th-mesh); box-shadow: none; }
.st__tag { font: 500 clamp(11px, 0.8vw, 14px) / 1 ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.8; }
.st__text { margin-top: clamp(28px, 3vw, 60px); font: 400 clamp(17px, 1.35vw, 26px) / 1.4 var(--th-font, var(--text)); text-wrap: pretty; }

/* Anatomy: the mark stays pinned while its four ideas scroll past */
.mod--anatomy {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 120px);
  padding: clamp(72px, 9vw, 180px) var(--pad-x);
}
.an__pin { position: sticky; top: clamp(72px, 10vh, 140px); align-self: start; }
.page .an__mark { width: min(100%, 520px); margin: clamp(24px, 3vw, 56px) 0; border-radius: var(--r); }
.an__title { font: 600 clamp(28px, 2.8vw, 58px) / 1.02 var(--th-font, var(--display)); letter-spacing: -0.03em; text-wrap: balance; }
.an__steps { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(56px, 7vw, 140px); }
.an__meta { display: flex; justify-content: space-between; gap: 1em; padding-bottom: 14px; margin-bottom: 18px; border-bottom: 1px solid rgb(255 255 255 / 0.16);
  font: 500 clamp(11px, 0.8vw, 14px) / 1 ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: 0.06em; text-transform: uppercase; color: var(--th-soft); }
.an__meta span:first-child { color: var(--th-accent); }
.page .an__photo { aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r); }
.an__body { display: grid; grid-template-columns: clamp(96px, 11vw, 180px) minmax(0, 1fr); gap: clamp(16px, 2vw, 36px); align-items: start; margin-top: clamp(18px, 2vw, 32px); }
.page .an__part { aspect-ratio: 700 / 494; object-fit: cover; border-radius: calc(var(--r) * 0.6); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.1); }
.an__name { font: 600 clamp(22px, 1.9vw, 38px) / 1.05 var(--th-font, var(--display)); letter-spacing: -0.02em; }
.an__text { margin-top: 10px; max-width: 30em; color: var(--th-soft); font: 400 clamp(15px, 1.1vw, 20px) / 1.45 var(--th-font, var(--text)); }

/* Gradient: the brand's colour field, full width, with its stops listed */
.mod--gradient {
  min-height: clamp(520px, 52vw, 1000px);
  display: flex; flex-direction: column; justify-content: space-between; gap: 48px;
  padding: clamp(56px, 7vw, 140px) var(--pad-x) clamp(32px, 3vw, 56px);
  background: var(--th-mesh);
}
.mod--gradient .st__kicker { color: inherit; opacity: 0.85; }
.gr__title { max-width: 10em; margin-top: 18px; font: 600 clamp(40px, 6vw, 128px) / 0.96 var(--th-font, var(--display)); letter-spacing: -0.035em; }
.gr__text { max-width: 30em; margin-top: clamp(20px, 2vw, 36px); font: 400 clamp(16px, 1.25vw, 24px) / 1.45 var(--th-font, var(--text)); opacity: 0.88; }
.gr__stops { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.gr__stops li {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 16px 10px 10px; border-radius: 999px;
  background: rgb(0 0 0 / 0.45); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  font: 500 clamp(12px, 0.85vw, 15px) / 1 var(--th-font, var(--text));
}
.gr__dot { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.35); }
.gr__hex { font-family: ui-monospace, 'SF Mono', Menlo, monospace; opacity: 0.7; }

/* Bento: rounded tiles on black, a wide or tall tile where the picture asks for it */
.mod--bento { padding: clamp(40px, 5vw, 96px) var(--pad-x); }
.bn__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px 32px; margin-bottom: clamp(24px, 3vw, 56px); }
.bn__line { max-width: 30em; font: 500 clamp(18px, 1.6vw, 32px) / 1.25 var(--th-font, var(--display)); letter-spacing: -0.015em; text-wrap: balance; }
.bn__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-flow: dense; gap: clamp(10px, 1vw, 20px); }
.bn__item { position: relative; margin: 0; grid-column: span 2; border-radius: var(--r); overflow: hidden; background: #111; }
.bn__item::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.12); pointer-events: none; } /* a black tile still shows on black */
.bn__item.is-wide { grid-column: span 4; }
.bn__item.is-tall { grid-row: span 2; }
.bn__item.is-third { grid-column: span 1; }
.page .bn__item img { height: 100%; object-fit: cover; }
.bn__item figcaption {
  position: absolute; left: 14px; bottom: 14px;
  padding: 7px 12px; border-radius: 999px;
  background: rgb(0 0 0 / 0.55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  color: #fff; font: 500 clamp(10px, 0.75vw, 13px) / 1 ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: 0.05em; text-transform: uppercase;
}

/* Closing: the brand line, centred, lit by the gradient */
.mod--closing { display: flex; flex-direction: column; align-items: center; gap: clamp(24px, 3vw, 48px); padding: clamp(96px, 12vw, 240px) var(--pad-x); text-align: center; }
.page .cl__mark { width: clamp(72px, 7vw, 132px); border-radius: calc(var(--r) * 0.6); }
.cl__title { max-width: 14em; font: 600 clamp(40px, 6vw, 128px) / 0.98 var(--th-font, var(--display)); letter-spacing: -0.035em; text-wrap: balance; }

@media (max-width: 900px) {
  .st__pair { grid-template-columns: minmax(0, 1fr); }
  .mod--anatomy { grid-template-columns: minmax(0, 1fr); }
  .an__pin { position: static; }
  .page .an__mark { width: min(60%, 320px); }
  .bn__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bn__item.is-wide { grid-column: span 2; }
  .bn__item.is-third { grid-column: span 1; }
}
@media (max-width: 560px) {
  .an__body { grid-template-columns: minmax(0, 1fr); }
  .page .an__part { width: 50%; }
  .bn__item, .bn__item.is-wide, .bn__item.is-third { grid-column: span 2; }
  .bn__item.is-tall { grid-row: auto; }
}

@media (max-width: 900px) {
  .mod--chapter, .mod--section, .th__head { grid-template-columns: minmax(0, 1fr); }
  .th__head .th__label { grid-row: auto; }
  .mod--split { grid-template-columns: minmax(0, 1fr); }
  .mod--split.is-reverse .th__media { order: 0; }
  .th__media { min-height: 0; aspect-ratio: 4 / 3; }
  .th__cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .th__swatches { flex-wrap: wrap; }
  .th__swatch { flex: 1 1 33%; min-height: 160px; }
}
@media (max-width: 560px) {
  .th__cards { grid-template-columns: minmax(0, 1fr); }
  .mod--cards[style*='--cols:5'] .th__card-media { aspect-ratio: 4 / 3; }
  .mod--duo { flex-direction: column; }
  .mod--duo figure { flex: none !important; }
  .th__swatch { flex-basis: 50%; }
}

.mod--embed iframe { width: 100%; height: 100%; border: 0; display: block; }

.proj__foot { width: var(--col); margin: clamp(56px, 7vw, 120px) auto 0; }
.proj__link {
  display: inline-flex; align-items: center;
  height: 44px; padding: 0 18px;
  border: 1px solid var(--ink); border-radius: 4px;
  font: 500 var(--bar-size) / 1 var(--label); letter-spacing: 0.04em; text-transform: uppercase;
  text-decoration: none;
  transition: background-color 0.3s, color 0.3s;
}
.proj__link:hover { background: var(--ink); color: var(--cream); }
.proj__foot .page__next { padding-left: 0; padding-right: 0; }

/* ── Smaller screens ─────────────────────────────────────── */
@media (max-width: 1024px) {
  .cat__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .proj__head { grid-template-columns: minmax(0, 1fr); }
  .mod--text { grid-template-columns: minmax(0, 1fr); }
  .xp__head, .xp__row, .xp__skills { grid-template-columns: minmax(0, 1fr); row-gap: 20px; }
  .xp__lede, .xp__skills .xp__role, .xp__skills ul { grid-column: auto; }
  .xp__when { flex-direction: row; gap: 1.2em; padding-top: 0; }
}
@media (max-width: 720px) {
  .cat__hero { height: var(--hero-h-sm, 46svh); }
  .cat__head { grid-template-columns: minmax(0, 1fr); }
  .cat__count { padding: 1em 0 0; }
  .cat__grid { grid-template-columns: minmax(0, 1fr); }
  .proj__cover { aspect-ratio: 4 / 3; }
  .mod--text { grid-template-columns: minmax(0, 1fr); }
  .page__next { flex-direction: column; align-items: flex-start; gap: 20px; }
  .page__next-media { width: min(100%, 320px); }
}

@media (prefers-reduced-motion: reduce) {
  .page [data-reveal] { transition: opacity 0.3s linear; transition-delay: 0s; }
  .page [data-reveal]:not(.is-in), .page.is-before [data-reveal] { transform: none; }
  .thumb__media img, .page__next-title, .cat-nav__mark { transition: none; }
}
/* Taras Racing: the film with softly rounded corners */
.page[data-slug='taras-racing'] .mod--video video { border-radius: clamp(12px, 1.4vw, 22px); }
