/* ==========================================================================
   Mike Tshimanga — Personal website (Figma "Final Page Design")
   1. Design tokens   2. Fonts & base   3. Layout grid   4. Text styles
   5. Components      6. Navigation & footer   7. Pages   8. Overlays
   9. Motion
   Phones (up to 767px wide) are adjusted in css/mobile.css.
   ========================================================================== */

/* 1. Design tokens (Figma colour styles)
   -------------------------------------------------------------------------- */
:root {
  /* Colour */
  --color-charcoal: #141414;
  --color-grey: #9b9b97;
  --color-emerald: #00674f;
  --color-white: #ffffff;
  --color-light-outline: #f0eee1;
  --color-linen: #f6f5ee;           /* preloader background */
  --color-pastel-orange: #ffc067;   /* brand accent: the cursor dot */
  --color-transition: #eeecdd;      /* page transition background (Figma "Page Transition") */
  --color-outline: rgba(20, 20, 20, 0.2);        /* Dark Outline at 20%: button borders */
  --color-hairline: rgba(20, 20, 20, 0.1);       /* Dark Outline at 10%: list rules */
  --color-outline-light: rgba(240, 238, 225, 0.2); /* Light Outline at 20% */

  /* Type */
  --font-serif: "Erode", Georgia, serif;
  --font-sans: "DM Sans", system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, monospace;

  /* Grid: 12 columns of 113px, 4px gutter, 20px page margin (at 1440 wide) */
  --grid-columns: 12;
  --grid-gap: 0.4rem;
  --page-margin: 2rem;

  /* Spacing */
  --space-4: 0.4rem;
  --space-8: 0.8rem;
  --space-12: 1.2rem;
  --space-14: 1.4rem;
  --space-20: 2rem;
  --space-24: 2.4rem;
  --space-32: 3.2rem;
  --space-40: 4rem;
  --space-60: 6rem;
  --space-80: 8rem;
  --space-120: 12rem;
  --space-section: 22rem;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-expo-out: cubic-bezier(0.19, 1, 0.22, 1);
  --ease-in-out-cubic: cubic-bezier(0.645, 0.045, 0.355, 1); /* GSAP power2.inOut (koto.com's panels) */
  --ease-quad-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-quart-out: cubic-bezier(0.165, 0.84, 0.44, 1);
  --duration-fast: 0.25s;

  --nav-height: 5.8rem;  /* the navigation bar: 16px + 26px item + 16px */

  /* Scaling (Lisson style): the page is laid out at this width and scales
     proportionally to any screen. 1rem = 10px at 1440px wide. */
  --design-width: 1440;
}

/* 2. Fonts & base
   -------------------------------------------------------------------------- */
