/* ─── Reset ─── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ─── Base ─────────────────────────────────────────────────────────────
   body font-size: 10px → 1em = 10px throughout (easy em math)
─────────────────────────────────────────────────────────────────────── */
html {
  scroll-behavior: smooth;
}

body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 10px;
  font-weight: 400;
  line-height: 1;
  background: #fff;
  color: #000;
  overflow-x: hidden;
}

::-webkit-scrollbar {
  width: 0;
  background: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}
img {
  display: block;
}
h1,
h2,
h3 {
  font-weight: 400;
}

/* ─── Header ──────────────────────────────────────────────────────────
   Fixed, full-width, 4-column grid matching the project grid
─────────────────────────────────────────────────────────────────────── */
.site-header {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  grid-column-gap: 2em;
  position: fixed;
  top: 1em;
  left: 1em;
  right: 1em;
  z-index: 100;
  background: transparent;
}

.header-name {
  font-size: clamp(1.8em, 2.2vw, 2.4em);
  line-height: 1.3;
  grid-area: 1 / 1 / 2 / 3;
}

.nav-btn {
  font-size: clamp(1.8em, 2.2vw, 2.4em);
  line-height: 1.3;
  grid-area: 1 / 4 / 2 / 5;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  font-weight: 400;
  color: inherit;
  padding: 0;
  text-align: left;
}

.nav-btn[data-hidden] {
  display: none;
}

/* ─── Site container ──────────────────────────────────────────────────
   15em top padding = 150px clears the fixed header
─────────────────────────────────────────────────────────────────────── */
.site-container {
  padding: 10em 1em 0;
}

/* ─── Project ─────────────────────────────────────────────────────────
   4-column grid:  [heading] [gallery gallery] [copy]
─────────────────────────────────────────────────────────────────────── */
.project {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  grid-column-gap: 2em;
  grid-row-gap: 2em;
  padding-bottom: 8em;
}

/* Left column — project name, client, year */
.project-heading {
  grid-area: 1 / 1 / 2 / 2;
  position: sticky;
  top: 8em;
  align-self: start;
}

.project-name {
  font-size: clamp(1.8em, 2.2vw, 2.4em);
  line-height: 1.3;
}

.project-client {
  display: block;
  font-size: clamp(1.8em, 2.2vw, 2.4em);
  line-height: 1.3;
}

.project-date {
  font-size: clamp(1.8em, 2.2vw, 2.4em);
  line-height: 1.3;
}

/* Center — slider (spans columns 2–3) */
.project-slider {
  grid-area: 1 / 2 / 2 / 4;
  position: relative;
}

.slides-viewport {
  width: 100%;
  overflow: hidden;
}

.slides-track {
  display: flex;
  gap: 10px;
  will-change: transform;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide {
  flex: none;
  width: 100%;
  position: relative;
}

.slide img {
  width: 100%;
  height: auto;
  max-height: 32vw;
  object-fit: contain;
  object-position: left top;
}

/* Placeholder shown when image src is missing / broken */
.slide-ph {
  width: 100%;
  aspect-ratio: 4 / 3;
}

/* Invisible click zones covering left/right halves of the slider */
.slider-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  z-index: 10;
}
.slider-zone.prev {
  left: 0;
  cursor:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none'%3E%3Cpath d='M20 6L8 16L20 26' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E")
      16 16,
    w-resize;
}
.slider-zone.next {
  right: 0;
  cursor:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none'%3E%3Cpath d='M12 6L24 16L12 26' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E")
      16 16,
    e-resize;
}

/* Right column — description */
.project-copy {
  grid-area: 1 / 4 / 2 / 5;
  position: sticky;
  top: 8em;
  align-self: start;
}

.project-copy p {
  font-size: 1.5em;
  line-height: 1.5;
  padding-bottom: 10px;
}

/* ─── Expand button ────────────────────────────────────────────────── */
.expand-btn {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 20;
  width: 28px;
  height: 28px;
  border: 1.5px solid #000;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
  padding: 0;
}

.expand-btn svg {
  width: 14px;
  height: 14px;
}

.project-slider:hover .expand-btn,
.mobile-img-wrap:hover .expand-btn {
  opacity: 1;
}

.mobile-img-wrap {
  position: relative;
}

