/* Tokens ------------------------------------------------------------------ */

:root {
  --page: #fff;
  --ink: #222;                /* every primary text */
  --muted: #6b6e73;           /* every secondary text — 5.4:1 on white */
  --accent: #ea6841;          /* the one accent, at display sizes */
  --accent-ink: #c2502c;      /* the same accent where text is small — 4.6:1 */
  --cursor: #2f6fd0;          /* the visitor's cursor, opposite the accent */
  --surface: #f5f5f5;         /* the page, while Work is on screen */
  --placeholder: #dedede;     /* every empty media slot */

  --note-blue: #d5f2f9;
  --note-green: #cbe87a;
  --note-yellow: #edd48e;

  --shadow-sm: 0 2px 2px rgba(0, 0, 0, 0.25);

  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-hand: "Gloria Hallelujah", "Comic Sans MS", cursive;
  --font-mono: "Roboto Mono", ui-monospace, Menlo, monospace;
  --font-accent: "Playfair Display", Georgia, "Times New Roman", serif;

  --nav-top: 24px;
  --nav-height: 48px; /* 40px links + 4px padding top and bottom */
  --anchor-gap: 60px; /* space between the sticky nav and a jumped-to title */

  --content: 864px;
  --gutter: 20px;
  /* Tight tracking belongs to display sizes; body text sets its own */
  --tracking: -0.04em;
  --tracking-body: -0.011em;
  --leading-body: 1.6;

  /* Display type (hero + contact) scales down from 48px at the 1024px frame */
  --display-size: clamp(30px, 4.6875vw, 48px);

  /* Six steps, and nothing between them */
  --text-xs: 13px;   /* labels, captions */
  --text-sm: 15px;   /* meta */
  --text-base: 16px; /* body */
  --text-md: 18px;   /* long-form body, sub-headings */
  --text-lg: 21px;   /* lede */
  --text-xl: 24px;   /* section titles */
  --section-gap: clamp(112px, 13vw, 190px);
  --title-gap: clamp(40px, 4.2vw, 60px);
}

/* Base -------------------------------------------------------------------- */

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

html {
  scrollbar-color: #cfccc4 transparent;
  scrollbar-width: thin;
}

