:root {
  --bg: #ffffff;
  --text: #171717;
  --muted: #666666;
  --soft: #f7f7f7;
  --line: rgba(0, 0, 0, 0.12);
  --line-soft: rgba(0, 0, 0, 0.08);
  --shadow-border: 0 0 0 1px rgba(0, 0, 0, 0.08);
  --shadow-card: 0 0 0 1px rgba(0, 0, 0, 0.08), 0 2px 2px rgba(0, 0, 0, 0.04), 0 12px 30px rgba(0, 0, 0, 0.06);
  --max: 1360px;
  --modal-max: 1480px;
  --gutter: clamp(18px, 3vw, 48px);
  --font: 'Geist', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font);
  font-feature-settings: "liga" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

img, video {
  display: block;
  max-width: 100%;
}

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

button {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px var(--gutter);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
  box-shadow: 0 1px 0 var(--line-soft);
}

.brand-mark,
.site-nav a,
.eyebrow,
.project-year,
.video-badge,
.loading,
.error-message,
.filter-button,
.project-meta-list dt,
.contact-grid span {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 28px);
  color: var(--muted);
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--text);
}

.hero {
  min-height: 78vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(96px, 14vw, 180px) var(--gutter) clamp(56px, 8vw, 110px);
  border-bottom: 1px solid var(--line);
}

.hero .eyebrow {
  margin: 0 0 22px;
  color: var(--muted);
}

h1 {
  max-width: 1120px;
  margin: 0;
  font-size: clamp(48px, 10vw, 148px);
  line-height: 0.88;
  letter-spacing: clamp(-7px, -0.055em, -2.5px);
  font-weight: 600;
}

.hero-subtitle,
.hero-meta {
  max-width: 760px;
  margin: 26px 0 0;
  font-size: clamp(22px, 3vw, 42px);
  line-height: 1.08;
  letter-spacing: -0.045em;
  font-weight: 400;
}

.hero-meta {
  margin-top: 10px;
  color: var(--muted);
}

.work-section {
  padding: clamp(52px, 8vw, 112px) var(--gutter) clamp(60px, 8vw, 110px);
}

.section-head {
  display: grid;
  grid-template-columns: minmax(160px, 0.28fr) minmax(0, 0.72fr);
  gap: clamp(24px, 4vw, 70px);
  max-width: var(--max);
  margin: 0 auto clamp(30px, 4.8vw, 66px);
}

.section-head .eyebrow {
  margin: 7px 0 0;
  color: var(--muted);
}

.section-head h2 {
  margin: 0;
  max-width: 960px;
  font-size: clamp(34px, 5vw, 76px);
  line-height: 0.95;
  letter-spacing: clamp(-3.6px, -0.05em, -1.4px);
  font-weight: 500;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: clamp(22px, 2.6vw, 34px);
}

.filter-button {
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.filter-button:hover,
.filter-button:focus-visible,
.filter-button.is-active {
  color: #fff;
  background: var(--text);
}

.projects-grid {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 1.35vw, 20px);
}

.project-card {
  position: relative;
  min-width: 0;
  padding: 0;
  background: #fff;
  color: inherit;
  text-align: left;
  border: 0;
  cursor: pointer;
  overflow: hidden;
  box-shadow: var(--shadow-border);
}

.project-thumb {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--soft);
  overflow: hidden;
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: none;
  transition: filter 700ms cubic-bezier(.2, .8, .2, 1);
}

.project-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 16px;
  padding: clamp(12px, 1.3vw, 20px);
  color: #fff;
  background: linear-gradient(180deg, rgba(0,0,0,0.08), rgba(0,0,0,0.78));
  opacity: 0;
  transition: opacity 260ms ease;
}

.project-overlay-top {
  position: absolute;
  top: clamp(16px, 2vw, 26px);
  right: clamp(16px, 2vw, 26px);
}

.project-overlay-info {
  display: grid;
  gap: 8px;
  max-width: 92%;
}

