@import url("https://fonts.googleapis.com/css2?family=Inter+Tight:wght@400;500;600;700&display=swap");

:root {
  --bg: #ffffff;
  --ink: #131313;
  --gray: #6b6b6b;
  --gray-light: #b0b0b0;
  --line: #e7e7e4;
  --highlight: #fff1a8;
  --site-gap: 32px;
  --page-top: 120px;
  --max-width: 960px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

/* ---------- Cursor stardust trail ---------- */

.stardust-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
}

/* Each particle is a tiny black glyph — dots, little plus marks, sparkles —
   kept small and faint for a subtle dreamcore trail. */
.stardust {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  user-select: none;
  will-change: transform, opacity;
  color: #000;
  line-height: 1;
  font-weight: 400;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Helvetica Neue", "Helvetica", Arial, sans-serif;
  font-stretch: normal;
  letter-spacing: 0;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 8px;
}

.content-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 48px;
}

/* ---------- Header ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 8px 0;
  padding-inline: 16px;
}

.site-header .logo-name {
  font-weight: 400;
  font-size: 15px;
}

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-size: 14px;
  color: var(--gray);
  transition: color 0.2s var(--ease);
}

.nav-icon {
  width: 18px;
  height: 18px;
  display: inline-block;
  vertical-align: middle;
}

.nav-links a:hover {
  color: var(--ink);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  gap: 5px;
  width: 32px;
  height: 32px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1001;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition:
    transform 0.25s var(--ease),
    opacity 0.25s var(--ease),
    width 0.25s var(--ease);
}

.nav-toggle.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
  width: 100%;
}

.nav-toggle.is-open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
  width: 100%;
}

/* ---------- Hero ---------- */

.hero {
  padding: 120px 0 90px;
}

.hero h1 {
  font-size: clamp(32px, 5.5vw, 52px);
  font-weight: 400;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}

.wave {
  display: inline-block;
  margin-left: 10px;
  animation: wave 2.4s ease-in-out infinite;
  transform-origin: 70% 70%;
}

/* ---------- Hero typewriter ---------- */

/* Reserve one line's height so the paragraphs below don't jump while the
   heading is empty at the start of the type-in. */
.hero-type {
  min-height: 1.05em;
}

.hero-type .typed {
  /* keep spaces from collapsing as they're typed, but still allow wrapping */
  white-space: pre-wrap;
}

/* The single underscore caret that rides the typing head and blinks. It
   sits on the baseline (bottom of the letters); once typing finishes it
   fades out so no underscore is left behind. */
.type-caret {
  display: inline-block;
  width: 0.55em;
  margin-left: 1px;
  border-bottom: 2px solid var(--ink);
  vertical-align: baseline;
  animation: type-blink 0.9s steps(1, end) infinite;
}

/* When the sentence is finished, the underscore stays put after the period
   and flickers twice before the loop restarts. A separate keyframe name (not
   the riding blink) forces the flicker to start cleanly from frame zero. */
.type-caret.is-final {
  animation: type-flicker 0.5s steps(1, end) 2;
}

@keyframes type-blink {
  0%,
  50% {
    opacity: 1;
  }
  50.01%,
  100% {
    opacity: 0;
  }
}

@keyframes type-flicker {
  0%,
  50% {
    opacity: 1;
  }
  50.01%,
  100% {
    opacity: 0;
  }
}

@keyframes wave {
  0%,
  60%,
  100% {
    transform: rotate(0deg);
  }
  10% {
    transform: rotate(14deg);
  }
  20% {
    transform: rotate(-8deg);
  }
  30% {
    transform: rotate(14deg);
  }
  40% {
    transform: rotate(-4deg);
  }
}

.hero .rotator-line {
  font-size: clamp(32px, 5.5vw, 52px);
  font-weight: 400;
  letter-spacing: -0.02em;
}

.rotator-wrap {
  display: inline-block;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 2px;
  vertical-align: baseline;
}

.rotator {
  display: inline-block;
  color: var(--ink);
  transition: opacity 0.35s var(--ease);
}

.rotator.swap {
  opacity: 0;
}

/* ---------- Reveal on scroll ---------- */

