/* Homepage. Measurements come from the 1920 frame; 1540 and 1280 keep the earlier frames' scale. */
:root {
  --black: #000;
  --ink: #070707;
  --white: #fff;
  --grey-bg: #f7f7f7;
  --grey-text: #4a4a4a;
  --grey-label: #aaa9a9;

  --sans: "Geist", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;

  /* 1280 is the base; larger screens override below */
  --gutter: 40px;
  --column: 680px;
  --fs: 20px;
  --lh: 26px;
  --k: .8;
  --logo-top: 32px;
  --nav-top: 35px;
  --nav-h: 66px;
  --nav-fs: 14px;
  --logo-px: 26px;
  --icon-box: 44px;
  --icon-scale: .85;
  --nav-px: 26px;
  --nav-gap: 22px;
  --intro-top: 180px;
  --intro-bottom: 211px;
  --label-tabs: 108px;
  --tabs-cards: 80px;
  --media-title: 28px;
  --project-gap: 72px;
  --work-bottom: 136px;
  --quote: 38px;
  --quote-lh: 50px;
  --spacer: 120px;
  --h1: 40px;
  --h1-lh: 52px;
  --hero-bottom: 126px;
}

@media (min-width: 1540px) {
  :root {
    --gutter: 48px;
    --column: 720px;
    --fs: 24px;
    --lh: 31px;
    --k: .9;
    --logo-top: 36px;
    --nav-top: 40px;
    --nav-h: 74px;
    --nav-fs: 15px;
    --logo-px: 28px;
    --icon-box: 48px;
    --icon-scale: .92;
    --nav-px: 29px;
    --nav-gap: 25px;
    --intro-top: 220px;
    --intro-bottom: 236px;
    --label-tabs: 120px;
    --media-title: 36px;
    --project-gap: 80px;
    --work-bottom: 152px;
    --quote: 42px;
    --quote-lh: 55px;
    --spacer: 144px;
    --h1: 48px;
    --h1-lh: 62px;
    --hero-bottom: 139px;
  }
}

@media (min-width: 1920px) {
  :root {
    --gutter: 64px;
    --column: 800px;
    --fs: 28px;
    --lh: 36px;
    --k: 1;
    --logo-top: 40px;
    --nav-top: 44px;
    --nav-h: 82px;
    --nav-fs: 16px;
    --logo-px: 30px;
    --icon-box: 50px;
    --icon-scale: 1;
    --nav-px: 31px;
    --nav-gap: 28px;
    --intro-top: 258px;
    --intro-bottom: 259px;
    --label-tabs: 130px;
    --tabs-cards: 88px;
    --media-title: 36px;
    --project-gap: 88px;
    --work-bottom: 238px;
    --quote: 48px;
    --quote-lh: 62px;
    --spacer: 258px;
    --hero-bottom: 120px;
  }
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--white);
  color: var(--black);
  font: 300 var(--fs)/var(--lh) var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, p, ul { margin: 0; padding: 0; font: inherit; }
ul { list-style: none; }
a { color: inherit; }
img { display: block; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

.column { width: min(var(--column), 100% - 2 * var(--gutter)); margin-inline: auto; }

/* Text sits at 80% and comes to full strength under the pointer */
@media (hover: hover) {
  [data-dim] { opacity: .8; transition: opacity .25s ease; }
  [data-dim]:hover,
  a:focus-visible [data-dim] { opacity: 1; }
}

/* Header */
.site-header {
  position: fixed;
  z-index: 10;
  inset: 0 var(--gutter) auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  pointer-events: none;
}

.site-header > * { pointer-events: auto; }

.pill {
  display: flex;
  align-items: center;
  height: var(--nav-h);
  border-radius: 999px;
  background: var(--black);
  color: var(--white);
  font: 400 var(--nav-fs)/1 var(--sans);
  text-decoration: none;
}

.magnetic { will-change: transform; }

.logo { margin-top: var(--logo-top); padding-inline: var(--logo-px); }

.site-nav { margin-top: var(--nav-top); gap: var(--nav-gap); padding-inline: var(--nav-px); }

.nav-icon {
  position: relative;
  display: grid;
  grid-template: 100% / 100%;
  place-items: center;
  width: var(--icon-box);
  height: var(--icon-box);
  border-radius: 50%;
  text-decoration: none;
}

.nav-icon img { transform: scale(var(--icon-scale)); }

.nav-tip {
  position: absolute;
  top: calc(100% + 18px);
  left: 50%;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--black);
  color: var(--white);
  font: 400 12px/1 var(--sans);
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, -4px);
  transition: opacity .15s, transform .15s;
  pointer-events: none;
}