/* ─── Lightbox ──────────────────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.35s ease,
    visibility 0.35s ease;
  cursor: pointer;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  cursor: default;
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.lightbox-close svg {
  width: 32px;
  height: 32px;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-nav svg {
  width: 24px;
  height: 24px;
}

.lightbox-prev {
  left: 24px;
}

.lightbox-next {
  right: 24px;
}

/* Mobile image stack — hidden on desktop, shown ≤767px */
.mobile-images {
  display: none;
}

/* ─── Cross-breakpoint transitions ────────────────────────────────────
   Smooth out font-size, spacing, and height changes that happen when
   the viewport crosses a breakpoint threshold.
─────────────────────────────────────────────────────────────────────── */

/* Text sizing */
.header-name,
.nav-btn,
.project-name,
.project-client,
.project-date,
.project-copy p,
.footer-name,
.footer-email,
.footer-ig,
.info-bio {
  transition: font-size 0.4s ease;
}

/* Fade the carousel out when it hides at mobile */
.project-slider {
  transition: opacity 0.35s ease;
}

/* Fade-in keyframe for mobile images appearing */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ─── Footer ──────────────────────────────────────────────────────────*/
.site-footer {
  border-top: 1px solid #000;
  padding-top: 1em;
  padding-bottom: 2em;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  grid-column-gap: 2em;
}

.footer-name {
  display: none;
}

.footer-email {
  font-size: 1.4em;
  line-height: 1.3;
  grid-area: 1 / 1 / 2 / 3;
}

.footer-ig {
  font-size: 1.4em;
  line-height: 1.3;
  grid-area: 1 / 4 / 2 / 5;
  text-align: right;
}

/* ─── Information overlay ─────────────────────────────────────────────
   Full-screen fixed panel in warm gray, toggled by nav button.
   Uses opacity/visibility instead of display:none so it can fade.
─────────────────────────────────────────────────────────────────────── */
.info-overlay {
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0;
  z-index: 50;
  background: #bbb9b9;
  padding: 15em 1em 0;
  overflow-y: auto;
  /* Hidden by default — fade in/out via opacity */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.45s ease,
    visibility 0.45s ease;
}

.info-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Inner grid — rule + bio. flex:1 makes it grow so footer is pushed to bottom */
.info-content {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
  grid-column-gap: 2em;
  align-content: start;
}

.info-rule {
  grid-column: 1 / -1;
  border-top: 1px solid #000;
}

.info-bio {
  grid-column: 1 / 5;
  font-size: 1.4em;
  line-height: 1.4;
  padding-top: 2em;
  padding-bottom: 4em;
}

.info-bio p {
  padding-bottom: 10px;
}

.info-image {
  grid-column: 7 / 9;
  padding-top: 2em;
}

.info-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* Footer sits as a flex item — always at the bottom of the overlay */
.info-footer {
  border-top: 1px solid #000;
  padding-top: 10px;
  padding-bottom: 2em;
  margin-top: 2em;
}

