/* Wëëzy homepage — scroll-driven rotating bottle hero (ported from the V1 static site) */

:root { --nav-h: 78px; }

/* ── Preloader ─────────────────────────────────────────── */

.preloader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.4rem;
  background: var(--ink);
  transition: opacity 0.7s var(--ease-lux), visibility 0.7s;
}

.preloader.is-done { opacity: 0; visibility: hidden; }

.preloader__mark {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6vw, 4rem);
}

.preloader__bar {
  width: min(220px, 50vw);
  height: 1px;
  background: var(--line);
  overflow: hidden;
}

.preloader__bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--cobalt-glow);
  transition: width 0.3s ease-out;
}

.preloader__pct {
  font-size: 0.72rem;
  letter-spacing: 0.35em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ── Hero ──────────────────────────────────────────────── */

.hhero { position: relative; background: var(--ink); }

.hhero__stage {
  position: relative;
  height: calc(100vh - var(--nav-h));
  height: calc(100svh - var(--nav-h));
  min-height: 480px;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.hhero__title {
  position: absolute;
  z-index: 1;
  inset-inline: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-inline: clamp(1.5rem, 6vw, 6rem);
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(4rem, 14vw, 13rem);
  line-height: 1;
  color: var(--text);
  user-select: none;
}

.hhero__bottle {
  position: relative;
  z-index: 2;
  margin: 0;
  width: min(42vh, 74vw);
  aspect-ratio: 3 / 4;
}

.hhero__bottle canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0.5rem;
  display: block;
}

.hhero__bottle::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 0.5rem;
  pointer-events: none;
  background: radial-gradient(ellipse 78% 86% at center, transparent 55%, var(--ink) 98%);
}

.hhero__glow {
  position: absolute;
  inset: -18%;
  z-index: -1;
  background: radial-gradient(ellipse 50% 42% at center 58%, rgba(46, 89, 255, 0.28), transparent 68%);
  filter: blur(12px);
}

.hhero__kicker {
  position: absolute;
  z-index: 3;
  top: 3vh;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0;
  font-size: 0.76rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--muted);
}

.hhero__kicker [lang="ar"] { letter-spacing: 0.06em; text-transform: none; font-size: 1.02rem; }
.hhero__kicker i { width: 40px; height: 1px; background: var(--bronze); }

.hhero__caption { position: absolute; z-index: 3; top: 50%; transform: translateY(-50%); opacity: 0; }
.hhero__caption--left { left: clamp(1.5rem, 8vw, 9rem); }
.hhero__caption--right { right: clamp(1.5rem, 8vw, 9rem); }
.hhero__caption-en { margin: 0; font-family: var(--font-display); font-size: clamp(1.4rem, 3vw, 2.3rem); line-height: 1.25; }
.hhero__caption-ar { margin: 0; font-size: clamp(1.5rem, 3.2vw, 2.5rem); line-height: 1.7; }

.hhero__end-cta {
  position: absolute;
  z-index: 3;
  bottom: 8vh;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem 2rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.82rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 0;
  visibility: hidden;
  transition: border-color 0.3s, background 0.3s;
}

.hhero__end-cta:hover { border-color: var(--cobalt-glow); background: rgba(46, 89, 255, 0.12); }

.hhero__hint {
  position: absolute;
  z-index: 3;
  bottom: 4vh;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
}

.hhero__hint-wheel { width: 18px; height: 28px; border: 1px solid var(--muted); border-radius: 10px; position: relative; }
.hhero__hint-wheel::after {
  content: "";
  position: absolute;
  left: 50%; top: 5px;
  width: 2px; height: 6px;
  margin-left: -1px;
  border-radius: 2px;
  background: var(--cobalt-glow);
  animation: hheroWheel 1.8s var(--ease-lux) infinite;
}

@keyframes hheroWheel {
  0% { transform: translateY(0); opacity: 1; }
  70% { transform: translateY(11px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}

/* ── Story ─────────────────────────────────────────────── */

.hstory { position: relative; padding: clamp(6rem, 15vh, 11rem) clamp(1.5rem, 6vw, 4rem); overflow: hidden; background: var(--ink); }
.hstory__bg { position: absolute; inset: 0; opacity: 0.5; }
.hstory__bg video { width: 100%; height: 100%; object-fit: cover; }
.hstory__bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse 90% 70% at center, transparent 30%, var(--ink) 88%); }
.hstory__inner { position: relative; max-width: 860px; margin-inline: auto; text-align: center; }
.hstory__line { margin: 0 0 0.6rem; font-size: clamp(1.4rem, 3.4vw, 2.3rem); color: var(--muted); line-height: 1.9; }
.hstory__line--big { font-size: clamp(2.8rem, 8vw, 5.6rem); color: var(--text); line-height: 1.5; margin-bottom: 1.8rem; }
.hstory__line--en { font-family: var(--font-display); font-size: clamp(1.1rem, 2.2vw, 1.6rem); font-style: italic; color: var(--bronze); margin-bottom: clamp(2.6rem, 5vw, 4rem); }
.hstory__body { max-width: 620px; margin-inline: auto; color: var(--muted); }
.hstory__body p { margin: 0 0 1.3rem; }
.hstory__body-ar { font-size: 1.4rem; color: var(--text); }

