/* ============================================================
   HARAMBEE — Asociația de Business a Românilor din Kenya
   Cinematic scroll engine — reproduced from the reference
   "Mostar city" spec, adapted for full-frame photography.
   ============================================================ */

@font-face {
  font-family: "Ogg Medium";
  src: url("https://dcym8fthxf5uu.cloudfront.net/fonts/247a073c-29f5-4a89-aa3a-741020f346fc/OggText-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --mx: 0; --my: 0;
  --back-opacity: 1; --back-x: 0px; --back-y: 0px; --back-scale: 0.76;
  --four-y: 10vh; --four-scale: 0.78;
  --bazaar-y: 20vh;
  --blur-px: 0px; --back-brightness: 1;
  --bazaar-blur-px: 0px; --bazaar-brightness: 1; --bazaar-saturation: 1;
  --shade-opacity: 1; --shade-z: 2;
  --shade-top-alpha: 0; --shade-mid-alpha: 0; --shade-bottom-alpha: 0;
  --blur-tint: 74, 181, 224;
  --title-y: 0px; --title-scale: 1; --title-opacity: 1;
  --bridge-x: -50%; --bridge-y: 0px; --bridge-bottom: 5vh;
  --bridge-width: 67.2vw; --bridge-scale: 1.02;
  --split-left-x: -50%;  --split-left-y: 0px;  --split-left-scale: 1;
  --split-right-x: -50%; --split-right-y: 0px; --split-right-scale: 1;
  --frame2-opacity: 0; --frame2-x: -50%; --frame2-y: -50%; --frame2-scale: 1.06;
  --intro-copy-y: 0px; --intro-copy-opacity: 1;
  --panel2-opacity: 0; --panel2-y: calc(-50% + 58px);
  --panel3-opacity: 0; --panel3-y: calc(-50% + 58px);
  --ink: #111411; --paper: #fdf1e1; --shadow: rgba(0, 0, 0, 0.32);
  font-family: Inter, Satoshi, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--paper);
  background: #0b1110;
  letter-spacing: 0;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; background: #0b1110; }
body { min-height: 100%; margin: 0; overflow-x: clip; background: #0b1110; }
button { border: 0; font: inherit; }
.site-shell { min-height: 100vh; }

/* ---- Scroll rig ----
   Runway = 2900px: hero exit + the bridge (frame2) + bazaar (frame3)
   choreography finishes by 2700px, leaving a ~200px settled hold so the
   sticky stage doesn't release into the gallery mid-animation. Section
   height directly bounds the scroll distance the JS engine reads, so this
   is also the real, only "jump target" for the #beneficii nav link (which
   now points at the gallery section right after — no separate anchor). */
.cinema-scroll { position: relative; height: calc(100vh + 2900px); }
.stage {
  position: sticky; top: 0; height: 100vh; min-height: 620px;
  overflow: hidden; isolation: isolate; background: #7fb4d4;
}
.world, .back-stack, .sky-img, .shade, .scene-img, .site-header,
.hero-title, .intro-copy, .story-panel {
  position: absolute;
}
.world { inset: 0; overflow: hidden; background: #79b7dd; }

/* ---- Header ---- */
.site-header {
  z-index: 10; top: 0; left: 0; right: 0;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto minmax(260px, 1fr);
  align-items: center; gap: 32px; padding: 32px;
  color: rgba(253, 241, 225, 0.86); pointer-events: auto;
}
.site-logo {
  justify-self: start;
  font-family: "Ogg Medium", Georgia, serif; font-size: 24px; line-height: 1; font-weight: 500;
  color: rgba(253, 241, 225, 0.92); text-decoration: none; white-space: nowrap;
}
.site-nav {
  display: flex; justify-content: center; align-items: center;
  gap: clamp(24px, 2.2vw, 44px);
}
.site-nav a, .language-switcher {
  color: rgba(253, 241, 225, 0.86); font-weight: 700; line-height: 1;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.2); text-decoration: none;
}
.site-nav a { font-size: 20px; font-weight: 400; }
.language-switcher {
  justify-self: end; display: inline-flex; align-items: center; justify-content: center;
  gap: 5px; padding: 0; background: transparent; font-size: 16px; cursor: pointer;
}
.language-switcher span { display: inline-flex; line-height: 1; }

/* ---- Scene images ---- */
.scene-img {
  display: block; user-select: none; -webkit-user-drag: none;
  will-change: transform, opacity, filter; pointer-events: none;
}
.sky-img {
  inset: 0; width: 100%; height: 100%; object-fit: cover; transform: none;
  filter: blur(var(--blur-px)) brightness(var(--back-brightness));
}

.back-stack {
  z-index: 1; top: 0; bottom: 0; left: -3vw; right: -3vw;
  position: absolute;
  opacity: var(--back-opacity);
  transform: translate3d(var(--back-x), var(--back-y), 0) scale(var(--back-scale));
  transform-origin: 50% 100%;
  will-change: transform, filter, opacity;
}
.back-img {
  inset: 0; width: 100%; height: 100%; object-fit: cover;
  filter: blur(var(--blur-px)) brightness(var(--back-brightness));
}
.back-bazaar, .back-four {
  top: auto; bottom: 0; left: 48%; right: auto;
  width: 112%; height: auto; object-fit: contain;
}
.back-bazaar {
  z-index: 3; opacity: 1;
  filter: blur(var(--bazaar-blur-px)) brightness(var(--bazaar-brightness)) saturate(var(--bazaar-saturation));
  transform: translate3d(-50%, var(--bazaar-y), 0) scale(0.86);
}
.back-four {
  z-index: 1; opacity: 0.72; mix-blend-mode: screen;
  transform: translate3d(-50%, calc(var(--four-y) - 110px), 0) scale(var(--four-scale));
}

/* ---- Hero title ---- */
.hero-title {
  z-index: 8; left: 50%; top: clamp(122px, 19vh, 205px);
  width: min(94vw, 1780px); margin: 0; color: #fdf1e1;
  font-family: "Ogg Medium", Georgia, serif; font-size: 14rem; font-weight: 500;
  line-height: 0.78; text-align: center; text-shadow: none;
  transform: translate3d(-50%, var(--title-y), 0) scale(var(--title-scale));
  opacity: var(--title-opacity); will-change: transform, opacity;
}

/* ---- Foreground scene images ---- */
.bridge-img {
  z-index: 4; left: 50%; bottom: var(--bridge-bottom);
  width: min(var(--bridge-width), 2140px); height: auto;
  transform: translate3d(var(--bridge-x), var(--bridge-y), 0) scale(var(--bridge-scale));
  transform-origin: 50% 48%;
}
.splitframe-img {
  z-index: 6; left: 50%; bottom: -2vh; width: min(118vw, 2240px); height: auto; pointer-events: none;
}
.splitframe-left {
  transform: translate3d(var(--split-left-x), var(--split-left-y), 0) scale(var(--split-left-scale));
  transform-origin: 21% 52%;
}
.splitframe-right {
  transform: translate3d(var(--split-right-x), var(--split-right-y), 0) scale(var(--split-right-scale));
  transform-origin: 79% 52%;
}
.frame-two-img {
  z-index: 5; filter: none !important; backdrop-filter: none;
  left: 50%; top: 50%; width: min(122vw, 2160px); height: auto;
  opacity: var(--frame2-opacity);
  transform: translate3d(var(--frame2-x), var(--frame2-y), 0) scale(var(--frame2-scale));
  transform-origin: 50% 48%;
}

/* ---- Shade ---- */
.shade {
  inset: 0; z-index: var(--shade-z); pointer-events: none; opacity: var(--shade-opacity);
  background: linear-gradient(180deg,
    rgba(var(--blur-tint), var(--shade-top-alpha)) 0%,
    rgba(var(--blur-tint), var(--shade-mid-alpha)) 48%,
    rgba(var(--blur-tint), var(--shade-bottom-alpha)) 100%);
}

/* ---- Intro copy ---- */
.intro-copy {
  z-index: 9; left: 50%; bottom: clamp(56px, 28vh, 400px);
  width: min(560px, calc(100vw - 40px)); text-align: center;
  transform: translate3d(-50%, var(--intro-copy-y), 0);
  opacity: var(--intro-copy-opacity); will-change: transform, opacity;
}
.intro-copy p {
  margin: 0 auto; max-width: 560px; color: #fdf1e1;
  font-size: 1.18rem; font-weight: 500; line-height: 1.18;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.42);
}
.hero-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 26px; }
.hero-tags span {
  min-height: 42px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0 25px; color: var(--ink); border-radius: 999px; background: #fdf1e1;
  font-size: 0.98rem; font-weight: 500; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

/* ---- Story panels ----
   A solid (non-blurred, so it's cheap on every scroll frame) dark card
   behind the text: text-shadow alone wasn't enough contrast over bright
   photography. */
.story-panel {
  z-index: 10; left: 50%; top: 45%; width: min(760px, calc(100vw - 42px));
  text-align: center; pointer-events: none;
  padding: 44px 40px; border-radius: 32px;
  background: rgba(7, 12, 11, 0.6);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.32);
  transform: translate3d(-50%, -50%, 0); will-change: transform, opacity;
}
.story-panel h2 {
  margin: 0; color: #fdf1e1; font-family: "Ogg Medium", Georgia, serif;
  font-size: 4.75rem; font-weight: 500; line-height: 0.95;
  text-shadow: 0 16px 38px var(--shadow);
}
.story-panel p {
  width: min(520px, 100%); margin: 26px auto 0; color: #fdf1e1;
  font-size: 1.14rem; font-weight: 500; line-height: 1.18;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.42);
}
.story-panel-bridge {
  top: 60%; opacity: var(--panel2-opacity);
  transform: translate3d(-50%, var(--panel2-y), 0);
}
.story-panel-bazaar {
  /* was 29% — collided with the header nav on common desktop heights
     (~800-900px) since that only leaves ~100px of clearance above the
     panel's vertical center. 50% keeps it clear on any realistic viewport. */
  top: 50%; opacity: var(--panel3-opacity);
  transform: translate3d(-50%, var(--panel3-y), 0);
}
.facts {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 86px; width: min(470px, 100%); margin: 72px auto 0;
}
.facts dt {
  color: #fdf1e1; font-family: "Ogg Medium", Georgia, serif;
  font-size: 4.2rem; font-weight: 500; line-height: 0.9; text-shadow: 0 14px 34px var(--shadow);
}
.facts dd {
  margin: 18px 0 0; color: #fdf1e1; font-size: 1rem; font-weight: 500; line-height: 1.14;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.42);
}
.note-button {
  min-height: 50px; margin-top: 28px; display: inline-flex; align-items: center; justify-content: center;
  gap: 12px; padding: 0 28px; border-radius: 999px; color: var(--ink); background: #fdf1e1;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.18); pointer-events: auto; cursor: pointer;
  text-decoration: none;
}
.note-button span:first-child { font-size: 1.25rem; line-height: 1; }