/* Erode (headings), kept with the site so it works opened from files too */
@font-face {
  font-family: "Erode";
  src: url("../assets/fonts/Erode-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Erode";
  src: url("../assets/fonts/Erode-Medium.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

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

/* Everything is sized in rem, which scales with the screen width (1rem = 10px on a
   1440px screen). Text sizes use min(scaled, cap): each text style grows with the
   screen until it reaches its value in the Figma "2k Screen" designs, then stops,
   while spacing, images and the grid keep scaling. */
html {
  font-size: calc(100vw / var(--design-width) * 10);
  -webkit-text-size-adjust: 100%;
  scrollbar-width: none; /* no scrollbar anywhere on the site (Firefox; Chrome and Safari below) */
}
/* Scrolling still works with the trackpad, mouse wheel and keyboard. Hiding the bar
   also means the page is always the full window width, which the scaling assumes. */
::-webkit-scrollbar { display: none; }

/* Paragraph style is the default */
body {
  margin: 0;
  background: var(--color-white);
  color: var(--color-charcoal);
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: min(1.4rem, 18px);
  line-height: min(1.8rem, 22px);
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 14;
  font-feature-settings: "ss01" 1, "liga" 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, p, ul, figure { margin: 0; }
h1, h2, h3 { font-weight: inherit; }
ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; letter-spacing: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

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

.skip-link {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  padding: var(--space-12) var(--space-20);
  background: var(--color-charcoal);
  color: var(--color-white);
  transform: translateY(-100%);
}
.skip-link:focus { transform: none; }

/* Hidden on screen, still read by screen readers */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* 3. Layout grid
   -------------------------------------------------------------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(var(--grid-columns), minmax(0, 1fr));
  column-gap: var(--grid-gap);
  padding-inline: var(--page-margin);
}

/* 4. Text styles (Figma text styles; Erode headings at -5%, Sub-Heading at -4%)
   -------------------------------------------------------------------------- */
/* Erode headings */
.h-2xxl { font-family: var(--font-serif); font-weight: 500; font-size: min(12rem, 180px); line-height: min(14rem, 220px); letter-spacing: -0.05em; font-feature-settings: "liga" 0; }
.h-xxl  { font-family: var(--font-serif); font-weight: 400; font-size: min(8rem, 120px);  line-height: min(9.6rem, 144px); letter-spacing: -0.05em; font-feature-settings: "liga" 0; }
.h-xl   { font-family: var(--font-serif); font-weight: 400; font-size: min(5.2rem, 80px); line-height: min(5.2rem, 80px); letter-spacing: -0.05em; font-feature-settings: "liga" 0; }
.h-l    { font-family: var(--font-serif); font-weight: 400; font-size: min(4.4rem, 68px); line-height: min(4.4rem, 68px); letter-spacing: -0.05em; font-feature-settings: "liga" 0; }
.h-m    { font-family: var(--font-serif); font-weight: 400; font-size: min(3.2rem, 50px); line-height: min(3.2rem, 50px); letter-spacing: -0.05em; font-feature-settings: "liga" 0; }
.h-sub  { font-family: var(--font-serif); font-weight: 500; font-size: min(2.4rem, 32px); line-height: min(2.4rem, 32px); letter-spacing: -0.04em; font-feature-settings: "liga" 0; }

/* "XL Heading - Indent": the first line starts four columns in; the section tag
   sits in that space (an .indent-tag inside the same block) */
.indented { position: relative; }
.indented > .h-xl { text-indent: 23.4rem; }
.indent-tag { position: absolute; top: 0; left: 0; padding-top: 1.5rem; }

/* DM Sans (Paragraph is the body default, above) */
.text-xs   { font-size: min(1.4rem, 18px); line-height: min(1.2rem, 16px); letter-spacing: -0.02em; }   /* XS Sub-Heading */
.paragraphs > * + * { margin-top: var(--space-14); }

/* Geist Mono: Section Tag */
.label {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: min(1.2rem, 16px);
  line-height: min(1.2rem, 16px);
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.muted { color: var(--color-grey); }

/* 5. Components
   -------------------------------------------------------------------------- */

/* Media frame: every image fills its frame edge to edge */
.media {
  position: relative;
  overflow: hidden;
}
.media > img,
.media > video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}
.media > img.pos-right { object-position: 87% center; } /* framing as in Figma */
.media > img.pos-high { object-position: center 20%; } /* keeps faces near the top of a photo in view */

/* Buttons (Figma "Primary Button" and "Secondary Button"; CTA Text) */
.btn-group { display: flex; flex-wrap: wrap; gap: var(--space-8); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4) var(--space-8);
  border: 1px solid transparent;
  font-weight: 500;
  line-height: min(1.6rem, 20px);
  letter-spacing: -0.02em;
  text-transform: capitalize;
  white-space: nowrap;
  transition:
    background-color var(--duration-fast) ease,
    border-color var(--duration-fast) ease,
    color var(--duration-fast) ease,
    opacity var(--duration-fast) ease;
}
.btn--primary { background: var(--color-emerald); color: var(--color-white); }
/* Hover: Pastel Orange with charcoal text */
.btn--primary:hover,
.btn--primary:focus-visible { background: var(--color-pastel-orange); color: var(--color-charcoal); }
/* White text and a Light Outline border with the Difference blend mode: reads dark
   on white pages and light on the dark hero */
.btn--secondary {
  border-color: var(--color-outline-light);
  color: var(--color-white);
  mix-blend-mode: difference;
}
.btn--secondary:hover,
.btn--secondary:focus-visible { border-color: var(--color-white); }

/* Credit rows (About lists): role | detail, hairlines between rows */
.credits { display: flex; flex-direction: column; gap: var(--space-12); }
.credits__list > li + li { box-shadow: inset 0 1px 0 var(--color-hairline); } /* drawn inside the row, so every row is 32px tall as in Figma */
.credit {
  display: flex;
  align-items: center;
  gap: var(--space-20);
  width: 100%;
  padding-block: 1rem;
  line-height: min(1.2rem, 16px);
  text-align: left;
  white-space: nowrap;
}
.credit__role { min-width: 12.4rem; } /* every name on the left is at least 124px wide (Figma) */
.credit__detail {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  color: var(--color-grey);
  transition: color var(--duration-fast) ease;
}
.credit__detail::before { /* the divider: 20px either side */
  content: "";
  width: 1px;
  height: 1rem;
  margin-right: calc(var(--space-8) - 1px); /* the text starts 20px after the line, as in Figma */
  background: var(--color-outline);
}
/* Experience rows: company (at least 120px wide), dot, years;
   16px either side of the dot, so the dots and years line up, as in Figma */
.credit__org { min-width: 12rem; }
.credit__dot { flex: none; width: 0.4rem; height: 0.4rem; margin-inline: 0.4rem; border-radius: 50%; background: currentColor; }
.credit__plus { width: 0.8rem; height: 0.8rem; margin-left: auto; transition: transform var(--duration-fast) ease; }
/* Rows that open an award panel: the detail turns charcoal on hover, and the + turns */
.credit--opens { cursor: pointer; }
.credit--opens:hover .credit__detail,
.credit--opens:focus-visible .credit__detail,
.credit--opens[aria-expanded="true"] .credit__detail { color: var(--color-charcoal); }
.credit--opens:hover .credit__plus { transform: rotate(90deg); }

/* 6. Navigation & footer
   -------------------------------------------------------------------------- */

/* Navigation (Figma component "Navigation"): white text with the Difference
   blend mode, so it shows near-black over the white pages and turns light over
   the dark hero and dark images. No background. */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 60;
  display: grid;
  grid-template-columns: repeat(var(--grid-columns), minmax(0, 1fr));
  column-gap: var(--grid-gap);
  align-items: start;
  padding: 1.6rem var(--page-margin);
  color: var(--color-white);
  /* Navigation text style: Erode Medium 16/18, -2% */
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: min(1.6rem, 20px);
  line-height: min(1.8rem, 24px);
  letter-spacing: -0.02em;
  font-feature-settings: "liga" 0;
  mix-blend-mode: difference;
  pointer-events: none;
}
.site-header.is-visible { pointer-events: auto; }
/* Case study: over the hero the bar is plain white, without the blend (Figma) */
.site-header.on-hero { mix-blend-mode: normal; }
.js .site-header.is-attached { transition: none; } /* moves with the hero's content (js/main.js) */

.site-header__brand { grid-column: 1 / span 2; justify-self: start; }

.site-header__nav { grid-column: 7 / span 3; }
.site-header__nav ul { display: flex; gap: var(--space-8); }
.site-header__brand,
.site-header__nav li > *,
.site-header__social > a,
.site-header .nav-line { display: block; }
.site-header .nav-line { padding-block: var(--space-4); }
/* Every link underlines on hover (after dashdigital.studio): the line draws in
   from the left, and when the mouse leaves it carries on out to the right. The
   current page stays underlined; while the Contact panel is open, only
   "Contact" is (as in Figma "Contact Overlay"). */
.site-header .nav-line { position: relative; border-bottom: 1px solid transparent; } /* the border keeps the line's space */
.site-header .nav-line::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 1px;
  background: var(--color-white);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}
