/* ══════════════════════════════════════════
   MARCELA MEIGNAN — Global CSS v3
   Shared across all inner pages
══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --black:  #0a0a0a;
  --white:  #ffffff;
  --off:    #f4f4f2;
  --mid:    #8a8a8a;
  --light:  #d4d4d0;
  --border: #e0e0dc;
  --dark:   #111111;
  --f: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
html { scroll-behavior: smooth; }
body {
  background: var(--white); color: var(--black);
  font-family: var(--f); font-weight: 300;
  font-size: 13px; line-height: 1.6;
  overflow-x: hidden; cursor: none;
  -webkit-font-smoothing: antialiased;
}
::-webkit-scrollbar { width: 1px; }
::-webkit-scrollbar-track { background: var(--off); }
::-webkit-scrollbar-thumb { background: var(--light); }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* ── Cursor ── */
#cur {
  position: fixed; width: 6px; height: 6px;
  background: var(--black); border-radius: 50%;
  pointer-events: none; z-index: 99999;
  transform: translate(-50%,-50%);
  transition: width .2s, height .2s, background .2s, border .2s;
  top: -100px; left: -100px;
}
#cur.h { width: 40px; height: 40px; background: transparent; border: 1px solid rgba(10,10,10,.4); }
#cur.w { background: var(--white); }

/* ── Animations ── */
@keyframes fadeup { from{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)} }
.reveal {
  opacity: 0; transform: translateY(24px);
  transition: opacity 1s ease, transform 1s cubic-bezier(.25,.46,.45,.94);
}
.reveal.vis { opacity: 1; transform: translateY(0); }
.d1{transition-delay:.1s} .d2{transition-delay:.2s} .d3{transition-delay:.3s}

/* ── Nav trigger ── */
#nav-trigger {
  position: fixed; top: 24px; left: 20px; z-index: 1001;
  background: none; border: none; cursor: none;
  display: flex; flex-direction: column; gap: 5px; padding: 6px;
}
#nav-trigger span {
  display: block; width: 22px; height: 1px; background: var(--black);
  transition: background .4s, transform .3s, opacity .3s;
}
#nav-trigger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
#nav-trigger.open span:nth-child(2) { opacity: 0; }
#nav-trigger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Site logo */
#site-logo {
  position: fixed; top: 24px; left: 56px; z-index: 1001;
  font-size: 11px; font-weight: 500; letter-spacing: .15em;
  text-transform: uppercase; color: var(--black);
  transition: color .4s, opacity .3s; white-space: nowrap;
}
#site-logo:hover { opacity: .45; }

/* Nav overlay */
#nav-overlay {
  position: fixed; inset: 0; z-index: 998;
  background: rgba(0,0,0,.35);
  opacity: 0; pointer-events: none; transition: opacity .4s;
}
#nav-overlay.open { opacity: 1; pointer-events: all; }

/* Side nav panel */
#side-nav {
  position: fixed; top: 0; left: 0; bottom: 0; width: 280px;
  z-index: 999; background: var(--black);
  transform: translateX(-100%);
  transition: transform .45s cubic-bezier(.25,.46,.45,.94);
  display: flex; flex-direction: column; padding: 100px 0 40px;
}
#side-nav.open { transform: translateX(0); }
.sn-links { flex: 1; display: flex; flex-direction: column; padding: 0 32px; }
.sn-link {
  font-size: clamp(22px,3vw,30px); font-weight: 100;
  letter-spacing: -.01em; text-transform: uppercase;
  color: var(--white); padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
  transition: opacity .3s; display: block;
}
.sn-link:last-of-type { border-bottom: none; }
.sn-link:hover { opacity: .45; }
.sn-link.active { font-weight: 500; opacity: 1; }
.sn-divider { width: calc(100% - 64px); height: 1px; background: rgba(255,255,255,.08); margin: 20px 32px; }
.sn-about {
  font-size: 13px; font-weight: 300; letter-spacing: .12em;
  text-transform: uppercase; color: rgba(255,255,255,.35);
  padding: 14px 32px 0; display: block; transition: color .3s;
}
.sn-about:hover, .sn-about.active { color: var(--white); }
.sn-bottom { padding: 32px 32px 0; border-top: 1px solid rgba(255,255,255,.06); margin-top: 32px; }
.sn-copy { font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.2); }

