:root {
  --bg: #f3f3f1;
  --ink: #0c0c0e;
  --grey: #6e6e73;
  --line: rgba(12, 12, 14, 0.08);
  --accent: #2f5bff;
  --white: #ffffff;
  --inv: #ffffff;
  --card: #ffffff;
  --gutter: clamp(16px, 2.8vw, 40px);
  --radius: 16px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --text-big: clamp(56px, 10.4vw, 168px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); transition: background-color .9s var(--ease); }
body {
  background: var(--bg);
  transition: background-color .9s var(--ease), color .9s var(--ease);
  color: var(--ink);
  font-family: "Onest", system-ui, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* closing screen: the room goes dark */
body.is-dark {
  --bg: #0c0c0e; --ink: #f3f3f1; --grey: #8e8e93;
  --line: rgba(243, 243, 241, 0.1); --inv: #0c0c0e; --card: #1a1a1d;
}
html:has(body.is-dark) { background: #0c0c0e; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img { display: block; max-width: 100%; }
main { overflow-x: clip; }

/* ---------- nav: a floating bar of liquid glass that stays for the whole page ---------- */
.nav {
  position: fixed; top: 12px; left: var(--gutter); right: var(--gutter); z-index: 20;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  height: 60px; padding: 0 6px 0 18px; border-radius: 999px;
  color: var(--ink);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.34));
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    inset 0 -1px 0 rgba(255, 255, 255, 0.25),
    inset 0 0 0 1px rgba(255, 255, 255, 0.4),
    0 10px 36px rgba(12, 12, 14, 0.08),
    0 1px 2px rgba(12, 12, 14, 0.06);
  transition: color .5s var(--ease), background .6s var(--ease), box-shadow .6s var(--ease), opacity .4s var(--ease);
}
/* the light catching the top edge of the glass */
.nav::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(120% 160% at 18% -60%, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 55%);
}
.nav > * { position: relative; }
/* over the film: clearer glass, white type */
.nav.on-media {
  color: var(--white);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.07));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    inset 0 0 0 1px rgba(255, 255, 255, 0.16),
    0 10px 36px rgba(0, 0, 0, 0.18);
}
.nav.on-media::before { opacity: .45; }
/* the dark closing screen: smoked glass */
.is-dark .nav:not(.on-media) {
  background: linear-gradient(180deg, rgba(44, 44, 48, 0.62), rgba(22, 22, 24, 0.5));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 10px 36px rgba(0, 0, 0, 0.4);
}
.is-dark .nav:not(.on-media)::before { opacity: .18; }

.brand { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 500; letter-spacing: -0.01em; }
.links { display: flex; gap: 32px; font-size: 16px; }
/* letters gain weight from the centre of the word outwards (nav.js); the link holds its bold width */
.links a { display: inline-flex; justify-content: center; white-space: nowrap; }
.nl { font-weight: 400; transition: font-weight .55s var(--ease); transition-delay: var(--d, 0ms); }
.links a:hover .nl, .links a:focus-visible .nl, .is-measuring .nl { font-weight: 700; }
.is-measuring .nl { transition: none; }
.links a:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; border-radius: 4px; }
.nav .pill { justify-self: end; }
.nav__end { justify-self: end; display: flex; align-items: center; gap: 6px; }