.site-header__nav [aria-current="page"] .nav-line::after,
.site-header__nav [aria-expanded="true"] .nav-line::after,
.site-header a:hover .nav-line::after,
.site-header button:hover .nav-line::after { transform: scaleX(1); transform-origin: left; }
.site-header__nav:has([aria-expanded="true"]) [aria-current="page"]:not(:hover) .nav-line::after { transform: scaleX(0); transform-origin: right; }

.site-header__social {
  grid-column: 11 / span 2;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: var(--space-12);
}
.site-header__social .divider { width: 1px; height: 1.2rem; background: var(--color-outline-light); }
/* Phones only (css/mobile.css): the "Menu" button and its panel (js/ui.js) */
.site-header__menu,
.menu-panel { display: none; }

/* Footer (Figma component "Footer") */
.site-footer__top {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 41.2rem; /* Figma: 140 + the quote's three lines (132) + 140 */
  padding-top: 14rem;
  background: var(--color-white);
}
.site-footer__quote { grid-column: 7 / span 5; }
/* The bar and the "Next page" labels use the Navigation text style (Erode Medium 16/18, -2%) */
.site-footer__bar,
.next-page__labels {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: min(1.6rem, 20px);
  line-height: min(1.8rem, 24px);
  letter-spacing: -0.02em;
  font-feature-settings: "liga" 0;
}
.site-footer__bar { padding-block: var(--space-20); color: var(--color-charcoal); }
.site-footer__bar > :first-child { grid-column: 1 / span 4; }
.site-footer__bar > a { grid-column: 7 / span 3; justify-self: start; }
/* The email underlines on hover like the menu links */
.site-footer__bar > a { position: relative; }
.site-footer__bar > a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.2rem;
  width: 100%;
  height: 1px;
  background: var(--color-charcoal);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}
.site-footer__bar > a:hover::after { transform: scaleX(1); transform-origin: left; }
.site-footer__time { grid-column: 10 / span 3; text-align: right; }

/* "Next page" panel stays pinned while the footer top slides away. It takes the
   rest of the screen height, so the whole footer is exactly one screen tall
   (as in Figma: 412 + 398 = 810 on a 1440 x 810 screen). */
.next-page {
  position: sticky;
  bottom: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  width: 100%;
  height: max(calc(100svh - 41.2rem), 20rem);
  overflow: hidden;
  color: var(--color-white);
  text-align: left;
}
.next-page__bg { position: absolute; inset: 0; }
.next-page__bg > img { object-position: center 24%; }
.next-page__labels { position: relative; width: 100%; padding-block: var(--space-12); }
.next-page__labels > :first-child { grid-column: 1 / span 2; }
.next-page__target { grid-column: 7 / span 6; }

/* Case studies: the footer is the next project (Figma "Footer" on the Case Study
   Details Page). Its white top has the project's name where a case study's title
   sits (from the grid's middle), with its services and project type along the bar;
   below, its hero picture, framed exactly as on its own page. Reaching the bottom
   (or clicking the picture) opens it, after simonekatherineinteriors.com: see
   "Next project" in js/transition.js. 364 + 446 = 810 on a 1440 x 810 screen. */
.site-footer--project .site-footer__top { height: 36.4rem; }
.site-footer__next { grid-column: 7 / span 6; display: grid; gap: var(--space-20); justify-items: start; }
.site-footer--project .site-footer__bar > :first-child { grid-column: 7 / span 3; }
.site-footer__type { grid-column: 10 / span 3; text-align: right; }
.next-page--project { height: max(calc(100svh - 36.4rem), 20rem); }
.next-page--project .case-hero__bg { inset: 0 0 auto; height: 145.3rem; } /* the hero's own box, from its top */

/* 7. Pages
   -------------------------------------------------------------------------- */

/* Page container: the sections between the hero and the footer, 220px apart,
   with 220px above the first and below the last */
.page-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-section);
  padding-block: var(--space-section);
}

