/* ============================================================
   Portfolio — éditorial dark theme
   ============================================================ */
:root {
  --bg: #0b0b0c;
  --bg-soft: #111113;
  --surface: #161618;
  --line: rgba(255, 255, 255, 0.10);
  --text: #ece9e4;
  --muted: #9a958c;
  --faint: #6b665e;
  --accent: #c8a27a;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gut: clamp(20px, 5vw, 90px);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: #0b0b0c; }

/* Film grain overlay */
.grain {
  position: fixed; inset: 0; z-index: 9000; pointer-events: none;
  opacity: 0.05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Scroll progress bar */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0;
  background: var(--accent); z-index: 9001; transition: width 0.1s linear;
}

/* ---------- Header ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 800;
  display: flex; align-items: center; justify-content: space-between;
  padding: clamp(18px, 2.4vw, 34px) var(--gut);
  transition: background 0.5s var(--ease), padding 0.5s var(--ease), border-color 0.5s;
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(11, 11, 12, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  padding-top: clamp(12px, 1.6vw, 18px);
  padding-bottom: clamp(12px, 1.6vw, 18px);
  border-color: var(--line);
}
.brand-name {
  font-family: var(--serif);
  font-size: clamp(1.15rem, 1.6vw, 1.5rem);
  letter-spacing: 0.02em; font-weight: 400;
}
.site-nav { display: flex; gap: clamp(20px, 2.6vw, 44px); }
.site-nav a {
  font-size: 0.74rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--muted); position: relative; padding: 4px 0;
  transition: color 0.35s;
}
.site-nav a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 0;
  background: var(--accent); transition: width 0.4s var(--ease);
}
.site-nav a:hover { color: var(--text); }
.site-nav a:hover::after { width: 100%; }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; width: 30px; height: 22px; position: relative; }
.nav-toggle span { position: absolute; left: 0; width: 100%; height: 1.5px; background: var(--text); transition: 0.35s var(--ease); }
.nav-toggle span:nth-child(1) { top: 4px; }
.nav-toggle span:nth-child(2) { bottom: 4px; }
body.menu-open .nav-toggle span:nth-child(1) { top: 10px; transform: rotate(45deg); }
body.menu-open .nav-toggle span:nth-child(2) { bottom: 10px; transform: rotate(-45deg); }

/* ---------- Boot loader ---------- */
.boot {
  position: fixed; inset: 0; z-index: 8500; background: var(--bg);
  display: grid; place-items: center; transition: opacity 0.7s var(--ease), visibility 0.7s;
}
.boot.hidden { opacity: 0; visibility: hidden; }
.boot-mark { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Reveal animation ---------- */
[data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
[data-reveal].in { opacity: 1; transform: none; }

/* ============================================================
   HERO
   ============================================================ */
.hero { position: relative; height: 100svh; min-height: 600px; overflow: hidden; display: flex; align-items: flex-end; }
.hero-media {
  position: absolute; inset: -4% ; background-size: cover; background-position: center;
  animation: kenburns 22s ease-in-out infinite alternate;
}
@keyframes kenburns { from { transform: scale(1.04) translateY(0); } to { transform: scale(1.16) translateY(-1.5%); } }
.hero-veil {
  position: absolute; inset: 0;
  background:
    linear-gradient(to top, rgba(11,11,12,0.96) 2%, rgba(11,11,12,0.25) 42%, rgba(11,11,12,0.45) 100%);
}
.hero-inner { position: relative; z-index: 2; padding: 0 var(--gut) clamp(60px, 9vh, 130px); max-width: 1100px; }
.hero-kicker {
  font-size: 0.78rem; letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--accent); margin-bottom: clamp(18px, 3vh, 32px);
}
.hero-title {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(3rem, 11vw, 9.5rem); line-height: 0.92;
  letter-spacing: -0.02em;
}
.hero-tagline {
  margin-top: clamp(16px, 2.4vh, 30px); font-size: clamp(1rem, 1.5vw, 1.35rem);
  color: var(--muted); max-width: 40ch; font-weight: 300;
}
.hero-scroll {
  position: absolute; bottom: 38px; right: var(--gut); z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--muted);
}
.hero-scroll-line { width: 1px; height: 54px; background: linear-gradient(var(--accent), transparent); animation: drop 1.8s var(--ease) infinite; transform-origin: top; }
@keyframes drop { 0% { transform: scaleY(0); } 40% { transform: scaleY(1); } 100% { transform: scaleY(0); transform-origin: bottom; } }
.hero-scroll-label { font-size: 0.62rem; letter-spacing: 0.24em; text-transform: uppercase; writing-mode: vertical-rl; }

/* ============================================================
   INTRO
   ============================================================ */
.intro { padding: clamp(80px, 16vh, 200px) var(--gut); max-width: 1200px; }
.intro-text {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(1.6rem, 4vw, 3.4rem); line-height: 1.25; letter-spacing: -0.01em;
}
.intro-text::first-letter { color: var(--accent); }

/* ============================================================
   SECTION heads
   ============================================================ */
.section-head { display: flex; align-items: baseline; gap: 22px; padding: 0 var(--gut); margin-bottom: clamp(40px, 6vh, 80px); }
.section-index { font-size: 0.8rem; color: var(--accent); letter-spacing: 0.2em; font-variant-numeric: tabular-nums; }
.section-title { font-family: var(--serif); font-weight: 300; font-size: clamp(2rem, 5vw, 4rem); letter-spacing: -0.01em; }

/* ============================================================
   COLLECTIONS GRID
   ============================================================ */
.series { padding-bottom: clamp(60px, 12vh, 160px); }
.collections {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(14px, 1.6vw, 28px);
  padding: 0 var(--gut);
}
.collection-card {
  position: relative; overflow: hidden; cursor: pointer; background: var(--surface);
  border-radius: 4px; grid-column: span 6; aspect-ratio: 4 / 5;
}
/* Editorial rhythm: make every 3rd card wide */
.collection-card:nth-child(3n+1) { grid-column: span 6; aspect-ratio: 16 / 11; }
.collection-card:nth-child(3n+2) { grid-column: span 6; aspect-ratio: 16 / 11; }
.collection-card:nth-child(3n+3) { grid-column: span 12; aspect-ratio: 21 / 9; }
.collection-card .cc-media {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  transition: transform 1.1s var(--ease), filter 0.8s var(--ease);
  transform: scale(1.02); filter: brightness(0.78);
}
.collection-card::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(11,11,12,0.85), transparent 60%);
}
.collection-card:hover .cc-media { transform: scale(1.08); filter: brightness(0.92); }
.cc-body { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: clamp(20px, 2.6vw, 40px); }
.cc-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.cc-count { font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); }
.cc-line { flex: 1; height: 1px; background: var(--line); transform: scaleX(0); transform-origin: left; transition: transform 0.7s var(--ease); }
.collection-card:hover .cc-line { transform: scaleX(1); }
.cc-title { font-family: var(--serif); font-weight: 300; font-size: clamp(1.5rem, 2.6vw, 2.6rem); line-height: 1.05; }
.cc-desc { color: var(--muted); font-size: 0.92rem; margin-top: 6px; max-width: 46ch; opacity: 0; transform: translateY(8px); transition: 0.6s var(--ease); }
.collection-card:hover .cc-desc { opacity: 1; transform: none; }

