:root {
  --bg: #ffffff;
  --bg-elevated: #f2f2f0;
  --fg: #111111;
  --muted: #8a8a8a;
  --line: #e6e6e3;

  --font-display: 'Raleway', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-label: 'Raleway', sans-serif;

  --gutter: clamp(16px, 3vw, 44px);
  --img-ratio: 1000 / 417;   /* default crop for all images (~2.39:1). Video stays 16:9. */
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

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

:focus-visible {
  outline: 1px solid var(--fg);
  outline-offset: 3px;
}

/* ---------- Header (3-column: label left | name center | nav right) ---------- */

.site-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 28px var(--gutter);
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.header-left { justify-self: start; }
.header-center { justify-self: center; }
.header-right { justify-self: end; }

.role-label {
  font-family: var(--font-label);
  font-weight: 300;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg);
  white-space: nowrap;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(18px, 2vw, 24px);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--fg);
  white-space: nowrap;
  padding-left: 0.28em; /* offset tracking so it sits truly centered */
}

nav.primary-nav {
  display: flex;
  gap: 26px;
}

nav.primary-nav a {
  font-family: var(--font-label);
  font-weight: 300;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg);
  transition: opacity 0.15s ease;
}

nav.primary-nav a:hover { opacity: 0.45; }
nav.primary-nav a.active {
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
}

@media (max-width: 720px) {
  .site-header {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 14px;
    padding: 22px var(--gutter);
  }
  .header-left, .header-center, .header-right { justify-self: center; }
  .wordmark { order: -1; font-size: 20px; }
}

/* ---------- Grid ---------- */

.work-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 72%;
  max-width: 1680px;
  margin: 0 auto;
  padding: 30px 0 60px;
}

@media (max-width: 1100px) { .work-grid { width: 88%; } }
@media (max-width: 900px) { .work-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .work-grid { grid-template-columns: 1fr; width: 100%; } }

.grid-item {
  position: relative;
  display: block;
  font-size: 0;   /* kill inline-whitespace gap under images */
  line-height: 0;
}

.grid-item .thumb-wrap {
  position: relative;
  display: block;
  line-height: 0;
  overflow: hidden;
  background: var(--bg-elevated);
}

.grid-item img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: var(--img-ratio);
  object-fit: cover;
}

.placeholder-fill {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: var(--img-ratio);
  background: repeating-linear-gradient(135deg, var(--bg-elevated) 0 18px, #e6e6e3 18px 36px);
  color: var(--muted);
  font-family: var(--font-label);
  font-size: 11px;
  line-height: 1.3;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  padding: 12px;
}

.grid-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 14px;
  background: rgba(17, 17, 17, 0.44);
  opacity: 0;
  transition: opacity 0.28s ease;
}

.grid-item:hover .grid-overlay,
.grid-item:focus-visible .grid-overlay { opacity: 1; }

.grid-overlay .g-title {
  font-family: var(--font-label);
  font-weight: 300;
  font-size: 13px;
  line-height: 1.4;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #ffffff;
}

/* ---------- Project page ---------- */

.project-page { display: none; padding: 8px var(--gutter) var(--gutter); }
.project-page.active { display: block; }
.work-grid-wrap.hidden { display: none; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-label);
  font-weight: 300;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 28px;
}

.back-link:hover { color: var(--fg); }

.project-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 18px;
  margin-bottom: 24px;
}

.project-meta h2 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(24px, 4vw, 38px);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0;
}

.project-meta .p-client {
  font-family: var(--font-label);
  font-weight: 300;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.project-meta .p-format {
  font-family: var(--font-label);
  font-weight: 300;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.project-media {
  width: 70%;
  max-width: 1100px;
  margin: 0 auto;
}

@media (max-width: 900px) { .project-media { width: 100%; } }

.project-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--bg-elevated);
  overflow: hidden;
}

.project-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.project-video .placeholder-fill {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
}

/* ---------- Tabs ---------- */

.project-tabs {
  display: flex;
  justify-content: center;
  gap: 28px;
  margin: 26px 0 22px;
  border-bottom: 1px solid var(--line);
}

.tab {
  background: none;
  border: 0;
  cursor: pointer;
  font-family: var(--font-label);
  font-weight: 300;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 0 12px;
  margin-bottom: -1px;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease;
}

.tab:hover { color: var(--fg); }
.tab.active { color: var(--fg); border-bottom-color: var(--fg); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- Stills (Imagery tab) ---------- */

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

@media (max-width: 700px) { .stills-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px) { .stills-grid { grid-template-columns: 1fr; } }

.stills-grid .still {
  width: 100%;
  aspect-ratio: var(--img-ratio);
  object-fit: cover;
  display: block;
}

.stills-grid .placeholder-fill {
  aspect-ratio: var(--img-ratio);
}

.still-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  line-height: 0;
}

.still-btn:hover .still { opacity: 0.85; }

body.lb-locked { overflow: hidden; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 10, 0.9);
  padding: 6vh 8vw;
}

.lightbox.open { display: flex; }

.lightbox .lb-img {
  max-width: 100%;
  max-height: 88vh;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.lightbox button {
  position: absolute;
  background: none;
  border: 0;
  color: #fff;
  cursor: pointer;
  font-family: var(--font-body);
  line-height: 1;
  opacity: 0.75;
  transition: opacity 0.15s ease;
}

.lightbox button:hover { opacity: 1; }

.lb-close {
  top: 22px;
  right: 28px;
  font-size: 34px;
  font-weight: 300;
}

.lb-prev, .lb-next {
  top: 50%;
  transform: translateY(-50%);
  font-size: 56px;
  font-weight: 300;
  padding: 10px 16px;
}

.lb-prev { left: 12px; }
.lb-next { right: 12px; }

@media (max-width: 640px) {
  .lightbox { padding: 4vh 4vw; }
  .lb-prev, .lb-next { font-size: 40px; padding: 8px 10px; }
  .lb-close { top: 14px; right: 16px; font-size: 30px; }
}

/* ---------- Credits tab ---------- */

.credits-list {
  max-width: 560px;
  margin: 4px auto 0;
}

.credit-row {
  display: flex;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-label);
  font-weight: 300;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.credit-label { color: var(--muted); flex: 0 0 190px; }
.credit-value { color: var(--fg); }
.credit-link { text-decoration: underline; text-underline-offset: 3px; }
.credit-link:hover { color: var(--muted); }

@media (max-width: 460px) { .credit-label { flex-basis: 120px; } }

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

.site-footer {
  padding: var(--gutter);
  margin-top: 40px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-family: var(--font-label);
  font-weight: 300;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.site-footer a:hover { color: var(--fg); }
