/* =========================================================
   NDANDA EVENTS — Main stylesheet
   ========================================================= */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
ul { list-style: none; }
::selection { background: var(--accent); color: #111; }

/* Lenis requirements */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.02em;
}
.display { font-size: var(--fs-hero); text-transform: uppercase; }
.eyebrow {
  font-size: var(--fs-small);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 500;
}
.accent { color: var(--accent); }

/* ---------- Layout helpers ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad-x); }
.section { padding-block: clamp(5rem, 12vh, 11rem); }
.grid { display: grid; gap: clamp(1rem, 2vw, 2rem); }

/* ==========================================================
   PRELOADER
   ========================================================== */
#preloader {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--bg);
  display: grid; place-items: center;
}
#preloader .pl-inner { text-align: center; overflow: hidden; }
#preloader .pl-word {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2rem, 6vw, 4rem); text-transform: uppercase;
  letter-spacing: -0.02em;
}
#preloader .pl-count {
  margin-top: 1rem; font-size: var(--fs-small);
  letter-spacing: 0.3em; color: var(--ink-soft);
}
.pl-bar { position: fixed; left: 0; bottom: 0; height: 2px; width: 0; background: var(--accent); z-index: 1001; transition: width .3s ease; }

/* ==========================================================
   IMAGE SKELETONS — shimmer while loading, fade image in
   ========================================================== */
@keyframes nd-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.work__media.is-loading, .carousel__item.is-loading {
  background-image: linear-gradient(100deg, #17241d 25%, #27392e 45%, #17241d 65%);
  background-size: 200% 100%;
  animation: nd-shimmer 1.4s ease-in-out infinite;
}
.img-fade { opacity: 0; }
.img-fade.is-loaded { opacity: 1; transition: opacity .7s var(--ease); }

/* ==========================================================
   CUSTOM CURSOR (hidden on touch)
   ========================================================== */
.cursor {
  position: fixed; top: 0; left: 0; z-index: 900;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); pointer-events: none;
  transform: translate(-50%, -50%);
  mix-blend-mode: difference;
  transition: width .3s var(--ease), height .3s var(--ease), background .3s;
}
.cursor.is-hover { width: 64px; height: 64px; background: var(--accent-2); }
@media (hover: none) { .cursor { display: none; } }

/* ==========================================================
   HEADER / NAV
   ========================================================== */
.site-header {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 500;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.4rem var(--pad-x);
}
.brand { font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; letter-spacing: -0.02em; text-transform: uppercase; position: relative; z-index: 2; }

/* ---- Desktop: glass pill nav ---- */
.nav {
  display: flex; align-items: center; gap: .25rem;
  padding: .4rem;
  background: rgba(22, 33, 27, 0.55);
  border: 1px solid rgba(242, 239, 230, 0.16);
  border-radius: 100px;
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}
.nav a {
  padding: .6rem 1.4rem;
  border-radius: 100px;
  font-size: .95rem; font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  transition: background .35s var(--ease), color .35s var(--ease);
}
.nav a:hover { background: rgba(242, 239, 230, 0.1); }
.nav a.active { background: var(--ink); color: #111; }
.nav a.active:hover { background: var(--ink); }

/* ---- Hamburger button (mobile only) ---- */
.nav-toggle {
  display: none; position: relative; z-index: 2;
  width: 44px; height: 44px; border-radius: 50%;
  flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: rgba(22, 33, 27, 0.55);
  border: 1px solid rgba(242, 239, 230, 0.16);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
}
.nav-toggle span {
  width: 20px; height: 2px; background: var(--ink); display: block;
  transition: transform .35s var(--ease), opacity .25s var(--ease);
}
.nav-toggle.is-open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ---- Mobile fullscreen menu (separate top-level overlay) ---- */
.mobile-menu {
  display: none; position: fixed; inset: 0; z-index: 490;
  flex-direction: column; justify-content: center;
  padding: max(6rem, 14vh) var(--pad-x) 3rem;
  background: var(--bg);
  transform: translateY(-100%);
  transition: transform .6s var(--ease);
}
.mobile-menu.is-open { transform: translateY(0); }
.mobile-menu__nav { display: flex; flex-direction: column; gap: .3rem; }
.mobile-menu__nav a {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2.4rem, 13vw, 4rem); line-height: 1.05;
  text-transform: uppercase; letter-spacing: -0.02em;
  color: var(--ink);
}
.mobile-menu__nav a.active { color: var(--accent); }
.mobile-menu__footer { margin-top: auto; padding-top: 2rem; display: flex; gap: 1.6rem; border-top: 1px solid var(--line); }
.mobile-menu__footer a { font-size: var(--fs-small); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }

html.menu-open { overflow: hidden; }

@media (max-width: 760px) {
  .nav { display: none; }
  .nav-toggle { display: flex; }
  .mobile-menu { display: flex; }
}

/* ==========================================================
   BUTTONS
   ========================================================== */
.btn {
  display: inline-flex; align-items: center; gap: .6rem;
  padding: 1rem 1.8rem; border: 1px solid var(--line); border-radius: 100px;
  font-size: var(--fs-small); letter-spacing: 0.14em; text-transform: uppercase;
  transition: background .4s var(--ease), color .4s var(--ease), border-color .4s;
  will-change: transform;
}
.btn:hover { background: var(--accent); color: #111; border-color: var(--accent); }
.btn--solid { background: var(--ink); color: #111; border-color: var(--ink); }
.link-arrow { display: inline-flex; align-items: center; gap: .5rem; }
.link-arrow svg { transition: transform .4s var(--ease); }
.link-arrow:hover svg { transform: translateX(6px); }

/* ==========================================================
   HERO
   ========================================================== */
/* Placeholder look for empty media wells (shown until real media loads) */
.hero__media, .work__media {
  background: linear-gradient(135deg, #17241d 0%, #0d1512 60%, #14201a 100%);
}

/* No-crop frame: whole photo (contain) over a soft blurred fill of itself.
   Reused by the hero, carousel and featured tiles so nothing gets cut. */
.nc { position: absolute; inset: 0; overflow: hidden; }
.nc__fill {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; transform: scale(1.15);
  filter: blur(30px) brightness(0.5) saturate(1.05);
}
.nc__main {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; will-change: transform;
}
/* win over the generic `.work__media img { object-fit: cover }` rule */
.work__media .nc__fill { object-fit: cover; }
.work__media .nc__main { object-fit: contain; }

/* Hero split slideshow — current image cut into pieces that slide
   apart (the cut varies each transition) to reveal the next image. */
.hero-slideshow { position: absolute; inset: 0; overflow: hidden; }
.hero-below { position: absolute; inset: 0; z-index: 0; }
.hero-pieces { position: absolute; inset: 0; z-index: 1; }
.hero-piece { position: absolute; inset: 0; will-change: transform; }
.work__media::before {
  content: "Ndanda"; position: absolute; inset: 0; z-index: 0;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 1.4rem;
  color: rgba(242,239,230,0.08); letter-spacing: .1em; text-transform: uppercase;
}
.work__media img, .work__media video { position: relative; z-index: 1; }

.hero { position: relative; height: 100svh; min-height: 640px; display: flex; align-items: flex-end; overflow: hidden; }
.hero__media { position: absolute; inset: 0; z-index: 0; }
.hero__media video, .hero__media img { width: 100%; height: 100%; object-fit: cover; }
.hero__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(13,21,18,.85), rgba(13,21,18,.15) 60%, rgba(13,21,18,.4)); }
.hero__inner { position: relative; z-index: 1; width: 100%; padding-bottom: clamp(2rem, 6vh, 5rem); }
.hero__title { font-size: var(--fs-hero); text-transform: uppercase; }
.hero__title .line { display: block; overflow: hidden; }
.hero__title .line > span { display: block; will-change: transform; }
.hero__meta { display: flex; flex-wrap: wrap; gap: 2rem; margin-top: 1.6rem; color: var(--ink-soft); }
.hero__meta span { font-size: var(--fs-small); letter-spacing: 0.14em; text-transform: uppercase; }
.scroll-cue { position: absolute; right: var(--pad-x); bottom: clamp(2rem,6vh,5rem); z-index:1; font-size: var(--fs-small); letter-spacing:.2em; text-transform:uppercase; color: var(--ink-soft); writing-mode: vertical-rl; }

/* ==========================================================
   REVEAL PRIMITIVES (driven by GSAP)
   ========================================================== */
[data-reveal] { will-change: transform, opacity; }
.split-line { display: block; overflow: hidden; }
.split-line > * { display: block; }

/* ==========================================================
   MARQUEE
   ========================================================== */
.marquee { overflow: hidden; border-block: 1px solid var(--line); padding-block: 1.4rem; }
.marquee__track { display: flex; gap: 3rem; width: max-content; will-change: transform; }
.marquee__track span { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.6rem, 4vw, 3rem); text-transform: uppercase; color: var(--ink-soft); white-space: nowrap; }
.marquee__track .dot { color: var(--accent); }