/* ============================================================
   ABOUT
   ============================================================ */
.about { padding: clamp(80px, 16vh, 200px) var(--gut); }
.about-grid { display: grid; grid-template-columns: 0.85fr 1fr; gap: clamp(30px, 6vw, 100px); align-items: center; }
.about-media { aspect-ratio: 4 / 5; background-size: cover; background-position: center; border-radius: 4px; filter: grayscale(0.2) brightness(0.92); }
.about-copy .section-title { margin: 14px 0 24px; }
.about-copy p { color: var(--muted); font-size: clamp(1rem, 1.3vw, 1.18rem); line-height: 1.8; max-width: 52ch; }

/* ============================================================
   CONTACT
   ============================================================ */
.contact { padding: clamp(90px, 18vh, 220px) var(--gut); border-top: 1px solid var(--line); }
.contact-title { font-family: var(--serif); font-weight: 300; font-size: clamp(2.6rem, 9vw, 7rem); line-height: 0.95; letter-spacing: -0.02em; margin: 16px 0 clamp(40px, 6vh, 70px); }
.contact-links { display: flex; flex-wrap: wrap; gap: clamp(20px, 4vw, 70px); }
.contact-links a, .contact-links span.ci {
  font-size: clamp(1rem, 1.5vw, 1.3rem); color: var(--muted); position: relative; transition: color 0.35s;
  display: inline-flex; flex-direction: column; gap: 4px;
}
.contact-links .ci-label { font-size: 0.66rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--faint); }
.contact-links a:hover { color: var(--accent); }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
  padding: 30px var(--gut); border-top: 1px solid var(--line);
  font-size: 0.74rem; letter-spacing: 0.08em; color: var(--faint);
}
.site-footer a:hover { color: var(--accent); }

/* ============================================================
   COLLECTION VIEW (gallery)
   ============================================================ */
