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

:root {
  --nav-h: 56px;
  --font: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --black: #111;
  --mid: #555;
}

html, body {
  background: #fff;
  color: var(--black);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

/* ── HEADER ── */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: #fff;
  border-bottom: 1px solid #e8e8e8;
}

.nav-row {
  display: flex;
  align-items: center;
  gap: 20px;
}

.burger {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
  transition: transform 0.45s ease;
}

.burger.open { transform: rotate(90deg); }

.burger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: #111;
}

.nav-items {
  display: flex;
  align-items: center;
  gap: 24px;
  overflow: hidden;
  max-width: 0;
  opacity: 0;
  transition: max-width 0.45s ease, opacity 0.35s ease;
  white-space: nowrap;
}

.nav-items.open { max-width: 500px; opacity: 1; }

.nav-items a {
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #111;
  text-decoration: none;
  opacity: 0.5;
}

.nav-items a:hover { opacity: 1; }

.header-brand {
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #111;
  text-decoration: none;
}

/* ── PAGE ── */
.page {
  margin-top: var(--nav-h);
  padding: 0 60px 80px;
}

/* ── TITLE ── */
.project-title-wrap {
  padding: 60px 0 56px;
  text-align: left;
}

.project-title {
  font-size: 36px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--black);
}

/* ── ABOUT ── */
.about-section {
  padding-bottom: 48px;
  border-bottom: 1px solid #e8e8e8;
}

.about-label {
  font-size: 28px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--black);
  margin-bottom: 28px;
}

.about-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  column-gap: 60px;
}

.about-body p {
  font-size: 15px;
  line-height: 1.75;
  color: var(--mid);
}

/* ── FEATURED IMAGES ── */
.images-section {
  padding-top: 48px;
}

.images-label {
  font-size: 28px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--black);
  margin-bottom: 28px;
}

.gallery {
  display: flex;
  align-items: center;
  gap: 20px;
}

.gallery-pair {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 8px;
  height: auto;
  flex: 1;
}

.gallery-img {
  width: auto;
  height: auto;
  max-width: calc(50% - 4px);
  max-height: min(50vh, calc(50vw - 50px));
  min-width: 0;
  flex: 0 1 auto;
  aspect-ratio: auto;
  object-fit: contain;
  display: block;
}

.images-section.solo:not(.focused) .gallery-img {
  max-width: 60%;
}

.gallery-arrow {
  background: none;
  border: none;
  font-size: 48px;
  font-weight: 700;
  cursor: pointer;
  color: #555;
  padding: 8px;
  flex-shrink: 0;
  transition: color 0.2s;
  line-height: 1;
}

.gallery-arrow:hover { color: #111; }

.gallery-counter {
  margin-top: 12px;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: #aaa;
}

.gallery-close {
  display: none;
  position: fixed;
  top: 20px;
  right: 28px;
  background: none;
  border: none;
  font-size: 32px;
  color: #aaa;
  cursor: pointer;
  z-index: 201;
  line-height: 1;
  transition: color 0.2s;
}
.gallery-close:hover { color: #111; }

/* ── GALLERY FOCUS MODE ── */
body.gallery-focus {
  overflow: hidden;
}

.images-section.focused {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  padding: 60px 20px;
  margin: 0;
  box-sizing: border-box;
}


.images-section.focused .images-label {
  display: none;
}

.images-section.focused .gallery-close {
  display: block;
}

.images-section.focused .gallery-counter {
  margin-top: 16px;
}

.images-section.focused .gallery {
  width: 100%;
  padding: 0 80px;
}

.images-section.focused .gallery-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 202;
}

.images-section.focused .gallery-prev { left: 40px; }
.images-section.focused .gallery-next { right: 40px; }

.images-section.focused .gallery-pair {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  height: auto;
  width: 100%;
  overflow: hidden;
}

.images-section.focused:not(.solo) .gallery-img {
  width: auto !important;
  height: auto !important;
  max-height: min(calc(100vh - 160px), 580px) !important;
  max-width: none !important;
  flex: 0 1 auto !important;
  min-width: 0 !important;
  display: block;
}

/* Triple slides: equal-width grid */
.images-section.focused.triple .gallery-pair {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  align-items: start;
  width: 100%;
  overflow: hidden;
}

.images-section.focused.triple .gallery-img {
  width: 100% !important;
  height: auto !important;
  max-height: min(calc(100vh - 160px), 580px) !important;
  max-width: 100% !important;
  object-fit: contain !important;
  flex: unset !important;
}

/* Solo slides: natural height, capped to avoid overflow */
.images-section.focused.solo .gallery-img {
  height: auto !important;
  max-height: calc(100vh - 120px) !important;
  object-fit: contain;
}

/* Quad slides: 2x2 grid */
.images-section.focused.quad .gallery-pair {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 8px;
  width: 100%;
  height: calc(100vh - 160px);
  overflow: hidden;
}

.images-section.focused.quad .gallery-img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: none !important;
  object-fit: cover !important;
  flex: unset !important;
}


/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .page { padding: 0 32px 60px; }
  .about-section,
  .images-section { grid-template-columns: 1fr; gap: 24px; }
  .about-body { grid-template-columns: 1fr; }
}

@media (max-width: 540px) {
  .page { padding: 0 20px 48px; }
  .project-title { font-size: 26px; }
  .images-grid { grid-template-columns: 1fr; }
}

.header:has(.burger.open) .header-brand {
  display: none;
}

/* ── MOBILE SCROLL GALLERY ── */
.mobile-scroll { display: none; }

@media (max-width: 768px) {
  .images-section { display: none; }
  .mobile-scroll {
    display: block;
    width: 100vw;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 24px;
    padding: 0 3px;
  }
  .mobile-scroll img {
    width: 100%;
    height: auto;
    display: block;
    margin-bottom: 3px;
  }
  .mobile-scroll img:last-child { margin-bottom: 0; }
}