.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition:
    opacity 1s var(--ease),
    transform 1s var(--ease);
  transition-delay: var(--delay, 0s);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Cards ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--site-gap);
  padding: 32px 0 120px;
}
.card {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 72px 32px;
  min-height: 240px;
  font-size: 30px;
  font-weight: 400;
  background: #fff;
  transition:
    border-color 0.25s var(--ease),
    transform 0.25s var(--ease),
    box-shadow 0.25s var(--ease);
}
.card:hover {
  border-color: var(--ink);
  transform: translateY(-4px);
  box-shadow: 0 18px 30px -20px rgba(0, 0, 0, 0.35);
}

/* ---------- Worked at + Recommendation ---------- */

.section-label {
  font-size: 38px;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

.worked-at-rec {
  padding: 40px 0 40px;
}

.what-people-say {
  padding: 40px 0 120px;
}

.wa-label {
  margin-bottom: 20px;
}

.logo-grid {
  width: 100%;
}

.logo-mask {
  position: relative;
  overflow: hidden;
  width: 100%;
  display: flex;
  align-items: center;
}

.logo-mask::before,
.logo-mask::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 96px;
  pointer-events: none;
  z-index: 1;
}

.logo-mask::before {
  left: 0;
  background: linear-gradient(to right, var(--bg), rgba(255, 255, 255, 0));
}

.logo-mask::after {
  right: 0;
  background: linear-gradient(to left, var(--bg), rgba(255, 255, 255, 0));
}

.logo-track {
  display: flex;
  gap: 72px;
  align-items: center;
  width: max-content;
  animation: logo-scroll 22s linear infinite;
  will-change: transform;
}

.logo-item {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 220px;
}

.logo-item img {
  max-width: 100%;
  max-height: 90px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.logo-more {
  margin-top: 28px;
  color: var(--gray-light);
  font-size: 14px;
  text-align: right;
}

@keyframes logo-scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.recommendations {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--site-gap);
  margin-top: 56px;
  align-items: start;
}

.what-people-say .recommendations {
  margin-top: 0;
}

.recommendation-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
}

.rec-card {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
  background: #fff;
  font-family: "Helvetica Neue", "Helvetica", Arial, sans-serif;
  font-stretch: normal;
}

.rec-head {
  display: flex;
  align-items: flex-start;
  min-height: 72px;
  gap: 14px;
  margin-bottom: 18px;
}

.rec-head img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.rec-name {
  font-weight: 400;
  font-size: 15px;
}

.rec-title {
  font-size: 13px;
  color: var(--gray);
}

.rec-quote {
  font-family: "Helvetica Neue", "Helvetica", Arial, sans-serif;
  font-weight: 400;
  font-size: 15px;
  line-height: 1.8;
  margin: 0;
}

.rec-quote-block {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 24px 0;
}

.rec-quote-block .quote-mark-open {
  position: absolute;
  left: 0;
  top: 0;
  margin-top: 0;
}

.rec-quote {
  flex: 1;
  margin: 18px 0 0;
}

.rec-excerpt {
  margin-top: 0;
  font-size: 13px;
  color: var(--gray);
  text-align: right;
}

.rec-quote mark {
  background: transparent;
  color: inherit;
  padding: 0;
  border-radius: 0;
}

.quote-mark {
  display: block;
  color: var(--gray-light);
}

.quote-mark-open,
.quote-mark-close {
  font-family: "Helvetica Neue", "Helvetica", Arial, sans-serif;
  font-weight: 400;
  font-size: 64px;
  line-height: 0.9;
}

.quote-mark-open {
  margin-bottom: 6px;
  text-align: left;
}

.quote-mark-close {
  margin-top: 4px;
  text-align: right;
}

.rec-excerpt {
  margin-top: 8px;
  font-size: 13px;
  color: var(--gray);
  text-align: right;
}

/* ---------- Connect section ---------- */
.connect-section {
  padding: 0 0 120px;
}

.connect-body p {
  color: var(--gray);
  font-size: 15px;
  max-width: 720px;
  margin: 0 0 12px 0;
}

.connect-email a {
  color: var(--gray);
  text-decoration: none;
  font-weight: 400;
}

/* ---------- Project cards (projects.html) ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: calc(var(--site-gap) * 3);
  margin: var(--site-gap) 0 calc(var(--site-gap) * 2);
}

.project-cards {
  padding-bottom: 40px;
}

.project-cards .back-link {
  margin-bottom: var(--site-gap);
}

/* Increase bottom gap for the back link on the Projects page */
.project-cards .back-link {
  margin-bottom: calc(var(--site-gap) * 2);
}