/* ── Page Hero ── */
.page-hero {
  padding: 160px 48px 80px;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: flex-end;
}
.ph-label { font-size: 9px; letter-spacing: .22em; text-transform: uppercase; color: var(--mid); margin-bottom: 16px; display: block; }
.ph-title { font-size: clamp(48px,8vw,110px); font-weight: 700; letter-spacing: -.04em; text-transform: uppercase; line-height: .88; }
.ph-title span { display: block; font-weight: 100; }
.ph-meta { text-align: right; }
.ph-meta p { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--mid); line-height: 2.4; }

/* ══════════════════════════════════════════
   SMART GALLERY CAROUSEL
   Auto-detects orientation, max 9 items
   BW on default, color in lightbox
══════════════════════════════════════════ */
.gallery-section { padding: 80px 48px 120px; }

/* Carousel wrapper */
.carousel-wrap {
  position: relative;
}

/* The track containing all slides */
.carousel-track {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  transition: none;
}

/* Each gallery item */
.gi {
  position: relative;
  overflow: hidden;
  cursor: none;
}

/* Smart image — auto height based on orientation */
.gi img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* BW by default */
  filter: grayscale(100%) contrast(1.06);
  transform: scale(1);
  transition: transform .8s cubic-bezier(.25,.46,.45,.94), filter .4s ease;
  min-height: 200px;
}

/* Portrait images get taller aspect ratio */
.gi.portrait img { aspect-ratio: 3/4; }
/* Landscape images get wider aspect ratio */
.gi.landscape img { aspect-ratio: 4/3; }
/* Square */
.gi.square img { aspect-ratio: 1/1; }
/* Default fallback */
.gi:not(.portrait):not(.landscape):not(.square) img { aspect-ratio: 3/4; }

/* Hover: slight zoom, slight color reveal */
.gi:hover img {
  transform: scale(1.05);
  filter: grayscale(40%) contrast(1.06);
}

/* Caption below image */
.gi-caption {
  padding: 12px 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--white);
}
.gi-cat {
  font-size: 9px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--mid); margin-bottom: 5px; display: block;
}
.gi-title {
  font-size: 12px; font-weight: 400; text-transform: uppercase;
  letter-spacing: -.005em; color: var(--black);
  line-height: 1.3; margin-bottom: 4px;
}
.gi-meta {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--light); letter-spacing: .04em; margin-top: 5px;
}

/* Click indicator overlay */
.gi-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0);
  transition: background .3s;
  pointer-events: none;
}
.gi:hover .gi-overlay { background: rgba(0,0,0,.08); }
.gi-open {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,.92); border: none; cursor: none;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: scale(.8);
  transition: opacity .3s, transform .3s;
  pointer-events: none;
}
.gi:hover .gi-open { opacity: 1; transform: scale(1); }
.gi-open svg { width: 13px; height: 13px; stroke: var(--black); fill: none; }

/* ══════════════════════════════════════════
   LIGHTBOX — full color on open
══════════════════════════════════════════ */
#lb {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(10,10,10,.97);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .35s;
}
#lb.open { opacity: 1; pointer-events: all; }

/* Image renders in FULL COLOR in lightbox */
#lb-img {
  max-width: 88vw; max-height: 82vh;
  object-fit: contain; display: block;
  /* NO grayscale filter — full color */
  filter: none;
  transform: scale(.96); opacity: 0;
  transition: transform .4s cubic-bezier(.25,.46,.45,.94), opacity .3s;
}
#lb.open #lb-img { transform: scale(1); opacity: 1; }

.lb-x {
  position: fixed; top: 28px; right: 36px;
  background: none; border: none; cursor: none;
  color: rgba(255,255,255,.4); font-size: 10px;
  letter-spacing: .2em; text-transform: uppercase; transition: color .3s;
  display: flex; align-items: center; gap: 10px;
}
.lb-x::before { content:''; display:block; width:16px; height:1px; background:currentColor; transform:rotate(45deg); }
.lb-x:hover { color: var(--white); }

.lb-nav {
  position: fixed; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: none;
  color: rgba(255,255,255,.3); transition: color .3s; padding: 20px;
}
.lb-nav:hover { color: var(--white); }
.lb-nav svg { width: 20px; height: 20px; stroke: currentColor; fill: none; }
.lb-prev { left: 12px; }
.lb-next { right: 12px; }

.lb-info { position: fixed; bottom: 40px; left: 48px; }
.lb-cat  { font-size: 9px; letter-spacing: .18em; text-transform: uppercase; color: rgba(255,255,255,.28); display: block; margin-bottom: 4px; }
.lb-ttl  { font-size: 14px; font-weight: 300; text-transform: uppercase; letter-spacing: -.005em; color: rgba(255,255,255,.65); }
.lb-cnt  { position: fixed; bottom: 40px; right: 48px; font-size: 9px; letter-spacing: .2em; color: rgba(255,255,255,.3); }

