/* ============================================================
   QATRA BIO, cinematic / motion layer (homepages only)
   Loaded after styles.css. Dark WebGL hero + elevated motion.
   ============================================================ */

/* ---- Lenis smooth scroll ---- */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

/* ---- Header floats OVER the dark hero (until scrolled) ---- */
.has-hero .site-header { position: fixed; inset-block-start: 0; inset-inline: 0; z-index: 100; background: transparent; border-block-end-color: transparent; box-shadow: none; transition: background 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease); }
.has-hero .site-header:not(.scrolled) .brand .wordmark { color: var(--cream); }
.has-hero .site-header:not(.scrolled) .brand .wordmark span { color: var(--gold); }
.has-hero .site-header:not(.scrolled) .nav-links a { color: rgba(247, 241, 230, 0.82); }
.has-hero .site-header:not(.scrolled) .nav-links a:hover { color: #fff; }
.has-hero .site-header:not(.scrolled) .lang-btn { color: var(--cream); border-color: rgba(247, 241, 230, 0.32); }
.has-hero .site-header:not(.scrolled) .menu-toggle span { background: var(--cream); }
.has-hero .site-header.scrolled { background: color-mix(in srgb, var(--cream) 92%, transparent); backdrop-filter: blur(12px) saturate(1.1); border-block-end: 1px solid var(--line-soft); box-shadow: var(--shadow-sm); }

/* ============ CINEMATIC HERO ============ */
.hero--cine {
  position: relative;
  min-block-size: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: #0b1c15;
  color: var(--cream);
  padding-block: 7rem 6rem;
  isolation: isolate;
}
.hero-canvas {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  z-index: 0;
  display: block;
}
/* static fallback when WebGL/reduced-motion unavailable */
.hero-canvas.is-static,
.hero--cine:not(:has(.hero-canvas.is-live)) .hero-canvas {
  background:
    radial-gradient(120% 90% at 72% 30%, rgba(201, 162, 78, 0.30), transparent 55%),
    radial-gradient(130% 120% at 20% 80%, rgba(23, 61, 47, 0.9), transparent 60%),
    linear-gradient(160deg, #143528 0%, #0b1c15 55%, #081711 100%);
}
.hero-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(110% 80% at 30% 65%, rgba(7, 18, 13, 0.62), transparent 60%),
    linear-gradient(to bottom, rgba(7, 18, 13, 0.35) 0%, transparent 24%, transparent 62%, rgba(8, 20, 15, 0.55) 86%, var(--cream) 100%);
}
.hero-veil::after { /* fine grain */
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* floating flacon, bleeds off the inline-end edge */
.hero-flacon {
  position: absolute;
  z-index: 1;
  inset-block: 0;
  inset-inline-end: clamp(-4rem, -2vw, 2rem);
  inline-size: clamp(280px, 34vw, 540px);
  display: grid;
  place-items: center;
  pointer-events: none;
}
.hero-flacon svg { inline-size: 64%; height: auto; filter: drop-shadow(0 30px 60px rgba(0, 0, 0, 0.5)); position: relative; z-index: 2; }
.hero-flacon-glow {
  position: absolute;
  inline-size: 78%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 162, 78, 0.42), rgba(201, 162, 78, 0.08) 45%, transparent 70%);
  filter: blur(6px);
}

