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

:root {
  --black:  #0c0c0b;
  --white:  #f4f3ef;
  --rule:   #e0dfd9;
  --muted:  #999890;
  --dark:   #3a3a37;
  --nav-h:  48px;
  --gap:    16px;
  --radius: 8px;
  --sans:   'DM Sans', sans-serif;
  --mono:   'DM Mono', monospace;
  --cols:   3;
}

html { background: var(--white); color: var(--black); }
html.lenis { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  font-family: var(--sans);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
}

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

/* ─── PROGRESS ───────────────────────────────────────────────── */
#progress {
  position: fixed;
  top: var(--nav-h); left: 0;
  height: 1px;
  background: var(--black);
  z-index: 200;
  width: 0;
  pointer-events: none;
}

/* ─── NAV ────────────────────────────────────────────────────── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
  transition: background .3s, border-color .3s;
  border-bottom: 1px solid transparent;
}
nav.scrolled { background: var(--white); border-color: var(--rule); }

.nav-name {
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.nav-center {
  position: absolute;
  left: 50%; transform: translateX(-50%);
  display: flex;
  gap: 2px;
  font-size: 11px;
  font-family: var(--mono);
}
.flt {
  padding: 3px 9px;
  border: 1px solid transparent;
  border-radius: 2px;
  cursor: pointer;
  background: none;
  font-family: inherit;
  font-size: inherit;
  color: var(--muted);
  transition: color .2s, border-color .2s;
}
.flt:hover { color: var(--black); }
.flt.on { color: var(--black); border-color: var(--black); }

.nav-right {
  display: flex;
  gap: 28px;
  list-style: none;
  font-size: 11.5px;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.nav-right a { opacity: .4; transition: opacity .2s; }
.nav-right a.on, .nav-right a:hover { opacity: 1; }
.lang-btn {
  background: none;
  border: 1px solid currentColor;
  color: inherit;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .08em;
  padding: 2px 7px;
  border-radius: 3px;
  opacity: .5;
  cursor: pointer;
  transition: opacity .2s;
}
.lang-btn:hover { opacity: 1; }

/* ─── HERO ───────────────────────────────────────────────────── */
main { padding-top: var(--nav-h); }

.hero {
  padding: 52px 20px 80px;
  opacity: 0;
  transform: translateY(14px);
}
.hero h1 {
  font-size: clamp(24px, 3.6vw, 50px);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -.025em;
  max-width: 820px;
}
.hero h1 sup {
  font-size: .42em;
  font-family: var(--mono);
  font-weight: 400;
  opacity: .45;
  vertical-align: super;
}

/* ─── GRID WRAPPER ───────────────────────────────────────────── */
.grid-outer {
  padding: 0 180px var(--gap);
  --gap: 32px;
}

.grid-row {
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  gap: var(--gap);
  margin-bottom: var(--gap);
}

/* ─── THUMB CELL ─────────────────────────────────────────────── */
.proj {
  position: relative;
  cursor: pointer;
  overflow: hidden;
  border-radius: var(--radius);
}
.proj.hide { display: none; }

.thumb-img {
  width: 100%;
  aspect-ratio: 3/4;
  background: var(--rule);
  overflow: hidden;
  position: relative;
  border-radius: var(--radius);
}
.thumb-img-inner {
  width: 100%; height: 100%;
  transition: transform .65s cubic-bezier(.19,1,.22,1);
}
.proj:hover .thumb-img-inner { transform: scale(1.03); }

/* real media inside thumb */
.thumb-img-inner img,
.thumb-img-inner video {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

/* placeholder */
.ph {
  width: 100%; height: 100%;
  background:
    repeating-linear-gradient(0deg,
      transparent, transparent 2px,
      rgba(0,0,0,.016) 2px, rgba(0,0,0,.016) 4px),
    var(--rule);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ph-label {
  font-size: 9.5px;
  font-family: var(--mono);
  color: var(--muted);
  opacity: .55;
  text-align: center;
  padding: 0 12px;
}

/* hover overlay */
.thumb-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 24px;
  background: rgba(10,10,9,.62);
  opacity: 0;
  transition: opacity .32s ease;
  pointer-events: none;
  text-align: center;
}
.proj:hover .thumb-overlay,
.proj.open .thumb-overlay { opacity: 1; }

.ov-title {
  font-size: 18px;
  font-weight: 400;
  color: #fff;
  line-height: 1.3;
  letter-spacing: -.02em;
}
.ov-meta {
  font-size: 10px;
  font-family: var(--mono);
  color: rgba(255,255,255,.55);
  letter-spacing: .03em;
}

/* + / × badge */
.thumb-badge {
  position: absolute;
  top: 12px; right: 12px;
  width: 22px; height: 22px;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #fff;
  line-height: 1;
  opacity: 0;
  transition: opacity .28s, transform .28s;
  pointer-events: none;
}
.proj:hover .thumb-badge { opacity: 1; }
.proj.open .thumb-badge { opacity: 1; transform: rotate(45deg); }

/* ─── EXPANDED PANEL ─────────────────────────────────────────── */
.proj-panel {
  height: 0;
  overflow: hidden;
  margin-bottom: var(--gap);
}

.panel-inner {
  display: grid;
  grid-template-columns: 340px 1fr;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--white);
  overflow: hidden;
}