/* ---- Footer / contact (post-stage, normal flow) ---- */
.site-footer {
  position: relative; z-index: 1; background: #0b1110; color: var(--paper);
  padding: clamp(56px, 9vw, 120px) clamp(24px, 6vw, 120px) 40px;
  border-top: 1px solid rgba(174, 138, 80, 0.35);
}
.footer-inner {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 40px;
  max-width: 1200px; margin: 0 auto;
}
.footer-name {
  margin: 0 0 10px; font-family: "Ogg Medium", Georgia, serif; font-size: clamp(1.4rem, 3vw, 2.2rem);
  font-weight: 500; line-height: 1.05; max-width: 22ch;
}
.footer-motto { margin: 0; letter-spacing: 0.14em; font-size: 0.82rem; color: #ae8a50; text-transform: uppercase; }
.footer-contact p { margin: 0 0 6px; color: rgba(253, 241, 225, 0.86); }
.footer-contact a { color: var(--paper); text-decoration: none; border-bottom: 1px solid rgba(174, 138, 80, 0.5); }
.footer-label { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.72rem; color: #ae8a50; margin-bottom: 12px !important; }
.footer-fine { max-width: 1200px; margin: 48px auto 0; font-size: 0.75rem; color: rgba(253, 241, 225, 0.5); }

/* ---- Gallery band (Romania · Kenya) ---- */
.gallery-band {
  position: relative; z-index: 1; background: #0b1110;
  padding: clamp(56px, 9vw, 120px) clamp(24px, 6vw, 120px);
  border-top: 1px solid rgba(174, 138, 80, 0.22);
}
.gallery-inner { max-width: 1240px; margin: 0 auto; }
.gallery-kicker {
  margin: 0 0 12px; text-transform: uppercase; letter-spacing: 0.2em;
  font-size: 0.75rem; color: #ae8a50;
}
.gallery-h {
  margin: 0 0 clamp(28px, 4vw, 44px); color: var(--paper);
  font-family: "Ogg Medium", Georgia, serif; font-weight: 500;
  font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1;
}
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 900px) { .gallery-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .gallery-grid { grid-template-columns: 1fr; } }

/* ---- Benefit photo cards (the association's benefits, each paired
   with a Romania/Kenya photo, replacing the old mid-scroll slider) ---- */
.benefit-photo {
  position: relative; margin: 0; aspect-ratio: 3 / 4; overflow: hidden;
  border-radius: 16px; border: 1px solid rgba(174, 138, 80, 0.18);
  background: #111;
}
.benefit-photo > img:first-child {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: transform 600ms ease;
}
.benefit-photo:hover > img:first-child { transform: scale(1.06); }
.benefit-photo::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top,
    rgba(6, 10, 9, 0.92) 0%, rgba(6, 10, 9, 0.64) 40%, rgba(6, 10, 9, 0) 70%);
}
.benefit-pin {
  position: absolute; top: 18px; right: 18px; z-index: 2;
  width: 34px; height: 34px; padding: 7px; border-radius: 50%;
  background: rgba(253, 241, 225, 0.92);
}
.benefit-photo figcaption { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 22px 20px; }
.benefit-kicker {
  display: block; margin-bottom: 8px; color: #d9b877;
  text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.7rem; font-weight: 600;
}
.benefit-photo h3 {
  margin: 0 0 8px; color: var(--paper); font-family: "Ogg Medium", Georgia, serif;
  font-weight: 500; font-size: 1.5rem; line-height: 1.05;
}
.benefit-photo p { margin: 0; color: rgba(253, 241, 225, 0.82); font-size: 0.92rem; line-height: 1.35; }