.nav-icon:hover .nav-tip,
.nav-icon:focus-visible .nav-tip { opacity: 1; transform: translate(-50%, 0); }

/* Hero: stays put while the rest of the page slides up over it */
.hero {
  position: sticky;
  top: 0;
  z-index: 0;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  background: var(--white);
}

.light, .about, .spacer, .site-footer { position: relative; z-index: 1; }
.about { background: var(--white); }

.hero__text {
  position: absolute;
  z-index: 1;
  left: var(--gutter);
  bottom: var(--hero-bottom);
  max-width: 53ch;
  font: 700 var(--fs)/var(--lh) var(--mono);
}

.hero__text h1 { font-size: var(--h1); line-height: var(--h1-lh); margin-bottom: 24px; }
.hero__text p + p { margin-top: 48px; }

/* Highlights sweep in as the page starts to scroll (progress set in main.js as --p, 0 to 1) */
.hl {
  --p: 0;
  background-color: transparent;
  padding-inline: .12em;
  margin-inline: -.12em;
  color: transparent;
  background-image:
    linear-gradient(90deg, var(--white) calc(var(--p) * 100%), var(--black) calc(var(--p) * 100%)),
    linear-gradient(var(--black), var(--black));
  background-repeat: no-repeat;
  background-size: 100% 100%, calc(var(--p) * 100%) 100%;
  -webkit-background-clip: text, border-box;
  background-clip: text, border-box;
  white-space: nowrap;
}

.id-card {
  /* fits the screen height, and leaves room for the hero text beside it */
  --cw: min(565px, (100svh - 30px) * 565 / 1050, 100vw - var(--fs) * 31.8 - 3 * var(--gutter));
  position: absolute;
  top: 0;
  right: 9.69%;
  width: var(--cw);
  transform-origin: 44.4% 0;
  will-change: transform;
}

.id-card img { width: 100%; height: auto; -webkit-user-drag: none; user-select: none; }

/* lanyard continues above the image so the top never shows a gap while the card bounces */
.id-card::before {
  content: "";
  position: absolute;
  bottom: 99.5%;
  left: 37.7%;
  width: 13.45%;
  height: 100vh;
  background: var(--ink);
}

/* Light band */
.light { background: var(--grey-bg); padding-bottom: var(--work-bottom); }

.intro { padding-top: var(--intro-top); color: var(--grey-text); }

.intro__row {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  margin-top: 36px;
}

.intro__list { display: flex; flex-direction: column; justify-content: space-between; }

/* Image covers with a title on top: only the image zooms on hover */
.cover {
  position: relative;
  display: block;
  overflow: hidden;
  container-type: inline-size;
  border-radius: 10px;
  background: var(--white);
  color: var(--white);
  text-decoration: none;
}

.cover__bg {
  position: absolute;
  inset: 0;
  transition: transform .9s cubic-bezier(.2, .7, .2, 1);
}

/* soft gradients barely show a small zoom, so it zooms further than a photo would */
.project:hover .cover__bg,
.project:focus-visible .cover__bg,
a.cover:hover .cover__bg { transform: scale(1.22); }

.cover__text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}

.cover__title { font: 700 4.5cqi/1.25 var(--sans); }
.cover__sub { margin-top: 1.4cqi; font: 300 3.5cqi/1.2 var(--sans); }