/* info column */
.panel-info {
  padding: 28px 24px 36px;
  border-right: 1px solid var(--rule);
}

.pi-title {
  font-size: 15px;
  font-weight: 400;
  letter-spacing: -.01em;
  line-height: 1.2;
  margin-bottom: 20px;
}

.pi-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 18px;
  margin-bottom: 20px;
  font-size: 10.5px;
  font-family: var(--mono);
}
.pi-meta dt { color: var(--muted); }
.pi-meta dd { color: var(--black); }

.pi-desc {
  font-size: 12px;
  font-weight: 300;
  line-height: 1.78;
  color: var(--dark);
  margin-bottom: 18px;
}

.pi-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 16px;
}
.pi-tag {
  font-size: 9px;
  font-family: var(--mono);
  border: 1px solid var(--rule);
  padding: 2px 7px;
  border-radius: 2px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.d-link {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
  opacity: .6;
  transition: opacity .2s;
}
.d-link:hover { opacity: 1; }

.pi-metrics {
  font-size: 10px;
  font-family: var(--mono);
  color: var(--muted);
}
.pi-metrics::before { content: '↑ '; }

/* gallery column */
.panel-gallery {
  padding: 28px 24px 36px;
  overflow-y: auto;
}

.gallery-track {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gallery-row {
  display: flex;
  gap: 8px;
}
.gallery-row--grid .gi {
  flex: 0 0 calc(25% - 6px);
}

/* equal-height row */
.gallery-row--equal {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.gallery-row--equal .gi {
  flex: 1;
  overflow: hidden;
}
/* first item: natural height, defines the reference */
.gallery-row--equal .gi:first-child img,
.gallery-row--equal .gi:first-child video {
  width: 100%;
  height: auto;
  display: block;
}
/* subsequent items: match reference height, show fully */
.gallery-row--equal .gi:not(:first-child) img,
.gallery-row--equal .gi:not(:first-child) video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.gi {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  border-radius: 4px;
}

.gi img,
.gi video {
  width: 100%;
  height: auto;
  display: block;
}

.gi.ph-item .ph { aspect-ratio: 4/3; width: 100%; }

/* ─── INFO SECTION ───────────────────────────────────────────── */
#info {
  padding: 96px 20px;
  border-top: 1px solid var(--rule);
}

.sec-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 0 40px;
}

.sec-label {
  font-size: 10.5px;
  font-family: var(--mono);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  padding-top: 3px;
}

.info-blocks { display: flex; flex-direction: column; }

.ib {
  padding: 36px 0;
  border-bottom: 1px solid var(--rule);
  opacity: 0;
  transform: translateY(12px);
}
.ib:first-child { padding-top: 0; }
.ib:last-child { border-bottom: none; }

.ib h3 {
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 10px;
  letter-spacing: .01em;
}
.ib p {
  font-size: 12px;
  font-weight: 300;
  line-height: 1.8;
  color: var(--dark);
  max-width: 520px;
}

/* ─── CONTACT ────────────────────────────────────────────────── */
#contact {
  padding: 96px 20px 72px;
  border-top: 1px solid var(--rule);
}

.avail {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  font-family: var(--mono);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 24px;
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: #4a4; flex-shrink: 0; }

.contact-cta {
  font-size: clamp(20px, 3vw, 42px);
  font-weight: 300;
  letter-spacing: -.025em;
  line-height: 1.08;
  max-width: 520px;
  margin-bottom: 40px;
  opacity: 0;
  transform: translateY(12px);
}

.c-links { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.c-links a {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 12px;
  transition: opacity .2s;
}
.c-links a:hover { opacity: .4; }
.c-links span {
  font-size: 10px;
  font-family: var(--mono);
  color: var(--muted);
  min-width: 68px;
}

/* ─── FOOTER ─────────────────────────────────────────────────── */
footer {
  padding: 18px 20px;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  font-family: var(--mono);
  color: var(--muted);
}

/* ─── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
  :root { --cols: 2; --gap: 12px; }
  .grid-outer { padding: 0 var(--gap) var(--gap); }
}
/* ─── TABLET / MOBILE GALLERY ────────────────────────────────── */
/* Each gallery item stacks full-width — overrides JS inline styles */
@media (max-width: 768px) {
  .gallery-row {
    flex-direction: column !important;
    height: auto !important;
  }
  .gi {
    flex: 0 0 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  .gi img, .gi video {
    width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
  }
}

@media (max-width: 600px) {
  :root { --cols: 1; --gap: 10px; --radius: 6px; }
  .nav-center { display: none; }
  .panel-inner { grid-template-columns: 1fr; }
  .panel-info { border-right: none; border-bottom: 1px solid var(--rule); }
  .sec-grid { grid-template-columns: 1fr; gap: 10px; }
}
