/* ---------- Tokens (from Figma) ---------- */
:root {
  --radius: 4px;         /* image and card corners: matches the case study hero images */
  --navy-900: #05142d;   /* logo */
  --navy-800: #122039;   /* headings, title */
  --navy-700: #2c384d;   /* body, nav */
  --grey-400: #bbc0c8;   /* carousel labels */
  --rule:     #dedede;
  --border:   #e6e6e6;
  --tile:     #f8f8f8;
  --accent:   #122039;   /* focus rings */
  --page:     #f7f7f5;   /* homepage background (lighter than Figma 1429:5708 #f2f2f0) */
  --yellow:   #ffe136;   /* All Work tile + footer */
  --nav-grey: #7f7f7f;
  --shade:    #494949;

  --font: "Unbounded", system-ui, sans-serif;
  --gutter: clamp(16px, 2.26vw, 39px);           /* 39px @ 1728 */
  --card-w: 360px;
  --card-gap: 8px;
  --ease: cubic-bezier(.22, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--navy-700);
  font-family: var(--font);
  font-weight: 300;
  border-top: 1px solid var(--border);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: none; }
a { color: inherit; text-decoration: none; }
h1, h2, p, ul { margin: 0; padding: 0; }
ul { list-style: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 38px 30px 0;
  height: 96px;
  background: var(--page);
}

.nav { display: flex; gap: clamp(24px, 3.4vw, 58px); margin-top: 4px; }
.nav__link {
  position: relative;
  font-weight: 400; font-size: clamp(14px, 1.04vw, 18px); line-height: 1.3;
  color: var(--navy-700);
  transition: opacity .2s;
}
.nav__link:hover { opacity: .65; }

/* ---------- Views ---------- */
.view[hidden] { display: none; }
.view { animation: view-in .55s var(--ease) both; }
.view--about { --from: 40px; }
@keyframes view-in { from { opacity: 0; transform: translateX(var(--from)); } }
@media (prefers-reduced-motion: reduce) { .view { animation: none; } }

