/* ─── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img { display: block; width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }

/* ─── Tokens ─────────────────────────────────────────────────────────────────── */
:root {
  --bg:       #f7f6f3;
  --ink:      #111110;
  --muted:    #767370;
  --muted-label: #595856; /* lifted for WCAG AA at small sizes (≥4.5:1 on --bg) */
  --line:     #d8d6d2;

  --font:     'Inter', system-ui, sans-serif;
  --font-serif: 'Noto Serif', Georgia, serif;
  --gap:      24px;
  --max:      1240px;
  --pad:      48px;
}

/* ─── Base ───────────────────────────────────────────────────────────────────── */
html { font-size: 16px; scroll-behavior: smooth; background: var(--ink); }

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

/* ─── Header ─────────────────────────────────────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px var(--pad);
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.header.scrolled { border-color: var(--line); }

.logo {
  display: flex;
  align-items: center;
}

.logo img {
  height: 48px;
  width: 48px !important;
  display: block;
  object-fit: contain;
}

.nav {
  display: flex;
  gap: 32px;
}

.nav a {
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted);
  transition: color 0.15s;
  position: relative;
}

.nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.nav a:hover::after,
.nav a[aria-current]::after { transform: scaleX(1); }

.nav a:hover,
.nav a[aria-current] { color: var(--ink); }

/* ─── Hero ───────────────────────────────────────────────────────────────────── */
.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 80px var(--pad) 48px;
}

.hero-text {
  font-family: var(--font-serif);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.01em;
  max-width: 65ch;
  color: var(--ink);
}

.hero-sub {
  font-size: clamp(14px, 1.4vw, 18px);
  color: var(--muted);
  font-family: var(--font);
  font-weight: 400;
  letter-spacing: 0;
  margin-top: 12px;
}

/* ─── Work ───────────────────────────────────────────────────────────────────── */
.work {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad) 40px;
}

/* ─── Scroll reveal ──────────────────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Chapter ────────────────────────────────────────────────────────────────── */
.chapter {
  display: flex;
  flex-direction: column;
  padding: 64px 0;
  gap: 40px;
}

.chapter-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chapter-arrow {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  cursor: none;
  user-select: none;
  transition: color 0.15s;
}

.chapter-arrow:hover { color: var(--ink); }

.chapter-client {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-label);
  transition: color 0.15s;
}

a.chapter-client {
  padding: 8px 0; /* expand touch target without changing visual size */
}

a.chapter-client:hover { color: var(--ink); }

.chapter-desc {
  font-family: var(--font-serif);
  font-size: clamp(15px, 1.6vw, 20px);
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: 0;
  color: var(--ink);
  max-width: 65ch;
}

/* Image block — tight rows */
.chapter-images {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chapter-grid {
  display: grid;
  gap: 6px;
  align-items: start;
}

.chapter-grid--full  { grid-template-columns: 1fr; }
.chapter-grid--two   { grid-template-columns: 1fr 1fr; }
.chapter-grid--three { grid-template-columns: 1fr 1fr 1fr; }

/* Metadata row at bottom */
.chapter-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.meta-info {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}


.meta-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 100px;
  background: rgba(17, 17, 16, 0.05);
}


/* ─── Figure ─────────────────────────────────────────────────────────────────── */
.fig .fig-img-wrap {
  overflow: hidden;
  position: relative;
}

.fig-project-link {
  display: block;
  text-decoration: none;
}

.fig-project-label {
  position: absolute;
  bottom: 20px;
  right: 20px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #fff;
  text-decoration: none;
  padding: 8px 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.25s ease, background 0.2s ease, border-color 0.2s ease;
  pointer-events: none;
}

.fig-project-link:hover .fig-project-label {
  opacity: 1;
}

.fig-project-label:hover {
  background: rgba(0, 0, 0, 0.6);
  border-color: #fff;
}

.fig-project-link::after { display: none; }

.fig .fig-img-wrap::after {
  content: '↗';
  position: absolute;
  top: 12px;
  right: 14px;
  font-size: 13px;
  color: var(--bg);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  line-height: 1;
}

.fig .fig-img-wrap:hover::after {
  opacity: 0.8;
}

.fig img {
  aspect-ratio: 4/3;
  object-fit: cover;
  background: var(--line);
}

.chapter-grid--full .fig img,
.chapter-grid--full .fig video {
  aspect-ratio: 16/9;
  object-fit: cover;
}

.fig-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-label);
  line-height: 2;
}

.fig-value {
  font-size: 12px;
  font-weight: 400;
  color: var(--ink);
  line-height: 2;
}

/* ─── Divider ────────────────────────────────────────────────────────────────── */
.divider {
  display: flex;
  justify-content: center;
  border-top: 1px solid var(--line);
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
}