/* ── Firma ── */
.firma {
  padding: 100px 48px 80px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.firma-rule {
  width: 1px; height: 72px;
  background: linear-gradient(to bottom, transparent, var(--light), transparent);
  margin: 0 auto 44px;
}
.firma-role { font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: var(--mid); margin-bottom: 24px; }
.firma-name { font-size: clamp(48px,8vw,108px); font-weight: 100; line-height: .88; letter-spacing: -.04em; text-transform: uppercase; color: var(--black); }
.firma-name strong { font-weight: 700; display: block; }
.firma-locations { margin-top: 28px; font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: var(--light); }

/* Dark firma (TheArsenale) */
.firma.dk { border-top-color: rgba(255,255,255,.08); }
.firma.dk .firma-role  { color: rgba(255,255,255,.3); }
.firma.dk .firma-name  { color: var(--white); }
.firma.dk .firma-locations { color: rgba(255,255,255,.2); }
.firma.dk .firma-rule  { background: linear-gradient(to bottom, transparent, rgba(255,255,255,.15), transparent); }

/* ── Footer ── */
footer { padding: 22px 48px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.f-mark { font-size: 10px; font-weight: 500; letter-spacing: .15em; text-transform: uppercase; }
.f-copy { font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: var(--mid); }

/* ── Responsive ── */
@media (max-width: 1024px) { .carousel-track { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 768px) {
  .page-hero { padding: 120px 24px 60px; flex-direction: column; gap: 20px; align-items: flex-start; }
  .ph-meta { text-align: left; }
  .gallery-section { padding: 60px 24px 80px; }
  .carousel-track { grid-template-columns: 1fr; }
  .firma { padding: 72px 24px 60px; }
  footer { flex-direction: column; gap: 8px; text-align: center; padding: 20px 24px; }
  .lb-info { display: none; }
  .lb-prev { left: 4px; } .lb-next { right: 4px; }
}

/* ── Archive preview caption (home grid) ── */
.ap-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}
.ap-item { position: relative; overflow: hidden; cursor: none; }
.ap-item img {
  width: 100%; aspect-ratio: 3/4;
  object-fit: cover; display: block;
  filter: grayscale(100%) contrast(1.06);
  transform: scale(1);
  transition: transform .8s cubic-bezier(.25,.46,.45,.94), filter .5s ease;
}
.ap-item:hover img { transform: scale(1.05); filter: grayscale(50%) contrast(1.06); }
.ap-caption {
  padding: 12px 16px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--white);
  display: flex; justify-content: space-between; align-items: flex-start;
}
.ap-cap-left { flex: 1; }
.ap-cap-tag {
  font-size: 9px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--mid); margin-bottom: 5px; display: block;
}
.ap-cap-title {
  font-size: 12px; font-weight: 400; text-transform: uppercase;
  letter-spacing: -.005em; color: var(--black); line-height: 1.3; margin-bottom: 3px;
}
.ap-cap-pub {
  font-size: 10px; color: var(--mid); letter-spacing: .04em;
}
.ap-cap-year {
  font-size: 11px; color: var(--light); letter-spacing: .05em;
  flex-shrink: 0; margin-left: 12px; padding-top: 16px;
}
.ap-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0); transition: background .3s;
}
.ap-item:hover .ap-overlay { background: rgba(0,0,0,.08); }
.ap-open {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,.92); border: none; cursor: none;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: scale(.8);
  transition: opacity .3s, transform .3s;
}
.ap-item:hover .ap-open { opacity: 1; transform: scale(1); }
.ap-open svg { width: 13px; height: 13px; stroke: var(--black); fill: none; }

/* ── Article link in gallery captions ── */
.gi-article-link {
  display: inline-block; margin-top: 8px;
  font-size: 9px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--mid); border-bottom: 1px solid var(--border);
  padding-bottom: 2px; transition: color .3s, border-color .3s;
  text-decoration: none;
}
.gi-article-link:hover { color: var(--black); border-color: var(--black); }

/* Covers year */
.cg-year { font-size: 10px; color: var(--light); letter-spacing: .06em; margin-top: 2px; }

@media (max-width: 1024px) { .ap-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 768px)  { .ap-grid { grid-template-columns: 1fr; } }