.project-card {
  display: flex;
  flex-direction: column;
  height: 340px;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
  text-decoration: none;
  color: inherit;
}

.project-card .card-media {
  flex: 0 0 66.666%;
  overflow: hidden;
  background: #f3f3f3;
}

.project-card .card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-card .card-content {
  flex: 0 0 33.333%;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.card-title {
  font-size: 18px;
  font-weight: 400;
  line-height: 1.1;
}

.card-subtitle {
  font-size: 13px;
  color: var(--gray);
  margin-top: 6px;
  font-weight: 400;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 40px;
}

.site-footer .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-inline: 16px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.site-footer .logo-name {
  font-weight: 400;
  font-size: 14px;
}

.site-footer .nav-links {
  gap: 20px;
}

.site-footer .nav-links a {
  font-size: 13px;
}

/* ---------- Simple content pages ---------- */

.about-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 100px;
  align-items: start;
  padding: var(--page-top) 0 120px;
  min-height: 60vh;
}

/* This is now the first section on the home page, so it needs to clear the header itself. */
.about-panel--home {
  padding: 80px 0 60px; /* space above/below the hero section — adjust these two numbers to taste */
  min-height: auto;
}

.about-panel--home .about-image {
  margin-top: 60px; /* sits a little higher than the first paragraph, closer to the heading */
}

.about-copy {
  max-width: 760px;
}

.about-copy h1,
.page-body h1 {
  font-size: clamp(32px, 4.5vw, 44px);
  font-weight: 400;
  margin: 0 0 60px;
  line-height: 1.05;
  color: var(--ink);
}

.page-body {
  padding: var(--page-top) 0 18px;
  min-height: 40vh;
}

.about-copy p {
  color: var(--gray);
  font-size: 16px;
  line-height: 1.85;
  margin: 0 0 24px;
}

.about-image {
  display: block;
  width: 100%;
  margin-top: 112px;
}

.about-image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 5px;
  object-fit: contain;
}

.back-link {
  display: inline-block;
  margin: 40px 0 var(--site-gap);
  font-size: 14px;
  border-bottom: 1px solid var(--ink);
}

/* ---------- Case Study Layout ---------- */

.case-study-page {
  padding: 0 0 120px;
}

.case-study-hero,
.case-study-section {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(0px, 4.5vw, 72px);
  align-items: start;
  padding: 80px 0; /* space above/below each section — adjust this to taste */
}

.case-study-hero {
  padding: 56px 0 60px; /* space above/below the hero — kept tight so it fits one viewport height */
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.3fr);
}

.case-study-hero .case-study-media img {
  max-width: 100%;
  object-fit: contain;
}

.case-study-hero .case-study-media--pair img {
  max-width: 220px;
}

.case-study-media.case-study-media--small img {
  max-width: 220px;
}

.case-study-section.section--reverse .case-study-copy {
  order: 2;
}

.case-study-section.section--reverse .case-study-media {
  order: 1;
}

.case-study-section--split {
  grid-template-columns: 1fr 1fr;
}

.case-study-section--media-large {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.case-study-section--media-large.section--reverse {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
}

/* Text-only variant for case studies without accompanying images */
.case-study-hero--full,
.case-study-section--full {
  grid-template-columns: 1fr;
}

.case-study-hero--full {
  padding: var(--page-top) 0 80px; /* matches the top spacing used on about.html etc. */
}

.case-study-hero--full .case-study-copy,
.case-study-section--full .case-study-copy {
  max-width: 720px;
  width: 100%;
  margin: 0;
}

.case-study-copy.case-study-copy--wide {
  max-width: none;
}

.case-study-copy.case-study-copy--900 {
  max-width: 900px;
}

/* Wider media column for sections with an image grid instead of a single image */
.case-study-section--grid-media {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.2fr);
}

.case-study-section--grid-media.section--reverse {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.1fr);
}

/* Editorial two-column text flow */
.case-study-columns {
  column-count: 2;
  column-gap: 56px;
}

.case-study-columns p,
.case-study-columns ul,
.case-study-columns li {
  break-inside: avoid;
}

.eyebrow,
.section-index {
  display: inline-block;
  margin: 0 0 28px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gray);
}