/* ==========================================================
   HERO IMAGE CAROUSEL (auto-scroll right→left, click → portfolio)
   ========================================================== */
.carousel { overflow: hidden; padding-block: clamp(1.5rem, 4vw, 3rem); }
.carousel__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.6rem; flex-wrap: wrap; }
.carousel__track { display: flex; gap: clamp(.8rem, 1.5vw, 1.4rem); width: max-content; will-change: transform; }
.carousel__item {
  position: relative; flex: 0 0 auto;
  width: clamp(220px, 26vw, 400px); aspect-ratio: 4 / 3;
  border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(135deg, #17241d 0%, #0d1512 60%, #14201a 100%);
}
.carousel__item::before {
  content: "Ndanda"; position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; color: rgba(242,239,230,0.08);
  letter-spacing: .1em; text-transform: uppercase;
}
.carousel__item .nc__main { transition: transform .8s var(--ease); }
.carousel__item:hover .nc__main { transform: scale(1.05); }
.carousel__item::after {
  content: "View all"; position: absolute; inset: auto 0 0 0; z-index: 2;
  padding: 1rem; font-size: var(--fs-small); letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink); background: linear-gradient(to top, rgba(13,21,18,.8), transparent);
  opacity: 0; transition: opacity .4s var(--ease);
}
.carousel__item:hover::after { opacity: 1; }

/* ==========================================================
   INTRO / ABOUT
   ========================================================== */
.intro__lead { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-h2); line-height: 1.12; max-width: 20ch; }
.intro__grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(2rem, 6vw, 6rem); align-items: end; }
.intro__body { color: var(--ink-soft); max-width: 46ch; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; margin-top: 4rem; }
.stat__num { font-family: var(--font-display); font-weight: 700; font-size: clamp(2.5rem, 6vw, 4.5rem); }
.stat__label { font-size: var(--fs-small); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
@media (max-width: 760px){ .intro__grid { grid-template-columns: 1fr; } .stats { grid-template-columns: 1fr 1fr; } }

/* ==========================================================
   SERVICES
   ========================================================== */
.service { display: grid; grid-template-columns: 80px 1fr auto; gap: 2rem; align-items: center;
  padding-block: clamp(1.6rem, 3vw, 2.6rem); border-top: 1px solid var(--line); }
.service:last-child { border-bottom: 1px solid var(--line); }
.service__no { color: var(--accent); font-family: var(--font-display); }
.service__name { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-h3); }
.service__desc { color: var(--ink-soft); max-width: 40ch; text-align: right; }
@media (max-width: 760px){ .service { grid-template-columns: 40px 1fr; } .service__desc { display:none; } }

/* ==========================================================
   PORTFOLIO GRID
   ========================================================== */
