:root {
  --ink: rgb(28, 62, 87);
  --ink-soft: rgb(60, 86, 106);
  --ground: rgb(255, 255, 255);
  --surface: rgb(240, 244, 247);
  --rule: rgb(214, 223, 230);
  --accent: rgb(73, 94, 212);
  --accent-ink: rgb(255, 255, 255);
  --select: rgb(218, 223, 247);

  --display: "Montserrat", sans-serif;
  --body: "Roboto", sans-serif;

  --gutter: clamp(20px, 5vw, 56px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: rgb(240, 240, 240);
    --ink-soft: rgb(176, 184, 192);
    --ground: rgb(23, 21, 21);
    --surface: rgb(36, 35, 37);
    --rule: rgb(58, 58, 62);
    --accent: rgb(150, 164, 245);
    --accent-ink: rgb(23, 21, 21);
    --select: rgb(52, 60, 120);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --ink: rgb(240, 240, 240);
  --ink-soft: rgb(176, 184, 192);
  --ground: rgb(23, 21, 21);
  --surface: rgb(36, 35, 37);
  --rule: rgb(58, 58, 62);
  --accent: rgb(150, 164, 245);
  --accent-ink: rgb(23, 21, 21);
  --select: rgb(52, 60, 120);
  color-scheme: dark;
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.125rem;
  line-height: 1.55;
}

/* Scroll progress: fills left to right as the page scrolls. */
.progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  z-index: 5;
  pointer-events: none;
}

::selection { background: var(--select); color: var(--ink); }

h1, h2, h3, p, dl, dd, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; }

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

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

.wrap {
  max-width: 1160px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--ground);
  font-weight: 500;
  text-decoration: none;
  border-radius: 4px;
  z-index: 10;
}
.skip:focus { top: 12px; }

/* Header */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}
.brand svg { width: 26px; height: auto; flex: none; }
.brand span {
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.masthead nav { display: flex; align-items: center; gap: clamp(12px, 2.5vw, 32px); }
.masthead nav ul { display: flex; gap: clamp(16px, 2.5vw, 32px); }
.masthead nav a {
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  padding-block: 10px;
}
.masthead nav a:hover { text-decoration: underline; }

.theme {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-right: -12px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--ink);
  cursor: pointer;
  transition: background-color 0.2s;
}
.theme:hover { background: var(--surface); }
.theme svg { width: 20px; height: 20px; }
.theme .moon { display: none; }
:root[data-theme="dark"] .theme .sun { display: none; }
:root[data-theme="dark"] .theme .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme .sun { display: none; }
  :root:not([data-theme="light"]) .theme .moon { display: block; }
}

/* Intro */

.intro {
  padding-block: clamp(48px, 8vw, 104px) clamp(56px, 8vw, 104px);
}

h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.125rem, 1.2rem + 3.9vw, 4rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  max-width: 16em;
  text-wrap: balance;
}

.lede {
  max-width: 30em;
  margin-top: 28px;
  font-size: clamp(1.1875rem, 1.1rem + 0.5vw, 1.375rem);
  line-height: 1.5;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 28px;
  margin-top: 36px;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 22px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 500;
  text-decoration: none;
  border: 0;
  border-radius: 4px;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.copy .icon-done, .copy.is-copied .icon-copy { display: none; }
.copy.is-copied .icon-done { display: block; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--accent) 70%, transparent);
}
.button svg, .more svg { width: 16px; height: 16px; flex: none; }

.text-link { font-weight: 500; padding-block: 10px; }
.text-link:hover { color: var(--accent); }

.status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink-soft);
}
.status::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
}


/* Work */

/* Each company is its own band; the second sits on a tinted ground. */
.group { padding-block: clamp(56px, 8vw, 112px); }
.group:first-child { padding-top: 0; }
.group:first-child .group-head { padding-top: clamp(32px, 4vw, 48px); border-top: 1px solid var(--ink); }
.group.tint { background: var(--surface); }
.group.tint .shot { background: var(--ground); }

.group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 32px;
}