.project-overlay-title {
  margin: 0;
  font-size: clamp(18px, 1.65vw, 34px);
  line-height: 0.92;
  letter-spacing: -0.055em;
  font-weight: 600;
}

.project-overlay-meta,
.project-overlay-role {
  margin: 0;
  font-size: clamp(11px, 0.9vw, 14px);
  line-height: 1.25;
}

.project-overlay-meta {
  color: rgba(255, 255, 255, 0.76);
}

.project-overlay-role {
  color: #fff;
}

.video-badge {
  align-self: flex-start;
  flex: 0 0 auto;
  padding: 7px 9px;
  color: #171717;
  background: #fff;
  border-radius: 999px;
}

.project-card:hover .project-overlay,
.project-card:focus-visible .project-overlay {
  opacity: 1;
}

.project-card:hover .project-thumb img,
.project-card:focus-visible .project-thumb img {
  filter: grayscale(1) contrast(1.05) brightness(0.82);
}

.project-card:focus-visible,
.modal-close:focus-visible,
.filter-button:focus-visible {
  outline: 2px solid #0a72ef;
  outline-offset: 3px;
}

.loading,
.error-message {
  grid-column: 1 / -1;
  margin: 0;
  padding: 38px;
  color: var(--muted);
  background: var(--soft);
  box-shadow: var(--shadow-border);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
}

.modal.is-open {
  display: block;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(22px);
}

.modal-panel {
  position: absolute;
  inset: clamp(10px, 2vw, 28px);
  overflow: auto;
  background: #fff;
  box-shadow: var(--shadow-card);
}

.modal-close {
  position: sticky;
  top: 0;
  z-index: 2;
  float: right;
  margin: 16px 16px 0 0;
  padding: 9px 12px;
  border: 0;
  color: #fff;
  background: #171717;
  cursor: pointer;
}

.modal-layout {
  clear: both;
  display: grid;
  grid-template-columns: minmax(250px, 0.32fr) minmax(0, 0.68fr);
  gap: clamp(24px, 4vw, 74px);
  width: min(100%, var(--modal-max));
  margin: 0 auto;
  padding: clamp(22px, 4vw, 64px);
}

.modal-info {
  position: sticky;
  top: 70px;
  align-self: start;
}

.modal-info .eyebrow {
  margin: 0 0 18px;
  color: var(--muted);
}

.modal-info h2 {
  margin: 0 0 26px;
  font-size: clamp(36px, 5vw, 78px);
  line-height: 0.92;
  letter-spacing: -0.055em;
  font-weight: 600;
}

.project-meta-list {
  display: grid;
  gap: 12px;
  margin: 0 0 28px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.project-meta-list div {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 16px;
}

.project-meta-list dt {
  color: var(--muted);
  font-size: 11px;
}

.project-meta-list dd {
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
}

.modal-description {
  margin: 0;
  color: var(--muted);
  font-size: clamp(17px, 1.4vw, 22px);
  line-height: 1.45;
  letter-spacing: -0.015em;
}

.modal-media {
  min-width: 0;
  display: grid;
  gap: clamp(18px, 2vw, 30px);
}

.modal-gallery,
.modal-videos {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(18px, 2vw, 30px);
}

.modal-gallery:empty,
.modal-videos:empty {
  display: none;
}

.modal-gallery img,
.modal-videos video {
  width: auto;
  max-width: 100%;
  max-height: min(82vh, 900px);
  margin: 0 auto;
  object-fit: contain;
  background: var(--soft);
  box-shadow: var(--shadow-border);
}

.modal-videos video {
  background: #000;
}

.text-section {
  display: grid;
  grid-template-columns: minmax(160px, 0.28fr) minmax(0, 0.72fr);
  gap: clamp(24px, 4vw, 70px);
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(52px, 7vw, 96px) var(--gutter);
  border-top: 1px solid var(--line);
}

.text-section > .eyebrow {
  margin: 8px 0 0;
  color: var(--muted);
}

.text-section-body h2 {
  max-width: 980px;
  margin: 0 0 clamp(18px, 2vw, 30px);
  font-size: clamp(34px, 5vw, 74px);
  line-height: 0.95;
  letter-spacing: clamp(-3.6px, -0.05em, -1.4px);
  font-weight: 500;
}

.text-section-body p {
  max-width: 980px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(20px, 2.2vw, 34px);
  line-height: 1.18;
  letter-spacing: -0.04em;
}

.client-list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.client-list li {
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: clamp(15px, 1.4vw, 20px);
  letter-spacing: -0.02em;
  background: #fff;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.contact-grid a {
  min-height: 148px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--soft);
  box-shadow: var(--shadow-border);
  transition: background 180ms ease, color 180ms ease;
}