.filters { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 3rem; }
.filter { padding: .55rem 1.2rem; border: 1px solid var(--line); border-radius: 100px; font-size: var(--fs-small); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); transition: all .3s var(--ease); }
.filter.active, .filter:hover { background: var(--ink); color: #111; border-color: var(--ink); }

/* ---- MASONRY COLLAGE --------------------------------------------------
   Full images at their natural shape — no cropping, no gaps. Varied
   heights give the collage its rhythm. Used by featured + portfolio. ------ */
.masonry {
  column-count: 4;
  column-gap: clamp(.6rem, 1.1vw, 1rem);
}
.masonry .work {
  display: block; width: 100%;
  margin: 0 0 clamp(.6rem, 1.1vw, 1rem);
  break-inside: avoid;
  position: relative; overflow: hidden;
  border-radius: var(--radius); background: var(--bg-elev);
  will-change: clip-path;
}
.masonry .work__media { position: static; }
.masonry .work__media img {
  width: 100%; height: auto; display: block;
  transition: transform .8s var(--ease);
}
.masonry .work:hover .work__media img { transform: scale(1.04); }

.work__overlay { position: absolute; inset: 0; z-index: 2; padding: 1.4rem;
  display: flex; flex-direction: column; justify-content: flex-end;
  background: linear-gradient(to top, rgba(13,21,18,.7), transparent 55%);
  opacity: 0; transition: opacity .5s var(--ease); }
.work:hover .work__overlay { opacity: 1; }
.work__title { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-h3); }
.work__cat { font-size: var(--fs-small); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }

@media (max-width: 1100px){ .masonry { column-count: 3; } }
@media (max-width: 680px) { .masonry { column-count: 2; } }

/* View-more: collapsed collage fades out with a button */
.collage { position: relative; }
.collage-fade {
  display: none; position: absolute; left: 0; right: 0; bottom: 3.5rem; height: 260px;
  background: linear-gradient(to top, var(--bg) 12%, transparent);
  pointer-events: none; z-index: 3;
}
.view-more { display: none; text-align: center; padding-top: 2rem; position: relative; z-index: 4; }
.collage.is-collapsed .collage-fade { display: block; }
.collage.is-collapsed .view-more { display: block; }

/* ==========================================================
   CTA STRIP
   ========================================================== */
.cta { text-align: center; }
.cta__title { font-size: var(--fs-h1); text-transform: uppercase; }
.cta__title a { transition: color .3s; }
.cta__title a:hover { color: var(--accent); }

/* ==========================================================
   CONTACT PAGE
   ========================================================== */
.contact__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 6vw, 6rem); }
@media (max-width: 860px){ .contact__grid { grid-template-columns: 1fr; } }
.field { position: relative; margin-bottom: 2rem; }
.field label { display: block; font-size: var(--fs-small); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: .6rem; }
.field input, .field textarea, .field select {
  width: 100%; background: transparent; border: none; border-bottom: 1px solid var(--line);
  color: var(--ink); font: inherit; padding: .7rem 0; transition: border-color .3s;
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--accent); }
.field select option { background: var(--bg-elev); }
.contact__info dt { font-size: var(--fs-small); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); margin-top: 2rem; }
.contact__info dd { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-h3); }
.socials { display: flex; gap: 1.4rem; margin-top: 2.5rem; }
.socials a { font-size: var(--fs-small); letter-spacing: .1em; text-transform: uppercase; }

/* ==========================================================
   FOOTER
   ========================================================== */
.site-footer { border-top: 1px solid var(--line); padding-block: 4rem; }
.footer__top { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 2rem; align-items: flex-start; }
.footer__big { font-size: var(--fs-h1); text-transform: uppercase; }
.footer__cols { display: flex; gap: 4rem; flex-wrap: wrap; }
.footer__col h4 { font-size: var(--fs-small); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 1rem; font-family: var(--font-body); font-weight: 500; }
.footer__col a { display: block; color: var(--ink-soft); padding: .2rem 0; transition: color .3s; }
.footer__col a:hover { color: var(--ink); }
.footer__bottom { display: flex; justify-content: space-between; margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: var(--fs-small); flex-wrap: wrap; gap: 1rem; }

/* ==========================================================
   PAGE TRANSITION OVERLAY
   ========================================================== */
#page-transition { position: fixed; inset: 0; z-index: 800; background: var(--accent); transform: scaleY(0); transform-origin: bottom; pointer-events: none; }

/* ---------- utilities ---------- */
.mt-1 { margin-top: 1rem; } .mt-2 { margin-top: 2rem; } .mt-4 { margin-top: 4rem; }
.text-soft { color: var(--ink-soft); }
.center { text-align: center; }