/* ---------- phones: a menu button and a glass sheet that unfolds from the header (nav.js) ---------- */
.nav__menu, .nav__sheet { display: none; }
@media (max-width: 860px) {
  .nav__menu {
    display: inline-grid; place-content: center; gap: 6px; width: 48px; height: 48px; flex: none; border-radius: 50%;
    background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line), 0 1px 2px rgba(0, 0, 0, 0.04);
  }
  .nav__menu span { display: block; width: 18px; height: 1.2px; border-radius: 1px; background: currentColor; transition: transform .5s var(--ease); }
  .nav__menu[aria-expanded="true"] span:first-child { transform: translateY(3.6px) rotate(45deg); }
  .nav__menu[aria-expanded="true"] span:last-child { transform: translateY(-3.6px) rotate(-45deg); }
  .nav__menu:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

  /* while the sheet is open the bar is light glass, whatever is under it */
  .nav.is-menu {
    color: var(--ink);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.56));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), inset 0 0 0 1px rgba(255, 255, 255, 0.4), 0 10px 36px rgba(12, 12, 14, 0.08);
  }
  .nav__sheet {
    display: grid; position: fixed; z-index: 19; top: 74px; left: var(--gutter); right: var(--gutter);
    padding: 18px 22px 22px; border-radius: 28px; color: var(--ink);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.6));
    -webkit-backdrop-filter: blur(26px) saturate(180%);
    backdrop-filter: blur(26px) saturate(180%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), inset 0 0 0 1px rgba(255, 255, 255, 0.45), 0 18px 48px rgba(12, 12, 14, 0.14);
    clip-path: inset(0 0 100% 0 round 28px); transition: clip-path .7s var(--ease);
  }
  .nav__sheet[hidden] { display: none; }
  .nav__sheet.is-open { clip-path: inset(0 0 0 0 round 28px); }
  .nav__sheet > a, .nav__sheet-foot {
    opacity: 0; transform: translateY(14px); transition: opacity .5s var(--ease), transform .7s var(--ease);
  }
  .nav__sheet.is-open > a, .nav__sheet.is-open .nav__sheet-foot {
    opacity: 1; transform: none; transition-delay: calc(var(--i, 0) * 50ms + 150ms);
  }
  .nav__sheet > a { font-size: 40px; line-height: 1.2; letter-spacing: -0.035em; padding: 4px 0; }
  .nav__sheet-foot { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 15px; color: var(--grey); }
  .is-dark .nav__sheet {
    background: linear-gradient(180deg, rgba(44, 44, 48, 0.82), rgba(22, 22, 24, 0.7));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 18px 48px rgba(0, 0, 0, 0.5);
  }
}
@media (max-width: 860px) and (prefers-reduced-motion: reduce) {
  .nav__sheet, .nav__sheet > a, .nav__sheet-foot, .nav__menu span { transition: none; }
}

/* buttons live in buttons.css */

/* ---------- media cover (vimeo iframes) ---------- */
.reel__media, .card__media { position: absolute; inset: 0; overflow: hidden; background: #111; }
iframe[data-cover] {
  position: absolute; top: 50%; left: 50%; border: 0;
  transform: translate(-50%, -50%); pointer-events: none;
}

/* ---------- hero ---------- */
.hero { position: relative; height: 175vh; }
.hero__sticky { position: sticky; top: 0; height: 100vh; overflow: hidden; }
.reel {
  --p: 0;
  position: absolute; inset: 0;
  clip-path: inset(
    calc((1 - var(--p)) * 96px)
    calc((1 - var(--p)) * var(--gutter))
    calc((1 - var(--p)) * 76px)
    calc((1 - var(--p)) * var(--gutter))
    round calc((1 - var(--p)) * var(--radius))
  );
}
.reel__media { opacity: 0; transform: scale(1.08); transition: opacity 1.2s var(--ease), transform 2s var(--ease); }
.reel.is-in .reel__media { opacity: 1; transform: none; }
.reel-bar {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: 24px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  font-size: 15px; transition: opacity .3s linear;
}
.reel { cursor: pointer; }
.reel-open { justify-self: end; font-size: 15px; border-bottom: 1px solid currentColor; padding-bottom: 2px; transition: color .3s var(--ease); }
.reel-open:hover { color: var(--accent); }
.reel:focus-visible, .reel-open:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.scroll-hint { color: var(--grey); }

/* ---------- statement ---------- */
.statement { padding: 26vh var(--gutter) 20vh; }
.big {
  font-size: var(--text-big); font-weight: 400; line-height: 0.96; letter-spacing: -0.04em;
}
.big .line { display: block; }
.big .line--indent { padding-left: 15vw; }

/* word mask: rise + focus pull */
.w { display: inline-block; overflow: hidden; vertical-align: top; padding: 0.04em 0 0.1em; margin-bottom: -0.1em; }
.wi {
  display: inline-block; transform: translateY(108%); filter: blur(8px); opacity: 0;
  transition: transform 1.2s var(--ease), filter 1.4s var(--ease), opacity 1s var(--ease);
  transition-delay: calc(var(--i, 0) * 70ms);
}
.is-in .wi { transform: none; filter: blur(0); opacity: 1; }

/* paragraph lines */
.ln { display: block; overflow: hidden; }
.lni {
  display: block; transform: translateY(105%);
  transition: transform 1s var(--ease); transition-delay: calc(var(--i, 0) * 80ms + 150ms);
}
.is-in .lni { transform: none; }

/* copy sits in the right half under "never shot."; words fill with ink as you read down */
.statement__row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; margin-top: 16vh;
}
.statement__copy { display: grid; gap: 48px; justify-items: start; max-width: 760px; }

/* clients: real names from the portfolio, opposite the copy */
.clients { display: grid; gap: 24px; align-content: start; padding-left: 8vw; }
.clients__label { font-size: 15px; color: var(--grey); }
.clients__list { list-style: none; display: grid; gap: 28px; }
.clients__list li { display: grid; gap: 6px; }
.clients__name { font-size: clamp(28px, 2.6vw, 40px); line-height: 1.05; letter-spacing: -0.02em; }
.clients__work { font-size: 15px; color: var(--grey); }
.fill { font-size: clamp(26px, 2.6vw, 42px); line-height: 1.22; letter-spacing: -0.015em; }
.fill .fw { opacity: var(--o, 0.16); transition: opacity .25s linear; }