/* Home ------------------------------------------------------------------------ */

/* Hero (Figma "Frame 76"): Charcoal, white text. Sits above the portraits, which
   start tucked beneath it. */
.hero {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  min-height: 100svh;
  padding-top: var(--space-20);
  padding-bottom: clamp(6rem, 19svh, 15.4rem);
  background: var(--color-charcoal);
  color: var(--color-white);
}
.hero__inner { width: 100%; align-items: start; }
.hero__meta { grid-column: 1 / span 2; display: grid; gap: var(--space-4); padding-top: 1rem; }
.hero__content { grid-column: 7 / span 5; display: grid; gap: var(--space-32); justify-items: start; }
.hero__text { display: grid; gap: var(--space-24); }
.hero__lead { max-width: 34.7rem; }

/* Portraits */
.portraits { padding: var(--space-20) var(--page-margin); }
.portraits__inner {
  display: grid;
  grid-template-columns: 300fr 464fr 300fr;
  column-gap: 5.1rem;
  align-items: start;
  width: min(100%, 116.6rem);
  margin-inline: auto;
}
.portraits__item--main { position: relative; z-index: 1; } /* side images slide out from behind it */
.portraits__item--left { margin-top: 8rem; }
.portraits__item--right { align-self: end; margin-bottom: 8rem; }
.portraits__item--left .portraits__figure,
.portraits__item--right .portraits__figure { aspect-ratio: 4 / 3; }
.portraits__item--main .portraits__figure { aspect-ratio: 464 / 618; }
.portraits__item--main img { object-position: 36% center; }
.portraits__item--left img { object-position: center 17%; }
.portraits__item--right img { object-position: center 9%; }

/* About (Figma "Frame 3"): the statement across ten columns, buttons 60px below */
.about { padding-block: var(--space-20); }
.about__inner {
  grid-column: 2 / span 10;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-60);
}

/* Capabilities */
.capabilities { padding-block: var(--space-20); }
.capabilities__inner { grid-column: 2 / span 10; }
.capabilities__heading {
  padding-block: var(--space-12);
  border-bottom: 1px solid var(--color-hairline);
}
.capabilities__body {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  column-gap: var(--grid-gap);
  align-items: start;
}
.capabilities__media {
  grid-column: 1 / span 2;
  position: sticky;
  top: 0;
  padding-block: var(--space-40);
}
.capabilities__frame { aspect-ratio: 230 / 268; }
/* Images are stacked; each one wipes up over the last (driven by js/main.js) */
.capabilities__frame > img { --wipe: 0%; clip-path: inset(var(--wipe) 0 0 0); will-change: clip-path, transform; }
.js .capabilities__frame > img + img { --wipe: 100%; }

.capabilities__list { grid-column: 5 / span 6; }
.capability {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  column-gap: var(--grid-gap);
  padding-block: var(--space-40);
}
.capability + .capability { border-top: 1px solid var(--color-hairline); }
.capability .h-sub { grid-column: 1 / span 3; }
.capability__detail {
  grid-column: 4 / span 3;
  display: grid;
  gap: var(--space-32);
}
.capability__media { display: none; } /* phones: each card has its own picture (css/mobile.css) */
.detail-list li { padding-block: var(--space-8); }
.detail-list li + li { border-top: 1px solid var(--color-hairline); }

/* Work: two columns of three square project images, 4px apart, the right column
   starting 120px lower. The columns drift at different speeds as you scroll
   (js/main.js). The project name stays in the middle of the screen through the
   whole section. */
.work { position: relative; padding-block: var(--space-20); }
.work__columns { align-items: start; }
.work__column { display: flex; flex-direction: column; gap: var(--grid-gap); }
.work__column--left { grid-column: 1 / span 6; }
.work__column--right { grid-column: 7 / span 6; margin-top: 12rem; }
.work__item { display: block; cursor: pointer; }
.work__frame { display: block; aspect-ratio: 1; }
/* Each image is 20% taller than its frame so it can glide inside it (parallax) */
.work__frame > img { inset: -10% 0 auto; height: 120%; will-change: transform; }
/* Shown on phones only (css/mobile.css): the section's tag and each project's name */
.work__name { display: none; }
.work__heading { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.work__title-layer { position: absolute; inset: 0; pointer-events: none; }
.work__title-sticky {
  position: sticky;
  top: 0;
  display: grid;
  place-items: center;
  height: 100svh;
  padding: var(--space-20);
}
.work__title {
  overflow: hidden; /* the name sinks into and rises from its baseline through this mask */
  color: var(--color-white);
  text-align: center;
}
.work__title span { display: inline-block; }

/* Who I work with (Figma "Frame 122") */
.clients { padding-block: var(--space-20); }
.clients__heading { grid-column: 1 / span 2; }
.clients__list { grid-column: 4 / span 9; display: grid; gap: var(--space-4); }
.client {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  column-gap: var(--grid-gap);
}
.client__media { grid-column: 1 / span 2; aspect-ratio: 1; }
.client__text {
  grid-column: 4 / span 4;
  display: flex;
  flex-direction: column;
  gap: var(--space-20);
}
.client__actions { margin-top: auto; }

/* Work page --------------------------------------------------------------------- */

/* Page container (Figma "Frame 131"): 220px above, between and below */
.page-container--work { padding-top: var(--space-section); }
.work-intro__title { grid-column: 7 / span 6; }

/* Projects: two columns, 4px apart, 220px between rows. Large cards fill their
   column (698px); small cards (464px) sit centred in a 698 x 741 space. Each card
   has the project name above its image, 14px apart. */
.work-list { row-gap: var(--space-section); padding-block: var(--space-20); }
.work-card { grid-column: span 6; display: grid; gap: var(--space-14); align-content: start; scroll-margin-top: var(--nav-height); }
.work-card__link { display: grid; gap: var(--space-14); cursor: pointer; }
.work-card--small { width: 46.4rem; justify-self: center; align-self: center; }
.work-card__media { aspect-ratio: 1; }
.work-card__media > img { inset: -10% 0 auto; height: 120%; will-change: transform; }

/* Lab page --------------------------------------------------------------------- */

/* "Laboratory" 20px below the 80px header space, then the cards 20px below its row */
.page-container--lab { gap: 0; padding-top: 8rem; }
.lab-intro { padding: var(--space-20) var(--page-margin); }

/* Two columns, 4px apart, 120px between rows */
.lab-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 12rem var(--grid-gap);
  padding: var(--space-20) var(--page-margin);
}
.lab-card { margin: 0; }
/* The frame takes its image's proportions (set in lab.html), so the card hugs the
   image. The image is 20% taller than the frame so it can glide inside it. */