.group-head h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2rem, 1.3rem + 3.2vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.group-head p { color: var(--ink-soft); font-weight: 500; text-wrap: balance; }

.project {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  column-gap: clamp(32px, 6vw, 80px);
  row-gap: 20px;
  align-items: center;
  margin-top: clamp(40px, 6vw, 72px);
}

.shot {
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
}
.shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease);
}
.project:hover .shot img { transform: scale(1.03); }

.meta {
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink-soft);
}

h3 {
  margin-top: 8px;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h3 a { text-decoration: none; }
/* The whole row is the link target. */
h3 a::after { content: ""; position: absolute; inset: 0; }
h3 a:focus-visible { outline: none; }
.project:has(h3 a:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 8px;
  border-radius: 6px;
}

.result { max-width: 26em; margin-top: 12px; text-wrap: pretty; }
.result strong { font-weight: 700; }

.more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 1rem;
  font-weight: 500;
  color: var(--accent);
}
.more svg { transition: transform 0.3s var(--ease); }
.project:hover .more svg { transform: translateX(4px); }

footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-block: 28px;
  font-size: 0.9375rem;
  color: var(--ink-soft);
}
footer a:hover { color: var(--ink); }

/* Narrow screens */

@media (max-width: 809px) {
  .project { grid-template-columns: minmax(0, 1fr); }
  .masthead { padding-block: 16px; }
  .masthead nav ul { display: none; }
}

/* One authored moment: the intro settles in on load. */

@media (prefers-reduced-motion: no-preference) {
  .intro h1, .intro .lede, .intro .actions, .intro .status {
    animation: settle 0.9s var(--ease) backwards;
  }
  .intro .lede { animation-delay: 0.08s; }
  .intro .actions { animation-delay: 0.16s; }
  .intro .status { animation-delay: 0.2s; }
  @keyframes settle {
    from { opacity: 0; transform: translateY(16px); filter: blur(6px); }
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

/* ---------- Case study pages ---------- */

h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.5rem, 1.25rem + 1.1vw, 2rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.case-head { padding-block: clamp(40px, 7vw, 88px) clamp(32px, 5vw, 56px); }
.case-head h1 { max-width: 18em; }
.case-head .lede { max-width: 40em; text-wrap: balance; }

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  column-gap: 32px;
  margin-top: clamp(32px, 5vw, 56px);
  border-top: 1px solid var(--ink);
}
.facts div { padding-block: 14px; }
.facts dt { font-size: 0.9375rem; color: var(--ink-soft); }
.facts dd { font-weight: 500; line-height: 1.4; }

.case-hero { padding-bottom: clamp(40px, 6vw, 72px); }

/* Headings sit in a left rail; text and figures share one column and one
   width beside it, so every block has the same left and right edge. */
.section {
  display: grid;
  grid-template-columns: minmax(160px, 240px) minmax(0, 1fr);
  column-gap: clamp(32px, 5vw, 72px);
  padding-block: clamp(40px, 6vw, 72px);
  border-top: 1px solid var(--rule);
}

.body { font-size: 1.1875rem; line-height: 1.6; }
.body > * + * { margin-top: 1em; }
.body h3 { margin-top: 0; font-size: 1.25rem; }
.body > * + h3 { margin-top: 56px; }
.body > h3 + * { margin-top: 8px; }
.body > * + figure, .body > figure + *, .body > * + .video, .body > .video + * { margin-top: 32px; }
.body > figure + h3 { margin-top: 56px; }
.body > h3 + figure { margin-top: 16px; }
.body ul { padding-left: 1.15em; list-style: disc; }
.body li + li { margin-top: 0.35em; }
.body li::marker { color: var(--ink-soft); }
.body p a { color: var(--accent); font-weight: 500; }

/* Quotes: body size, set in italic under an opening mark in the accent color. */
blockquote {
  margin: 0;
  font-style: italic;
  text-wrap: pretty;
}
blockquote::before {
  content: "\201C";
  display: block;
  height: 0.5em;
  margin-left: -0.04em;
  font-family: var(--display);
  font-style: normal;
  font-weight: 700;
  font-size: 2.75em;
  line-height: 1;
  color: var(--accent);
}
.body > * + blockquote, .body > blockquote + * { margin-top: 32px; }

/* Figures: every tile in a gallery shares one frame so rows line up. */
figure { margin: 0; }
figcaption {
  margin-top: 10px;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--ink-soft);
}