.cover--small .cover__text { transform: translateY(1.8cqi); }
.cover--small .cover__title { font-size: 8.5cqi; line-height: 1; }
.cover--small .cover__sub { margin-top: 3cqi; font-size: 5.8cqi; }
.cover__title--rule { padding: 0 3cqi 1cqi; border-bottom: 1px solid currentColor; }

.intro__media { flex: none; width: 329px; height: 232px; border-radius: 8px; }

/* Section label */
.label {
  padding-inline: var(--gutter);
  font: 700 36px/46px var(--sans);
  color: var(--grey-label);
}

/* Work */
.work { padding-top: var(--intro-bottom); }
.work .column { margin-top: var(--label-tabs); }

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 25px;
  margin-bottom: var(--tabs-cards);
  font: 400 var(--fs)/var(--lh) var(--sans);
}

.tab { padding: 11px 17px; border-radius: 999px; transition: background-color .15s, color .15s; }
.tab:hover:not(.is-active) { background: #e9e9e9; }
.tab.is-active { background: var(--ink); color: var(--white); font-weight: 700; }

.project { display: block; color: inherit; text-decoration: none; }
.project[hidden] { display: none; }
.project + .project { margin-top: var(--project-gap); }
.project[aria-disabled="true"] { cursor: default; }

.project__media { aspect-ratio: 800 / 508; margin-bottom: var(--media-title); }

.project__title { font-weight: 400; }
.project__title strong { font-weight: 700; }

.tags { display: flex; flex-wrap: wrap; gap: 12px; margin-block: 16px; }
.tags li { padding: 12px 16.5px; border: 1px solid var(--black); border-radius: 28px; }

.project__summary { font-weight: 400; }

.work__empty { padding-block: 48px; color: #6b6b6b; }

/* ---------- Sound on/off button in the corner of a video ---------- */
.clip, .screen-video { position: relative; }

.mute {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgb(0 0 0 / .62);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: transform .3s cubic-bezier(.34, 1.56, .64, 1), background-color .2s;
}

.mute:hover { transform: scale(1.1); background: rgb(0 0 0 / .8); }
.mute svg { width: 22px; height: 22px; }
.mute .mute__on, .mute[aria-pressed="true"] .mute__off { display: none; }
.mute[aria-pressed="true"] .mute__on { display: block; }

/* the About video's button only shows once a video is set */
.about__panel .mute { z-index: 3; right: var(--gutter); bottom: 32px; }
.about__panel:has(video:not([src])) .mute { display: none; }

/* About: a tall section whose stage stays pinned while the animation plays (driven by main.js) */
.about { height: 300vh; height: 300svh; }

.about__stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: var(--white);
}

.about__quote {
  position: absolute;
  top: 19.9%;
  left: 34px;
  max-width: 19.5em;
  font: 400 var(--quote)/var(--quote-lh) var(--mono);
  will-change: transform, opacity;
}

.about__label {
  position: absolute;
  top: 65.9%;
  right: calc(43px * var(--k));
  display: flex;
  font: 700 48px/58px var(--sans);
  white-space: nowrap;
}

.about__slash, .about__word { display: inline-block; will-change: transform, opacity; }

.about__panel {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #040404;
  color: var(--white);
  clip-path: inset(50% 50% 50% 50%);
}

.about__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .6s ease; }
.about__video.is-ready { opacity: 1; }
/* darkens the video so the text on top stays readable */
.about__panel::after { content: ""; position: absolute; inset: 0; background: rgb(0 0 0 / .55); pointer-events: none; }

.about__content { position: absolute; inset: 0; z-index: 1; opacity: 0; }

.about__tag {
  position: absolute;
  top: 23.1%;
  left: var(--gutter);
  font: 700 36px/46px var(--sans);
  color: var(--grey-label);
}

