/* ============================================================
   SMILE LAB — scroll-driven cinematic experience
   ============================================================ */

:root {
  --bg: #08080a;
  --ink: #121216;
  --text: #f4f1e8;
  --text-dim: #9a978f;
  --lime: #d4ff3f;
  --lime-ink: #0a0a0c;
  --surface: rgba(244, 241, 232, 0.04);
  --surface-border: rgba(244, 241, 232, 0.1);
  --font-display: "Alexandria", "Cairo", sans-serif;
  --font-body: "IBM Plex Sans Arabic", "Tajawal", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: auto; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.8;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--lime); color: var(--lime-ink); }
img, video, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-display); }

/* ---------- grain ---------- */
.grain {
  position: fixed; inset: -50%; width: 200%; height: 200%;
  pointer-events: none; z-index: 2000; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 6000;
  display: flex; flex-direction: column; gap: 12px;
  align-items: center; justify-content: center;
  background: var(--bg);
  transition: opacity 0.8s var(--ease), visibility 0.8s;
}
.loader.hidden { opacity: 0; visibility: hidden; }
.loader__word {
  font-family: var(--font-display); font-weight: 900;
  font-size: clamp(1.8rem, 6vw, 3rem); letter-spacing: 0.1em;
}
.loader__word span { color: var(--lime); }
.loader__pct {
  font-family: var(--font-display); font-weight: 300;
  font-size: clamp(2.6rem, 9vw, 5rem); color: var(--lime); line-height: 1;
}

/* ---------- chrome ---------- */
.progress {
  position: fixed; top: 0; bottom: 0; left: 0; width: 3px;
  background: rgba(244, 241, 232, 0.07); z-index: 3000;
}
.progress span {
  display: block; width: 100%; height: 100%;
  background: var(--lime);
  transform: scaleY(0); transform-origin: top;
}

.cursor, .cursor-dot { display: none; }
@media (hover: hover) and (pointer: fine) {
  .cursor {
    display: block; position: fixed; top: 0; left: 0; z-index: 4000;
    width: 38px; height: 38px; border-radius: 50%;
    border: 1.5px solid rgba(212, 255, 63, 0.65);
    pointer-events: none;
    transition: width 0.25s, height 0.25s, background 0.25s;
  }
  .cursor.is-hover { width: 64px; height: 64px; background: rgba(212, 255, 63, 0.1); }
  .cursor-dot {
    display: block; position: fixed; top: 0; left: 0; z-index: 4001;
    width: 5px; height: 5px; border-radius: 50%;
    background: var(--lime); pointer-events: none;
  }
}

.bar {
  position: fixed; top: 0; right: 0; left: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(20px, 5vw, 56px);
  mix-blend-mode: difference;
}
.bar__logo { font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; }
.bar__logo span { color: var(--lime); }
.bar__back { font-size: 0.88rem; color: var(--text-dim); }
.bar__back:hover { color: var(--lime); }