.case-study-copy h1 {
  margin: 0 0 28px;
  font-size: clamp(24px, 3.4vw, 40px);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.case-study-copy h1 .h1-small {
  font-size: 0.7em;
}

.case-study-copy h2 {
  margin: 0 0 28px;
  font-size: clamp(24px, 3.4vw, 28px);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

/* Larger section heading variant — still regular weight, no italics */
.case-study-copy h2.case-study-heading {
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 400;
  font-style: normal;
}

.case-study-copy p:not(.eyebrow):not(.section-index),
.case-study-copy strong {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
  margin: 0 0 16px;
}

.case-study-copy p.subhead:not(.eyebrow):not(.section-index) {
  margin-top: 32px; /* more space after the preceding paragraph */
  margin-bottom: 8px; /* tighter space before the bullet list */
}

.case-study-copy p.section-index + p.subhead:not(.eyebrow):not(.section-index) {
  margin-top: 0; /* no preceding paragraph here, so no extra top space needed — keeps it level with the image */
}

.case-study-copy li {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
  margin: 0 0 16px;
}

.case-study-copy .lead {
  font-size: 18px;
  color: var(--ink);
}

.case-study-list {
  margin: 8px 0 0;
  padding-left: 18px;
}

.case-study-list li {
  margin-bottom: 10px;
}

.case-study-media {
  display: flex;
  justify-content: center;
  margin-top: 49px; /* offsets the eyebrow/section-index label so the image lines up with the heading, not the label */
}

.case-study-media img {
  width: 100%;
  max-width: 560px;
  height: auto;
  display: block;
  border-radius: 24px;
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px -34px rgba(0, 0, 0, 0.28);
}

.case-study-media--large img {
  max-width: 640px;
}

.case-study-media--pair {
  justify-content: flex-end;
  gap: 20px;
}

.case-study-media--pair img {
  max-width: 200px;
  flex: 1 1 0;
  min-width: 0;
}

/* Before/after screenshot pair, placed inline right after the paragraph it illustrates */
.case-study-image-pair {
  display: flex;
  gap: 24px;
  margin: 24px 0 48px;
}

.case-study-image-pair img {
  flex: 1;
  width: 50%;
  height: auto;
  display: block;
  border-radius: 24px;
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px -34px rgba(0, 0, 0, 0.28);
}

.case-study-image-pair.case-study-image-pair--small img {
  flex: none;
  width: 210px;
  max-width: 210px;
}

/* Before & After: mile redeem on the left, flight choosing on the right */
.before-after-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 48px;
  row-gap: 16px;
  margin-top: 24px;
}

.before-after-grid .case-study-image-pair {
  margin: 0;
}

/* The source order is paragraph → its screenshots → paragraph → its
   screenshots, so it reads in the right order when this collapses to one
   column on mobile. On the web the grid is explicitly placed to keep the
   original arrangement: both paragraphs on the top row, both screenshot
   pairs on the row beneath them. */
@media (min-width: 901px) {
  .before-after-grid > :nth-child(1) {
    grid-area: 1 / 1;
  }

  .before-after-grid > :nth-child(2) {
    grid-area: 2 / 1;
  }

  .before-after-grid > :nth-child(3) {
    grid-area: 1 / 2;
  }

  .before-after-grid > :nth-child(4) {
    grid-area: 2 / 2;
  }
}

@media (max-width: 900px) {
  /* minmax(0, 1fr) rather than 1fr: a bare 1fr keeps an automatic
     min-content floor, and the screenshots inside are wide enough to push
     the column past the screen. */
  .before-after-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }

  .before-after-grid > * {
    min-width: 0;
  }
}

.case-study-media--stack {
  flex-direction: column;
  gap: 24px;
}

.case-study-media--grid4 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: 100%;
}

.case-study-media--grid4 img {
  max-width: none;
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  border: none;
  box-shadow: none;
  border-radius: 16px;
}

/* Keep clockwise order (top-left, top-right, bottom-right, bottom-left)
   despite the default row-major grid auto-placement. */
.case-study-media--grid4 img:nth-child(3) {
  grid-row: 2;
  grid-column: 2;
}

.case-study-media--grid4 img:nth-child(4) {
  grid-row: 2;
  grid-column: 1;
}

/* Full-bleed standalone images between sections */
.case-study-image-band {
  padding: 40px 0 80px;
}

