:root {
  --bg: #0D0D0C;
  --surface: #1A1917;
  --line: #262522;
  --text: #EDEBE6;
  --muted: #9A9892;
  --accent: #E8B04B;
  --pad: clamp(20px, 4vw, 48px);
  --display: 'Space Grotesk', system-ui, sans-serif;
  --body: 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover, a:focus-visible { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
img { display: block; max-width: 100%; }

/* Header */
.site-header {
  padding: 28px var(--pad);
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  justify-content: space-between;
  align-items: center;
}
.logo {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.08em;
}
.logo span { color: var(--accent); }
.site-nav { display: flex; gap: clamp(20px, 3vw, 36px); }
.site-nav a {
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 10px 0;
}
.site-nav a[aria-current="page"] { color: var(--accent); box-shadow: inset 0 -1px 0 var(--accent); }

/* Hero */
.hero { padding: 0 var(--pad); }
.hero-frame {
  position: relative;
  aspect-ratio: 21 / 9;
  min-height: 420px;
  background: var(--surface);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}
.hero-video {
  position: absolute;
  inset: 0;
  pointer-events: none;
  container-type: size;
}
.hero-video iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  width: max(100cqw, 177.78cqh);
  height: max(100cqh, 56.25cqw);
  transform: translate(-50%, -50%);
  border: 0;
}
.hero-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(13,13,12,0.85) 0%, rgba(13,13,12,0.15) 55%, rgba(13,13,12,0) 100%);
}
.hero-copy {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: clamp(24px, 4vw, 48px);
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
  align-items: flex-end;
}
.hero h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(40px, 6.5vw, 96px);
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: -0.03em;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 24px;
  border: 1px solid var(--text);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}
.btn:hover, .btn:focus-visible { border-color: var(--accent); color: var(--accent); }

/* Work grid */
.section-head {
  padding: clamp(56px, 8vw, 96px) var(--pad) 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  justify-content: space-between;
  align-items: flex-end;
}
.section-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 32px;
  font-weight: 500;
}
.filters { display: flex; flex-wrap: wrap; gap: 4px 28px; }
.filters button {
  font: inherit;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: none;
  border: 0;
  color: var(--muted);
  padding: 12px 0;
  min-height: 44px;
  cursor: pointer;
}
.filters button:hover { color: var(--text); }
.filters button[aria-pressed="true"] { color: var(--accent); box-shadow: inset 0 -1px 0 var(--accent); }

.grid {
  padding: 0 var(--pad) 120px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr));
  gap: 40px 24px;
  list-style: none;
  margin: 0;
}
.grid li[hidden] { display: none; }
.card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  padding: 0;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--surface);
  overflow: hidden;
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .4s ease, transform .6s ease;
}
.thumb img.loaded { opacity: 1; }
.card:hover .thumb img, .card:focus-visible .thumb img { transform: scale(1.03); }
.thumb .play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .25s ease;
  background: rgba(13,13,12,0.35);
}
.card:hover .play, .card:focus-visible .play { opacity: 1; }
.card-title { font-size: 16px; font-weight: 500; line-height: 1.35; }
.card-roles { font-size: 13px; color: var(--muted); margin-top: 4px; }
.card:hover .card-title { color: var(--accent); }

