/* ═══════════════════════════════════════════════════════════════
   MUMUF.COM — Editorial Portfolio Stylesheet
   Visual Language: Studio / Portfolio / Photography / Minimal
   ═══════════════════════════════════════════════════════════════ */

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

/* ── TOKENS ─────────────────────────────────────────────────── */
:root {
  --bg: #ffffff;
  --bg-alt: #f7f7f3;
  --text: #151515;
  --muted: #888888;
  --line: #e0e0e0;
  
  --font: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-inter: 'Inter', var(--font);
  
  --nav-size: 13px;
  --nav-weight: 400;
  --nav-gap: 24px;
  --nav-color: var(--text);
  --nav-active-opacity: 1;
  --nav-inactive-opacity: 0.45;
  
  --title-size: 15px;
  --title-weight: 400;
  
  --page-pad: 28px;
  --grid-gap: 22px;
  --row-gap: 32px;
  
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --dur: 400ms;
}

/* ── BASE ────────────────────────────────────────────────────── */
html {
  font-size: 14px;
  line-height: 1.15;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  overflow-x: hidden;
}

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

button {
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  color: inherit;
  padding: 0;
}

img {
  display: block;
  max-width: 100%;
}

/* ── SCROLLBAR ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 3px; height: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 0; }

/* ── HEADER / NAV ────────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px var(--page-pad);
  background: var(--bg);
}

.site-logo {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--nav-gap);
}

.site-nav a {
  font-size: var(--nav-size);
  font-weight: var(--nav-weight);
  letter-spacing: 0.04em;
  color: var(--nav-color);
  opacity: var(--nav-inactive-opacity);
  transition: opacity 0.2s var(--ease);
}

.site-nav a:hover,
.site-nav a.active {
  opacity: var(--nav-active-opacity);
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  font-size: var(--nav-size);
  font-weight: var(--nav-weight);
  letter-spacing: 0.04em;
  color: var(--text);
}

/* Mobile nav overlay */
.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99;
  background: var(--bg);
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: var(--page-pad);
  gap: 32px;
}

.mobile-nav.open {
  display: flex;
}

.mobile-nav a {
  font-size: 28px;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--text);
  opacity: 0.35;
  transition: opacity 0.2s;
}

.mobile-nav a:hover,
.mobile-nav a.active {
  opacity: 1;
}

.mobile-nav-close {
  position: absolute;
  top: 20px;
  right: var(--page-pad);
  font-size: 13px;
  color: var(--muted);
}

/* ── MAIN ────────────────────────────────────────────────────── */
.page-main {
  padding-top: 64px; /* header height + padding */
}

/* ── PROJECT SECTION ─────────────────────────────────────────── */
.project-section {
  padding: 0 var(--page-pad);
  margin-bottom: 120px;
}

.project-section:first-of-type {
  padding-top: 48px;
}

.project-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: var(--row-gap);
}

.project-title {
  font-size: var(--title-size);
  font-weight: var(--title-weight);
  letter-spacing: 0;
  color: var(--text);
}

.project-count {
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* ── PROJECT GALLERY — 12 COLUMN EDITORIAL GRID ─────────────── */
.project-gallery {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--grid-gap);
  row-gap: var(--grid-gap);
}

/* Gallery Items */
.gallery-item {
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-alt);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s var(--ease);
}

.gallery-item:hover img {
  opacity: 0.85;
}