.shots {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr));
}
.zoom {
  display: block;
  aspect-ratio: var(--ratio);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
  cursor: zoom-in;
  transition: border-color 0.2s;
}
.zoom:hover { border-color: var(--accent); }
.zoom img { width: 100%; height: 100%; object-fit: contain; }
.shots.bare img { width: 100%; height: auto; }

.numbers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 280px));
  gap: 24px 56px;
}
.numbers div { display: flex; flex-direction: column-reverse; gap: 6px; }
.numbers dt { color: var(--ink-soft); }
.numbers dd {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.75rem, 1.3rem + 2vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 12px 24px 12px 0; text-align: left; border-bottom: 1px solid var(--rule); white-space: nowrap; }
thead th { font-size: 0.9375rem; font-weight: 500; color: var(--ink-soft); border-bottom-color: var(--ink); }
tbody th { font-weight: 500; }

.video { aspect-ratio: 16 / 9; }
.video iframe { width: 100%; height: 100%; border: 0; border-radius: 6px; }

.next { background: var(--surface); }
.next .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px 32px;
  padding-block: clamp(40px, 6vw, 72px);
}
.next a { text-decoration: none; }
.next .forward {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.5rem, 1.2rem + 1.6vw, 2.25rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.next .forward span { font-weight: 600; color: var(--ink-soft); }
.next .forward svg { width: 0.7em; height: 0.7em; flex: none; transition: transform 0.3s var(--ease); }
.next .forward:hover svg { transform: translateX(6px); }
.next .back { font-weight: 500; text-decoration: underline; padding-block: 10px; }
.next .back:hover { color: var(--accent); }

@media (max-width: 809px) {
  .section { display: block; }
  .section > h2 { margin-bottom: 20px; }
  .body { font-size: inherit; line-height: inherit; }
  .shots { grid-template-columns: repeat(var(--cols-narrow, 1), minmax(0, 1fr)); gap: 8px; }
  /* Stacked one per row, each image takes its own shape. */
  .shots.stack-narrow .zoom { aspect-ratio: var(--own); }
}

/* ---------- Lightbox ---------- */

.lb-open { overflow: hidden; }

.lightbox {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgb(13, 20, 27);
  color: rgb(240, 240, 240);
  overflow: hidden;
}
.lightbox::backdrop { background: none; }
.lightbox[open] {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  opacity: 1;
  transition: opacity 0.25s var(--ease);
}
@starting-style { .lightbox[open] { opacity: 0; } }

.lb-stage {
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 64px clamp(12px, 6vw, 88px) 8px;
  cursor: zoom-out;
}
.lb-stage img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  cursor: default;
}
.lb-meta {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 12px 24px 20px;
  font-size: 0.9375rem;
  line-height: 1.4;
  text-align: center;
}
.lb-count { flex: none; color: rgb(176, 184, 192); font-variant-numeric: tabular-nums; }

.lightbox button {
  position: absolute;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.1);
  color: inherit;
  cursor: pointer;
  transition: background-color 0.2s;
}
.lightbox button:hover { background: rgb(255 255 255 / 0.22); }
.lightbox button:focus-visible { outline-color: rgb(240, 240, 240); }
.lightbox button svg { width: 20px; height: 20px; }
.lb-close { top: 12px; right: 12px; }
.lb-prev, .lb-next { top: 50%; margin-top: -24px; }
.lb-prev { left: 12px; }
.lb-next { right: 12px; }
.lightbox button[hidden] { display: none; }

@media (max-width: 809px) {
  .lb-stage { padding-inline: 8px; }
  .lb-prev, .lb-next { top: auto; bottom: 64px; margin-top: 0; }
}