.card {
  position: relative; flex: none;
  width: var(--card-w); aspect-ratio: 360 / 601;
  border-radius: var(--radius); overflow: hidden;
  scroll-snap-align: start;
  isolation: isolate;
}
.card__img { position: absolute; pointer-events: none; transition: transform .6s var(--ease); }
.card__img--cover { inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card:hover .card__img, .card:focus-visible .card__img { transform: scale(1.015); }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- About / CV ---------- */
/* Same type scale as the case studies: 16px copy (14px in the tables), section titles a step
   up in the left column, thin rules and compact rows, after the CV reference */
.cv {
  padding: clamp(24px, 3.5vw, 60px) var(--gutter) 120px;
  max-width: 1728px; margin: 0 auto;
  --body: clamp(14px, 1.03vw, 16px);         /* = case study copy */
  --small: clamp(13px, .87vw, 14px);
}
.cv__section {
  display: grid; grid-template-columns: 29.64% 1fr;
  border-top: 1px solid var(--cv-line);   /* one line style for every section, edge to edge */
  padding: 20px 0 clamp(96px, 8.5vw, 150px);
}
.cv { --cv-line: color-mix(in srgb, var(--navy-800) 14%, transparent); }
.cv__label {
  font-weight: 300; font-size: var(--body); line-height: 1.57; color: var(--navy-800);   /* same size as the copy on the right */
}
.cv__body { min-width: 0; padding-top: 3px; }
.cv__icon { display: none; }                  /* decorative marks: not in the reference layout */
.cv__prose { font-size: var(--body); line-height: 1.57; max-width: 760px; color: var(--navy-800); }
.cv__prose p + p { margin-top: 1em; }

.cv__table { font-size: var(--body); line-height: 1.57; color: var(--navy-800); }   /* same size + line spacing as the opening paragraph */
.cv__table li { display: grid; column-gap: 16px; }
.cv__table li > span:last-child { text-align: right; white-space: nowrap; }
.cv__table--work li { grid-template-columns: 32.1fr 42.6fr 25.3fr; }
.cv__table--edu  li { grid-template-columns: 49.3fr 25.4fr 25.3fr; }
/* Work history: a little air between jobs; a second role at the same company (Method) stays tucked under the first */
.cv__table--work li { padding: 7px 0; }
.cv__table--work li:first-child { padding-top: 0; }
.cv__table--work li:has(+ li > span:first-child:empty) { padding-bottom: 0; }
.cv__table--work li:has(> span:first-child:empty) { padding-top: 0; }
.cv__table .sf-link { color: inherit; text-decoration: none; }

.clients {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px;
  margin-top: 4px;
}
/* Client tiles: small logos; on hover each takes its brand's two tones (tile + logo colour, via
   the SVG filters next to the list), and tiles with a case study show an arrow that opens it */
.clients li { aspect-ratio: 372 / 246; }
.client {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; padding: 8%;
  background: var(--tile); border-radius: var(--radius); text-decoration: none;
  transition: background-color .35s ease;
}
.client__logo { display: flex; align-items: center; justify-content: center; max-width: 100%; transform: scale(.65); }
.client__logo > img { height: auto; max-width: 100%; }
.client:hover, .client:focus-visible { background: var(--brand); }
.client:hover .client__logo, .client:focus-visible .client__logo { filter: var(--tone); }
.client:focus-visible { outline: 2px solid var(--navy-800); outline-offset: 3px; }
.client__arrow {
  position: absolute; top: 14px; right: 14px; width: 18px; height: 18px;
  filter: var(--tone); opacity: 0; transform: translateX(-4px);
  transition: opacity .25s ease, transform .35s var(--ease);
}
.client:hover .client__arrow, .client:focus-visible .client__arrow { opacity: 1; transform: none; }
.sr-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.up-logo   { position: relative; width: 143px; height: auto; aspect-ratio: 157 / 82; max-width: 100%; }
.group-logo{ position: relative; width: 224px; max-width: 100%; aspect-ratio: 224 / 36.485; }
.up-logo > span, .group-logo > span { position: absolute; }
.up-logo img, .group-logo img { width: 100%; height: 100%; }

/* ---------- Tablet ---------- */
@media (max-width: 1024px) {
  :root { --card-w: 300px; }
  .cv__section { grid-template-columns: 24% 1fr; }
}

/* ---------- Mobile ---------- */
@media (max-width: 720px) {
  :root { --card-w: 74vw; }
  .site-header { padding-top: 22px; height: 72px; }
  .nav { margin-top: 10px; }

  .cv__section { grid-template-columns: 1fr; padding: 32px 0 48px; }
  .cv__label { margin-bottom: 14px; }
  .cv__icon { margin: 12px 0 16px; }

  .cv__table li,
  .cv__table--work li,
  .cv__table--edu li {
    grid-template-columns: 1fr auto;
    grid-template-areas: "a c" "b b";
    padding: 10px 0; border-bottom: 1px solid #f0f0f0;
  }
  .cv__table li > span:nth-child(1) { grid-area: a; }
  .cv__table li > span:nth-child(2) { grid-area: b; }
  .cv__table li > span:nth-child(3) { grid-area: c; }
  .cv__table li > span:nth-child(1):empty { display: none; }
  .cv__table li:has(> span:first-child:empty) { grid-template-areas: "b c"; }
  /* a second role at the same company (Method) stays joined to the first: no rule or gap between */
  .cv__table li:has(+ li > span:first-child:empty) { border-bottom: 0; padding-bottom: 0; }
  .cv__table li:has(> span:first-child:empty) { padding-top: 0; }

  .clients { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .client { padding: 10%; }
  .client__logo { transform: scale(.75); }
}

/* ======================================================================
   Homepage redesign (Figma 1429:5708)
   ====================================================================== */
/* Main nav: the name and the links share one text style (size, weight, spacing, colour) */
.wordmark, .nav__link {
  font-weight: 400; font-size: clamp(12px, .87vw, 15px); line-height: 1.3; letter-spacing: .01em;
  color: var(--navy-700); text-decoration: none; transition: opacity .2s;
}
.wordmark:hover, .nav__link:hover { opacity: .6; }
.nav { margin-top: 0; gap: clamp(20px, 1.97vw, 34px); }

/* Header: no background of its own, so content scrolls cleanly beneath the name and links */
.site-header { background: none; pointer-events: none; }
.site-header > * { pointer-events: auto; }
/* The name and links invert against whatever scrolls beneath them (cards, images, the yellow footer),
   so they stay readable. With "difference" blending, this beige is exactly page colour minus navy:
   on the plain page they still read as the usual navy, and over dark images they turn light. */
.site-header { mix-blend-mode: difference; }
.site-header .wordmark, .site-header .nav__link { color: #cbbfa8; }   /* page minus navy-700, so difference blending shows navy */
/* the page you're on: a thin underline rather than a different colour */
.nav__link[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }

.view--home { --from: 0px; padding: 0 32px 56px; }
.view--work { --from: 40px; }
.view--work, .view--about { min-height: calc(100svh - 97px); }   /* home sizes to its cards, so the footer sits close underneath */

.statement {
  max-width: 932px; margin-top: clamp(48px, 7.2vw, 125px);
  font-weight: 300; font-size: clamp(22px, 1.847vw, 31.92px); line-height: 1.3; color: var(--navy-800);
}

/* Four project cards stepping up/down, plus the yellow All Work tile — all bottom-aligned */
.featured {
  display: grid; grid-template-columns: repeat(4, minmax(0, 340fr)) minmax(0, 272fr);
  gap: 8px; align-items: end; margin-top: clamp(64px, 9.78vw, 169px);
}
.hcard, .allwork { position: relative; display: block; border-radius: var(--radius); overflow: hidden; isolation: isolate; }
.hcard > img { position: absolute; max-width: none; pointer-events: none; transition: transform .7s var(--ease); }
.hcard:hover > img, .hcard:focus-visible > img { transform: scale(1.015); }

.allwork {
  aspect-ratio: 272 / 228; background: var(--yellow); color: var(--navy-800);
  /* same yellow as the footer; it stays put on hover, only the hidden pattern appears */
}
/* paper grain, as on the footer; the hover reveal comes from assets/dither.js */
.allwork::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: .16; mix-blend-mode: multiply;
}
.allwork span { position: absolute; left: 15px; bottom: 14px; font-weight: 400; font-size: clamp(14px, .96vw, 16.58px); text-transform: capitalize; }
.allwork__arrow { position: absolute; top: 14px; right: 15px; width: 20px; height: 20px; transition: transform .35s var(--ease); }
.allwork:hover .allwork__arrow { transform: translateX(4px); }
.hcard:focus-visible, .allwork:focus-visible, .card:focus-visible { outline: 2px solid var(--navy-800); outline-offset: 3px; }

/* All Work view: every project in a responsive grid */
.work-title { padding: clamp(32px, 4vw, 72px) 30px clamp(24px, 2.4vw, 40px); font-weight: 300; font-size: clamp(22px, 1.847vw, 31.92px); color: var(--navy-800); }
.work-title span { color: var(--nav-grey); }

/* Project list: large image, then title, one line of subcopy and tags (after the studio reference) */
.work-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(12px, 1.1vw, 20px); row-gap: clamp(48px, 4.6vw, 80px);
  padding: 0 30px clamp(64px, 6vw, 112px);
}
.work-card { display: block; color: var(--navy-800); text-decoration: none; }
.work-card__media {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: var(--radius); background: #e4e4e1; isolation: isolate;
}
.work-card__media img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: transform .7s var(--ease);
}
.work-card:hover .work-card__media img, .work-card:focus-visible .work-card__media img { transform: scale(1.015); }
.work-card:focus-visible { outline: none; }
.work-card:focus-visible .work-card__media { outline: 2px solid var(--navy-800); outline-offset: 3px; }
.work-card__title {
  margin: clamp(16px, 1.3vw, 22px) 0 0;   /* space between the image and its text */
  font-weight: 300; font-size: clamp(20px, 1.6vw, 28px); line-height: 1.15; letter-spacing: -.01em;
}
.work-card__sub {
  margin: 4px 0 0;
  font-weight: 300; font-size: clamp(13px, .87vw, 15px); line-height: 1.5; color: var(--nav-grey);
}
.work-card__tags { display: flex; flex-wrap: wrap; gap: 6px; margin: clamp(10px, .75vw, 12px) 0 0; padding: 0; list-style: none; }
.work-card__tags li {
  padding: 6px 10px 5px; border-radius: 4px;
  background: rgba(18, 32, 57, .06); color: var(--navy-800);
  font-weight: 400; font-size: clamp(11px, .76vw, 13px); line-height: 1.2;
  transition: background-color .3s;
}
.work-card:hover .work-card__tags li { background: rgba(18, 32, 57, .09); }

