:root {
  --paper: #fbfbfa;
  --ink: #0a0a0a;
  --body: #2b2b2b;
  --muted: #6e6e6e;
  --chip: #f0f0ee;
  --chip-hover: #e2e2df;
  --rule: #dededa;
  --shell: 1180px;
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, monospace;
}

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

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

body {
  margin: 0;
  padding: 0 24px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }

.shell { max-width: var(--shell); margin: 0 auto; }
.narrow { max-width: 900px; margin: 0 auto; }

.eyebrow {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- nav ---------- */

.nav-wrap {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  padding: 20px 0 8px;
  background: linear-gradient(var(--paper) 60%, rgba(251, 251, 250, 0));
}

.nav {
  display: flex;
  gap: 0;
  background: var(--chip);
  border-radius: 999px;
  padding: 4px;
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.nav a {
  display: block;
  padding: 8px 16px;
  border-radius: 999px;
  transition: background 0.18s ease, color 0.18s ease;
}

.nav a:hover { background: var(--chip-hover); }

/* The black pill marks the view you're currently in — nothing else. */
.nav a.current,
.nav a.current:hover { background: var(--ink); color: var(--paper); }

/* ---------- landing hero ---------- */

.hero { padding: 96px 0 0; text-align: center; }

.hero .greeting {
  margin: 0 0 26px;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(38px, 7vw, 76px);
  line-height: 1.06;
  letter-spacing: -0.03em;
  font-weight: 500;
  text-wrap: balance;
}

[data-typewriter].typing::after {
  content: "";
  display: inline-block;
  width: 0.07em;
  height: 0.92em;
  margin-left: 0.05em;
  vertical-align: -0.1em;
  background: currentColor;
  animation: caret 0.9s steps(1) infinite;
}

@keyframes caret {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

h2 {
  margin: 0;
  font-size: clamp(34px, 5.5vw, 58px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 500;
}

/* ---------- work grid ---------- */

.work { padding: 180px 0 0; scroll-margin-top: 80px; }
.work-head { text-align: center; }
.work-head p { margin: 14px 0 0; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 56px 48px;
  padding: 100px 0 0;
}

.tile-frame {
  overflow: hidden;
  background: #d9d9d9;
  aspect-ratio: 4 / 3;
}

.tile-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  will-change: transform;
}

.tile-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 14px 0 0;
}

.tile-meta .title { font-size: 15px; letter-spacing: -0.01em; }
.tile-meta .sub {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: right;
}

.tile:hover .title { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- about ---------- */

.about { padding: 200px 0 0; scroll-margin-top: 80px; }

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 48px;
  align-items: start;
}

.about h2 { font-weight: 400; font-size: clamp(32px, 4.5vw, 52px); line-height: 1; }
.about .intro { margin: 0; font-size: 17px; line-height: 1.45; max-width: 46ch; text-wrap: pretty; }

.roles { display: grid; gap: 64px; padding: 96px 0 0; }
.roles .period { margin: 0; font-size: 13px; letter-spacing: 0.09em; text-transform: uppercase; }
.roles .org { margin: 0 0 16px; font-size: 15px; font-weight: 600; line-height: 1.35; }
.roles .note { margin: 0; font-size: 15px; line-height: 1.45; max-width: 52ch; color: var(--body); text-wrap: pretty; }

/* ---------- contact + footer ---------- */

.contact { padding: 200px 0 0; text-align: center; }
.contact h2 { font-weight: 400; font-size: clamp(32px, 5vw, 54px); line-height: 1; }

.button {
  display: inline-block;
  margin: 40px 0 0;
  padding: 13px 26px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: background 0.18s ease;
}

.button:hover { background: #333; color: var(--paper); }

footer {
  padding: 140px 0 44px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

footer a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- case study ---------- */

.case-head { padding: 88px 0 0; }
.case-head h1 { margin: 28px 0 0; max-width: 20ch; font-size: clamp(36px, 6vw, 68px); }

.case-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 40px;
  padding: 32px 0 0;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.case-facts .dim { color: var(--muted); }

.case-body { padding: 88px 0 0; }

.case-body .sidebar { display: grid; gap: 34px; }
.case-body .sidebar p.label { margin: 0 0 10px; }
.case-body .sidebar p.value { margin: 0; font-size: 15px; line-height: 1.6; color: var(--body); }

.case-body .prose { display: grid; gap: 52px; }
.case-body .prose h3 {
  margin: 0 0 18px;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 500;
}
.case-body .prose p { margin: 0 0 18px; font-size: 17px; line-height: 1.5; max-width: 62ch; text-wrap: pretty; }
.case-body .prose p:last-child { margin-bottom: 0; }

.section { padding: 140px 0 0; }
.section > .eyebrow { margin-bottom: 20px; }

.media-stack { display: grid; gap: 24px; padding: 24px 0 0; }

/* Rows are grouped by orientation so like shapes sit together and each image
   keeps its own aspect ratio. */
.row { display: grid; gap: 24px; align-items: start; }
.row.cols-1 { grid-template-columns: 1fr; }
.row.cols-2 { grid-template-columns: repeat(2, 1fr); }
.row.cols-3 { grid-template-columns: repeat(3, 1fr); }

figure { margin: 0; }
figure img, figure video { width: 100%; height: auto; background: #ececea; }

.media-link { display: block; }
.media-link img { transition: opacity 0.18s ease; }
.media-link:hover img { opacity: 0.82; }

.row.cols-1 figure img, .row.cols-1 figure video {
  width: auto;
  max-width: 100%;
  max-height: 88vh;
  margin: 0 auto;
}
figcaption { margin: 10px 0 0; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

.film { background: #0a0a0a; }
.film video { width: 100%; }

.next {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
  padding: 28px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.next-text { display: flex; flex-direction: column; gap: 10px; }
.next .label { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.next .name { font-size: clamp(22px, 3vw, 34px); letter-spacing: -0.02em; }
.next .next-sub { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }

.next-thumb {
  width: 220px;
  /* height:auto is required — the HTML height attribute otherwise wins over
     aspect-ratio and the tile renders full-resolution tall. */
  height: auto;
  flex: none;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #d9d9d9;
  transition: opacity 0.18s ease;
}

.next:hover .name { text-decoration: underline; text-underline-offset: 4px; }
.next:hover .next-thumb { opacity: 0.75; }

/* ---------- motion ---------- */

@keyframes tile-reveal {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes tile-drift {
  from { transform: scale(1.09) translateY(-13px); }
  to { transform: scale(1.09) translateY(13px); }
}

/* Scroll-driven, guarded: unsupported browsers just show the grid as-is. */
@supports (animation-timeline: view()) {
  [data-reveal] {
    animation: tile-reveal linear both;
    animation-timeline: view();
    animation-range: entry 5% entry 55%;
  }
  [data-parallax] {
    animation: tile-drift linear both;
    animation-timeline: view();
    animation-range: cover 0% cover 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal], [data-parallax] { animation: none !important; }
  [data-typewriter].typing::after { animation: none; opacity: 0; }
}

/* ---------- responsive ---------- */

@media (max-width: 720px) {
  body { padding: 0 18px; }
  .hero { padding: 64px 0 0; }
  .work { padding: 120px 0 0; }
  .grid { gap: 40px 24px; padding: 64px 0 0; }
  .about, .contact { padding: 120px 0 0; }
  .split { grid-template-columns: 1fr; gap: 20px; }
  .roles { gap: 44px; padding: 64px 0 0; }
  .case-body { padding: 72px 0 0; }
  .case-body .split { gap: 44px; }
  .section { padding: 88px 0 0; }
  .row.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .row { gap: 16px; }
  .media-stack { gap: 16px; }
  .next { gap: 20px; }
  .next-thumb { width: 120px; }
  footer { padding: 88px 0 32px; flex-direction: column; gap: 10px; }
}
