/* Dark theme — values from the LANDING-3 / CASE STUDY-3 frames in Web Redesign.fig */
:root {
  color-scheme: dark;
  --paper: #000000;
  --ink: #ffffff;
  --body: #d2d2d2;
  --muted: #9a9a9a;
  /* The nav container is #d9d9d9 at 40%; flattened over black so whatever
     scrolls under the sticky nav can't tint it. */
  --chip: #575757;
  --chip-hover: #6e6e6e;
  --rule: #2b2b2b;
  --well: #141414;
  --radius: 20px;
  --gutter: 24px;
  --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;
  background: var(--paper);
}

body {
  margin: 0;
  padding: 0 var(--gutter);
  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%, transparent);
}

.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 solid 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; }

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

/* Hero hierarchy from the mock (1381px frame): 36px uppercase greeting over a
   96px headline set solid, both regular weight. Sizes keep that ratio. */
.hero .greeting {
  margin: 0 0 1.4em;
  font-size: clamp(16px, 2.6vw, 37px);
  line-height: 1.2;
  font-weight: 400;
  text-transform: uppercase;
}

.hero h1 {
  font-size: clamp(40px, 7vw, 100px);
  line-height: 1;
  letter-spacing: 0;
  font-weight: 400;
}

/* 86px circle beside 36px caps in the mock, centred on the cap height */
.avatar {
  display: inline-block;
  width: 2.4em;
  height: 2.4em;
  margin: 0 0.62em;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: -0.8em;
  background: var(--well);
  transition: opacity 0.3s ease, transform 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.25);
}

/* Typewriter: every character is laid out from the start and only fades in,
   so centred, wrapping lines never shift while they type. */
.typing .ch { opacity: 0; }
.typing .ch.on { opacity: 1; }
.typing .avatar { opacity: 0; transform: scale(0.6); }
.typing .avatar.on { opacity: 1; transform: none; }

.ch.caret { position: relative; }
.ch.caret::after {
  content: "";
  position: absolute;
  left: 100%;
  top: 0.08em;
  bottom: 0.04em;
  width: 0.07em;
  margin-left: 0.03em;
  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;
}

/* Featured Work entrance: tiles slide in from beyond the grid's edges, clipped to it */
.grid.assembling { overflow: hidden; overflow: clip; }

.tile-frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--well);
  aspect-ratio: 4 / 3;
  container-type: inline-size;
  /* WebKit drops the rounded clip on transformed children without this */
  -webkit-mask-image: -webkit-radial-gradient(white, black);
}

.tile-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  will-change: transform;
  transition: filter 0.3s ease;
}

/* Hover state from LANDING-3-OVERLAY: image blurred under 72% black, title,
   blurb, and a pill. Sizes are the frame's, scaled to the tile's width. */
.tile-over {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 8px;
  padding: 0 6.5% 5%;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  opacity: 0;
  transition: opacity 0.28s ease;
}

.over-title {
  font-size: 22px;
  font-size: clamp(18px, 6.4cqi, 32px);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.over-desc {
  max-width: 92%;
  font-size: 13px;
  font-size: clamp(12px, 3.2cqi, 16px);
  line-height: 1.4;
  text-wrap: pretty;
}

.over-cta {
  margin-top: 18px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #fff;
  color: #000;
  font-size: 10.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

@media (hover: hover) and (pointer: fine) {
  .tile:hover .tile-over,
  .tile:focus-visible .tile-over { opacity: 1; }
  .tile:hover .tile-frame img,
  .tile:focus-visible .tile-frame img { filter: blur(6px); }
}

.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: #d9d9d9; 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; }

/* fixed-width digits so the ticking seconds don't nudge the line */
.clock time { margin-left: 0.5em; font-variant-numeric: tabular-nums; }

/* ---------- 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;
  border-radius: var(--radius);
  background: var(--well);
}

/* Sized from the window rather than the page column: inset 15% on each side */
.bleed {
  display: grid;
  gap: 24px;
  width: calc(100% + 2 * var(--gutter));
  margin: 20px calc(-1 * var(--gutter)) 0;
  padding: 0 15vw;
}

.embed {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--well);
}
.embed iframe { display: block; width: 100%; height: 100%; border: 0; }

/* Images that read as one piece: full width, edge to edge, outer corners rounded */
.panel { display: grid; }
.panel figure img { border-radius: 0; }
.panel figure:first-child img {
  border-top-left-radius: var(--radius);
  border-top-right-radius: var(--radius);
}
.panel figure:last-child img {
  border-bottom-left-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
}

.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); }

.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;
  border-radius: 12px;
  background: var(--well);
  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-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-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-parallax] { animation: none !important; }
  .ch.caret::after { animation: none; opacity: 0; }
  .tile-over, .tile-frame img { transition: none; }
}

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

@media (max-width: 720px) {
  :root { --radius: 14px; --gutter: 18px; }
  .bleed { gap: 16px; padding: 0 var(--gutter); }
  .hero { padding: 64px 0 0; }
  .avatar { display: none; }
  .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); }
  /* beats the inline aspect-ratio columns: a portrait beside a wide image
     would be too narrow to read on a phone */
  .row.justified { grid-template-columns: 1fr !important; }
  .row { gap: 16px; }
  .media-stack { gap: 16px; }
  .next { gap: 20px; }
  .next-thumb { width: 120px; border-radius: 8px; }
  footer { padding: 88px 0 32px; flex-direction: column; gap: 10px; }
}