.divider span {
  font-size: 18px;
  color: var(--muted);
  line-height: 1;
  background: var(--bg);
  padding: 0 8px;
  transform: translateY(-50%);
  display: block;
}

/* ─── CTA ────────────────────────────────────────────────────────────────────── */
.cta {
  border-top: 1px solid var(--line);
}

.cta-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 80px var(--pad) 96px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.cta-headline {
  font-family: var(--font-serif);
  font-size: clamp(48px, 8vw, 112px);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  display: block;
  transition: opacity 0.2s;
}

.cta-headline:hover {
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-thickness: 1px;
}

/* ─── Footer ─────────────────────────────────────────────────────────────────── */
.footer-full {
  background: var(--ink);
  color: var(--bg);
  margin-top: 40px;
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 40px var(--pad);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-links-row {
  display: flex;
  gap: 28px;
  align-items: center;
}

.footer-links-row a {
  font-size: 12px;
  font-weight: 400;
  color: rgba(247, 246, 243, 0.7);
  text-decoration: none;
  transition: color 0.15s;
  display: flex;
  align-items: center;
}

.footer-links-row a:hover { color: var(--bg); }

.footer-copy {
  font-size: 12px;
  color: rgba(247, 246, 243, 0.5);
}

/* ─── Project page ───────────────────────────────────────────────────────────── */
.project {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad) 80px;
}

.project-hero {
  margin: 0 calc(-1 * var(--pad));
  margin-bottom: 64px;
}

.project-hero img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
}

.project-intro {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  padding-bottom: 64px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0;
}