.contact-grid a:hover,
.contact-grid a:focus-visible {
  background: var(--text);
  color: #fff;
}

.contact-grid span {
  color: var(--muted);
}

.contact-grid a:hover span,
.contact-grid a:focus-visible span {
  color: rgba(255,255,255,.72);
}

.contact-grid strong {
  font-size: clamp(18px, 1.7vw, 26px);
  line-height: 1.05;
  letter-spacing: -0.04em;
  font-weight: 500;
  word-break: break-word;
}

body.modal-locked {
  overflow: hidden;
}

@media (max-width: 1180px) {
  .projects-grid {
    max-width: 980px;
  }
}

@media (max-width: 980px) {
  .section-head,
  .modal-layout,
  .text-section {
    grid-template-columns: 1fr;
  }

  .modal-info {
    position: static;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .site-header {
    padding: 14px var(--gutter);
  }

  .site-nav {
    gap: 14px;
  }

  .hero {
    min-height: 68vh;
  }

  .project-overlay {
    opacity: 1;
  }

  .project-card:hover .project-thumb img,
  .project-card:focus-visible .project-thumb img {
    filter: none;
  }

  .modal-panel {
    inset: 0;
  }

  .modal-layout {
    padding: 20px;
  }

  .modal-close {
    margin: 12px 12px 0 0;
  }

  .modal-gallery img,
  .modal-videos video {
    max-height: 78vh;
  }
}

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

  .site-nav {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}


/* v3 small fixes */
.text-section--contact .text-section-body h2 {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
}


/* v4: return to calmer 3-column grid and full-screen project view */
.modal-backdrop {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
}

.modal-panel {
  position: absolute;
  inset: 0;
  overflow: auto;
  background: transparent;
  box-shadow: none;
}

.modal-close {
  position: fixed;
  top: clamp(16px, 2vw, 28px);
  right: clamp(16px, 2vw, 28px);
  z-index: 5;
  float: none;
  margin: 0;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: #fff;
  background: #171717;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.modal-layout {
  clear: none;
  width: min(100%, 1420px);
  margin: 0 auto;
  padding: clamp(78px, 8vw, 118px) var(--gutter) clamp(40px, 5vw, 78px);
  grid-template-columns: minmax(260px, 0.35fr) minmax(0, 0.65fr);
}

.modal-info {
  top: clamp(92px, 10vw, 130px);
}

.modal-gallery img,
.modal-videos video {
  max-height: min(78vh, 820px);
  width: auto;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  background: var(--soft);
}

@media (max-width: 980px) {
  .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .modal-layout {
    grid-template-columns: 1fr;
  }

  .modal-info {
    position: static;
  }
}

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


/* v5: bigger home cards, cropped covers, project media fit to viewport */

/* Home grid: 3 cards, but larger on full screen */
.projects-grid {
  max-width: min(1500px, calc(100vw - var(--gutter) * 2));
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 1.45vw, 24px);
}