body {
  margin: 0;
  /* /scripts/motion.js ramps --tint 0 → 1 as the case studies come up, so the page
     turns grey underneath the white cards with no edge anywhere */
  background-color: color-mix(in srgb, var(--surface) calc(var(--tint, 0) * 100%), var(--page));
  transition: background-color 0.45s linear;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: var(--leading-body);
  letter-spacing: var(--tracking-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* The surfaces the browser draws still belong to the design */
::selection {
  background: #ffdccf;
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 3px;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  border: 3px solid var(--page);
  border-radius: 999px;
  background: #cfccc4;
}

::-webkit-scrollbar-thumb:hover {
  background: #b4b0a7;
}

h1, h2, h3, p, ul, pre {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button {
  font: inherit;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.page {
  position: relative;
  overflow: hidden;
  overflow: clip;
}

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

.section {
  padding-top: var(--section-gap);
}

/* Section titles are the nav's anchor targets: land them --anchor-gap
   below the fixed nav */
.section-title {
  scroll-margin-top: calc(var(--nav-top) + var(--nav-height) + var(--anchor-gap));
  margin-bottom: var(--title-gap);
  font-size: var(--text-xl);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: var(--tracking);
  text-align: center;
}

/* Accent words ("disappear.", contact links) set in Playfair Display italic */
.accent {
  position: relative;
  display: inline-block;
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
}

/* Home, as a memoji, standing outside the bar on the left */
.home-memoji {
  position: fixed;
  top: var(--nav-top);
  left: clamp(20px, 8vw, 120px);
  z-index: 10;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: transparent;
  transition: background-color 0.25s var(--ease-out), scale 0.25s var(--ease-out);
}

.home-memoji img {
  width: auto;
  height: 37px;
}

@media (hover: hover) {
  .home-memoji:hover {
    background: rgba(34, 34, 34, 0.07);
    scale: 1.04;
  }
}

.home-memoji:active {
  scale: 0.96;
}

@media (max-width: 719px) {
  .home-memoji {
    left: 14px;
    width: 44px;
    height: 44px;
  }

  .home-memoji img {
    height: 32px;
  }
}

/* Nav --------------------------------------------------------------------- */

/* Figma "Glass" on the nav (node 51:462): light -45° at 80%, refraction 50,
   depth 50, dispersion 85, frost 6, splay 100. Frost and light are CSS;
   refraction and dispersion come from the #nav-glass SVG filter, which
   /scripts/main.js switches on where backdrop SVG filters render (Chromium). The
   glass is clear — only a breath of white in it — so the page colour shows
   through and the labels are ink. */
.nav {
  position: fixed;
  top: var(--nav-top);
  left: 50%;
  z-index: 10;
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 24px;
  /* Figma: white at 50%, one soft shadow. The inner rim and the blur are
     what make it read as glass rather than a flat plate. */
  background: rgba(255, 255, 255, 0.5);
  box-shadow:
    0 8px 8px rgba(0, 0, 0, 0.04),
    inset 0 1px 0.5px rgba(255, 255, 255, 0.9),
    inset 0 -1px 0.5px rgba(255, 255, 255, 0.5),
    inset 0 0 0 1px rgba(255, 255, 255, 0.4);
  -webkit-backdrop-filter: blur(10px) saturate(1.6);
  backdrop-filter: blur(10px) saturate(1.6);
  transform: translateX(-50%);
}

.nav.nav--refract {
  -webkit-backdrop-filter: url(#nav-glass);
  backdrop-filter: url(#nav-glass);
}

/* Rim light: brightest on the edge facing the -45° light, a fainter
   bounce on the opposite edge */
.nav::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(135deg,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(255, 255, 255, 0.35) 22%,
    rgba(30, 38, 60, 0.12) 48%,
    rgba(30, 38, 60, 0.08) 58%,
    rgba(255, 255, 255, 0.5) 80%,
    rgba(255, 255, 255, 0.9) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
}

.nav a {
  transition: color 0.2s ease, background-color 0.2s ease;
}

.nav a img {
  transition: filter 0.2s ease, opacity 0.2s ease;
}

/* Icons match the labels: muted grey, white inside the active pill */
.nav a:not(.is-active) img {
  filter: brightness(0) invert(0.42);
}

.nav .is-active img {
  filter: brightness(0) invert(1);
}

@media (hover: hover) {
  .nav a:not(.is-active):hover {
    color: var(--ink);
  }

  .nav a:not(.is-active):hover img {
    filter: brightness(0) invert(0.13);
  }
}

.glass-defs {
  position: absolute;
  width: 0;
  height: 0;
}

.nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 80px;
  height: 40px;
  border-radius: 20px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: normal;
  text-decoration: none;
}

.nav .nav__icon {
  width: 60px;
}

/* 40px tall by the design, 44px to the finger */
.nav a::before {
  content: "";
  position: absolute;
  inset: -2px 0;
}

.nav a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* One active item at a time (set by /scripts/main.js from scroll position) */
/* On a page without the sliding indicator (the case studies), the active
   item carries the accent pill itself */
.nav .is-active {
  background: var(--accent);
  color: #fff;
}

.nav__icon img[src*="home"] {
  width: 15.5px;
  height: 16.25px;
}

.nav__icon img[src*="download"] {
  width: 14.9px;
  height: 14.9px;
}

/* Hero -------------------------------------------------------------------- */

/* --hold extends the hero's content below its visible end so the pinned
   headline (/styles/motion.css) has room to stay put while Work scrolls up over it;
   the negative margin cancels it out, so the layout is unchanged. A sticky
   element can only travel inside its parent's content box, so the extra room
   is a spacer (::after), not padding. */
.hero {
  --s: 1; /* sticky-note scale */
  --hero-top: 276px;
  --hold: 640px;
  position: relative;
  max-width: 1440px;
  min-height: calc(648px + var(--hold));
  margin-inline: auto;
  margin-bottom: calc(-1 * var(--hold));
  padding: 0 var(--gutter);
}

.hero::after {
  content: "";
  display: block;
  height: var(--hold);
}

/* The notes board spans the first screen of the hero. It sits in flow but
   takes no height (the negative bottom margin), so /styles/motion.css can pin it
   like the headline; the side margins let notes reach the page edges. */
.notes {
  position: relative;
  height: var(--notes-h, 648px);
  margin: 0 calc(-1 * var(--gutter)) calc(-1 * var(--notes-h, 648px));
  pointer-events: none;
}

.note {
  position: absolute;
  top: calc(var(--y) * var(--s) * 1px);
  width: calc(122px * var(--s));
  height: calc(122px * var(--s));
  background: var(--c);
  box-shadow: var(--shadow-sm);
  transform: rotate(calc(var(--r) * 1deg));
  /* A handwritten problem on each note */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(12px * var(--s));
  color: var(--ink);
  font-family: var(--font-hand);
  font-size: max(10px, calc(15px * var(--s)));
  line-height: 1.3;
  letter-spacing: normal;
  text-align: center;
}

.note[data-side="l"] {
  left: calc(var(--x) * var(--s) * 1px);
}

.note[data-side="r"] {
  right: calc(var(--x) * var(--s) * 1px);
}

.hero__title {
  letter-spacing: var(--tracking);
  position: relative;
  margin-top: var(--hero-top);
  font-size: var(--display-size);
  line-height: 1.4167;
  font-weight: 500;
  text-align: center;
}

.hero__line {
  display: block;
}

/* All pill/badge sizes are in em so they scale with the headline */
.name-pill {
  position: relative;
  display: inline-block;
  width: 2.8125em;
  height: 1em;
  margin: 0 0.06em;
  border-radius: 0.5em;
  background: var(--accent);
  vertical-align: middle;
}

/* A window flush with the pill's bottom edge that extends 35px above it.
   The photo rests low so only the top of the head shows inside the pill;
   on hover (/styles/motion.css) it rises into the part above. */
.name-pill__photo {
  position: absolute;
  bottom: 0;
  left: 0.3333em;
  width: 2.1667em;
  height: 1.7292em;
  overflow: hidden;
}

.name-pill__photo img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  transform: translateY(0.8333em);
}

.xp-badge {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* 27% larger than Figma's 66px badge. The negative margins keep its footprint
     at the old size, so it doesn't push the lines apart and tucks slightly into
     "designer". --badge-scale also spreads the hover tags (/styles/motion.css). */
  --badge-scale: 1.2727;
  width: calc(1.375em * var(--badge-scale));
  height: calc(1.375em * var(--badge-scale));
  margin: -0.1875em -0.1em -0.1875em -0.12em;
  color: #f7f6ee;
  line-height: 1;
  vertical-align: middle;
}

.xp-badge img {
  position: absolute;
  inset: 7.52%;
  width: 84.96%;
  height: 84.96%;
}

.xp-badge__num,
.xp-badge__unit {
  position: relative;
}

.xp-badge__num {
  font-size: 0.4242em;
  font-weight: 700;
}

.xp-badge__unit {
  font-size: 0.3712em;
  font-weight: 700;
  text-transform: uppercase;
}

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

/* White cards on a page that turns grey while this section is on screen —
   the separation is the surface, not a border or a shadow. */
.work-list {
  display: grid;
  gap: 20px;
}

/* Figma 278:4144 — art flush to the right, copy inset on the left */
.work-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 456px;
  align-items: center;
  gap: 40px;
  padding: 16px 16px 16px 40px;
  border-radius: 24px;
  background: var(--page);
  color: inherit;
  text-decoration: none;
}

/* Four rows, spaced apart: meta, title, metrics, tags */
.work-card__body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  min-height: 363px;
  padding: 16px 0;
}

.work-card__meta,
.work-card__tags {
  color: var(--muted);
  font-size: var(--text-xs);
  letter-spacing: -0.04em;
  line-height: 1.45;
}

.work-card__title {
  font-size: var(--text-lg);
  line-height: 1.3;
  font-weight: 500;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

/* The numbers the case study earns, one per line so they read as a list */
/* Nothing shipped yet: meta and title sit together at the top rather than
   being pushed apart by a row rhythm with no rows to fill it */
.work-card.is-soon .work-card__body {
  justify-content: flex-start;
  gap: 16px;
}

.work-card__metrics {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--text-sm);
  letter-spacing: -0.04em;
  line-height: 26px;
}

.work-card__media {
  position: relative;
  aspect-ratio: 456 / 363;
  border-radius: 16px;
  background: var(--placeholder);
  overflow: hidden;
}

.work-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}


.paper {
  position: relative;
  z-index: 1;
  padding: 0 73px 40px;
  color: var(--ink);
}

.about-grid {
  text-align: center;
}

.about-text {
  max-width: min(760px, 46ch);
  margin: 0 auto;
  text-align: left;
  text-wrap: pretty;
  font-size: clamp(22px, 3.125vw, 32px);
  line-height: 1.32;
  font-weight: 500;
  letter-spacing: -0.03em;
  text-wrap: pretty;
}

.about-text p + p {
  margin-top: 1.25em;
}

/* The resume link rides inside the copy; it stays on one line so the drawn
   loop has a single box to wrap around */
.about-text .accent {
  display: inline-block;
  color: var(--accent);
  white-space: nowrap;
}

.enjoy__title {
  margin-top: 96px;
  font-size: var(--text-md);
  line-height: 1.4;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.enjoy__list {
  display: grid;
  justify-content: start;
  grid-template-columns: repeat(3, 221px);
  /* Filled column by column (five per column), matching the design */
  grid-template-rows: repeat(5, auto);
  grid-auto-flow: column;
  row-gap: 14px;
  margin-top: 28px;
  color: var(--muted);
  font-size: var(--text-base);
  line-height: 1.5;
  white-space: nowrap;
}

/* Portrait in the footer ------------------------------------------------- */

.portrait {
  position: relative;
  display: flex;
  justify-content: center;
  width: 100%;
  margin: 0;
  justify-self: center;
}

.portrait__photo {
  position: relative;
  z-index: 1;
  width: 174px;
  height: auto;
}

/* Signed across the page, with the photograph standing in front of it */
.portrait__sign {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(760px, 82vw);
  max-width: none;
  height: auto;
  translate: -50% -50%;
  opacity: 0.9;
  pointer-events: none;
}

/* Clientele --------------------------------------------------------------- */

/* Full-bleed: the row runs edge to edge, fading out at both ends */
.clients {
  margin-top: clamp(80px, 9vw, 128px);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}

.clients__track {
  display: flex;
  width: max-content;
}

.clients__row {
  display: flex;
  align-items: center;
  gap: 64px;
  padding-right: 64px;
}

.clients img {
  height: var(--h, 36px);
  width: auto;
  /* One page, one accent: the marks read as a set until you point at one */
  filter: grayscale(1);
  opacity: 0.8;
  transition: filter 0.3s var(--ease-out), opacity 0.3s var(--ease-out);
}

.clients__word {
  color: var(--muted);
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: 0.02em;
  opacity: 0.8;
  transition: color 0.3s var(--ease-out), opacity 0.3s var(--ease-out);
}

@media (hover: hover) {
  .clients li:hover img {
    filter: none;
    opacity: 1;
  }

  .clients li:hover .clients__word {
    color: var(--ink);
    opacity: 1;
  }
}

@media (max-width: 719px) {
  .clients__row {
    gap: 40px;
    padding-right: 40px;
  }

  .clients img {
    height: 28px;
  }
}

/* Contact ----------------------------------------------------------------- */

.contact {
  padding-top: 190px;
}

.contact__text {
  letter-spacing: var(--tracking);
  font-size: var(--display-size);
  line-height: 1.4167;
  font-weight: 500;
}

/* The channels are green like their hover loop */
.contact__text a.accent {
  color: var(--accent);
}

/* "Copied" bubble for links that copy instead of navigate */
.accent[data-copy]::before {
  content: "Number copied!";
  position: absolute;
  bottom: 100%;
  left: 50%;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  font-weight: 500;
  letter-spacing: normal;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity 0.15s ease;
}

.accent[data-copy].is-copied::before {
  opacity: 1;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Footer ------------------------------------------------------------------ */

.footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 24px;
  padding: 120px 0 61px;
  font-size: var(--text-sm);
  color: var(--muted);
}

.footer__made {
  justify-self: end;
}

/* The five stack in one cell, so the line doesn't jump as they take turns */
.made-emojis {
  display: inline-grid;
  vertical-align: -0.15em;
}

.made-emoji {
  grid-area: 1 / 1;
}

/* Tablet ------------------------------------------------------------------ */

@media (max-width: 1023px) {
  :root {
    --section-gap: 120px;
  }

  .hero {
    --s: 0.8;
    --hero-top: 250px;
    --notes-h: 560px;
    min-height: 0;
    padding-bottom: 140px;
  }

  .note--low {
    display: none;
  }

  .about-grid {
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 32px;
  }

  .paper {
    padding-inline: 48px;
  }

  .enjoy__list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 24px;
    white-space: normal;
  }

}

/* Mobile ------------------------------------------------------------------ */

@media (max-width: 719px) {
  :root {
    --section-gap: 96px;
    --title-gap: 40px;
  }

  /* The headline fills the first screen and centres itself (so pinning it
     at top: 0 keeps it centred), with the notes scattered around it: the
     upper notes above it, the lower ones measured up from the screen's
     bottom edge */
  .hero {
    --s: 0.6;
    --hero-top: 0px;
    min-height: 0;
    padding: 0 var(--gutter);
  }

  .hero__title {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
    min-height: 100svh;
  }

  .hero__part {
    display: block;
  }

  .hero {
    --notes-h: 100vh;
  }

  @supports (height: 100svh) {
    .hero {
      --notes-h: 100svh;
    }
  }

  .note--low {
    display: block;
    top: auto;
    bottom: calc((640 - var(--y)) * var(--s) * 1px);
  }

  /* Phone: one column, the image above the words */
  .work-card {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 20px 20px 24px;
  }

  .work-card__media {
    order: -1;
  }

  .work-card__body {
    gap: 10px;
    min-height: 0;   /* the desktop row rhythm would strand the copy on a phone */
    padding: 0;
  }


  .about .section-title {
    margin-bottom: 28px;
  }

  .paper {
    padding: 24px 20px 72px;
  }


  .about-grid {
    grid-template-columns: 1fr;
  }

  .enjoy__title {
    margin-top: 48px;
    font-size: 22px;
  }

  .enjoy__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
    grid-auto-flow: row;
    column-gap: 20px;
    margin-top: 24px;
    /* long entries wrap here instead of running into the next column */
    white-space: normal;
  }

  .contact {
    padding-top: 120px;
  }

  .footer {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 16px;
    padding: 112px 0 40px;
    text-align: center;
  }

  .footer .portrait {
    order: -1;
    margin-bottom: 32px;
  }

  .footer__made {
    justify-self: center;
  }
}

@media (max-width: 420px) {
  .nav a {
    width: 64px;
  }

  .nav .nav__icon {
    width: 48px;
  }
}