.project-intro-left {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.project-title {
  font-family: var(--font-serif);
  font-size: clamp(32px, 4.5vw, 60px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.project-meta-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 8px;
}

.project-meta-item {
  display: flex;
  gap: 16px;
  align-items: baseline;
}

.project-intro-right {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-top: 8px;
}

.project-desc {
  font-family: var(--font-serif);
  font-size: clamp(15px, 1.5vw, 18px);
  font-weight: 400;
  line-height: 1.7;
  color: var(--ink);
}

.project-gallery {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 48px;
}

.project-nav {
  max-width: var(--max);
  margin: 0 auto;
  padding: 40px var(--pad) 56px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
}

.project-nav-back,
.project-nav-next {
  font-size: 13px;
  font-weight: 400;
  color: var(--muted-label);
  text-decoration: none;
  transition: color 0.15s;
}

.project-nav-back:hover,
.project-nav-next:hover { color: var(--ink); }

/* ─── About ──────────────────────────────────────────────────────────────────── */

.about-page {
  max-width: var(--max);
  margin: 0 auto;
  padding: 72px var(--pad) 120px;
}

.about-statement {
  padding-bottom: 64px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.about-headline {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(2.2rem, 5vw, 4.5rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 2rem;
}

.about-body {
  font-size: clamp(1rem, 1.6vw, 1.35rem);
  line-height: 1.6;
  color: var(--muted-label);
  max-width: 56ch;
  margin: 0 0 0.75rem;
}

.about-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

/* Clients row */
.about-clients {
  padding-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.about-clients-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.about-client-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 0;
}

.about-client-item a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.about-client-logo {
  display: block;
  width: 100%;
  max-width: 110px;
  height: 38px;
  object-fit: contain;
  filter: grayscale(1) contrast(1.3);
  mix-blend-mode: multiply;
  opacity: 0.8;
}

.about-client-fallback {
  display: none;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.about-col-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-label);
}


/* ─── Custom Cursor ──────────────────────────────────────────────────────────── */
* { cursor: none; }
a, button { cursor: none; }

.cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 8px;
  height: 8px;
  background: #fff;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  mix-blend-mode: difference;
  transition:
    width  0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    height 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    background 0.3s ease,
    border 0.3s ease;
}

.cursor.expanded {
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid #fff;
}

.cursor.in-lightbox {
  mix-blend-mode: normal;
  background: #fff;
}

@media (hover: none) {
  * { cursor: auto; }
  a, button { cursor: auto; }
  .cursor { display: none; }
}

/* ─── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  :root {
    --pad: 24px;
  }

  .hero { padding-top: 56px; padding-bottom: 48px; }
  .chapter { padding: 48px 0; gap: 32px; }
}

@media (max-width: 640px) {
  :root { --pad: 20px; }

  .chapter-desc { font-size: 16px; max-width: 100%; }
  .project-intro { grid-template-columns: 1fr; gap: 40px; }
  .project-hero { margin-bottom: 40px; }
  .project-gallery { padding-top: 40px; }
  .chapter-grid--full .fig img,
  .chapter-grid--full .fig video { aspect-ratio: 4/3; }
  .project-nav { padding: 28px var(--pad) 40px; }

  .footer-inner { flex-direction: column; align-items: flex-start; gap: 20px; }
  .footer-links-row { flex-wrap: wrap; gap: 16px; }
}

@media (max-width: 640px) {
  .about-hero-name { font-size: clamp(40px, 12vw, 80px); }
  .about-hero-bio-wrap { max-width: 100%; }
  .about-hero-bio { font-size: 14px; }

  .about-clients-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
  }

  .about-client-item {
    padding: 20px 8px;
  }

  .about-client-logo {
    max-height: 24px;
    max-width: 80px;
  }
}

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

/* ─── Lightbox ───────────────────────────────────────────────────────────────── */
.header,
main,
.footer-full {
  transition: filter 0.35s ease;
}

body.lightbox-open .header,
body.lightbox-open main,
body.lightbox-open .footer-full {
  filter: blur(10px);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(17, 17, 16, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: all;
}

.lightbox img,
.lightbox video {
  max-width: 92vw;
  max-height: 92vh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 28px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(247, 246, 243, 0.75);
  cursor: pointer;
  transition: color 0.15s;
  -webkit-appearance: none;
  appearance: none;
  background: none;
  border: none;
  font-family: var(--font);
}

.lightbox-close:hover { color: var(--bg); }

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  -webkit-appearance: none;
  appearance: none;
  background: none;
  border: none;
  color: rgba(247,246,243,0.5);
  font-size: 28px;
  line-height: 1;
  padding: 16px 24px;
  cursor: pointer;
  transition: color 0.15s;
  font-family: var(--font);
  z-index: 10;
}

.lightbox-prev { left: 0; }
.lightbox-next { right: 0; }
.lightbox-prev:hover,
.lightbox-next:hover { color: var(--bg); }

.fig .fig-img-wrap img,
.fig .fig-img-wrap video {
  display: block;
  width: 100%;
  height: auto;
  transition: filter 0.3s ease;
}

.fig .fig-img-wrap:hover img,
.fig .fig-img-wrap:hover video {
  filter: brightness(0.85);
}

/* ─── Video controls ──────────────────────────────────────────────────────── */
.project-hero.video-wrap {
  position: relative;
}

.project-hero.video-wrap video {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
  transition: filter 0.3s ease;
}

.video-overlay {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.video-wrap:hover .video-overlay {
  opacity: 1;
  pointer-events: auto;
}

.video-wrap:hover video {
  filter: brightness(0.75);
}

.video-controls {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.video-controls .video-ctrl-btn:first-child {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: auto;
}

.video-controls .video-ctrl-btn:last-child {
  position: absolute;
  left: calc(50% + 36px);
  top: 50%;
  transform: translateY(-50%);
  pointer-events: auto;
  transition: opacity 0.2s ease;
}

.video-project-link {
  position: absolute;
  bottom: 20px;
  right: 20px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #fff;
  text-decoration: none;
  padding: 8px 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.video-project-link:hover {
  background: rgba(0, 0, 0, 0.6);
  border-color: #fff;
}

.video-ctrl-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  cursor: none;
  backdrop-filter: blur(8px);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.video-ctrl-btn:hover {
  background: rgba(0, 0, 0, 0.65);
  border-color: #fff;
  transform: scale(1.08);
}

.video-timeline {
  position: absolute;
  bottom: 20px;
  left: 24px;
  right: 24px;
}

.video-overlay:has(.video-project-link) .video-timeline {
  right: 172px;
  height: 38px;
  display: flex;
  align-items: center;
  cursor: none;
  pointer-events: auto;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 20px;
  border: 1.5px solid rgba(255,255,255,0.12);
  padding: 0 16px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.video-timeline:hover {
  background: rgba(0,0,0,0.5);
  border-color: rgba(255,255,255,0.25);
}

.video-timeline-track {
  position: relative;
  width: 100%;
  height: 2px;
  background: rgba(255,255,255,0.22);
  border-radius: 1px;
  pointer-events: none;
  transition: background 0.15s ease;
}

.video-timeline:hover .video-timeline-track {
  background: rgba(255,255,255,0.3);
}

.video-timeline-progress {
  height: 100%;
  width: 0%;
  background: rgba(255,255,255,0.9);
  border-radius: 1px;
}

/* ─── Focus states ───────────────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 2px;
}

.nav a:focus-visible,
.footer-links-row a:focus-visible,
.about-col a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
  border-radius: 2px;
}


.lightbox-close:focus-visible {
  outline: 2px solid var(--bg);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Images inside overflow:hidden wrappers can't show outline — use box-shadow instead */
.fig .fig-img-wrap img:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 3px var(--ink);
}

/* ─── Reduced motion ─────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .lightbox {
    transition: none;
  }

  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