/* ---------- featured work ---------- */
.work { padding: 6vh var(--gutter) 18vh; }
.work__head { display: flex; justify-content: space-between; align-items: end; gap: 40px; margin-bottom: 9vh; }
.big--work { font-size: clamp(56px, 9.4vw, 152px); white-space: nowrap; }
.work__lead { font-size: 17px; line-height: 1.45; color: var(--grey); max-width: 28ch; padding-bottom: 1.4vw; }

.c { display: inline-block; overflow: hidden; vertical-align: top; padding: 0.04em 0 0.1em; margin-bottom: -0.1em; }
.ci {
  display: inline-block; transform: translateY(108%) rotate(4deg); filter: blur(6px); opacity: 0;
  transition: transform 1.1s var(--ease), filter 1.2s var(--ease), opacity .8s var(--ease);
  transition-delay: calc(var(--i, 0) * 32ms);
}
.is-in .ci { transform: none; filter: blur(0); opacity: 1; }

.grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 40px; row-gap: 112px; }
.card {
  display: block; opacity: 0; transform: translateY(90px);
  transition: opacity 1s var(--ease), transform 1.3s var(--ease);
}
.card.is-in { opacity: 1; transform: none; }
.card__frame {
  position: relative; aspect-ratio: 16 / 10; border-radius: var(--radius); overflow: hidden;
  transform: perspective(1400px) rotateX(9deg) scale(0.94); transform-origin: 50% 100%;
  transition: transform 1.5s var(--ease);
}
.card.is-in .card__frame { transform: none; }
.card:nth-child(even) .card__frame { transition-delay: 120ms; }
.card:nth-child(even) { transition-delay: 120ms; }
.card__media img {
  width: 100%; height: 100%; object-fit: cover; transform: scale(1.2);
  transition: transform 1.8s var(--ease), opacity .6s var(--ease);
}
.card.is-in .card__media img { transform: scale(1.02); }
.card__media iframe { opacity: 0; transition: opacity .6s var(--ease); }
.card.playing .card__media iframe { opacity: 1; }
/* video can't bend, so it steps aside while the page moves and the bent cover takes over */
.is-scrolling .card__media iframe { opacity: 0 !important; transition: opacity .12s linear; }
.card__cap { display: grid; grid-template-columns: 1fr auto; gap: 8px 24px; margin-top: 24px; }
.card__title {
  position: relative; display: inline-flex; align-items: center;
  font-size: clamp(24px, 2.2vw, 34px); font-weight: 400; letter-spacing: -0.015em; line-height: 1.1;
}

/* WebGL takes over the cover once its texture is ready (work-gl.js) */
.work-gl { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 4; pointer-events: none; }
.card.gl-ready .card__media { background: transparent; }
.card.gl-ready .card__media img { opacity: 0; }
.card.gl-ready .card__frame { transform: none; transition: none; }

/* title: letters roll up when the card arrives; on hover they slide apart, right letters first,
   and a hairline arrow slides out of the left edge with them. --pace (from scroll speed) shortens the entrance. */
.card__name { display: inline-flex; padding: 0.06em 0 0.14em; clip-path: inset(0 -2.5em 0 -0.1em); }
.tl {
  display: inline-block;
  transition: transform .8s var(--ease);
  transition-delay: calc(var(--i, 0) * 10ms);
}
.tli {
  display: inline-block; transform: translateY(115%);
  transition: transform calc(1s * var(--pace, 1)) var(--ease);
  transition-delay: calc((var(--i, 0) * 30ms + 250ms) * var(--pace, 1));
}
.card.is-in .tli { transform: none; }
/* Arrow. It lives inside the first letter's column, just left of it, and the title clips everything left of
   its own edge. So the arrow can only ever be pulled out by the first letter as it slides right, and pushed
   back in as it returns: it rides with the text and cannot land on it, whatever the timing.
   Length 1.5em + 0.35em gap = the 1.85em slide, so at rest it is fully hidden, on hover fully out. */