.lab-card__media { display: block; width: 100%; }
.lab-card__media > img { inset: -10% 0 auto; height: 120%; will-change: transform; }
/* "Framed": the image 464px wide, centred in a square that grows with a taller image */
.lab-card--framed {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
}
.lab-card--framed > .lab-card__media { width: 46.4rem; }

/* About page -------------------------------------------------------------------- */

/* Intro (Figma "Frame 152"): the statement 300px down across ten columns, then
   the story on the right half, 80px below */
.about-intro {
  display: flex;
  flex-direction: column;
  gap: var(--space-80);
  padding: 30rem var(--page-margin) var(--space-20);
}
.about-intro__statement { width: 116.6rem; margin-inline: auto; }
.about-intro__statement .indent-tag { padding-top: 1.2rem; }
.about-intro__story { width: 34.7rem; margin-left: 70.2rem; }

/* Photo wave (Figma "Frame 10"): the photos are placed in design px from the
   photo area's top-left, along a diagonal. Each photo is 4px from the next, and
   the sizes rise to the large photo in the middle and fall again (113, 230,
   698, 230, 113 wide). js/main.js moves them along the diagonal. */
.story { position: relative; }
.story__photos { position: relative; height: 133.3rem; }
.story__photo { position: absolute; margin: 0; }
.story__photo--4 { left: 2rem; top: 117.1rem; width: 11.3rem; height: 14.2rem; }
.story__photo--3 { left: 13.7rem; top: 92.5rem; width: 23rem; height: 28.8rem; }
.story__photo--2 { left: 37.1rem; top: 23rem; width: 69.8rem; height: 87.2rem; }
.story__photo--1 { left: 107.3rem; top: 12rem; width: 23rem; height: 28.8rem; }
.story__photo--0 { left: 130.7rem; top: 2rem; width: 11.3rem; height: 14.2rem; }
/* Framing inside each photo, as in Figma (kept as the photos change size) */
.story__photo--0 > img { top: -1.95%; height: 126.09%; }
.story__photo--1 > img { top: -3.8%; height: 120.04%; }
.story__photo--3 > img { top: -0.67%; height: 111.68%; }
.story__photo--2 > img { top: -1.41%; left: -9.28%; width: 116.37%; height: 116.37%; } /* cropped as in Figma */

/* What I've worked on (Figma "Experience statement"): the statement across the
   right eight columns, then a 464px column of text, lists and buttons */
.experience {
  display: flex;
  justify-content: flex-end;
  padding: var(--space-120) var(--page-margin);
}
.experience__inner { width: 93.2rem; display: flex; flex-direction: column; align-items: center; gap: var(--space-80); }
.experience__inner > .indented { width: 100%; }
.experience__column { width: 46.4rem; display: flex; flex-direction: column; gap: var(--space-60); }
.experience__lists { display: flex; flex-direction: column; gap: var(--space-24); }

/* Case study page --------------------------------------------------------------- */

/* Hero (Figma "Frame 1000008319"): the project image behind, darkened by 20%.
   The title stays in the middle of the screen while the description and credits
   rise into view on the left; when both meet, the rest of the image scrolls by. */
.case-hero { position: relative; height: 145.3rem; color: var(--color-white); }
.case-hero__bg { position: absolute; inset: 0; }
/* Fills the hero, scaled evenly (no stretching): zoomed just enough that the gallery
   wall above the painting is out of frame (Figma's vertical framing), centred across */
.case-hero__bg--goodman > img { inset: auto; top: -4.16%; left: -17.34%; width: 134.68%; height: 111.86%; }
.case-hero__bg::after { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, 0.2); }
/* The details scroll up until they're level with the title (Figma "Lock Up": the
   Description at 374px from the top), then both stay put while the rest of the
   painting scrolls past; both let go together, at the end of the hero. The details
   box is the same height as the title's (810), so they release on the same frame. */