/* Main cards: crop horizontal images into vertical poster-like covers */
.project-thumb {
  aspect-ratio: 4 / 5;
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Project view: make images/videos fit almost exactly inside current viewport */
.modal-layout {
  width: min(100%, 1500px);
  padding-top: clamp(56px, 5.2vw, 82px);
  padding-bottom: clamp(22px, 3vw, 42px);
  grid-template-columns: minmax(250px, 0.34fr) minmax(0, 0.66fr);
}

.modal-info {
  top: clamp(72px, 7vw, 96px);
}

.modal-media,
.modal-gallery,
.modal-videos {
  gap: clamp(14px, 1.6vw, 22px);
}

/* Vertical and square media should never exceed the visible page height */
.modal-gallery img,
.modal-videos video {
  max-height: calc(100vh - 104px);
  width: auto;
  max-width: 100%;
  object-fit: contain;
  margin-left: auto;
  margin-right: auto;
}

/* Remove the feeling of a grey "mat" around contained images */
.modal-gallery img {
  background: transparent;
}

/* Slightly wider media column on desktop */
@media (min-width: 981px) {
  .modal-media {
    justify-items: center;
  }

  .modal-gallery img,
  .modal-videos video {
    max-width: min(100%, 860px);
  }
}

/* On very wide screens keep cards large but not absurd */
@media (min-width: 1600px) {
  .projects-grid {
    max-width: 1560px;
  }
}

/* Tablet fallback */
@media (max-width: 980px) {
  .projects-grid {
    max-width: min(980px, calc(100vw - var(--gutter) * 2));
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .modal-gallery img,
  .modal-videos video {
    max-height: calc(100vh - 88px);
  }
}

/* Phone fallback */
@media (max-width: 520px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .modal-gallery img,
  .modal-videos video {
    max-height: calc(100vh - 76px);
  }
}


/* v6: editorial-scale project card typography + Clients before About */
.project-overlay {
  padding: clamp(20px, 2.1vw, 34px);
  background: linear-gradient(180deg, rgba(0,0,0,0.04) 0%, rgba(0,0,0,0.18) 38%, rgba(0,0,0,0.82) 100%);
}

.project-overlay-info {
  gap: clamp(8px, 1vw, 16px);
  max-width: 96%;
}

.project-overlay-title {
  font-size: clamp(34px, 3.3vw, 72px);
  line-height: 0.86;
  letter-spacing: -0.075em;
  font-weight: 650;
}

.project-overlay-meta {
  font-size: clamp(16px, 1.35vw, 26px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  color: rgba(255,255,255,0.88);
  text-transform: none;
}

.project-overlay-role {
  font-size: clamp(16px, 1.25vw, 24px);
  line-height: 1.05;
  letter-spacing: -0.035em;
  color: #fff;
}

.video-badge {
  padding: 9px 12px;
  font-size: clamp(11px, 0.8vw, 14px);
}

@media (max-width: 980px) {
  .project-overlay-title {
    font-size: clamp(30px, 5.5vw, 58px);
  }

  .project-overlay-meta,
  .project-overlay-role {
    font-size: clamp(15px, 2.3vw, 22px);
  }
}

@media (max-width: 520px) {
  .project-overlay-title {
    font-size: clamp(36px, 11vw, 64px);
  }

  .project-overlay-meta,
  .project-overlay-role {
    font-size: clamp(17px, 5vw, 24px);
  }
}


/* v8: homepage restored to v6, only project mobile view updated */

.media-slide {
  width: 100%;
  display: grid;
  place-items: center;
}

.media-slide img,
.media-slide video {
  width: auto;
  max-width: 100%;
  max-height: calc(100vh - 104px);
  object-fit: contain;
  background: transparent;
  box-shadow: var(--shadow-border);
}

.mobile-slide-caption {
  display: none;
}

@media (max-width: 640px) {
  /* Header no longer floats over the main feed on mobile */
  .site-header {
    position: static;
    background: #fff;
    backdrop-filter: none;
  }

  .site-nav {
    display: none;
  }

  .brand-mark {
    font-size: 11px;
  }

  /* Project opens as full-screen swipe gallery on mobile */
  .modal-panel {
    inset: 0;
    background: #000;
    color: #fff;
    overflow: hidden;
  }

  .modal-backdrop {
    background: #000;
    backdrop-filter: none;
  }

  .modal-close {
    position: fixed;
    top: max(10px, env(safe-area-inset-top));
    right: 12px;
    z-index: 20;
    padding: 10px 13px;
    color: #111;
    background: #fff;
    border: 0;
    box-shadow: none;
  }

  .modal-layout {
    display: block;
    width: 100%;
    height: 100dvh;
    padding: 0;
    margin: 0;
  }

  .modal-info {
    display: none;
  }

  .modal-media {
    width: 100%;
    height: 100dvh;
    display: block;
  }

  .modal-gallery {
    width: 100%;
    height: 100dvh;
    display: flex;
    gap: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .modal-gallery::-webkit-scrollbar {
    display: none;
  }

  .modal-videos {
    display: none;
  }

  .media-slide {
    position: relative;
    flex: 0 0 100%;
    width: 100%;
    height: 100dvh;
    scroll-snap-align: start;
    display: grid;
    place-items: center;
    background: #000;
    overflow: hidden;
  }

  .media-slide img,
  .media-slide video {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: contain;
    background: #000;
    box-shadow: none;
  }

  .media-slide--cover img {
    object-fit: cover;
    filter: brightness(0.58);
  }

  .mobile-slide-caption {
    position: absolute;
    inset: auto 0 0 0;
    display: block;
    padding: 82px 20px 28px;
    color: #fff;
    background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,0.76) 45%, rgba(0,0,0,0.94));
  }

  .mobile-slide-caption .eyebrow {
    margin: 0 0 12px;
    color: rgba(255,255,255,0.7);
  }

  .mobile-slide-caption h2 {
    margin: 0 0 14px;
    max-width: 92%;
    font-size: clamp(36px, 12vw, 58px);
    line-height: 0.86;
    letter-spacing: -0.075em;
    font-weight: 650;
  }

  .mobile-slide-caption .mobile-meta {
    margin: 0 0 16px;
    font-size: 15px;
    line-height: 1.2;
    color: rgba(255,255,255,0.82);
  }

  .mobile-slide-caption .mobile-description {
    margin: 0;
    max-width: 94%;
    max-height: 34dvh;
    overflow: auto;
    font-size: 15px;
    line-height: 1.38;
    color: rgba(255,255,255,0.84);
  }

  .modal.is-open::after {
    content: "swipe";
    position: fixed;
    left: 20px;
    top: max(14px, env(safe-area-inset-top));
    z-index: 19;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.7);
  }
}


/* v9: restore mobile homepage as large one-project-per-screen cards */
@media (max-width: 820px) {
  .work-section {
    padding-left: 16px;
    padding-right: 16px;
  }

  .section-head {
    display: block;
    margin-bottom: 26px;
  }

  .section-head h2 {
    max-width: 96%;
    font-size: clamp(36px, 11vw, 64px);
    line-height: 0.9;
    letter-spacing: -0.07em;
  }

  .filter-row {
    margin-top: 24px;
    gap: 10px;
  }

  .filter-button {
    padding: 12px 17px;
    font-size: 12px;
  }

  .projects-grid {
    width: 100%;
    max-width: none;
    display: grid;
    grid-template-columns: 1fr !important;
    gap: 18px;
    margin: 0;
  }

  .project-card {
    width: 100%;
    min-height: min(78svh, 760px);
  }

  .project-thumb {
    height: min(78svh, 760px);
    min-height: 560px;
    aspect-ratio: auto;
  }

  .project-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .project-overlay {
    opacity: 1;
    padding: 22px;
    background: linear-gradient(180deg, rgba(0,0,0,0.04) 0%, rgba(0,0,0,0.16) 38%, rgba(0,0,0,0.78) 100%);
  }

  .project-overlay-info {
    gap: 10px;
    max-width: 94%;
  }

  .project-overlay-title {
    font-size: clamp(42px, 14vw, 76px);
    line-height: 0.86;
    letter-spacing: -0.075em;
    font-weight: 650;
  }

  .project-overlay-meta {
    font-size: clamp(21px, 6vw, 34px);
    line-height: 1.02;
    letter-spacing: -0.045em;
    text-transform: none;
    color: rgba(255,255,255,0.9);
  }

  .project-overlay-role {
    font-size: clamp(20px, 5.6vw, 32px);
    line-height: 1.05;
    letter-spacing: -0.045em;
    color: #fff;
  }

  .video-badge {
    padding: 9px 12px;
    font-size: 11px;
  }
}

@media (max-width: 420px) {
  .project-thumb {
    height: min(76svh, 680px);
    min-height: 500px;
  }

  .project-overlay-title {
    font-size: clamp(38px, 13vw, 62px);
  }

  .project-overlay-meta {
    font-size: clamp(19px, 5.6vw, 28px);
  }

  .project-overlay-role {
    font-size: clamp(18px, 5.2vw, 27px);
  }
}


/* v10: reset mobile carousel state reliably */
@media (max-width: 640px) {
  .modal-gallery {
    scroll-behavior: auto;
  }
}


/* v12: simpler mobile zoom, no edge-swipe, normal swipe restored */
@media (max-width: 640px) {
  .modal-gallery {
    scroll-behavior: auto;
    touch-action: pan-x;
    overscroll-behavior: contain;
  }

  .media-slide img,
  .media-slide video {
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    will-change: transform;
    transform-origin: center center;
  }

  .media-slide.is-zoomed img,
  .media-slide.is-zoomed video {
    cursor: grab;
  }

  .modal.is-zooming .modal-gallery {
    scroll-snap-type: none;
    overflow-x: hidden;
  }
}


/* v13: softer double-tap zoom reset */
@media (max-width: 640px) {
  .media-slide.is-resetting img,
  .media-slide.is-resetting video {
    transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
  }
}


/* v14: header order + smoother double-tap zoom in/out */
@media (max-width: 640px) {
  .media-slide.is-resetting img,
  .media-slide.is-resetting video,
  .media-slide.is-doubletap-zooming img,
  .media-slide.is-doubletap-zooming video {
    transition: transform 440ms cubic-bezier(0.16, 1.18, 0.32, 1);
  }
}


/* v15: slower double-tap zoom + mobile sticky navigation */
@media (max-width: 640px) {
  .site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    padding: 10px 12px;
    gap: 12px;
    background: rgba(255,255,255,0.88);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 1px 0 var(--line-soft);
  }

  .brand-mark {
    flex: 0 0 auto;
    max-width: 108px;
    font-size: 10px;
    line-height: 1.05;
  }

  .site-nav {
    display: flex;
    flex: 1 1 auto;
    justify-content: flex-end;
    gap: 10px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
  }

  .site-nav::-webkit-scrollbar {
    display: none;
  }

  .site-nav a {
    font-size: 10px;
    line-height: 1;
  }

  .modal.is-open {
    z-index: 100;
  }

  .media-slide.is-resetting img,
  .media-slide.is-resetting video,
  .media-slide.is-doubletap-zooming img,
  .media-slide.is-doubletap-zooming video {
    transition: transform 880ms cubic-bezier(0.16, 1.08, 0.26, 1);
  }
}