.tl:first-child { position: relative; }
.card__arrow {
  position: absolute; right: calc(100% + 0.35em); top: 50%;
  width: 1.5em; height: 0.4em; margin-top: -0.2em;
  color: var(--ink); pointer-events: none;
}
.card__arrow svg { display: block; width: 100%; height: 100%; overflow: visible; }
.card__arrow path {
  stroke: currentColor; stroke-width: 1.1; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round;
}
/* the head opens once the shaft is out; it stays open while sliding home and resets once hidden */
.card__arrow .arrow-head { stroke-dasharray: 1 2; stroke-dashoffset: 1; transition: stroke-dashoffset 0s linear .8s; }
@media (hover: hover) and (pointer: fine) {
  .card:hover .tl { transform: translateX(1.85em); transition-delay: calc(var(--r, 0) * 16ms); }
  /* --r of the first column = how long that letter waits before it moves */
  .card:hover .arrow-head { stroke-dashoffset: 0; transition: stroke-dashoffset .45s var(--ease) calc(var(--r, 0) * 16ms + 300ms); }
}

.card__year { font-size: 16px; color: var(--grey); align-self: center; font-variant-numeric: tabular-nums; }
.card__tags { grid-column: 1 / -1; font-size: 16px; color: var(--grey); }


/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .links { display: none; }
  .nav { grid-template-columns: 1fr auto; top: 10px; height: 56px; padding: 0 4px 0 14px; }
  .reel { clip-path: inset(calc((1 - var(--p)) * 84px) calc((1 - var(--p)) * var(--gutter)) calc((1 - var(--p)) * 64px) calc((1 - var(--p)) * var(--gutter)) round calc((1 - var(--p)) * 14px)); }
  .reel-bar .scroll-hint { display: none; }
  .reel-bar { grid-template-columns: 1fr auto; }
  .big .line--indent { padding-left: 0; }
  .statement { padding: 18vh var(--gutter) 6vh; }
  .statement__row { grid-template-columns: 1fr; margin-top: 8vh; gap: 56px; }
  .work { padding-top: 8vh; }
  .clients { padding-left: 0; }
  .work__head { flex-direction: column; align-items: start; }
  .big--work { white-space: normal; }
  .grid { grid-template-columns: 1fr; row-gap: 72px; }
}

@media (prefers-reduced-motion: reduce) {
  .wi, .ci, .lni, .card, .card__frame, .card__media img, .reel__media, .nav { transition: none !important; }
  .wi, .ci, .lni { transform: none; filter: none; opacity: 1; }
  .card { opacity: 1; transform: none; }
  .card__frame, .reel__media { transform: none; opacity: 1; }
  .fill .fw { opacity: 1; }
}

/* ---------- page transition (transition.js): the cover grows from its card to the whole screen ---------- */
.pt { position: fixed; z-index: 100; overflow: hidden; pointer-events: none; background: #111; }
.pt img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* portrait screens: grow into the whole 16:9 frame on black, like the project hero there */
@media (max-aspect-ratio: 1/1) { .pt { background: #000; } .pt img { object-fit: contain; } }
.is-leaving .nav { opacity: 0; transition: opacity .3s var(--ease); }

/* ---------- the way to the full list, under the featured grid ---------- */
.work__more { display: flex; justify-content: center; margin-top: 14vh; }

/* ---------- moving between pages (cross-document View Transitions, Chrome and Safari) ----------
   The old page lifts a little and dissolves, the new one rises into place; the header keeps its own
   name, so it stays put while the page changes under it. Other browsers simply navigate. */
@view-transition { navigation: auto; }
.nav { view-transition-name: site-nav; }
::view-transition-old(root) { animation: page-out .42s cubic-bezier(0.4, 0, 1, 1) both; }
::view-transition-new(root) { animation: page-in .7s cubic-bezier(0.16, 1, 0.3, 1) .12s both; }
@keyframes page-out { to { opacity: 0; transform: translateY(-2vh) scale(0.99); } }
@keyframes page-in { from { opacity: 0; transform: translateY(3vh); } }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}

/* ---------- keyboard: a skip link first in the tab order, and a clear focus ring everywhere ---------- */
.skip {
  position: fixed; left: 16px; top: -64px; z-index: 200; padding: 10px 18px; border-radius: 999px;
  background: var(--ink); color: var(--white); font-size: 15px; transition: top .3s var(--ease);
}
.skip:focus { top: 16px; }
:where(a, button, input, textarea, [tabindex]):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
main:focus { outline: none; }

/* narrow phones: "makereal" is longer than the old name, so the header tightens to keep the brand and both buttons in one row */
@media (max-width: 430px) {
  .nav { padding-left: 12px; }
  .brand { gap: 8px; font-size: 18px; }
  .brand img { width: 26px; height: 26px; }
  .nav .pill { gap: 8px; padding: 0 16px 0 12px; font-size: 14px; }
}
@media (max-width: 360px) {
  .nav .pill .led { display: none; }
  .nav .pill { padding: 0 14px; }
}