.collection-view { padding-top: clamp(120px, 18vh, 220px); }
.collection-hero { padding: 0 var(--gut) clamp(40px, 6vh, 70px); }
.back-link { font-size: 0.74rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); transition: color 0.3s; }
.back-link:hover { color: var(--accent); }
.collection-title { font-family: var(--serif); font-weight: 300; font-size: clamp(2.6rem, 8vw, 6.5rem); line-height: 0.95; letter-spacing: -0.02em; margin: 22px 0 14px; }
.collection-desc { color: var(--muted); font-size: clamp(1rem, 1.4vw, 1.25rem); max-width: 56ch; }
.collection-count { display: inline-block; margin-top: 18px; font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); }

/* Justified gallery */
.gallery { padding: 0 var(--gut) clamp(80px, 14vh, 160px); display: flex; flex-direction: column; gap: clamp(8px, 0.9vw, 16px); }
.gal-row { display: flex; gap: clamp(8px, 0.9vw, 16px); }
.gal-item {
  position: relative; overflow: hidden; cursor: pointer; background: var(--surface);
  border-radius: 3px; flex-grow: 1;
}
.gal-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease), opacity 0.8s; }
.gal-item .lqip { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(14px); transform: scale(1.1); }
.gal-item .full { position: absolute; inset: 0; opacity: 0; }
.gal-item .full.loaded { opacity: 1; }
.gal-item:hover .full { transform: scale(1.05); }
.gal-item::after { content: ""; position: absolute; inset: 0; background: rgba(11,11,12,0); transition: background 0.4s; }
.gal-item:hover::after { background: rgba(11,11,12,0.12); }

/* ============================================================
   LIGHTBOX
   ============================================================ */
.lightbox {
  position: fixed; inset: 0; z-index: 9500; background: rgba(8,8,9,0.96);
  backdrop-filter: blur(6px); display: grid; place-items: center;
  opacity: 0; visibility: hidden; transition: opacity 0.45s var(--ease), visibility 0.45s;
}
.lightbox.open { opacity: 1; visibility: visible; }
.lb-stage { max-width: 92vw; max-height: 86vh; display: flex; flex-direction: column; align-items: center; gap: 16px; transform: scale(0.97); transition: transform 0.45s var(--ease); }
.lightbox.open .lb-stage { transform: none; }
.lb-stage img { max-width: 92vw; max-height: 80vh; object-fit: contain; border-radius: 2px; box-shadow: 0 30px 80px rgba(0,0,0,0.6); }
.lb-stage figcaption { color: var(--muted); font-size: 0.9rem; letter-spacing: 0.04em; text-align: center; max-width: 60ch; }
.lb-close, .lb-nav { position: fixed; background: none; border: 0; color: var(--text); cursor: pointer; opacity: 0.7; transition: opacity 0.3s, transform 0.3s; }
.lb-close:hover, .lb-nav:hover { opacity: 1; }
.lb-close { top: 26px; right: 32px; font-size: 1.4rem; }
.lb-nav { top: 50%; transform: translateY(-50%); font-size: 3rem; font-weight: 200; padding: 0 18px; }
.lb-prev { left: 14px; } .lb-next { right: 14px; }
.lb-nav:hover { transform: translateY(-50%) scale(1.1); }
.lb-counter { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); font-size: 0.74rem; letter-spacing: 0.2em; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty {
  text-align: center; padding: clamp(80px, 16vh, 180px) var(--gut);
}
.empty h3 { font-family: var(--serif); font-weight: 300; font-size: clamp(1.6rem, 4vw, 2.6rem); margin-bottom: 16px; }
.empty p { color: var(--muted); max-width: 44ch; margin: 0 auto; }
.empty a { color: var(--accent); border-bottom: 1px solid currentColor; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-media { aspect-ratio: 16 / 11; }
  .collection-card,
  .collection-card:nth-child(3n+1),
  .collection-card:nth-child(3n+2),
  .collection-card:nth-child(3n+3) { grid-column: span 12; aspect-ratio: 16 / 11; }
  .cc-desc { opacity: 1; transform: none; }
}
@media (max-width: 720px) {
  .nav-toggle { display: block; z-index: 810; }
  .site-nav {
    position: fixed; inset: 0; background: rgba(11,11,12,0.97); backdrop-filter: blur(20px);
    flex-direction: column; justify-content: center; align-items: center; gap: 38px;
    transform: translateY(-100%); transition: transform 0.6s var(--ease); z-index: 805;
  }
  body.menu-open .site-nav { transform: none; }
  .site-nav a { font-size: 1.1rem; }
  .hero-scroll { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, [data-reveal] { animation: none !important; transition-duration: 0.01ms !important; }
  [data-reveal] { opacity: 1; transform: none; }
}