/* v16: fix double-tap race condition; calmer zoom timing */
@media (max-width: 640px) {
  .media-slide.is-resetting img,
  .media-slide.is-resetting video,
  .media-slide.is-doubletap-zooming img,
  .media-slide.is-doubletap-zooming video {
    transition: transform 960ms cubic-bezier(0.18, 1.02, 0.24, 1);
  }
}


/* v17: white mobile project viewer + swipe down to close */
@media (max-width: 640px) {
  .modal-panel {
    background: #fff;
    color: #111;
  }

  .modal-backdrop {
    background: #fff;
  }

  .media-slide {
    background: #fff;
  }

  .media-slide img,
  .media-slide video {
    background: #fff;
  }

  .media-slide--cover img {
    filter: brightness(0.62);
  }

  .mobile-slide-caption {
    color: #fff;
  }

  .modal.is-open::after {
    color: rgba(17,17,17,0.45);
    mix-blend-mode: difference;
  }

  .modal-close {
    color: #111;
    background: rgba(255,255,255,0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
  }

  .modal-panel.is-swipe-closing {
    transition: transform 220ms ease, opacity 220ms ease;
  }
}


/* v18: mobile swipe hint arrow */
@media (max-width: 640px) {
  .modal.is-open::before {
    content: "→";
    position: fixed;
    right: 18px;
    top: 50%;
    z-index: 19;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: rgba(17,17,17,0.72);
    background: rgba(255,255,255,0.74);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
    font-family: var(--mono);
    font-size: 24px;
    line-height: 1;
    pointer-events: none;
    animation: swipeHintPulse 1.8s ease-in-out infinite;
  }

  .modal.is-zooming::before {
    display: none;
  }

  @keyframes swipeHintPulse {
    0%, 100% { opacity: 0.36; transform: translateY(-50%) translateX(0); }
    50% { opacity: 0.86; transform: translateY(-50%) translateX(5px); }
  }
}


/* v19: arrow behavior refinements */
@media (max-width: 640px) {
  .modal.is-open::before {
    opacity: 0.86;
    transition: opacity 220ms ease;
  }

  .modal.is-open.is-after-first-slide::before {
    opacity: 0.28;
  }

  .modal.is-open.is-last-slide::before {
    display: none;
  }

  .modal.is-open.is-after-first-slide:not(.is-last-slide)::before {
    animation: none;
  }
}


/* v20: safer text/contact scaling */
h1 {
  max-width: 1320px;
  font-size: clamp(44px, 8.3vw, 132px);
  letter-spacing: clamp(-6px, -0.055em, -2px);
}

.hero-subtitle,
.hero-meta {
  font-size: clamp(20px, 2.35vw, 34px);
}

.text-section-body h2 {
  font-size: clamp(30px, 4.25vw, 62px);
  max-width: 1040px;
}

.text-section-body p {
  font-size: clamp(18px, 1.75vw, 28px);
  line-height: 1.22;
  letter-spacing: -0.032em;
}

.contact-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(10px, 1.2vw, 18px);
}