/* Lightbox */
.lightbox {
  border: 0;
  padding: 0;
  width: min(1200px, 94vw);
  max-width: none;
  background: transparent;
  color: var(--text);
}
.lightbox::backdrop { background: rgba(5,5,5,0.92); }
.lightbox-inner { display: flex; flex-direction: column; gap: 12px; }
.lightbox-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.lightbox-title { font-size: 15px; color: var(--muted); }
.lightbox-close {
  background: none;
  border: 0;
  color: var(--text);
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.lightbox-close:hover { color: var(--accent); }
.lightbox-player { position: relative; aspect-ratio: 16 / 9; background: #000; }
.lightbox-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Footer */
.site-footer {
  padding: 64px var(--pad);
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  justify-content: space-between;
  align-items: flex-end;
}
.kicker {
  display: block;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.footer-email { font-family: var(--display); font-size: clamp(22px, 3vw, 40px); word-break: break-word; }
.footer-links { display: flex; flex-wrap: wrap; gap: 28px; font-size: 14px; }
.footer-links .muted { color: var(--muted); }

/* Resume */
.page { padding: clamp(40px, 6vw, 80px) var(--pad) 120px; max-width: 1100px; }
.page h1 {
  margin: 0 0 12px;
  font-family: var(--display);
  font-size: clamp(40px, 6vw, 80px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.03em;
}
.page .lede { margin: 0; color: var(--muted); font-size: 18px; }
.resume-section { margin-top: 72px; }
.resume-section > h2 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.job {
  display: grid;
  grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
  gap: 8px 40px;
  padding: 32px 0;
  border-top: 1px solid var(--line);
}
.job-when { font-size: 14px; color: var(--muted); }
.job h3 { margin: 0; font-family: var(--display); font-size: 22px; font-weight: 500; line-height: 1.25; }
.job .org { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.job ul { margin: 16px 0 0; padding-left: 18px; }
.job li { margin: 6px 0; color: #D6D4CE; }
.job li::marker { color: var(--accent); }
.skills { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; padding: 0; list-style: none; }
.skills li { border: 1px solid var(--line); padding: 8px 14px; font-size: 14px; }

@media (max-width: 700px) {
  .job { grid-template-columns: minmax(0, 1fr); }
  .hero-frame { aspect-ratio: auto; min-height: 70vh; }
}

/* Contact */
.contact-email {
  display: inline-block;
  margin-top: 40px;
  font-family: var(--display);
  font-size: clamp(28px, 5.5vw, 72px);
  font-weight: 500;
  letter-spacing: -0.02em;
  word-break: break-word;
}
.contact-actions { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 32px; }
.contact-meta { margin-top: 72px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 32px; }
.contact-meta p { margin: 0; font-size: 18px; }
.copy-status { font-size: 14px; color: var(--accent); min-height: 20px; margin-top: 12px; }

@media (prefers-reduced-motion: reduce) {
  .thumb img, .thumb .play { transition: none; }
  .card:hover .thumb img { transform: none; }
}
.job .desc { margin: 16px 0 0; color: #D6D4CE; }
.job .desc + .desc { margin-top: 12px; }
.page .lede + .lede { margin-top: 4px; }

/* Intro (no banner) */
.intro {
  padding: clamp(28px, 6vw, 88px) var(--pad) clamp(20px, 4.5vw, 64px);
  display: flex;
  flex-wrap: wrap;
  gap: 48px 64px;
  justify-content: space-between;
  align-items: flex-end;
  border-bottom: 1px solid var(--line);
}
.intro h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(48px, 8vw, 128px);
  font-weight: 500;
  line-height: 0.92;
  letter-spacing: -0.035em;
}
.intro h1 span { color: var(--accent); }
.intro-side { max-width: 400px; display: flex; flex-direction: column; gap: 24px; padding-bottom: 8px; }
.intro-side p { margin: 0; font-size: 18px; line-height: 1.55; color: #C9C7C1; }
.intro-book { font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.intro-book:hover { color: var(--text); }
.section-head.after-intro { padding-top: 40px; }

/* About */
.about-bio { max-width: 760px; margin-top: 40px; }
.about-bio p { font-size: 19px; line-height: 1.7; color: #D6D4CE; margin: 0 0 24px; }
.clients {
  list-style: none; margin: 24px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  border-top: 1px solid var(--line);
}
.clients li { padding: 18px 0; border-bottom: 1px solid var(--line); font-size: 16px; padding-right: 16px; }

@media (max-width: 700px) {
  .site-header { padding: 18px 20px 8px; row-gap: 4px; }
  .site-nav { gap: 18px; }
  .site-nav a { font-size: 13px; }
  .intro { padding: 28px 20px 20px; gap: 12px; border-bottom: 0; }
  .intro h1 { font-size: 34px; line-height: 1.02; }
  .intro h1 br { display: none; }
  .intro-side { gap: 0; padding: 0; }
  .intro-side p { font-size: 15px; }
  .intro-book { display: none; }
  .section-head, .section-head.after-intro { padding: 8px 20px 16px; }
  .section-head h2 { display: none; }
  .filters { flex-wrap: nowrap; overflow-x: auto; gap: 16px; width: 100%; justify-content: space-between; scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .filters button { flex: 0 0 auto; padding: 8px 0; font-size: 12px; letter-spacing: 0.04em; }
  .grid { padding: 0 20px 80px; gap: 28px; }
  .about-bio p { font-size: 17px; }
}

/* Client logos */
.logo-grid {
  list-style: none; margin: 32px 0 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 48px 32px;
}
.logo-grid li {
  flex: 0 0 calc((100% - 5 * 32px) / 6);
  height: 88px;
  display: flex; align-items: center; justify-content: center;
}
.logo-grid img { max-width: 100%; max-height: 72px; width: auto; height: auto; object-fit: contain; }
@media (max-width: 1000px) {
  .logo-grid li { flex-basis: calc((100% - 3 * 32px) / 4); }
}
@media (max-width: 700px) {
  .logo-grid { gap: 32px 20px; }
  .logo-grid li { flex-basis: calc((100% - 2 * 20px) / 3); height: 64px; }
  .logo-grid img { max-height: 52px; }
}

/* Intro with background photo */
.intro.intro-bg {
  position: relative;
  min-height: min(78vh, 760px);
  margin: 0;
  padding: clamp(28px, 4vw, 56px) var(--pad);
  border-bottom: 0;
  background: #0D0D0C url("/images/bts.jpg") center 35% / cover no-repeat;
  overflow: hidden;
  isolation: isolate;
}
.intro.intro-bg::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to top, rgba(13,13,12,0.92) 0%, rgba(13,13,12,0.55) 45%, rgba(13,13,12,0.2) 100%);
}
.intro.intro-bg { flex-direction: column; flex-wrap: nowrap; justify-content: flex-end; align-items: flex-start; gap: 20px; }
.intro.intro-bg h1 { font-size: clamp(40px, 5.2vw, 84px); line-height: 0.95; }
.intro.intro-bg .intro-side { max-width: 520px; gap: 16px; padding-bottom: 0; }
.intro.intro-bg .intro-side p { color: #E2E0DA; }
@media (max-width: 700px) {
  /* Phones: show the whole photo (2576x1717), text underneath */
  .intro.intro-bg {
    --photo-h: calc(100vw * 1717 / 2576);
    min-height: 0;
    margin: 0;
    padding: calc(var(--photo-h) - 36px) 20px 20px;
    background-size: 100% auto;
    background-position: top center;
  }
  .intro.intro-bg::before {
    background: linear-gradient(to bottom, rgba(13,13,12,0) 0, rgba(13,13,12,0) calc(var(--photo-h) - 110px), #0D0D0C calc(var(--photo-h) - 4px));
  }
}

/* About: text with photo */
.page:has(.about-top) { max-width: 1800px; margin: 0 auto; }
.about-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) calc(var(--about-photo-size, 50) * 1%);
  gap: clamp(40px, 5vw, 96px);
  align-items: start;
}
.about-top .about-bio { margin-top: 32px; max-width: none; }
.about-top .about-bio p { font-size: clamp(17px, 1.15vw, 21px); line-height: 1.75; }
.about-photo { margin: calc(clamp(40px, 6vw, 80px) + 44px + var(--about-photo-down, 0) * 1px) 0 0; transform: translateX(calc(var(--about-photo-right, 0) * 1px)); }
.about-photo img { display: block; width: 100%; height: auto; }
@media (max-width: 900px) {
  .about-top { grid-template-columns: minmax(0, 1fr) !important; }
  .about-photo { order: -1; max-width: 520px; margin: 0; transform: none; }
}

/* Category rows */
.rows { display: flex; flex-direction: column; gap: 64px; padding: 56px 0 112px; }
.vrow { display: flex; flex-direction: column; gap: 20px; }
.vrow-head { padding: 0 var(--pad); display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
.vrow-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.vrow-title h2 { margin: 0; font-family: var(--display); font-size: 28px; font-weight: 500; }
.vrow-count { font-size: 13px; color: var(--muted); }
.vrow-arrows { display: flex; gap: 8px; }
.vrow-arrows button {
  width: 44px; height: 44px; border-radius: 999px; border: 1px solid #3A3936;
  background: none; color: var(--text); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.vrow-arrows button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.vrow-arrows button:disabled { opacity: 0.3; cursor: default; }
.vrow-track {
  list-style: none; margin: 0; padding: 0 var(--pad);
  display: flex; gap: 20px; overflow-x: auto;
  scroll-snap-type: x mandatory; scroll-padding-inline: var(--pad);
  scrollbar-width: none;
}
.vrow-track::-webkit-scrollbar { display: none; }
.vrow-track li { flex: 0 0 clamp(280px, 26vw, 440px); scroll-snap-align: start; }
.vrow-track .card { gap: 12px; }
.vrow-track .card-title { font-size: 15px; }
.thumb .tags {
  position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 1;
  display: flex; flex-wrap: wrap; gap: 6px;
  opacity: 0; transform: translateY(4px); transition: opacity .2s ease, transform .2s ease;
}
.thumb .tags span {
  font-size: 11px; letter-spacing: 0.04em; padding: 4px 9px; border-radius: 999px;
  background: rgba(13,13,12,0.78); color: var(--text); border: 1px solid rgba(237,235,230,0.25);
}
.card:hover .tags, .card:focus-visible .tags { opacity: 1; transform: none; }
@media (hover: none) { .thumb .tags { opacity: 1; transform: none; } }
@media (max-width: 700px) {
  .rows { padding: 24px 0 72px; gap: 48px; }
  .vrow-head { padding: 0 20px; }
  .vrow-title h2 { font-size: 22px; }
  .vrow-arrows { display: none; }
  .vrow-track { padding: 0 20px; gap: 14px; scroll-padding-inline: 20px; }
  .vrow-track li { flex-basis: 80%; }
}

/* Homepage: menu floats over the top photo (desktop and tablet) */
@media (min-width: 701px) {
  body:has(.intro-bg) { position: relative; }
  body:has(.intro-bg) .site-header {
    position: absolute; top: 0; left: 0; right: 0; z-index: 5;
  }
  body:has(.intro-bg) .intro.intro-bg {
    --hdr: 100px;
    --box: min(78vh, 760px);
    min-height: calc(var(--box) + var(--hdr));
    padding-top: calc(clamp(28px, 4vw, 56px) + var(--hdr));
    /* same framing as before, just extended upward under the menu */
    background-position: center min(0px, calc(var(--hdr) - (100vw * 1717 / 2576 - var(--box)) * 0.35));
  }
  body:has(.intro-bg) .intro.intro-bg::before {
    background:
      linear-gradient(to bottom, rgba(13,13,12,0.55) 0, rgba(13,13,12,0) 170px),
      linear-gradient(to top, rgba(13,13,12,0.92) 0%, rgba(13,13,12,0.55) 45%, rgba(13,13,12,0.2) 100%);
  }
}

/* Resume: company first, role underneath, date lined up with the company */
.job h3.co .co-meta { font-family: var(--body, Inter, sans-serif); font-size: 14px; font-weight: 400; color: var(--muted); margin-left: 10px; }
.job .role { margin: 4px 0 0; font-size: 16px; font-weight: 500; color: var(--text); }
.job-when { line-height: 1.4; padding-top: 6px; }
@media (max-width: 700px) { .job-when { padding-top: 0; } }