.case-study-image-band img,
.case-study-image-group img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 24px;
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px -34px rgba(0, 0, 0, 0.28);
}

.case-study-image-group {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 40px 0 80px;
}

/* ---------- Responsive ---------- */

/* Single mobile breakpoint for the whole site: 900px.
   Anything wider keeps the desktop layout exactly as-is. */
@media (max-width: 900px) {
  .case-study-hero,
  .case-study-section {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 56px 0;
  }

  .case-study-section.section--reverse .case-study-copy,
  .case-study-section.section--reverse .case-study-media {
    order: initial;
  }

  .case-study-media img {
    max-width: 100%;
  }

  .case-study-columns {
    column-count: 1;
  }

  .worked-at-rec {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    row-gap: 48px;
  }

  .wa-label {
    grid-column: 1;
    grid-row: 1;
  }

  .logo-grid {
    grid-column: 1;
    grid-row: 2;
  }

  .rec-card {
    grid-column: 1;
    grid-row: 3;
  }
}

@media (max-width: 900px) {
  .cards {
    grid-template-columns: 1fr;
  }

  .site-header {
    padding-top: 24px;
  }

  .nav-toggle {
    display: flex;
  }

  .site-header nav {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-12px);
    transition:
      opacity 0.25s var(--ease),
      transform 0.25s var(--ease);
    z-index: 1000;
  }

  .site-header nav.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .nav-links {
    flex-direction: column;
    align-items: center;
    gap: 28px;
  }

  .nav-links a {
    font-size: 22px;
  }

  .hero {
    padding: 80px 0 60px;
  }

  .content-wrap {
    padding: 0 32px;
  }

  .logo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .logo-more {
    grid-column: auto;
    grid-row: auto;
    justify-self: center;
    margin-top: 10px;
  }
}

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

.case-study-meta {
  list-style: none;
  margin: 28px 0 0;
  padding: 24px 0 0;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
}

.case-study-meta li {
  display: flex;
  gap: 12px;
  font-size: 14px;
  color: var(--ink);
  line-height: 1.5;
}

.case-study-meta-label {
  flex: 0 0 80px;
  color: var(--gray);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 12px;
  padding-top: 1px;
}

.case-study-meta-value {
  flex: 1 1 auto;
  min-width: 0;
}

.case-study-quote {
  font-size: 20px;
  font-style: italic;
  line-height: 1.5;
  color: var(--ink);
  border-left: 2px solid var(--line);
  padding-left: 20px;
  margin: 8px 0 16px;
}

.case-study-media--trio {
  gap: 16px;
}

.case-study-media--trio img {
  flex: 1 1 0;
  min-width: 0;
  max-width: 220px;
}

/* Portrait app-demo videos — sit on the media side like a phone screen,
   same rounded/bordered/shadowed treatment as the screenshot images. */
.case-study-media--video video {
  width: 100%;
  max-width: 260px;
  height: auto;
  display: block;
  border-radius: 24px;
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px -34px rgba(0, 0, 0, 0.28);
}

/* Embedded interactive prototype (e.g. a Figma embed) — fills the media
   column at a 16:9 ratio with the same quiet border treatment. */
.case-study-media--embed {
  align-self: start;
}

.case-study-media--embed .figma-embed {
  width: 100%;
  max-width: 560px;
  aspect-ratio: 16 / 9;
  height: auto;
  display: block;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
}

/* Every section on this page fills the viewport height, content centered within it.
   The hero is excluded so its top spacing matches the other case-study pages. */
.kala-page .case-study-section {
  min-height: 100vh;
  align-items: center;
}

/* Text column wider, tighter gap to the images (except the 3-image feature sections) */
.kala-page .case-study-section {
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 40px;
}

.kala-page .case-study-section--features {
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
}

/* Short text-only intro blurb right after the hero — doesn't need a full
   viewport of centering space above/below it like the other sections */
.kala-page .case-study-section.case-study-section--overview {
  min-height: 0;
  padding: 24px 0 32px;
}

@media (max-width: 900px) {
  .kala-page .case-study-section {
    min-height: auto;
  }
}

/* =========================================================
   MOBILE LAYOUT — 900px and below
   ---------------------------------------------------------
   Nothing in here fires above 900px, so the web layout is
   untouched. The shape of the mobile page:

   - The page sits in one 80vw column, centred.
   - Sections that put text beside pictures on the web stack
     instead: text first (the full 80vw), pictures after.
   - Picture rows break out a little wider than the text
     column and scroll sideways, so a pair or a trio of phone
     screenshots stays side by side on one screen.
   ========================================================= */