/* ── Notes anatomy ─────────────────────────────────────── */

.hnotes { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2.2rem, 5vw, 5.5rem); align-items: center; }
.hnotes__media { border-radius: 0.8rem; overflow: hidden; }
.hnotes__pyramid { list-style: none; margin: 0; padding: 0; counter-reset: stage; }
.hnotes__pyramid li { position: relative; padding: 1.5rem 0 1.5rem 3.2rem; border-bottom: 1px solid var(--line); counter-increment: stage; }
.hnotes__pyramid li::before { content: "0" counter(stage); position: absolute; left: 0; top: 1.6rem; font-family: var(--font-display); font-size: 1.15rem; color: var(--cobalt-glow); }
.hnotes__stage { display: block; font-size: 0.76rem; letter-spacing: 0.28em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.35rem; }
.hnotes__list { display: block; font-family: var(--font-display); font-size: 1.28rem; }
.hnotes__ar { display: block; margin-top: 0.3rem; color: var(--bronze); font-size: 1rem; }

/* ── Order channels ────────────────────────────────────── */

.horder { text-align: center; }
.horder__copy { max-width: 56ch; margin: 0 auto clamp(2.2rem, 5vw, 3.6rem); color: var(--muted); }
.horder__copy [lang="ar"] { display: block; margin-top: 0.6rem; font-size: 1.2rem; color: var(--text); }
.horder__channels { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.1rem, 2.5vw, 1.8rem); max-width: 1040px; margin: 0 auto 2.4rem; }
.horder__channel { display: flex; flex-direction: column; gap: 0.4rem; padding: 1.8rem 1.5rem 1.6rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 0.8rem; transition: transform 0.5s var(--ease-lux), border-color 0.4s, box-shadow 0.5s; }
.horder__channel:hover { transform: translateY(-6px); border-color: rgba(93, 132, 255, 0.5); box-shadow: 0 24px 60px -24px rgba(46, 89, 255, 0.4); }
.horder__channel-label { font-size: 0.72rem; letter-spacing: 0.28em; text-transform: uppercase; color: var(--bronze); }
.horder__channel-value { font-family: var(--font-display); font-size: 1.4rem; }
.horder__channel-hint { font-size: 0.85rem; color: var(--muted); }

/* If GSAP/ScrollTrigger fail to load, keep the hero readable instead of
   leaving captions and the CTA stuck at opacity:0 forever. */
.hhero.no-anim .hhero__caption,
.hhero.no-anim .hhero__end-cta {
  opacity: 1;
  visibility: visible;
  transform: none;
  position: relative;
  top: auto;
  transform: translateY(0);
}

.hhero.no-anim .hhero__stage { height: auto; padding-block: 6vh 4vh; }
.hhero.no-anim .hhero__title { position: relative; padding-block: 2vh; }
.hhero.no-anim .hhero__caption { display: block; margin-top: 1.4rem; }
.hhero.no-anim .hhero__hint { display: none; }

/* ── Reveal helpers ────────────────────────────────────── */

.reveal-img { clip-path: inset(8% 4% 8% 4% round 0.8rem); transform: scale(0.96); transition: clip-path 1s var(--ease-lux), transform 1s var(--ease-lux); }
.reveal-img.is-visible { clip-path: inset(0 0 0 0 round 0.8rem); transform: none; }
.fade-up { opacity: 0; transform: translateY(32px); transition: opacity 0.8s var(--ease-lux), transform 0.8s var(--ease-lux); }
.fade-up.is-visible { opacity: 1; transform: none; }

/* ── Responsive ────────────────────────────────────────── */

@media (max-width: 1024px) {
  .hnotes { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .horder__channels { grid-template-columns: 1fr; max-width: 460px; }
}

@media (max-width: 600px) {
  .hhero__bottle { width: min(38vh, 82vw); }
  .hhero__caption { top: auto; bottom: 14vh; transform: none; }
  .hhero__caption--right { display: none; }

  .hhero__title {
    inset: 0;
    padding: 10vh 6vw 10vh;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    font-size: clamp(3.2rem, 16vw, 4.4rem);
  }

  .hhero__title-half:last-child { align-self: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .reveal-img { clip-path: none; transform: none; }
  .fade-up { opacity: 1; transform: none; }
  .hhero__hint { display: none; }
}