.about__text {
  position: absolute;
  top: 34%;
  left: 50%;
  width: min(var(--column), 100% - 2 * var(--gutter));
  transform: translateX(-50%);
  font: 400 var(--fs)/var(--lh) var(--mono);
}

.about__text p + p { margin-top: var(--lh); }
.about__lead { font-weight: 700; }
.about__resume { display: inline-block; margin-top: var(--lh); font: 300 var(--fs)/var(--lh) var(--sans); text-underline-offset: 4px; text-decoration-thickness: .055em; }

/* motion turned off: no pinning, the black About panel simply shows */
.about.is-static { height: auto; }
.about.is-static .about__stage { position: relative; height: auto; min-height: 100svh; }
.about.is-static .about__quote, .about.is-static .about__label { display: none; }
.about.is-static .about__panel { position: relative; min-height: 100svh; clip-path: none; }
.about.is-static .about__content { opacity: 1; }

.spacer { height: var(--spacer); background: var(--grey-bg); }

/* Footer */
.site-footer {
  display: flex;
  justify-content: space-between;
  padding: 80px var(--gutter);
  background: var(--black);
  color: var(--white);
  font: 700 var(--fs)/var(--lh) var(--mono);
}

.site-footer ul { display: flex; flex-direction: column; gap: 44px; text-align: right; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* Links that are not filled in yet */
a[aria-disabled="true"], a[aria-disabled="true"]:hover { cursor: default; text-decoration-line: none; }

/* Tablets and phones: the card hangs at the top and the hero text sits below it */
@media (max-width: 1023px) {
  .id-card { --cw: min(52vw, 340px, (100svh - 360px) * 565 / 1050); }
  .hero { display: flex; flex-direction: column; justify-content: flex-end; padding: 0 var(--gutter) 40px; }
  .hero__text { position: relative; left: auto; bottom: auto; max-width: 53ch; font-size: 17px; line-height: 24px; }
  .hero__text h1 { font-size: 34px; line-height: 42px; margin-bottom: 16px; }
  .hero__text p + p { margin-top: 24px; }
}

/* Phones and small tablets: no frame exists for this size, so it is adapted from the desktop design */
@media (max-width: 767px) {
  :root {
    --gutter: 20px;
    --fs: 18px;
    --lh: 25px;
    --k: .45;
    --logo-top: 20px;
    --nav-top: 20px;
    --nav-h: 52px;
    --nav-fs: 12px;
    --logo-px: 18px;
    --icon-box: 40px;
    --icon-scale: .78;
    --nav-px: 10px;
    --nav-gap: 4px;
    --intro-top: 88px;
    --intro-bottom: 112px;
    --label-tabs: 48px;
    --tabs-cards: 40px;
    --media-title: 20px;
    --project-gap: 56px;
    --work-bottom: 88px;
    --quote: 24px;
    --quote-lh: 32px;
    --spacer: 64px;
  }

  .hero__text { font-size: 15px; line-height: 21px; }
  .hero__text h1 { font-size: 28px; line-height: 36px; margin-bottom: 14px; }
  .hero__text p + p { margin-top: 18px; }

  .label { font-size: 32px; line-height: 40px; }
  .intro__row { flex-direction: column; }
  .intro__list { gap: 16px; }
  .intro__media { width: 100%; height: auto; aspect-ratio: 329 / 232; }

  .tabs { gap: 2px; font-size: 16px; }
  .tab { padding: 8px 12px; }
  .tags { gap: 8px; }
  .tags li { padding: 8px 14px; border-radius: 22px; }

  .about__quote { left: var(--gutter); right: var(--gutter); top: 16%; }
  .about__label { right: var(--gutter); font-size: 32px; line-height: 40px; }
  .about__tag { top: 12%; font-size: 26px; line-height: 32px; }
  .about__text { top: 22%; font-size: 15px; line-height: 21px; }
  .site-footer { padding-block: 56px; }
  .site-footer ul { gap: 28px; }
  .nav-tip { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tab, .nav-tip, .cover__bg, [data-dim] { transition: none; }
}
