:root {
  --bg: #181715;
  --text: #ffffff;
  --text-2: rgba(251, 250, 249, 0.7);
  --text-3: #8a8987; /* content/tertiary (#fbfaf9 at 50%) flattened on --bg, so overlapping logo shapes don't stack */
  --line: rgba(251, 250, 249, 0.08);
  --accent: #eb682f;
  --page-pad: 40px;
  --gap: 40px;
  --aside: 320px;
  --radius: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 14px/20px "Geist", system-ui, sans-serif;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
::selection { background: var(--accent); color: var(--bg); }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 500; font-family: "IBM Plex Serif", Georgia, serif; letter-spacing: -0.01em; }

.link { color: var(--accent); transition: opacity .15s ease; }
.link:hover { opacity: .75; }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.text-2 { color: var(--text-2); }
.text-2 p + p { margin-top: 20px; }

/* Key-value list: a hairline above every row and under the last one */
.list { margin: 0; padding: 0; list-style: none; border-bottom: 1px solid var(--line); }
.row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.row > :first-child { color: var(--text-2); }
.row > :last-child { text-align: right; white-space: nowrap; }

.shot {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(251, 250, 249, 0.04);
}
.shot img { width: 100%; height: 100%; object-fit: cover; }
/* sizes in the markup are doubled on purpose: every screen gets a 2x image */

.divider { width: 100%; height: 0; margin: 0; border: 0; border-top: 1px solid var(--line); }

/* ── Home ─────────────────────────────────────────────── */

.page {
  display: grid;
  grid-template-columns: var(--aside) minmax(0, 1fr);
  gap: var(--gap);
  padding: var(--page-pad);
}

.aside { display: flex; flex-direction: column; gap: 168px; }
.logo { display: block; width: 95px; height: 20px; color: var(--text); }
.logo svg { display: block; width: 100%; height: 100%; }
.info { display: flex; flex-direction: column; gap: 32px; }
.block h2 { margin-bottom: 16px; font-size: 16px; line-height: 20px; }

/* Logos: an endless, slow marquee; two identical sets slide by exactly one set width */
.logos {
  overflow: hidden;
  color: var(--text-3);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 32px, #000 calc(100% - 32px), transparent);
          mask-image: linear-gradient(90deg, transparent, #000 32px, #000 calc(100% - 32px), transparent);
}
.logos-track { display: flex; width: max-content; animation: marquee 40s linear infinite; }
.logos:hover .logos-track { animation-play-state: paused; }
.logos-set { display: flex; align-items: center; gap: 24px; margin: 0; padding: 0 24px 0 0; list-style: none; }
.logos-set svg { display: block; height: 24px; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* Cases fill the rest of the screen, but stop at 1440px and stay centred in it */
.cases {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  max-width: 1440px;
  min-width: 0;
  justify-self: center;
}
.case { display: flex; flex-direction: column; gap: 16px; }
.case .shot { aspect-ratio: 2880 / 2048; }
.case .shot img { transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.case:hover .shot img { transform: scale(1.015); }
.case-text { display: flex; align-items: flex-start; gap: 10px; }
.case-text > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.case-text h2 { font-size: 16px; line-height: 20px; }
.case-text .link { white-space: nowrap; }
.case:hover .link { opacity: .75; }
.case:focus-visible { outline-offset: 6px; border-radius: calc(var(--radius) + 4px); }

/* Desktop: the left column spans the screen height, logo on top, info at the bottom */
@media (min-width: 1024px) {
  .aside {
    gap: 64px;
    justify-content: space-between;
    min-height: calc(100vh - 2 * var(--page-pad));
    min-height: calc(100dvh - 2 * var(--page-pad));
  }
}
/* …and stays in view while the cases scroll, when it fits the screen */
@media (min-width: 1024px) and (min-height: 760px) {
  .aside { position: sticky; top: var(--page-pad); align-self: start; }
}

/* Laptop: narrower side column */
@media (max-width: 1199px) {
  :root { --aside: 288px; --page-pad: 32px; --gap: 32px; }
}

/* Tablet: info on top in two columns, cases below */
@media (max-width: 1023px) {
  :root { --page-pad: 32px; }
  .page { grid-template-columns: minmax(0, 1fr); gap: 64px; }
  .aside { gap: 56px; }
  .info {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 40px;
    row-gap: 32px;
  }
  .info .block:first-child { grid-row: span 2; }
}

/* Phone: one column */
@media (max-width: 679px) {
  :root { --page-pad: 20px; }
  .page { gap: 48px; padding-top: 24px; }
  .aside { gap: 40px; }
  .info { display: flex; flex-direction: column; gap: 32px; }
}

/* ── Case study ───────────────────────────────────────── */

.study {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 64px;
  max-width: 900px;
  margin: 0 auto;
  padding: var(--page-pad);
  box-sizing: content-box;
}
.study > * { width: 100%; }
.study .shot { aspect-ratio: 4 / 3; }
.prose { max-width: 400px; display: flex; flex-direction: column; gap: 32px; }
.prose section, .intro { display: flex; flex-direction: column; gap: 16px; }
.intro { align-items: flex-start; }
.intro h1 { font-size: 24px; line-height: 32px; }
.prose h2 { font-size: 18px; line-height: 24px; }

.stats { display: flex; gap: 32px; margin: 0; }
.stats > div { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.stats dt { color: var(--text-2); }
.stats dd { margin: 0; font: 500 24px/32px "IBM Plex Serif", Georgia, serif; letter-spacing: -0.01em; white-space: nowrap; }

.metrics { width: 100%; border-collapse: collapse; border-bottom: 1px solid var(--line); }
.metrics th, .metrics td { padding: 8px 0; border-top: 1px solid var(--line); text-align: left; vertical-align: top; font-weight: 400; }
.metrics th, .metrics td:not(:last-child) { color: var(--text-2); }
.metrics th:first-child, .metrics td:first-child { width: 175px; padding-right: 12px; }

/* ── Page transitions ─────────────────────────────────── */
/* Same-origin navigations cross-fade; the case image (same view-transition-name on the card
   and on the case hero) flies between its two places. Browsers without support just navigate. */

@view-transition { navigation: auto; }

::view-transition-group(*) { animation-duration: .5s; animation-timing-function: cubic-bezier(.2, .7, .2, 1); }
::view-transition-old(root) { animation: .25s ease both vt-out; }
::view-transition-new(root) { animation: .45s cubic-bezier(.2, .7, .2, 1) .08s both vt-in; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(12px); } }

/* The card image is 2880:2048 and the hero is 4:3: crop instead of stretching while it morphs */
::view-transition-old(case-proxy), ::view-transition-new(case-proxy),
::view-transition-old(case-change), ::view-transition-new(case-change) {
  height: 100%;
  object-fit: cover;
  overflow: clip;
}
::view-transition-group(case-proxy), ::view-transition-group(case-change) { border-radius: var(--radius); overflow: clip; }

@media (prefers-reduced-motion: reduce) {
  .logos-track { animation: none; }
  @view-transition { navigation: none; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

@media (max-width: 679px) {
  .study { gap: 48px; padding-top: 24px; }
  .study .shot { border-radius: 12px; }
  .stats { gap: 16px; }
  .stats dd { font-size: 20px; line-height: 28px; }
  .metrics th:first-child, .metrics td:first-child { width: 48%; }
}