/* CV tiles sit on the warm page colour */
.clients li { background: #fff; }

/* Tablet and mobile: the project cards become a swipeable carousel that runs to the screen edges */
@media (max-width: 1100px) {
  .featured {
    --pad: 32px;
    display: flex; align-items: flex-end; gap: 8px;
    margin-inline: calc(var(--pad) * -1); padding-inline: var(--pad);
    overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain;   /* no vertical wobble from the rise-in animation */
    scroll-snap-type: x mandatory; scroll-padding-inline: var(--pad);
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .featured::-webkit-scrollbar { display: none; }
  .featured > * { flex: 0 0 clamp(200px, 30vw, 320px); scroll-snap-align: start; }
  .featured > .allwork { flex-basis: clamp(170px, 24vw, 260px); }
}
@media (max-width: 720px) {
  .site-header { padding: 22px 16px 0; height: 64px; }
  .view--home { padding: 0 16px 24px; }
  .view--home, .view--work, .view--about { min-height: calc(100svh - 65px); }
  .featured { --pad: 16px; gap: 6px; }
  .featured > * { flex-basis: min(58vw, 290px); }
  .featured > .allwork { flex-basis: min(46vw, 230px); }
  .work-title { padding: 32px 16px 20px; }
  .work-grid { grid-template-columns: 1fr; row-gap: 40px; padding: 0 16px 48px; }
}

/* All Work: hero video plays over the card image (assets/video.js) */
.work-card__media .tile-video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity .4s ease, transform .7s var(--ease); pointer-events: none;
}
.work-card__media .tile-video.is-ready { opacity: 1; }
.work-card:hover .work-card__media .tile-video { transform: scale(1.015); }

/* Work cards (homepage + All Work) rise in, staggered in reading order (main.js adds .is-in) */
.js-stagger :is(.hcard, .allwork, .work-card) {
  opacity: 0; transform: translateY(28px);
  transition: opacity .7s ease, transform .9s var(--ease);
  transition-delay: var(--d, 0ms);
}
.js-stagger :is(.hcard, .allwork, .work-card).is-in { opacity: 1; transform: none; }