.contact-grid a {
  min-width: 0;
  min-height: clamp(118px, 11vw, 158px);
  padding: clamp(14px, 1.35vw, 22px);
}

.contact-grid strong {
  display: block;
  max-width: 100%;
  font-size: clamp(16px, 1.28vw, 24px);
  line-height: 1.08;
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
  word-break: normal;
}

.contact-grid span {
  font-size: clamp(10px, 0.78vw, 12px);
}

.contact-grid a[href^="mailto:"] strong {
  font-size: clamp(14px, 1.05vw, 20px);
  letter-spacing: -0.04em;
}

@media (max-width: 980px) {
  h1 {
    font-size: clamp(42px, 11vw, 92px);
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .contact-grid a {
    min-height: 116px;
  }

  .contact-grid strong,
  .contact-grid a[href^="mailto:"] strong {
    font-size: clamp(20px, 5.4vw, 34px);
  }
}

@media (max-width: 640px) {
  h1 {
    font-size: clamp(38px, 10.8vw, 68px);
    line-height: 0.9;
    letter-spacing: -0.065em;
  }

  .section-head h2,
  .text-section-body h2 {
    font-size: clamp(30px, 9vw, 52px);
  }

  .text-section-body p {
    font-size: clamp(18px, 5.2vw, 26px);
  }

  .contact-grid a {
    min-height: 106px;
  }

  .contact-grid strong,
  .contact-grid a[href^="mailto:"] strong {
    font-size: clamp(19px, 5.6vw, 30px);
    line-height: 1.05;
  }
}