/* ---------- scene 1: film scrub ---------- */
.film { position: relative; height: 100svh; overflow: hidden; }
#filmCanvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.film__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(8,8,10,.8) 0%, rgba(8,8,10,.15) 45%, rgba(8,8,10,.4) 100%);
}
.film__content {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: center;
  padding: 0 clamp(20px, 6vw, 70px);
}
.film__eyebrow {
  color: var(--lime); font-weight: 500; letter-spacing: 0.08em;
  margin-bottom: 16px; font-size: clamp(0.85rem, 2vw, 1rem);
}
.film__title {
  font-size: clamp(2.8rem, 11vw, 8rem);
  font-weight: 900; line-height: 1.08;
}
.film__line { display: block; }
.film__line--2 i {
  font-style: normal; color: var(--lime);
}
.film__sub {
  margin-top: 20px; max-width: 460px;
  color: var(--text-dim); font-size: clamp(0.95rem, 2.4vw, 1.1rem);
}
.film__hint {
  position: absolute; bottom: 26px; right: 50%; transform: translateX(50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-size: 0.78rem; letter-spacing: 0.16em; color: var(--text-dim);
}
.film__hint span {
  width: 1.5px; height: 40px;
  background: linear-gradient(var(--lime), transparent);
  animation: hint 1.8s ease-in-out infinite;
}
@keyframes hint {
  0% { transform: scaleY(0); transform-origin: top; }
  45% { transform: scaleY(1); transform-origin: top; }
  55% { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ---------- scene 2: word wall ---------- */
.wall {
  padding: clamp(110px, 16vw, 200px) 0;
  display: flex; flex-direction: column; gap: clamp(10px, 2vw, 24px);
  overflow: hidden;
}
.wall__line {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(2.4rem, 8.5vw, 6.5rem);
  line-height: 1.18; white-space: nowrap; will-change: transform;
}
.wall__line i { font-style: normal; color: var(--lime); font-size: 0.55em; vertical-align: middle; }
.wall__line--lime { color: var(--lime); }
.wall__line--lime i { color: var(--text); }
.wall__line--ghost {
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(244, 241, 232, 0.4);
}

/* ---------- feature scenes ---------- */
.feat { position: relative; }
.feat__pin {
  height: 100svh; overflow: hidden; position: relative;
  display: grid; place-items: center;
  perspective: 1100px;
}
.feat__word {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 0;
  font-family: var(--font-display); font-weight: 900;
  font-size: clamp(6rem, 26vw, 22rem); line-height: 1;
  color: transparent; -webkit-text-stroke: 1.6px rgba(212, 255, 63, 0.5);
  white-space: nowrap; pointer-events: none; will-change: transform;
}
.feat__media {
  position: relative; z-index: 1;
  width: 100vw; height: 100svh;
  overflow: hidden; will-change: transform, border-radius;
  background: var(--ink);
}
.feat__media video { width: 100%; height: 100%; object-fit: cover; }
.feat__num {
  position: absolute; bottom: 5%; inset-inline-start: 5%; z-index: 2;
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(4rem, 12vw, 9rem); line-height: 1;
  color: transparent; -webkit-text-stroke: 1.4px rgba(244, 241, 232, 0.4);
  pointer-events: none; will-change: transform;
}
.feat__info {
  position: absolute; bottom: clamp(28px, 6vw, 60px); right: clamp(20px, 6vw, 70px); z-index: 3;
  max-width: min(440px, 80vw);
  background: rgba(8, 8, 10, 0.55);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--surface-border);
  border-radius: 20px; padding: 20px 26px;
  will-change: transform, opacity;
}
.feat__info h3 { font-size: clamp(1.2rem, 3.4vw, 1.7rem); font-weight: 800; margin-bottom: 6px; }
.feat__info p { color: var(--text-dim); font-size: 0.95rem; }

/* ---------- horizontal strip ---------- */
.strip { position: relative; overflow: hidden; }
.strip__head {
  padding: clamp(80px, 10vw, 130px) clamp(20px, 6vw, 70px) clamp(30px, 4vw, 50px);
}
.strip__head h2 {
  font-size: clamp(2.2rem, 7vw, 4.5rem); font-weight: 800;
}
.strip__head h2 span { color: var(--lime); }
.strip__head p { color: var(--text-dim); margin-top: 8px; }
.strip__track {
  display: flex; gap: clamp(16px, 3vw, 34px);
  padding: 0 clamp(20px, 6vw, 70px) clamp(90px, 12vw, 150px);
  width: max-content; will-change: transform;
}
.strip__card {
  position: relative; flex: 0 0 auto;
  width: clamp(240px, 32vw, 380px); aspect-ratio: 3 / 4;
  border-radius: 22px; overflow: hidden;
  border: 1px solid var(--surface-border);
  background: var(--ink);
  transition: transform 0.45s var(--ease);
}
.strip__card:hover { transform: translateY(-10px); }
.strip__card video { width: 100%; height: 100%; object-fit: cover; }
.strip__card figcaption {
  position: absolute; bottom: 0; right: 0; left: 0;
  padding: 36px 18px 14px;
  background: linear-gradient(to top, rgba(8,8,10,.85), transparent);
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.05rem;
}

/* ---------- finale ---------- */
.finale {
  min-height: 90svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 80px clamp(20px, 6vw, 70px);
}
.finale__title {
  font-size: clamp(2.6rem, 9vw, 6.5rem); font-weight: 900; line-height: 1.15;
}
.finale__title span { color: var(--lime); }
.finale__sub { color: var(--text-dim); margin: 18px 0 36px; max-width: 480px; }
.finale__cta { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 16px 36px; border-radius: 999px;
  font-family: var(--font-display); font-weight: 700; font-size: 1.05rem;
  border: 1.5px solid transparent; cursor: pointer;
  transition: transform 0.3s var(--ease), border-color 0.3s, color 0.3s;
  will-change: transform;
}
.btn--primary { background: var(--lime); color: var(--lime-ink); }
.btn--ghost { border-color: var(--surface-border); color: var(--text); }
.btn--ghost:hover { border-color: var(--lime); color: var(--lime); }

/* ---------- mini footer ---------- */
.mini {
  border-top: 1px solid var(--surface-border);
  padding: 28px clamp(20px, 6vw, 70px) 36px;
  text-align: center; color: var(--text-dim); font-size: 0.85rem;
  display: flex; flex-direction: column; gap: 6px;
}
.mini a { color: var(--text-dim); }
.mini a:hover { color: var(--lime); }
.mini strong { color: var(--text); }

/* ---------- reveal helpers ---------- */
.js .film__content > *, .js .film__hint { opacity: 0; transform: translateY(26px); }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .grain, .film__hint span { animation: none; }
}