@media (max-width: 900px) {
  :root {
    /* 10vw each side leaves an 80vw content column. */
    --mobile-pad: 10vw;
    /* Picture rows break out to 92vw: (80vw * 1.15) = 92vw,
       pulled back by (80vw * 0.075) = 6vw on each side.
       Using % of the column rather than vw keeps a desktop
       scrollbar from pushing the page sideways when you
       preview this by resizing a browser window. */
    --bleed-width: 115%;
    --bleed-pull: -7.5%;
  }

  /* ---------- Page shell ---------- */

  /* padding-inline, not the `padding` shorthand: `.case-study-page` and the
     section rules below both set `padding` for their vertical spacing, and a
     shorthand there would reset this inset back to zero. */
  .content-wrap,
  .site-header,
  .site-footer .wrap {
    padding-inline: var(--mobile-pad);
  }

  /* `.wrap` nested inside the content column (the project card grid) would
     otherwise be inset twice. */
  .content-wrap .wrap {
    padding-inline: 0;
  }

  /* ---------- Footer nav: one tight row at the bottom ---------- */

  /* The shared `.nav-links` mobile rule turns the header menu into a
     vertical list. The footer nav opts back out of that: it stays a
     single horizontal row, LinkedIn icon included. */
  .site-footer {
    padding: 24px 0 28px;
  }

  .site-footer .wrap {
    flex-direction: column;
    align-items: center;
    gap: 14px;
  }

  .site-footer .nav-links {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 14px;
  }

  .site-footer .nav-links a {
    display: flex;
    align-items: center;
    font-size: 13px;
  }

  .site-footer .nav-links .nav-icon {
    width: 16px;
    height: 16px;
  }

  /* ---------- Home: intro text first, photo after ---------- */

  .about-panel {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 64px 0 56px;
    min-height: auto;
  }

  .about-copy {
    max-width: none;
  }

  .about-copy h1,
  .page-body h1 {
    margin-bottom: 32px;
  }

  /* The desktop offset that lines the photo up with the first
     paragraph makes no sense once the photo is below the text. */
  .about-image,
  .about-panel--home .about-image {
    margin-top: 0;
  }

  /* ---------- Home: worked-at marquee ---------- */

  .worked-at-rec {
    padding: 24px 0 32px;
  }

  .section-label {
    font-size: 28px;
  }

  .logo-track {
    gap: 40px;
  }

  .logo-item {
    min-width: 140px;
  }

  .logo-item img {
    max-height: 56px;
  }

  .logo-mask::before,
  .logo-mask::after {
    width: 36px;
  }

  /* ---------- Home: recommendation cards stack vertically ---------- */

  /* One per row, each filling the 80vw column and growing as tall as
     its quote needs. The first card, then the second below it. */
  .what-people-say {
    padding: 24px 0 72px;
  }

  .recommendations {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .recommendation-item,
  .rec-card {
    width: 100%;
    height: auto;
  }

  .rec-card {
    padding: 22px;
  }

  .rec-quote-block {
    padding: 10px 16px 0;
  }

  .quote-mark-open,
  .quote-mark-close {
    font-size: 44px;
  }

  .connect-section {
    padding: 0 0 72px;
  }

  /* ---------- Case studies: text first, pictures after ---------- */

  /* Every two-column variant collapses to one. Listed out in full because
     several of them (`--grid-media.section--reverse`, `--media-large
     .section--reverse`) are two-class selectors that would otherwise outrank
     a plain `.case-study-section` override. */
  .case-study-hero,
  .case-study-hero--full,
  .case-study-section,
  .case-study-section--split,
  .case-study-section--full,
  .case-study-section--media-large,
  .case-study-section--media-large.section--reverse,
  .case-study-section--grid-media,
  .case-study-section--grid-media.section--reverse,
  .kala-page .case-study-section,
  .kala-page .case-study-section--features {
    grid-template-columns: 1fr;
    gap: 24px;
    padding-block: 48px;
    min-height: auto;
    align-items: start;
  }

  .case-study-hero {
    padding-block: 32px 48px;
  }

  .case-study-hero--full,
  .kala-page .case-study-section--overview {
    padding-block: 32px 40px;
  }

  /* Text always leads, pictures always follow — including in the
     sections the web layout flips (`.section--reverse`). */
  .case-study-section .case-study-copy,
  .case-study-section.section--reverse .case-study-copy,
  .case-study-hero .case-study-copy {
    order: 1;
  }

  .case-study-section .case-study-media,
  .case-study-section.section--reverse .case-study-media,
  .case-study-hero .case-study-media {
    order: 2;
  }

  .case-study-copy,
  .case-study-hero--full .case-study-copy,
  .case-study-section--full .case-study-copy,
  .case-study-copy--900 {
    max-width: none;
    width: 100%;
    /* Grid items default to min-width:auto, which lets a wide child (the
       before/after screenshot pairs) push the column past the screen. */
    min-width: 0;
  }

  .case-study-page {
    padding-block: 0 72px;
  }

  .case-study-meta-label {
    flex: 0 0 68px;
  }

  /* ---------- Case studies: picture rows ---------- */

  /* A sideways scroller. Pairs and trios are sized to fit inside one
     screen, so it only actually scrolls if a section has more images
     than that. */
  .case-study-media {
    display: flex;
    margin-top: 4px;
    gap: 12px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .case-study-media::-webkit-scrollbar {
    display: none;
  }

  .case-study-media > img {
    scroll-snap-align: center;
  }

  /* Single-image sections stay inside the text column. The desktop max-widths
     still cap them, so a lone phone screenshot doesn't blow up on a tablet. */
  .case-study-media img {
    width: 100%;
    border-radius: 16px;
  }

  .case-study-media.case-study-media--small img {
    max-width: 320px;
  }

  .case-study-media--stack {
    flex-direction: column;
    gap: 16px;
  }

  /* Multi-image rows break out wider than the text column so the
     screenshots don't end up postage-stamp sized. */
  .case-study-media--pair,
  .case-study-media--trio,
  .case-study-media--grid4 {
    width: var(--bleed-width);
    margin-inline: var(--bleed-pull);
  }

  /* Two vertical screenshots: equal width, tops aligned, both on screen. */
  .case-study-media--pair {
    justify-content: center;
    align-items: flex-start;
    gap: 12px;
  }

  /* They share the row equally, so equal width = equal height. The cap stops
     them ballooning on a wide phone/small tablet. */
  .case-study-media--pair img,
  .case-study-hero .case-study-media--pair img,
  .case-study-media--small.case-study-media--pair img {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    max-width: 320px;
  }

  /* Three vertical screenshots (kala): all three side by side, equal size. */
  .case-study-media--trio {
    justify-content: center;
    align-items: flex-start;
    gap: 8px;
  }

  .case-study-media--trio img {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    max-width: 240px;
    border-radius: 12px;
  }

  /* The 2x2 research grids stay a grid, just wider. */
  .case-study-media--grid4 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    overflow: visible;
  }

  .case-study-media--grid4 img {
    border-radius: 12px;
  }

  /* ---------- Case studies: before/after pairs inside the copy ---------- */

  .case-study-image-pair {
    width: var(--bleed-width);
    margin-inline: var(--bleed-pull);
    justify-content: center;
    align-items: flex-start;
    gap: 12px;
    margin-block: 16px 32px;
  }

  .case-study-image-pair img,
  .case-study-image-pair.case-study-image-pair--small img {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    max-width: 320px;
    border-radius: 16px;
  }

  /* Repeats margin-inline at this specificity because the desktop rule for
     this pair uses the `margin` shorthand and would otherwise win. */
  .before-after-grid .case-study-image-pair {
    margin-block: 8px 0;
    margin-inline: var(--bleed-pull);
  }

  /* ---------- Case studies: full-width image bands ---------- */

  .case-study-image-band {
    padding: 24px 0 48px;
  }

  .case-study-image-group {
    gap: 20px;
    padding: 24px 0 48px;
  }

  .case-study-image-band img,
  .case-study-image-group img {
    border-radius: 16px;
  }

  /* ---------- Project cards ---------- */

  .projects-grid {
    gap: calc(var(--site-gap) * 1.5);
  }

  .project-card {
    height: auto;
  }

  .project-card .card-media {
    flex: none;
    aspect-ratio: 3 / 2;
  }

  .project-card .card-content {
    flex: none;
  }
}