.case-hero__details-track { position: absolute; top: 34.4rem; bottom: 0; left: var(--page-margin); width: 58.1rem; }
.case-hero__details {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: var(--space-60);
  height: 81rem;
  padding-bottom: 9.6rem;
}
.case-hero__row { display: grid; grid-template-columns: 23rem 34.7rem; column-gap: var(--grid-gap); align-items: baseline; }
.case-hero__credits { display: grid; gap: var(--space-24); align-self: start; margin: 0; } /* top-aligned with "Credits", as in Figma (no browser list margins) */
.case-hero__credits div { display: grid; gap: var(--space-4); }
.case-hero__credits dd { margin: 0; line-height: min(1.8rem, 22px); } /* 18px, as in Figma */
.case-hero__title-track { position: absolute; top: 0; bottom: 0; left: 71.7rem; }
.case-hero__title { position: sticky; top: 0; padding-block: 35.7rem; white-space: nowrap; }

.case-body { display: flex; flex-direction: column; gap: var(--grid-gap); padding-block: var(--space-20); }
.case-statement {
  display: flex;
  flex-direction: column;
  gap: var(--space-80);
  padding: var(--space-section) var(--page-margin);
}
.case-statement__heading { width: 116.6rem; margin-inline: auto; }
.case-statement__heading .indent-tag { padding-top: 1.2rem; }
.case-statement__text { width: 34.7rem; margin-left: 70.2rem; }
.case-pair { display: flex; justify-content: space-between; padding-inline: var(--page-margin); }
.case-pair > .media { width: 69.8rem; aspect-ratio: 1; }
.case-wide { padding-inline: var(--page-margin); }
.case-wide > .media { height: 78.8rem; }
.case-focus { display: flex; justify-content: center; padding: var(--space-section) var(--page-margin); }
.case-focus__inner { width: 93.2rem; display: flex; flex-direction: column; align-items: center; gap: var(--space-80); }
.case-focus__inner > .indented { width: 100%; }
.case-focus__image { width: 46.4rem; height: 62rem; background: var(--color-emerald); }
/* Images shown whole on a light ground, as in Figma */
.media.on-light { background: #f5f8f7; }
.media.on-grey { background: #f4f4f4; }
.media.on-grey > img { left: 9.37%; top: -9.31%; width: 81.25%; height: 123.35%; }
/* Parallax (js/main.js): photos are 20% taller than their frames, so they can glide
   inside them. The painting on the grey background keeps its Figma framing and
   glides only within its crop. */
.case-body .media > img { will-change: transform; }
.case-body .media:not(.on-grey) > img { inset: -10% 0 auto; height: 120%; }


/* 404 page ---------------------------------------------------------------------- */
.not-found {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-120);
  min-height: 100svh;
  padding: var(--space-80) var(--page-margin);
}
.not-found__art { position: relative; width: 84.5rem; height: 33rem; }
.not-found__art > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* The 404 effect draws on a canvas over the whole screen (js/mousegrid.js), so its
   blocks can travel past the artwork's edges; the text and button sit above it */
.mousegrid { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.not-found__text { position: relative; z-index: 1; display: grid; justify-items: center; gap: var(--space-32); width: 34.4rem; text-align: center; }
.not-found__text p { line-height: 1.32; }

/* 8. Overlays
   -------------------------------------------------------------------------- */

/* While a panel is open the page behind is blurred under a 10% white veil */
.veil {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(1.2rem);
  -webkit-backdrop-filter: blur(1.2rem);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0s linear 0.5s;
}
.veil.is-open { opacity: 1; visibility: visible; transition: opacity 0.5s ease; }
/* The award panels cover the navigation too (as in Figma); the Contact panel brings its own.
   Their veil fades in and out over 1s, with the panel (after koto.com) */
.award-open .veil { z-index: 62; transition: opacity 1s var(--ease-in-out-cubic), visibility 0s linear 1s; }
.award-open .veil.is-open { transition: opacity 1s var(--ease-in-out-cubic); }
/* ...and the page behind is pushed a quarter of the screen to the right, away from the panel */
.award-open main,
.award-open [data-footer] { transition: transform 1s var(--ease-in-out-cubic); }
.award-shown main,
.award-shown [data-footer] { transform: translateX(25%); }
/* The Contact panel moves the same way, from the top: its veil fades over 1s and
   the page is pushed a quarter of the screen down, away from it */
.contact-motion .veil { transition: opacity 1s var(--ease-in-out-cubic), visibility 0s linear 1s; }
.contact-motion .veil.is-open { transition: opacity 1s var(--ease-in-out-cubic); }
.contact-motion main,
.contact-motion [data-footer] { transition: transform 1s var(--ease-in-out-cubic); }
.contact-shown main,
.contact-shown [data-footer] { transform: translateY(25vh); }
/* Moving the page makes it a layer of its own, so the white behind it has to be
   inside that layer, or the blended buttons (.btn--secondary) have nothing to
   blend with and vanish (same reason as .pt-active main) */
.award-open main,
.contact-motion main { background: var(--color-white); }

/* Contact panel (Figma "Contact Overlay"): drops down from the top with its own
   navigation, with the email address and social links on the right half */
.contact-panel {
  position: fixed;
  inset: 0 0 auto;
  z-index: 61; /* above the page's bar: it has its own (below) */
  display: flex;
  justify-content: flex-end;
  padding: 18rem var(--page-margin) var(--space-60);
  background: var(--color-white);
  border-bottom: 1px solid var(--color-hairline);
  transform: translateY(-100%);
  visibility: hidden;
  /* Motion after koto.com's Studio news panel: 1s, ease in and out, both ways */
  transition: transform 1s var(--ease-in-out-cubic), visibility 0s linear 1s;
}
.contact-panel.is-open { transform: none; visibility: visible; transition: transform 1s var(--ease-in-out-cubic); }
/* The panel's own navigation (js/ui.js): the page's bar, copied along the panel's
   top in charcoal, so it reads on the white panel whatever the page's bar looks
   like. The panel sits above the page's bar and brings this in with it. */
.js .site-header.panel-nav {
  position: absolute;
  inset: 0 0 auto;
  transform: none;
  transition: none;
  mix-blend-mode: normal;
  color: var(--color-charcoal);
  pointer-events: auto;
}
.panel-nav .nav-line::after { background: var(--color-charcoal); }
.panel-nav .site-header__social .divider { background: var(--color-outline); }
.contact-panel__inner { width: 69.8rem; display: flex; flex-direction: column; gap: var(--space-20); }
/* The email underlines on hover like the menu links: the line draws in from the
   left, and when the mouse leaves it carries on out to the right */
.contact-panel__email { position: relative; display: inline-block; }
.contact-panel__email::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--color-charcoal);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}
.contact-panel__email:hover::after { transform: scaleX(1); transform-origin: left; }
/* "Email Copied" (Figma): shows 20px to the right of the address after a click copies it */
.contact-panel__email-row { position: relative; align-self: flex-start; }
.contact-panel__copied {
  position: absolute;
  top: 6.4rem;
  left: calc(100% + var(--space-20));
  white-space: nowrap;
  color: var(--color-charcoal);
  opacity: 0;
  transform: translateY(0.6rem);
  transition: opacity 0.3s ease, transform 0.3s var(--ease-out);
  pointer-events: none;
}
.contact-panel__copied.is-shown { opacity: 1; transform: none; }
.contact-panel__links { display: flex; align-items: center; gap: var(--space-12); }
.contact-panel__links .divider { width: 1px; height: 1.2rem; background: var(--color-outline); }
/* The social links underline on hover like the menu links */
.contact-panel__links a { position: relative; }
.contact-panel__links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.4rem;
  width: 100%;
  height: 1px;
  background: var(--color-charcoal);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}
