/* Fonts are served from this site (see fonts/LICENSE.txt). Each file is a variable font. */
@font-face { font-family: "Big Shoulders Display"; src: url("/fonts/big-shoulders.woff") format("woff"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist"; src: url("/fonts/geist.woff") format("woff"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/fonts/geist-mono.woff") format("woff"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #0E0E10;
  --surface: #141417;
  --ink: #F3F1EC;
  --soft: #E2DFD8;
  --muted: #B8B5AE;
  --faint: #8E8B85;
  --line: rgba(243, 241, 236, 0.14);
  --line-strong: rgba(243, 241, 236, 0.4);
  --red: #FF3B30;
  --yellow: #FFC400;
  --blue: #2F7BFF;
  --plate-blend: screen;
  --grain-blend: screen;
  --solid-bg: #F3F1EC;
  --solid-ink: #0E0E10;
  --display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --body: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --sp: 1;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #F3F1EC;
  --surface: #FBFAF7;
  --ink: #141414;
  --soft: #2B2925;
  --muted: #4A4741;
  --faint: #66625A;
  --line: rgba(20, 20, 20, 0.14);
  --line-strong: rgba(20, 20, 20, 0.4);
  --red: #E8332A;
  --yellow: #F2B800;
  --blue: #1F5FD6;
  --plate-blend: multiply;
  --grain-blend: multiply;
  --solid-bg: #141414;
  --solid-ink: #F3F1EC;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--bar-h, 90px) - 24px); }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  margin: 0;
  transition: background-color 200ms ease, color 200ms ease;
}

a { color: inherit; }

.wrap {
  margin: 0 auto;
  max-width: 1200px;
  padding-left: clamp(20px, 5vw, 48px);
  padding-right: clamp(20px, 5vw, 48px);
}

.label {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.display {
  font-family: var(--display);
  font-weight: 900;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

/* Interaction rules
   Text link (.t-link): the color split appears on the text itself.
   Button (.btn): the color split appears on the button box.
   Both give a stronger split for a moment when clicked. */
.t-link {
  text-decoration: none;
  transition: text-shadow 200ms ease, transform 200ms ease;
}

.t-link:hover {
  text-shadow: -2px 0 0 var(--red), 2px 0 0 var(--blue), 0 -2px 0 var(--yellow);
}

.t-link:active {
  text-shadow: -4px 0 0 var(--red), 4px 1px 0 var(--blue), 0 -3px 0 var(--yellow);
  transform: translateY(1px);
  transition-duration: 60ms;
}

.t-link.underline {
  border-bottom: 2px solid currentColor;
  padding-bottom: 3px;
}

.btn {
  align-items: center;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 600;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  text-decoration: none;
  transition: box-shadow 200ms ease, transform 200ms ease;
}

.btn-solid {
  background: var(--solid-bg);
  border-color: var(--solid-bg);
  color: var(--solid-ink);
}

.btn:hover {
  box-shadow: -3px 0 0 var(--red), 3px 2px 0 var(--blue), 0 -3px 0 var(--yellow);
  transform: translate(1px, -1px);
}

.btn:active {
  box-shadow: -6px 0 0 var(--red), 6px 3px 0 var(--blue), 0 -5px 0 var(--yellow);
  transform: translate(0, 1px);
  transition-duration: 60ms;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 26px;
  transition: box-shadow 200ms ease, transform 200ms ease;
}

.card:hover {
  box-shadow: -3px 0 0 var(--red), 3px 2px 0 var(--blue), 0 -3px 0 var(--yellow);
  transform: translate(1px, -1px);
}

.skip-link {
  background: var(--solid-bg);
  color: var(--solid-ink);
  font-weight: 600;
  left: 16px;
  padding: 12px 18px;
  position: absolute;
  top: -80px;
  z-index: 100;
}

.skip-link:focus { top: 16px; }

.site-nav a[aria-current="true"] {
  border-bottom: 2px solid currentColor;
  padding-bottom: 2px;
}

.t-link:focus-visible,
.btn:focus-visible,
.skip-link:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

/* Header */
.site-bar {
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 40;
}

.site-header {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  padding-bottom: 24px;
  padding-top: 24px;
}

.brand {
  align-items: center;
  display: inline-flex;
  font-family: var(--mono);
  font-size: 14px;
  gap: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.swatches { display: inline-flex; gap: 3px; }
.swatches span { height: 8px; width: 8px; }

.site-nav {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  font-size: 15px;
  font-weight: 500;
  gap: 24px;
}

.theme-toggle {
  border-radius: 999px;
  height: 44px;
  justify-content: center;
  min-height: 44px;
  padding: 0;
  width: 44px;
}

.theme-toggle svg {
  fill: none;
  height: 18px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 18px;
}

.icon-moon { display: none; }
:root[data-theme="light"] .icon-sun { display: none; }
:root[data-theme="light"] .icon-moon { display: block; }

/* Hero */
.hero {
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding-bottom: clamp(64px, 9vw, 112px);
  padding-top: clamp(64px, 11vw, 132px);
}

.hero h1 {
  font-size: clamp(56px, 15.6vw, 200px);
  isolation: isolate;
  line-height: 0.92;
  margin: 0;
  position: relative;
}

.plates {
  inset: 0;
  pointer-events: none;
  position: absolute;
  user-select: none;
}

.plate {
  inset: 0;
  mix-blend-mode: var(--plate-blend);
  position: absolute;
}

.plate-y { animation: driftY 6s ease-in-out infinite alternate; color: var(--yellow); transform: translate(calc(var(--sp) * -5px), 0); }
.plate-r { animation: driftR 8s ease-in-out infinite alternate; color: var(--red); transform: translate(calc(var(--sp) * -2px), calc(var(--sp) * 1px)); }
.plate-b { animation: driftB 10s ease-in-out infinite alternate; color: var(--blue); transform: translate(calc(var(--sp) * 4px), 0); }

.ink { color: var(--ink); display: block; position: relative; }

@keyframes driftY {
  0% { transform: translate(calc(var(--sp) * -5px), 0); }
  50% { transform: translate(calc(var(--sp) * -9px), calc(var(--sp) * 3px)); }
  100% { transform: translate(calc(var(--sp) * -3px), calc(var(--sp) * -3px)); }
}

@keyframes driftR {
  0% { transform: translate(calc(var(--sp) * -2px), calc(var(--sp) * 1px)); }
  50% { transform: translate(calc(var(--sp) * 2px), calc(var(--sp) * 5px)); }
  100% { transform: translate(calc(var(--sp) * -5px), calc(var(--sp) * -2px)); }
}

@keyframes driftB {
  0% { transform: translate(calc(var(--sp) * 4px), 0); }
  50% { transform: translate(calc(var(--sp) * 8px), calc(var(--sp) * -3px)); }
  100% { transform: translate(calc(var(--sp) * 3px), calc(var(--sp) * 4px)); }
}

.hero-row {
  align-items: flex-end;
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  justify-content: space-between;
}

.tagline {
  color: var(--soft);
  flex: 1 1 420px;
  font-size: clamp(20px, 2.2vw, 26px);
  line-height: 1.45;
  margin: 0;
  max-width: 620px;
}

.actions { display: flex; flex-wrap: wrap; gap: 14px; }

.facts {
  border-top: 1px solid var(--line);
  display: grid;
  font-family: var(--mono);
  font-size: 13px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin: 0;
}

.facts div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 20px 0 0;
}

.facts dt { color: var(--faint); letter-spacing: 0.1em; text-transform: uppercase; }
.facts dd { margin: 0; }

/* Sections */
section.block {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding-bottom: 56px;
  padding-top: 56px;
}

.section-head {
  align-items: baseline;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 20px;
  padding-bottom: 16px;
}

.section-head h2 {
  font-size: clamp(36px, 5vw, 72px);
  line-height: 1;
  margin: 0;
}

.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.card h3 { font-size: 19px; font-weight: 600; line-height: 1.3; margin: 0; }
.card p { color: var(--muted); margin: 0; }

.work-card { gap: 12px; padding: 30px; }
.work-card .num {
  font-family: var(--display);
  font-size: 56px;
  font-weight: 900;
  line-height: 1;
  text-shadow: -3px 0 0 var(--red), 3px 1px 0 var(--blue), 0 -2px 0 var(--yellow);
}
.work-card h3 { font-size: 24px; }
.work-card .result { color: var(--ink); font-family: var(--mono); font-size: 14px; margin-top: auto; padding-top: 8px; }

.chips {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 14px;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.chips li { border: 1px solid var(--line-strong); border-radius: 4px; padding: 6px 12px; }
/* Tools: one line that scrolls slowly in a loop, pausing on hover. */
.tools { align-items: center; display: flex; gap: 16px; min-width: 0; }
.tools-label { flex: none; }
.tools-window {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.tools-track { animation: tools-scroll 40s linear infinite; display: flex; width: max-content; }
.tools-track .chips { flex-wrap: nowrap; padding-right: 10px; white-space: nowrap; }
.tools-window:hover .tools-track { animation-play-state: paused; }
@keyframes tools-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

@media (max-width: 560px) {
  .tools { align-items: flex-start; flex-direction: column; gap: 10px; }
  .tools-window { width: 100%; }
}

.principles { display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.principle { display: flex; flex-direction: column; gap: 8px; }
.principle .bar { height: 6px; width: 28px; }
.principle strong { font-size: 21px; font-weight: 600; }
.principle span:last-child { color: var(--muted); }

.timeline { display: flex; flex-direction: column; list-style: none; margin: 0; padding: 0; }
.timeline li {
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 40px;
  padding: 24px 0;
}
.timeline .when { color: var(--faint); flex: 0 0 200px; font-family: var(--mono); font-size: 14px; padding-top: 4px; }
.timeline .what { display: flex; flex: 999 1 420px; flex-direction: column; gap: 6px; min-width: 0; }
.timeline .role { font-size: 20px; font-weight: 600; }
.timeline .detail { color: var(--muted); }

.contact { display: flex; flex-direction: column; gap: 28px; padding-bottom: 96px; padding-top: 72px; }
.contact h2 {
  font-size: clamp(48px, 8vw, 130px);
  isolation: isolate;
  line-height: 0.95;
  margin: 0;
  position: relative;
}

/* The plates only move while their heading is on screen. */
.is-offscreen .plate { animation-play-state: paused; }
.contact p { color: var(--soft); font-size: 19px; margin: 0; max-width: 580px; }

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--faint);
  display: flex;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 13px;
  gap: 12px;
  justify-content: space-between;
  padding-bottom: 104px;
  padding-top: 28px;
}

.rotator .pick {
  align-self: flex-start;
  font-size: 18px;
  font-weight: 600;
  transition: opacity 180ms ease;
}

.rotator .pick.is-swapping {
  opacity: 0;
  text-shadow: -4px 0 0 var(--red), 4px 1px 0 var(--blue), 0 -3px 0 var(--yellow);
}

.grain {
  height: 100%;
  inset: 0;
  mix-blend-mode: var(--grain-blend);
  opacity: 0.05;
  pointer-events: none;
  position: fixed;
  width: 100%;
  z-index: 50;
}

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

@media (max-width: 560px) {
  .site-nav { font-size: 14px; gap: 14px; }
  .site-header { gap: 6px 16px; padding-bottom: 10px; padding-top: 10px; }
  .theme-toggle { height: 38px; min-height: 38px; width: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .plate { animation: none; }
  .tools-track { animation: none; }
  .tools-track .chips[aria-hidden="true"] { display: none; }
  .tools-window { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
  .t-link, .btn, .card, body { transition: none; }
}

/* Easter egg: five clicks on a name. */
body { overflow-x: clip; }

.is-misprinting .plate { animation: misprint 2.2s cubic-bezier(0.3, 0.7, 0.2, 1) both; }

@keyframes misprint {
  0% { transform: translate(0, 0) rotate(0); }
  14% { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); }
  34% { transform: translate(calc(var(--dx) * 1.1), calc(var(--dy) * 0.9)) rotate(calc(var(--rot) * 1.15)); }
  60% { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); }
  74% { transform: translate(calc(var(--dx) * -0.12), calc(var(--dy) * -0.12)) rotate(calc(var(--rot) * -0.2)); }
  86% { transform: translate(calc(var(--dx) * 0.04), calc(var(--dy) * 0.04)) rotate(0); }
  100% { transform: translate(0, 0) rotate(0); }
}

/* Case study pages */
.hero h1.case-title { font-size: clamp(48px, 10vw, 132px); }

.back { align-self: flex-start; font-family: var(--mono); font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; }

.case-lede { color: var(--soft); font-size: clamp(20px, 2.2vw, 26px); line-height: 1.45; margin: 0; max-width: 760px; }

.stats { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.stat { align-items: flex-start; }
.stat .figure {
  font-family: var(--display);
  font-size: clamp(64px, 8vw, 104px);
  font-weight: 900;
  line-height: 0.95;
  text-shadow: -3px 0 0 var(--red), 3px 1px 0 var(--blue), 0 -3px 0 var(--yellow);
}
.stat p { color: var(--soft); max-width: 26ch; }

.prose { display: flex; flex-direction: column; gap: 18px; max-width: 720px; }
.prose p { color: var(--soft); font-size: 19px; line-height: 1.65; margin: 0; }
.prose strong { color: var(--ink); font-weight: 600; }

.compare { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.compare ul { color: var(--muted); display: flex; flex-direction: column; gap: 10px; margin: 0; padding-left: 20px; }
.compare .label { color: var(--faint); }

.case-end { align-items: flex-start; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 24px; padding-bottom: 96px; padding-top: 56px; }
.case-end h2 { font-size: clamp(32px, 4.5vw, 60px); line-height: 1; margin: 0; }

/* Floating email button, bottom right on every page. */
.fab {
  background: var(--solid-bg);
  border-color: var(--solid-bg);
  border-radius: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  color: var(--solid-ink);
  height: 56px;
  justify-content: center;
  min-height: 56px;
  padding: 0;
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  width: 56px;
  z-index: 45;
}

.fab svg {
  fill: none;
  height: 24px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 24px;
}

/* Easter egg: a hidden spot in the footer. Clicking it shows the character for a moment, then the spot moves. */
.site-footer { position: relative; }
.egg-spot { height: 30px; position: absolute; width: 30px; z-index: 5; }
.egg-pop {
  bottom: 100%;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  transform: translateY(6px);
  transition: opacity 180ms ease, transform 180ms ease, visibility 0s linear 180ms;
  user-select: none;
  visibility: hidden;
  width: 84px;
  z-index: 20;
}
.egg-pop.is-on { opacity: 1; transform: none; transition-delay: 0s; visibility: visible; }
.egg-pop img { display: block; height: 184px; image-rendering: pixelated; width: 84px; }
.egg-bubble {
  background: #fff;
  border: 2px solid #5d5d66;
  border-radius: 16px;
  box-shadow: 0 2px 0 #b9b9c2, inset 0 -3px 0 #e3e3ea;
  color: #222;
  font: 600 13px/1.2 var(--mono);
  left: 92px;
  padding: 8px 14px;
  position: absolute;
  top: 0;
  white-space: nowrap;
}
.egg-bubble::before {
  background: #fff;
  border-bottom: 2px solid #5d5d66;
  border-left: 2px solid #5d5d66;
  content: "";
  height: 10px;
  left: -7px;
  position: absolute;
  top: 12px;
  transform: rotate(45deg);
  width: 10px;
}
.egg-pop.is-flipped .egg-bubble { left: auto; right: 92px; }
.egg-pop.is-flipped .egg-bubble::before {
  border-bottom: 0;
  border-left: 0;
  border-right: 2px solid #5d5d66;
  border-top: 2px solid #5d5d66;
  left: auto;
  right: -7px;
}
@media (prefers-reduced-motion: reduce) { .egg-pop { transition: none; transform: none; } }
