/* ============================================================
   KABUNAKO — HOMEPAGE
   Dark industrial treatment. Scoped entirely to body.page-home so
   every other page keeps the warm-paper design system untouched.
   Animation is driven by assets/js/home.js (Anime.js).
   ============================================================ */

/* ---------- Palette: invert the shared tokens, add homepage-only ones ---------- */
body.page-home{
  --paper:        #0A0A0B;
  --paper-2:      #121214;
  --paper-3:      #1B1B1E;
  --ink:          #F6F1E8;
  --ink-2:        #D6CFC4;
  --ink-soft:     #948B80;
  --line:         rgba(246,241,232,.14);
  --line-soft:    rgba(246,241,232,.07);

  --gold:      #F5B301;
  --gold-2:    #FFC93C;
  --ember:     #E8531B;

  /* Africa map */
  --map-hot:   #FFB03A;
  --map-line:  #F07A16;
  --map-deep:  #B24A0C;

  /* Plant-news gears — the metal has to sit clearly above the #0A0A0B
     background or no amount of layer opacity will make it read. */
  --gear-hi:   #5A5047;
  --gear-mid:  #3A332C;
  --gear-lo:   #221E1A;
  --gear-edge: #F5B301;

  background:var(--paper);
  color:var(--ink);
}

/* ---------- Nav / footer / mobile menu on a dark page ---------- */
.page-home .nav.scrolled{
  background:rgba(10,10,11,.78);
  border-color:var(--line-soft);
  box-shadow:0 1px 0 rgba(246,241,232,.06);
}
.page-home .nav-links a{ color:rgba(246,241,232,.72); }
.page-home .nav-links a:hover{ color:#fff; }
.page-home .nav-links a::after{ background:var(--gold); }
.page-home .nav-burger{ border-color:var(--line); color:var(--ink); }
.page-home .brand .mark rect{ stroke:var(--gold); }
.page-home .brand small{ color:rgba(246,241,232,.45); }

/* The footer and mobile menu were authored for a light page: they paint
   themselves with var(--ink)/var(--paper), which the inversion above flips the
   wrong way. Re-pin them to literal values. footer.php also sets
   `style="color:var(--paper)"` inline on the brand, hence !important. */
.page-home .footer{ background:#0E0E10; color:#F6F1E8; border-top:1px solid var(--line-soft); }
.page-home .footer h5{ color:#fff; }
.page-home .footer .brand{ color:#F6F1E8 !important; }
.page-home .footer .brand .mark rect{ stroke:#F6F1E8; }
.page-home .footer .brand .mark path:last-of-type{ fill:#F6F1E8; }
.page-home .mobile-menu{ background:#0A0A0B; color:#F6F1E8; }
.page-home .mobile-menu .close{ color:#F6F1E8; }

.page-home .btn--primary{ --bg:var(--gold); --fg:#15110D; border-color:var(--gold); font-weight:600; }
.page-home .btn--primary:hover{ background:var(--gold-2); border-color:var(--gold-2); }
.page-home .btn--ghost{ --fg:var(--ink); border-color:var(--line); }
.page-home .btn--ghost:hover{ background:rgba(246,241,232,.08); color:#fff; border-color:rgba(246,241,232,.4); }

/* A shine sweep for the primary CTA (section 7 of the brief) */
.page-home .btn--primary .shine{
  position:absolute; top:0; left:-40%; width:32%; height:100%;
  background:linear-gradient(100deg, transparent, rgba(255,255,255,.55), transparent);
  transform:skewX(-18deg); pointer-events:none; opacity:0;
}

/* ============================================================
   HERO
   ============================================================ */
.hero-x{
  position:relative; overflow:hidden; isolation:isolate;
  min-height:min(96vh, 900px);
  display:flex; align-items:center;
  padding-top:clamp(120px,14vw,168px);
  padding-bottom:clamp(56px,7vw,96px);
}

/* Photography layer — scaled 1.06 -> 1 on load, then floats */
.hero-x__photo{ position:absolute; inset:-4%; z-index:0; will-change:transform; }
.hero-x__photo img{ width:100%; height:100%; object-fit:cover; display:block; }
.hero-x__scrim{
  position:absolute; inset:0; z-index:1; pointer-events:none;
  background:
    linear-gradient(100deg, rgba(8,8,9,.96) 0%, rgba(8,8,9,.86) 34%, rgba(8,8,9,.42) 62%, rgba(8,8,9,.72) 100%),
    linear-gradient(0deg, rgba(8,8,9,.95) 2%, transparent 40%);
}
.hero-x__sparks{ position:absolute; inset:0; z-index:2; pointer-events:none; }
.hero-x__inner{
  position:relative; z-index:4; width:100%;
  display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.05fr);
  gap:clamp(24px,4vw,64px); align-items:center;
}

.hero-x__copy{ will-change:transform; }
.hero-x h1{
  font-family:var(--display); font-weight:900; text-transform:uppercase;
  font-size:clamp(42px,6.2vw,86px); line-height:.95; letter-spacing:-.01em;
  margin:0 0 clamp(20px,2.6vw,30px);
}
.hero-x h1 .ln{ display:block; overflow:hidden; }
.hero-x h1 .ln > span{ display:block; }
.hero-x h1 .gold{ color:var(--gold); }
.hero-x__lede{
  max-width:34ch; color:rgba(246,241,232,.74);
  font-size:clamp(15px,1.15vw,17px); line-height:1.65; margin:0;
}

.hero-x__stats{ display:flex; flex-wrap:wrap; gap:clamp(24px,3.4vw,52px); margin-top:clamp(28px,3.6vw,48px); }
.hstat b{
  display:block; font-family:var(--display); font-weight:900; color:var(--gold);
  font-size:clamp(30px,3.4vw,46px); line-height:1; letter-spacing:-.01em;
}
/* direct child only — the counter lives in `.hstat > b > span.cnt` and must
   not inherit the small grey label styling */
.hstat > span{
  display:block; margin-top:10px; white-space:pre-line;
  font-size:12.5px; line-height:1.45; color:rgba(246,241,232,.62);
}
.hero-x__cta{ margin-top:clamp(30px,3.6vw,46px); display:flex; gap:14px; flex-wrap:wrap; }

/* ---------- Africa map ---------- */
.hero-x__map{ position:relative; will-change:transform; }
.africa{ position:relative; width:100%; margin-inline:auto; max-width:640px; }
.africa__svg{ width:100%; height:auto; display:block; overflow:visible; }
.africa__label{
  position:absolute; left:87.2%; top:69.5%; transform:translateY(-50%);
  font-family:var(--mono); font-size:clamp(10px,.86vw,13px); font-weight:600;
  letter-spacing:.18em; text-transform:uppercase; color:var(--gold);
  white-space:nowrap; pointer-events:none;
}
.af-zim{ filter:drop-shadow(0 0 12px rgba(245,179,1,.55)); }

/* The SVG carries opacity="0" / fill-opacity="0" presentation attributes so the
   markup describes its pre-animation state. CSS (which outranks presentation
   attributes) restores the resting state, and `.has-anim` re-hides them only
   when JS is actually going to animate them in. */
.af-marker, .af-halo, .af-leader-dot{ opacity:1; }
.af-zim{ fill-opacity:1; stroke-opacity:1; }
/* Purely decorative — only ever visible while the pulse animation runs. */
.af-pulse{ opacity:0; }

/* ============================================================
   PRODUCT MOSAIC
   ============================================================ */
.prods{ display:grid; grid-template-columns:repeat(4,1fr); grid-auto-rows:clamp(180px,17vw,214px); gap:2px; }
.ptile{
  position:relative; overflow:hidden; display:flex; flex-direction:column;
  padding:clamp(20px,1.8vw,28px); color:#fff; isolation:isolate;
  transition:box-shadow .4s ease;
}
.ptile--tall{ grid-row:span 2; }
.ptile--wide{ grid-column:span 2; }
.ptile--deep  { background:linear-gradient(150deg,#8A4405,#B85F09); }
.ptile--amber { background:linear-gradient(150deg,#F0A81E,#D08405); }
.ptile--orange{ background:linear-gradient(150deg,#EA6A17,#C2490B); }
.ptile--rust  { background:linear-gradient(150deg,#C2530F,#8E3407); }
.ptile__grad{
  position:absolute; inset:0; z-index:1; opacity:0; pointer-events:none;
  background:linear-gradient(150deg, rgba(255,255,255,.22), transparent 55%);
}
.ptile__title{
  position:relative; z-index:3; margin:0;
  font-family:var(--display); font-weight:700; text-transform:uppercase;
  font-size:clamp(15px,1.35vw,20px); line-height:1.15; letter-spacing:.01em;
  max-width:12ch; text-shadow:0 1px 14px rgba(0,0,0,.3);
}
.ptile__img{
  position:absolute; z-index:2; right:-6%; bottom:-8%; width:82%; height:74%;
  display:flex; align-items:flex-end; justify-content:center; will-change:transform;
}
.ptile__img img{
  width:100%; height:100%; object-fit:contain; object-position:bottom center;
  mix-blend-mode:luminosity; opacity:.92;
  filter:drop-shadow(0 20px 30px rgba(0,0,0,.45)) contrast(1.12);
}
.ptile--tall .ptile__img{ width:100%; height:62%; right:-10%; }
.ptile--wide .ptile__img{ width:56%; height:88%; }
.ptile__go{
  position:absolute; z-index:4; right:clamp(16px,1.4vw,22px); bottom:clamp(16px,1.4vw,22px);
  width:34px; height:34px; border-radius:50%; background:var(--gold); color:#15110D;
  display:grid; place-items:center; font-size:15px; font-weight:700;
  box-shadow:0 6px 18px rgba(0,0,0,.28);
}
.ptile__spark{
  position:absolute; z-index:1; inset:auto -20% -30% auto; width:70%; aspect-ratio:1;
  border-radius:50%; background:radial-gradient(circle, rgba(255,225,140,.5), transparent 65%);
  opacity:0; pointer-events:none;
}
.ptile--more{ background:linear-gradient(150deg,#EA6A17,#B8420A); }
.ptile--more .ptile__title{ max-width:16ch; }

/* ============================================================
   PLANT NEWS
   ============================================================ */
.news{ position:relative; overflow:hidden; isolation:isolate; background:#0A0A0B;
  padding-block:clamp(64px,8vw,110px); }
.news__photo{ position:absolute; inset:-6%; z-index:0; will-change:transform; }
.news__photo img{ width:100%; height:100%; object-fit:cover; display:block; opacity:.34; }
.news__scrim{ position:absolute; inset:0; z-index:1;
  background:linear-gradient(180deg, rgba(8,8,9,.9), rgba(8,8,9,.72) 45%, rgba(8,8,9,.94)); }
.gears{ position:absolute; inset:0; z-index:2; pointer-events:none; }
.gears__svg{ width:100%; height:100%; display:block; }
.gear-layer{ will-change:transform; }
/* transform-box:fill-box makes transform-origin resolve against the gear's own
   bounding box (its centre) instead of the whole viewBox, so it spins in place. */
.gear__spin{ transform-box:fill-box; transform-origin:50% 50%; will-change:transform; }
/* Layer opacity + edge brightness are the two knobs for how present the gear
   room feels. Depth ordering must hold: further back = fainter. */
.gear-layer--d1{ opacity:.55; }
.gear-layer--d2{ opacity:.72; }
.gear-layer--d3{ opacity:.88; }
.gears__tech{ opacity:.34; }
.gear__edge{ stroke-opacity:.8; }
.gear__ring{ stroke-opacity:.55; }
.gear__spoke{ stroke-opacity:.45; }
.news__inner{ position:relative; z-index:4; display:grid; grid-template-columns:minmax(190px,.72fr) 3fr;
  gap:clamp(24px,4vw,60px); align-items:start; }
.news__head h2{
  font-family:var(--display); font-weight:900; text-transform:uppercase;
  font-size:clamp(32px,3.6vw,50px); line-height:.95; margin:0;
  text-shadow:0 2px 18px rgba(8,8,9,.9);
}
.news__rule{ height:3px; width:64px; background:var(--gold); margin-top:22px; transform-origin:left center; }
.news__items{ display:grid; grid-template-columns:repeat(3,1fr); gap:clamp(20px,2.6vw,40px); }
.nitem{ position:relative; padding-left:clamp(18px,1.8vw,28px); }
.nitem__sep{ position:absolute; left:0; top:0; width:1px; height:100%;
  background:var(--gold); opacity:.55; transform-origin:top center; }
.nitem__date{ font-family:var(--mono); font-size:13px; color:rgba(246,241,232,.6); margin:0 0 14px; }
.nitem__date b{ font-family:var(--display); font-weight:800; font-size:22px; color:var(--gold);
  letter-spacing:.01em; transition:color .3s ease; }
/* Gears run behind this copy, so keep the text crisp with a shadow rather than
   veiling the gears back down. */
.nitem__title{ margin:0; font-size:15.5px; line-height:1.55; color:rgba(246,241,232,.92);
  text-shadow:0 1px 12px rgba(8,8,9,.95); }
.nitem__date{ text-shadow:0 1px 12px rgba(8,8,9,.95); }
.nitem:hover .nitem__date b{ color:var(--gold-2); }
.news__all{ display:flex; align-items:center; justify-content:flex-end;
  gap:16px; margin-top:clamp(30px,4vw,54px); }
.news__all a{ display:inline-flex; align-items:center; gap:16px;
  font-family:var(--mono); font-size:12.5px; letter-spacing:.14em; text-transform:uppercase; }
.news__all .rnd{ width:46px; height:46px; border-radius:50%; background:var(--gold); color:#15110D;
  display:grid; place-items:center; font-size:19px; transition:transform .35s cubic-bezier(.2,.7,.2,1); }
.news__all a:hover .rnd{ transform:translateX(4px); }

/* ============================================================
   FLOATING ACTION BUTTONS
   ============================================================ */
.fabs{ position:fixed; right:clamp(14px,2vw,28px); bottom:clamp(14px,2vw,28px); z-index:70;
  display:grid; gap:12px; }
.fab{
  width:54px; height:54px; border-radius:50%; border:0; cursor:pointer;
  background:var(--gold); color:#15110D; display:grid; place-items:center;
  font-size:20px; box-shadow:0 10px 28px rgba(0,0,0,.4);
  transition:background .3s ease;
}
.fab:hover{ background:var(--gold-2); }
.fab__i{ display:block; line-height:1; will-change:transform; }
.fab--top{ opacity:0; visibility:hidden; transition:opacity .35s ease, visibility .35s ease, background .3s ease; }
.fab--top.is-on{ opacity:1; visibility:visible; }

/* ============================================================
   ANIMATION INITIAL STATES
   `.has-anim` is only added when JS is on AND motion is allowed, so
   content is never hidden from no-JS or reduced-motion visitors.
   ============================================================ */
.has-anim .anim-up,
.has-anim .anim-fade,
.has-anim .hstat,
.has-anim .ptile,
.has-anim .nitem{ opacity:0; }
.has-anim .hero-x h1 .ln > span{ transform:translateY(105%); }
.has-anim .news__rule{ transform:scaleX(0); }
.has-anim .nitem__sep{ transform:scaleY(0); }
.has-anim .ptile__title,
.has-anim .ptile__img,
.has-anim .ptile__go{ opacity:0; }
.has-anim .africa__svg .af-outline,
.has-anim .africa__svg .af-border,
.has-anim .africa__svg .af-leader,
.has-anim .af-marker,
.has-anim .af-halo,
.has-anim .af-leader-dot,
.has-anim .africa__label,
.has-anim .hero-x__scrim{ opacity:0; }
.has-anim .af-zim{ fill-opacity:0; stroke-opacity:0; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width:1080px){
  .hero-x__inner{ grid-template-columns:1fr; gap:36px; }
  .hero-x__map{ order:2; max-width:520px; margin-inline:auto; width:100%; }
  .hero-x__scrim{ background:linear-gradient(180deg, rgba(8,8,9,.9), rgba(8,8,9,.8) 50%, rgba(8,8,9,.96)); }
  .news__inner{ grid-template-columns:1fr; }
}
@media (max-width:900px){
  .prods{ grid-template-columns:repeat(2,1fr); }
  .ptile--tall{ grid-row:span 1; }
  .ptile--wide{ grid-column:span 2; }
  .news__items{ grid-template-columns:1fr; gap:28px; }
}
@media (max-width:560px){
  .prods{ grid-template-columns:1fr; }
  .ptile--wide{ grid-column:span 1; }
  .hero-x__stats{ gap:22px; }
  .hstat{ min-width:44%; }
  .fab{ width:48px; height:48px; font-size:18px; }
}

/* ============================================================
   REDUCED MOTION — content visible, no continuous or parallax motion
   ============================================================ */
@media (prefers-reduced-motion: reduce){
  .page-home .hero-x__photo,
  .page-home .news__photo,
  .page-home .hero-x__copy,
  .page-home .hero-x__map,
  .page-home .gear-layer,
  .page-home .ptile__img{ transform:none !important; }
  .page-home .hero-x__sparks{ display:none; }
  .page-home .btn:hover{ transform:none; }
}