/* ═══════════════════════════════════════════════════════════════════════
   RESPONSIVE — TABLET  ≤991px
   · font-size → 8px  (all em values scale down automatically)
   · header: 6-col grid, name left, nav far right
   · project: 6-col grid; heading + copy on row 1, slider full-width row 2
   · heading loses sticky; slide height fixed at 64vw
═══════════════════════════════════════════════════════════════════════ */
@media screen and (max-width: 991px) {
  /* Header */
  .site-header {
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr;
  }
  .header-name {
    grid-area: 1 / 1 / 2 / 4; /* cols 1–3 */
  }
  .nav-btn {
    grid-area: 1 / 6 / 2 / 7; /* col 6, far right */
    text-align: right;
    justify-self: end;
  }

  /* Project grid */
  .project {
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr;
    border-top: 1px solid #000;
    padding-top: 2em;
    padding-bottom: 10em;
  }

  /* heading: row 1, cols 1–2, no longer sticky */
  .project-heading {
    grid-area: 1 / 1 / 2 / 3;
    position: static;
    top: auto;
  }

  /* slider: row 2, full 6 cols */
  .project-slider {
    grid-area: 2 / 1 / 3 / 7;
  }

  /* slides fixed at 64vw height */
  .slides-viewport {
    height: 64vw;
  }
  .slide {
    height: 64vw;
  }
  .slide img {
    max-height: none;
    height: 100%;
    object-fit: contain;
    object-position: left top;
  }

  /* copy: row 1, cols 4–6 */
  .project-copy {
    grid-area: 1 / 4 / 2 / 7;
    padding-bottom: 2em;
    padding-right: 2em;
  }

  /* Information overlay */
  .info-content {
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr;
  }
  .info-bio {
    grid-column: 1 / 4;
    /* padding-bottom: 0; */
  }
  .info-image {
    grid-column: 4 / 7;
    padding-top: 2em;
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr;
  }
  .footer-email {
    grid-area: 1 / 1 / 2 / 4;
  }
  .footer-ig {
    grid-area: 1 / 6 / 2 / 7;
    text-align: right;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE  ≤767px
   · header collapses to 2 cols
   · carousel hidden → static image stack shown
   · heading, images, copy all span full width and stack vertically
   · copy loses sticky
═══════════════════════════════════════════════════════════════════════ */
@media screen and (max-width: 767px) {
  /* Header collapses to 2 cols */
  .site-header {
    grid-template-columns: 1fr 1fr;
  }
  .header-name {
    grid-area: 1 / 1 / 2 / 2;
  }
  .nav-btn {
    grid-area: 1 / 2 / 2 / 3;
    text-align: right;
    justify-self: end;
  }

  /* Project — flex column so copy can be sticky over images */
  .project {
    display: flex;
    flex-direction: column;
    padding-top: 2em;
  }

  /* heading: first in flow */
  .project-heading {
    order: 1;
  }

  /* carousel hidden */
  .project-slider {
    display: none;
  }

  /* copy: after heading, sticky over images */
  .project-copy {
    order: 2;
    position: sticky;
    top: 5.5em;
    padding-top: 4em;
    padding-right: 0;
    padding-bottom: 2em;
    background: transparent;
    z-index: 10;
  }

  /* static image stack: after copy in flow — fades in */
  .mobile-images {
    order: 3;
    display: block;
    animation: fadeIn 0.45s ease forwards;
  }
  .mobile-img-wrap {
    margin-bottom: 1em;
  }
  .mobile-img {
    width: 100%;
    height: auto;
    display: block;
  }
  .mobile-img-ph {
    width: 100%;
    aspect-ratio: 4 / 3;
  }

  /* Information overlay */
  .info-content {
    grid-template-columns: 1fr 1fr;
  }
  .info-bio {
    grid-column: 1 / -1;
    padding-bottom: 2em;
  }
  .info-image {
    grid-column: 1 / -1;
    padding-top: 0;
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr 1fr 1fr 1fr;
    grid-template-rows: auto auto;
  }
  .footer-name {
    display: none;
  }
  .footer-email {
    grid-area: 1 / 1 / 2 / 3;
  }
  .footer-ig {
    grid-area: 1 / 3 / 2 / 5;
    text-align: right;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   RESPONSIVE — SMALL MOBILE  ≤479px
   · font-size → 7px
   · project abandons grid entirely → display: block
   · info overlay becomes single column
   · footer collapses to 2 cols
═══════════════════════════════════════════════════════════════════════ */
@media screen and (max-width: 479px) {
  /* Project — flex column so we can reorder copy before images */
  .project {
    display: flex;
    flex-direction: column;
    padding-bottom: 8em;
  }
  .project-heading {
    order: 1;
    padding-bottom: 0em;
  }
  .project-copy {
    order: 2;
    position: sticky;
    top: 7.25em;
    padding-top: 0;
    padding-bottom: 2em;
    background: transparent;
    z-index: 10;
    font-size: 0.75em;
  }
  .mobile-images {
    order: 3;
  }
  .project-slider {
    order: 4;
  }
  .mobile-img-wrap {
    margin-bottom: 1em;
  }

  .info-overlay {
    padding-top: 10em;
  }

  /* Information overlay — single column */
  .info-content {
    grid-template-columns: 1fr;
  }
  .info-bio {
    padding-bottom: 4em;
  }

  /* Footer — 2 cols */
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .footer-email {
    grid-area: 1 / 1 / 2 / 2;
    text-align: left;
  }
  .footer-ig {
    grid-area: 1 / 2 / 2 / 3;
    text-align: right;
  }
}