.contact-panel__links a:hover::after { transform: scaleX(1); transform-origin: left; }

/* Award panels (Figma "The Loeries Awards: Awards Slide Out"): slide in from the
   left, with the Close button on the panel's right edge */
.award-panel {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 64;
  display: flex;
  align-items: flex-start;
  max-height: 100svh;
  transform: translateX(-100%);
  visibility: hidden;
  /* Motion after koto.com's Studio news panel: 1s, ease in and out, both ways */
  transition: transform 1s var(--ease-in-out-cubic), visibility 0s linear 1s;
}
.award-panel.is-open { transform: none; visibility: visible; transition: transform 1s var(--ease-in-out-cubic); }
.award-panel__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-60);
  width: 54.4rem;
  height: 100svh;
  padding: var(--space-80) var(--space-40) var(--space-40);
  overflow-y: auto; /* scrolls on its own to show everything (data-lenis-prevent lets the wheel through) */
  overscroll-behavior: contain;
  background: var(--color-white);
  border-right: 1px solid var(--color-hairline);
}
.award-panel__text { display: grid; gap: 2.8rem; max-width: 32.7rem; }
.award-panel__close { margin: var(--space-12); }
.award-gallery { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); width: 46.4rem; }
.award-gallery > .media { height: 28.8rem; }
.award-gallery > .media--wide { grid-column: 1 / -1; height: 31.8rem; }
.award-gallery > .media--short { height: 26.8rem; }
/* Framing inside photos, as in Figma */
.award-gallery .crop-a { left: -2.34%; top: -2.88%; width: 196.69%; height: 105.77%; }
.award-gallery .crop-b { left: -95.65%; top: -3.28%; width: 201.72%; height: 115.41%; }

/* 9. Motion
   -------------------------------------------------------------------------- */

/* Cursor dot: follows the mouse (js/main.js); not shown on touch screens */
.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 200;
  width: 1rem;
  height: 1rem;
  margin: -0.5rem 0 0 -0.5rem;
  border-radius: 50%;
  background: var(--color-pastel-orange);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease, background-color 0.2s ease;
}
.cursor-dot.is-active { opacity: 1; }
.cursor-dot.is-on-orange { background: var(--color-charcoal); } /* over a hovered green button, which turns Pastel Orange */
.cursor-dot.is-active.is-over-work { opacity: 0; } /* the "View Work" tag takes over */

/* "View Work" tag: sits just below-right of the pointer over the work images,
   styled like the primary button (Figma "Hover Cursor") */
.cursor-tag {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 200;
  min-width: 8.2rem;
  padding: var(--space-4) var(--space-8);
  background: var(--color-emerald);
  color: var(--color-white);
  font-weight: 500;
  line-height: min(1.6rem, 20px);
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}

@media (hover: none) {
  .cursor-dot,
  .cursor-tag { display: none; }
}