/* Orientation modifiers */
.gallery-item.portrait img {
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.gallery-item.square img {
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.gallery-item.landscape img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.gallery-item.wide img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* ── LAYOUT PRESETS ─────────────────────────────────────────── */

/* Layout A: 5 images — featured spread */
.layout-A .gallery-item:nth-child(1) {
  grid-column: 1 / span 5;
}
.layout-A .gallery-item:nth-child(2) {
  grid-column: 7 / span 4;
  margin-top: 80px;
}
.layout-A .gallery-item:nth-child(3) {
  grid-column: 3 / span 4;
  margin-top: 40px;
}
.layout-A .gallery-item:nth-child(4) {
  grid-column: 8 / span 5;
}
.layout-A .gallery-item:nth-child(5) {
  grid-column: 2 / span 7;
  margin-top: 48px;
}

/* Layout B: 4 images — balanced */
.layout-B .gallery-item:nth-child(1) {
  grid-column: 2 / span 4;
}
.layout-B .gallery-item:nth-child(2) {
  grid-column: 7 / span 5;
  margin-top: 100px;
}
.layout-B .gallery-item:nth-child(3) {
  grid-column: 1 / span 6;
  margin-top: 32px;
}
.layout-B .gallery-item:nth-child(4) {
  grid-column: 8 / span 4;
  margin-top: 20px;
}

/* Layout C: 8 images — story flow */
.layout-C .gallery-item:nth-child(1) {
  grid-column: 1 / span 5;
}
.layout-C .gallery-item:nth-child(2) {
  grid-column: 7 / span 4;
  margin-top: 60px;
}
.layout-C .gallery-item:nth-child(3) {
  grid-column: 3 / span 3;
}
.layout-C .gallery-item:nth-child(4) {
  grid-column: 8 / span 5;
}
.layout-C .gallery-item:nth-child(5) {
  grid-column: 1 / span 4;
}
.layout-C .gallery-item:nth-child(6) {
  grid-column: 6 / span 3;
  margin-top: 80px;
}
.layout-C .gallery-item:nth-child(7) {
  grid-column: 10 / span 3;
}
.layout-C .gallery-item:nth-child(8) {
  grid-column: 2 / span 8;
  margin-top: 40px;
}

/* Layout D: 12+ images — magazine spread */
.layout-D {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--grid-gap);
  row-gap: var(--grid-gap);
}

.layout-D .gallery-item:nth-child(1) {
  grid-column: 1 / span 6;
}
.layout-D .gallery-item:nth-child(2) {
  grid-column: 8 / span 5;
}
.layout-D .gallery-item:nth-child(3) {
  grid-column: 2 / span 4;
  margin-top: 60px;
}
.layout-D .gallery-item:nth-child(4) {
  grid-column: 7 / span 4;
  margin-top: 40px;
}
.layout-D .gallery-item:nth-child(5) {
  grid-column: 1 / span 5;
  margin-top: 80px;
}
.layout-D .gallery-item:nth-child(6) {
  grid-column: 7 / span 6;
}
.layout-D .gallery-item:nth-child(7) {
  grid-column: 3 / span 4;
  margin-top: 40px;
}
.layout-D .gallery-item:nth-child(8) {
  grid-column: 8 / span 5;
  margin-top: 60px;
}
.layout-D .gallery-item:nth-child(n+9) {
  grid-column: span 4;
  margin-top: 20px;
}

/* ── CATALOGUE PAGE ─────────────────────────────────────────── */
.catalogue-grid {
  padding: 80px var(--page-pad) 120px;
  columns: 6;
  column-gap: 10px;
}

.catalogue-item {
  break-inside: avoid;
  margin-bottom: 10px;
  cursor: pointer;
  overflow: hidden;
  background: var(--bg-alt);
}

.catalogue-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: opacity 0.3s var(--ease);
}

.catalogue-item:hover img {
  opacity: 0.8;
}

/* ── INFO PAGE ──────────────────────────────────────────────── */
.info-page {
  padding: 80px var(--page-pad) 120px;
  max-width: 600px;
}

.info-section {
  margin-bottom: 72px;
}

.info-label {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
}

.info-text {
  font-size: 14px;
  font-weight: 300;
  line-height: 1.9;
  color: var(--text);
  letter-spacing: 0.01em;
}

.info-text a {
  border-bottom: 1px solid var(--line);
  transition: border-color 0.2s;
}

.info-text a:hover {
  border-color: var(--text);
}

.info-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.info-link {
  font-size: 13px;
  font-weight: 300;
  color: var(--muted);
  letter-spacing: 0.01em;
  transition: color 0.2s;
}

.info-link:hover {
  color: var(--text);
}

.info-works {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.info-work {
  font-size: 13px;
  font-weight: 300;
  color: var(--text);
  letter-spacing: 0.01em;
}

/* ── LIGHTBOX ────────────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur) var(--ease);
}

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

.lightbox-content {
  position: relative;
  max-width: calc(100vw - 80px);
  max-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: calc(100vh - 80px);
  object-fit: contain;
}

.lightbox-ui {
  position: fixed;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 28px;
}

.lightbox-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.lightbox-counter {
  font-size: 12px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.05em;
}

.lightbox-close {
  font-size: 12px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.05em;
  cursor: pointer;
  pointer-events: all;
  transition: color 0.2s;
}

.lightbox-close:hover {
  color: #fff;
}

.lightbox-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.lightbox-sound {
  font-size: 11px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lightbox-nav-hint {
  font-size: 11px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 0.05em;
}

.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 80px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: all;
  opacity: 0;
  transition: opacity 0.2s;
}

.lightbox:hover .lightbox-nav {
  opacity: 1;
}

.lightbox-nav.prev {
  left: 0;
}

.lightbox-nav.next {
  right: 0;
}

.lightbox-nav-arrow {
  font-size: 20px;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 300;
}

.lightbox-nav:hover .lightbox-nav-arrow {
  color: rgba(255, 255, 255, 0.9);
}

/* ── THEME TOGGLE ────────────────────────────────────────────── */
.theme-toggle {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s;
  padding: 4px 0;
}

.theme-toggle:hover {
  color: var(--text);
}

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
  :root {
    --page-pad: 24px;
    --grid-gap: 16px;
    --row-gap: 28px;
  }
  
  /* Tablet: 8 column grid */
  .project-gallery,
  .layout-A, .layout-B, .layout-C {
    grid-template-columns: repeat(8, 1fr);
  }
  
  .layout-A .gallery-item:nth-child(1) { grid-column: 1 / span 4; }
  .layout-A .gallery-item:nth-child(2) { grid-column: 5 / span 4; margin-top: 60px; }
  .layout-A .gallery-item:nth-child(3) { grid-column: 1 / span 4; margin-top: 30px; }
  .layout-A .gallery-item:nth-child(4) { grid-column: 5 / span 4; }
  .layout-A .gallery-item:nth-child(5) { grid-column: 1 / span 8; margin-top: 40px; }
  
  .layout-B .gallery-item:nth-child(1) { grid-column: 1 / span 4; }
  .layout-B .gallery-item:nth-child(2) { grid-column: 5 / span 4; margin-top: 80px; }
  .layout-B .gallery-item:nth-child(3) { grid-column: 1 / span 4; margin-top: 24px; }
  .layout-B .gallery-item:nth-child(4) { grid-column: 5 / span 4; margin-top: 16px; }
  
  .catalogue-grid {
    columns: 5;
  }
}