.hero-inner {
  position: relative;
  z-index: 2;
  inline-size: 100%;
  max-inline-size: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.hero-inner .eyebrow { color: var(--gold); margin-block: 0 1.2rem; }
.hero-inner .eyebrow::before { background: var(--gold); opacity: 0.8; }
.brand-draw { display: block; inline-size: 56px; margin-bottom: 1.6rem; }
.brand-draw svg { inline-size: 100%; height: auto; }
.motion .brand-draw { opacity: 0; }

.hero-title {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--cream);
  font-size: clamp(2.5rem, 1.4rem + 5.6vw, 5.6rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  max-inline-size: 17ch;
  margin: 0;
}
:root[lang="ar"] .hero-title { line-height: 1.18; letter-spacing: 0; max-inline-size: 15ch; font-weight: 700; }
.hero-title .word { display: inline-block; overflow: hidden; vertical-align: top; }
.hero-title .word-in { display: inline-block; }
.hero-lede {
  margin-block: 1.6rem 2.4rem;
  max-inline-size: 44ch;
  font-size: clamp(1.05rem, 0.98rem + 0.5vw, 1.3rem);
  line-height: 1.62;
  color: rgba(247, 241, 230, 0.78);
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 1rem; }
.hero-trust { margin-block-start: 2.6rem; display: flex; flex-wrap: wrap; gap: 0.9rem 1.8rem; }
.hero-trust span { display: inline-flex; align-items: center; gap: 0.5rem; font-size: var(--step--1); color: rgba(247, 241, 230, 0.66); font-weight: 500; }
.hero-trust .ico { inline-size: 1.05rem; block-size: 1.05rem; color: var(--gold); }

/* dark-hero buttons */
.btn--gold { background: linear-gradient(135deg, #e3c277, #c9a24e); color: #21180a; box-shadow: 0 10px 30px rgba(201, 162, 78, 0.34); border: 0; }
.btn--gold:hover { box-shadow: 0 16px 40px rgba(201, 162, 78, 0.46); filter: brightness(1.04); }
.btn--line { border: 1.5px solid rgba(247, 241, 230, 0.45); color: var(--cream); background: transparent; }
.btn--line:hover { background: rgba(247, 241, 230, 0.1); border-color: var(--cream); }

/* scroll cue */
.scroll-cue {
  position: absolute;
  z-index: 3;
  inset-block-end: 1.8rem;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  color: rgba(247, 241, 230, 0.6);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
:root[dir="rtl"] .scroll-cue { transform: translateX(50%); }
.scroll-cue-line { inline-size: 1px; block-size: 46px; background: linear-gradient(to bottom, transparent, var(--gold)); position: relative; overflow: hidden; }
.scroll-cue-line::after { content: ""; position: absolute; inset-inline: 0; inset-block-start: 0; block-size: 40%; background: var(--cream); animation: cue 2.4s var(--ease) infinite; }
@keyframes cue { 0% { transform: translateY(-100%); } 60%, 100% { transform: translateY(260%); } }
.scroll-cue:hover { color: var(--cream); }

@media (max-width: 860px) {
  .hero-flacon { inset-inline-end: 50%; transform: translateX(50%); inset-block-start: auto; inset-block-end: 6%; block-size: 46%; opacity: 0.5; }
  :root[dir="rtl"] .hero-flacon { transform: translateX(-50%); }
  .hero-title { max-inline-size: 20ch; }
  .hero-inner { text-align: start; }
}

/* ============ SPLIT-WORD SCRUB REVEAL ============ */
[data-reveal-words] .word { display: inline-block; }

/* ============ ELEVATED TYPE & SPACING (homepage) ============ */
.has-hero .section { padding-block: clamp(5.5rem, 3.5rem + 9vw, 11rem); }
.has-hero h2 { font-size: clamp(2rem, 1.5rem + 2.4vw, 3.4rem); letter-spacing: -0.01em; }
.has-hero .section-head { margin-bottom: clamp(2.6rem, 1.8rem + 2.5vw, 4.4rem); }
.has-hero .lede { font-size: clamp(1.05rem, 0.98rem + 0.45vw, 1.32rem); }

/* ============ CARD HOVER PHYSICS ============ */
.product-visual { overflow: hidden; }
.product-visual svg { transition: transform 0.7s var(--ease); }
.product:hover .product-visual svg { transform: translateY(-6px) scale(1.06); }
.use, .step, .product { transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease), border-color 0.5s var(--ease); }
.use:hover, .step:hover { transform: translateY(-6px); }

/* ============ CUSTOM CURSOR ============ */
.cursor {
  position: fixed;
  inset-block-start: 0;
  inset-inline-start: 0;
  inline-size: 9px;
  block-size: 9px;
  margin: -4.5px 0 0 -4.5px;
  border-radius: 50%;
  background: var(--copper);
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: normal;
  transition: width 0.3s var(--ease), height 0.3s var(--ease), background 0.3s var(--ease), opacity 0.3s var(--ease);
  will-change: transform;
}
.cursor.is-hot { inline-size: 38px; block-size: 38px; margin: -19px 0 0 -19px; background: rgba(201, 162, 78, 0.18); border: 1px solid var(--gold); }
@media (hover: none) { .cursor { display: none; } }

/* ============ DARK-HERO: keep header CTA readable ============ */
.has-hero .site-header:not(.scrolled) .btn--primary { box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25); }

/* respect reduced motion: no transforms/parallax linger */
@media (prefers-reduced-motion: reduce) {
  .hero-flacon { opacity: 0.55; }
  .scroll-cue-line::after { animation: none; }
  .cursor { display: none; }
}

/* ---- Hero brand mark (real logo image) ---- */
.brand-draw { inline-size: auto; block-size: 64px; }
.brand-draw img { display: block; block-size: 64px; inline-size: auto; }