/* ============================================================
   Media queries — reproduced verbatim from the reference
   ============================================================ */
@media (max-width: 1500px) {
  .hero-title { font-size: 11rem; }
  .story-panel h2 { font-size: 4.1rem; }
}

@media (max-width: 1100px) {
  .hero-title { top: 15vh; font-size: 7.5rem; }
  .bridge-img { width: 138vw; }
  .frame-two-img { width: 132vw; }
  .story-panel h2 { font-size: 3.2rem; }
  .facts { gap: 34px; margin-top: 44px; }
  .facts dt { font-size: 3.2rem; }
}

@media (max-width: 640px) {
  .stage { min-height: 640px; }
  .site-header { grid-template-columns: 1fr auto; gap: 18px; padding: 24px; }
  .site-nav {
    grid-column: 1 / -1; grid-row: 2; justify-content: flex-start;
    gap: 18px; overflow-x: auto; scrollbar-width: none;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .hero-title { top: 16vh; font-size: clamp(2.6rem, 13.5vw, 4.5rem); }
  .bridge-img { bottom: 2vh; width: 190vw; }
  .frame-two-img { width: 176vw; }
  .intro-copy { bottom: 42px; }
  .intro-copy p, .story-panel p { font-size: 1rem; }
  .hero-tags { gap: 8px; }
  .hero-tags span { min-height: 38px; padding: 0 16px; font-size: 0.88rem; }
  /* shared 42% for both panels on mobile — the old 26% bazaar-specific
     override collided with the header; they never show at the same time
     (opacity cross-fades between them), so sharing one safe position is fine */
  .story-panel { top: 42%; padding: 30px 24px; border-radius: 24px; }
  .story-panel h2 { font-size: 2.45rem; }
  .facts { gap: 18px; margin-top: 34px; }
  .facts dt { font-size: 2.5rem; }
  .footer-inner { flex-direction: column; gap: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .scene-img, .back-stack, .hero-title, .intro-copy, .story-panel { transition: none; }
}

/* ============================================================
   Full-frame photograph art layer (adaptation of the reference
   transparent-PNG layers to real Kenya/Romania photography).
   Transforms & choreography are inherited unchanged; only the
   box model + feathered edges differ.
   ============================================================ */

/* Deepest sky/landscape — slightly darkened so foreground reads */
.sky-img { filter: blur(var(--blur-px)) brightness(calc(var(--back-brightness) * 0.9)); }

/* Kenya scene revealed behind the split — full-cover of the stage */
.back-bazaar {
  top: 0; bottom: 0; left: 50%; right: auto;
  width: 118%; height: 100%; object-fit: cover; object-position: center 58%;
}

/* Warm light bloom accent — normal blend + no blur (cheaper compositing) */
.back-four { opacity: 0.45; mix-blend-mode: normal; filter: none; }

/* The two parting halves: cover the stage, clip to Romania | Kenya,
   feather the tops so the hero word and sky show above. */
.splitframe-img {
  top: 0; bottom: auto; height: 100vh; object-fit: cover;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 27%, #000 100%);
          mask-image: linear-gradient(to bottom, transparent 0%, #000 27%, #000 100%);
}
.splitframe-left  { object-position: center; clip-path: inset(0 50% 0 0); }
.splitframe-right { object-position: center; clip-path: inset(0 0 0 50%); }

/* Foreground bridge — a wide panorama strip at the base, top feathered */
.bridge-img {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 30%);
          mask-image: linear-gradient(to bottom, transparent 0%, #000 30%);
  filter: saturate(1.05);
}

/* Kenya close-up that fades in behind the parted halves */
.frame-two-img {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 18%, #000 100%);
          mask-image: linear-gradient(to bottom, transparent 0%, #000 18%, #000 100%);
}

/* Top & bottom scrims seat the hero word and the intro text against
   bright photography. z-index 7 sits above every scene photo (max z 6)
   so the darkening is real compositing, not a lucky coincidence with the
   splitframe masks — hero-title/intro-copy are raised above both (8, 9)
   so they stay on top of their own scrim. */
.top-scrim {
  position: absolute; top: 0; left: 0; right: 0; height: 46vh; z-index: 7;
  pointer-events: none;
  background: linear-gradient(to bottom,
    rgba(11, 17, 16, 0.62) 0%, rgba(11, 17, 16, 0.34) 42%,
    rgba(11, 17, 16, 0.10) 72%, transparent 100%);
}
.bottom-scrim {
  position: absolute; bottom: 0; left: 0; right: 0; height: 48vh; z-index: 7;
  pointer-events: none;
  background: linear-gradient(to top,
    rgba(6, 10, 9, 0.72) 0%, rgba(6, 10, 9, 0.4) 40%,
    rgba(6, 10, 9, 0.1) 68%, transparent 100%);
}

/* Legibility over bright photography */
.hero-title { text-shadow: 0 8px 44px rgba(0, 0, 0, 0.5); }
.story-panel h2 { text-shadow: 0 10px 40px rgba(0, 0, 0, 0.55); }
.story-panel p, .facts dd, .intro-copy p { text-shadow: 0 2px 20px rgba(0, 0, 0, 0.6); }