/* Preloader (Figma "Proloader"): "Mike Tshimanga" typed in the middle, then the
   surname deleted and "T." typed; after a short pause the page opens through a
   window growing from a strip at the bottom (Ottografie; js/main.js). Hidden
   without JavaScript. */
.loader { display: none; }
.js .loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--color-linen);
}
/* The name: Erode Regular 39/38, -4%, typed out letter by letter (js/main.js), centred
   on the screen as it's typed and deleted. */
.loader__name {
  position: absolute;
  top: calc(50% - 1.9rem);
  left: 50%;
  transform: translateX(-50%); /* centred: the name stays centred as it's typed and deleted */
  font-family: var(--font-serif);
  font-weight: 400; /* Regular, as in Figma */
  font-size: min(3.9rem, 58.5px);
  line-height: min(3.8rem, 57px);
  letter-spacing: -0.04em;
  font-feature-settings: "ss01" 1, "liga" 0;
  white-space: nowrap;
}
/* The typing cursor: blinks while waiting, stays solid while typing */
.loader__caret {
  display: inline-block;
  width: 2px;
  height: 3rem;
  margin-left: 0.3rem;
  vertical-align: -0.5rem;
  background: var(--color-charcoal);
  animation: caret-blink 1s steps(1) infinite;
}
.loader__name.is-typing .loader__caret { animation: none; }
@keyframes caret-blink { 50% { opacity: 0; } }

/* Navigation: the whole bar slides down and back up */
.js .site-header {
  transform: translateY(-100%);
  transition: transform 0.6s var(--ease-in-out-cubic); /* eases out of view and back in, visibly */
}
.js .site-header.is-visible { transform: none; }
.site-header.no-transition { transition: none; }

/* Portraits: centre image grows in, side images slide out from behind it (Cappen style) */
.js .portraits__figure { opacity: 0; transform: scale(0.5); }
.js .portraits__item--left .portraits__figure { transform: translateX(120%) scale(0.5); }
.js .portraits__item--right .portraits__figure { transform: translateX(-120%) scale(0.5); }

.portraits.is-in .portraits__figure {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.65s var(--ease-quad-out),
    transform 0.65s var(--ease-quad-out);
}
.portraits.is-in .portraits__item--left .portraits__figure,
.portraits.is-in .portraits__item--right .portraits__figure {
  transition:
    opacity 0.85s var(--ease-quad-out) 0.4s,
    transform 0.85s var(--ease-quart-out) 0.4s;
}
.portraits.is-in .portraits__item--right .portraits__figure { transition-delay: 0.5s; }

[data-drift],
[data-reveal-under-hero] { will-change: transform; }

/* Footer "next page" hover image */
.next-page__hover {
  opacity: 0;
  transform: scale(1.06);
  transition:
    opacity 0.6s ease,
    transform 1.2s var(--ease-out);
}
.next-page:hover .next-page__hover,
.next-page:focus-visible .next-page__hover,
.next-page.is-held .next-page__hover { /* clicked: kept while the page shrinks away from under the pointer (js/transition.js) */
  opacity: 1;
  transform: scale(1);
}


/* Page transition (Figma "Page Transition", movement after andersdrage.com;
   js/transition.js). The open page shrinks into a card on the pale background
   and slides across to the next page's card, which then grows to fill the screen. */
.pt {
  position: fixed;
  inset: 0;
  z-index: 40;
  overflow: hidden;
  background: var(--color-transition);
}
.pt__track { position: absolute; top: 0; left: 0; will-change: transform; } /* moved into place by js/transition.js */
.pt__card {
  position: absolute;
  top: 0;
  overflow: hidden;
  background: var(--color-white);
}
/* The opening (into or out of a case study; js/transition.js): a page's
   preview, with its navigation, full screen above everything, opened or cut
   through by a window that grows from a strip along the bottom */
.pt-open {
  position: fixed;
  inset: 0;
  z-index: 70;
  overflow: hidden;
  background: var(--color-white);
}
.pt-open .site-header { position: absolute; }
/* Next project opening (js/transition.js): the next project's picture, grown out
   of a case study's footer, and its hero text rising into place (laid out as on
   its page, at the top) */
.pt-next { position: fixed; inset: 0; z-index: 70; overflow: hidden; pointer-events: none; }
.pt-next__picture { position: absolute; inset: 0; overflow: hidden; }
.pt-next__hero { position: absolute; top: 0; left: 0; width: 100%; }
/* A miniature screen: the page's preview at the right point, with its navigation */
.pt__screen { position: absolute; top: 0; left: 0; overflow: hidden; transform-origin: 0 0; }
.pt__screen .site-header { position: absolute; }
.pt__shot { position: absolute; top: 0; left: 0; width: 100%; max-width: none; }

.pt-active main,
.pt-active [data-footer] { position: relative; z-index: 45; }
.pt-active main { background: var(--color-white); }

/* Before the transition script runs on an arriving page: page hidden */
.pt-arriving body { background: var(--color-transition); }
.pt-arriving .loader { display: none; }
.pt-arriving main,
.pt-arriving [data-footer] { visibility: hidden; }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
  .site-header:not(.is-visible) { visibility: hidden; }
  .js .portraits__figure { opacity: 1 !important; transform: none !important; }
}