@media (max-width: 768px) {
  :root {
    --page-pad: 16px;
    --grid-gap: 12px;
    --row-gap: 24px;
  }
  
  .site-nav {
    display: none;
  }
  
  .menu-toggle {
    display: block;
  }
  
  .page-main {
    padding-top: 60px;
  }
  
  .project-section {
    margin-bottom: 80px;
  }
  
  .project-section:first-of-type {
    padding-top: 32px;
  }
  
  /* Mobile: 4 column grid */
  .project-gallery,
  .layout-A, .layout-B, .layout-C {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .layout-A .gallery-item:nth-child(1) { grid-column: 1 / span 4; }
  .layout-A .gallery-item:nth-child(2) { grid-column: 3 / span 2; margin-top: 40px; }
  .layout-A .gallery-item:nth-child(3) { grid-column: 1 / span 2; margin-top: 24px; }
  .layout-A .gallery-item:nth-child(4) { grid-column: 3 / span 2; }
  .layout-A .gallery-item:nth-child(5) { grid-column: 1 / span 4; margin-top: 32px; }
  
  .layout-B .gallery-item:nth-child(1) { grid-column: 1 / span 4; }
  .layout-B .gallery-item:nth-child(2) { grid-column: 2 / span 3; margin-top: 60px; }
  .layout-B .gallery-item:nth-child(3) { grid-column: 1 / span 4; margin-top: 20px; }
  .layout-B .gallery-item:nth-child(4) { grid-column: 2 / span 3; margin-top: 12px; }
  
  .layout-C .gallery-item:nth-child(1) { grid-column: 1 / span 4; }
  .layout-C .gallery-item:nth-child(2) { grid-column: 3 / span 2; margin-top: 40px; }
  .layout-C .gallery-item:nth-child(3) { grid-column: 1 / span 2; }
  .layout-C .gallery-item:nth-child(4) { grid-column: 3 / span 2; }
  .layout-C .gallery-item:nth-child(5) { grid-column: 1 / span 2; margin-top: 60px; }
  .layout-C .gallery-item:nth-child(6) { grid-column: 3 / span 2; margin-top: 60px; }
  .layout-C .gallery-item:nth-child(7) { grid-column: 1 / span 2; }
  .layout-C .gallery-item:nth-child(8) { grid-column: 1 / span 4; margin-top: 32px; }
  
  /* Mobile lightbox */
  .lightbox {
    background: #000;
  }
  
  .lightbox-content {
    max-width: 100vw;
    max-height: 100vh;
  }
  
  .lightbox-content img {
    max-height: 100vh;
    width: auto;
  }
  
  .lightbox-nav {
    width: 50px;
    opacity: 1;
  }
  
  .lightbox-ui {
    padding: 16px;
  }
  
  /* Catalogue: 3 columns on mobile */
  .catalogue-grid {
    columns: 3;
    column-gap: 8px;
    padding-bottom: 80px;
  }
  
  .catalogue-item {
    margin-bottom: 8px;
  }
  
  /* Info mobile */
  .info-page {
    padding: 60px var(--page-pad) 80px;
  }
  
  .info-section {
    margin-bottom: 56px;
  }
}

/* ── DARK THEME ─────────────────────────────────────────────── */
html.dark {
  --bg: #0a0a0a;
  --bg-alt: #141414;
  --text: #f0f0f0;
  --muted: #666666;
  --line: #2a2a2a;
}

html.dark .catalogue-item,
html.dark .gallery-item {
  background: var(--bg-alt);
}

/* ── ENTRANCE ANIMATION ─────────────────────────────────────── */
.project-section {
  opacity: 0;
  transform: translateY(12px);
  animation: fadeUp 0.5s var(--ease-out) forwards;
}

.project-section:nth-child(1) { animation-delay: 0.1s; }
.project-section:nth-child(2) { animation-delay: 0.2s; }
.project-section:nth-child(3) { animation-delay: 0.3s; }
.project-section:nth-child(4) { animation-delay: 0.4s; }
.project-section:nth-child(5) { animation-delay: 0.5s; }

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .project-section {
    opacity: 1;
    transform: none;
    animation: none;
  }
}
