/* =========================================================
   ImenFix — cinematic intro (Three.js + GSAP, scroll-driven)
   Only visible while <html> has the .has-intro class.
   ========================================================= */
.intro { display: none; }
html.has-intro, html.has-intro body { overflow: hidden; height: 100%; overscroll-behavior: none; }
html.has-intro .intro {
  display: block; position: fixed; inset: 0; z-index: 1000;
  background: #07080c; color: #fff; overflow: hidden;
  touch-action: none; user-select: none; -webkit-user-select: none;
}

.intro__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* colour grade: vignette + film grain on top of the WebGL scene */
.intro__grade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(0,0,0,.55) 100%),
    linear-gradient(180deg, rgba(5,6,10,.55) 0%, transparent 22%, transparent 70%, rgba(5,6,10,.6) 100%);
}
.intro__grain {
  position: absolute; inset: -50%; pointer-events: none; opacity: .09; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: intro-grain .9s steps(6) infinite;
}
@keyframes intro-grain {
  0% { transform: translate(0,0); } 20% { transform: translate(-3%,2%); } 40% { transform: translate(2%,-3%); }
  60% { transform: translate(-2%,-1%); } 80% { transform: translate(3%,3%); } 100% { transform: translate(0,0); }
}

/* brand at the top of the cinematic scenes */
.intro__brand {
  position: absolute; top: clamp(18px, 4vh, 40px); left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; text-align: center; pointer-events: none;
  text-shadow: 0 2px 14px rgba(0,0,0,.6);
}
.intro__brand img { width: auto; height: clamp(84px, 15vh, 140px); filter: drop-shadow(0 6px 22px rgba(0,0,0,.6)) drop-shadow(0 0 18px rgba(255,30,50,.35)); }
.intro__brand svg { width: clamp(46px, 6vh, 64px); height: clamp(54px, 7vh, 75px); color: #e3111f; filter: drop-shadow(0 0 14px rgba(255,30,50,.65)); }
.intro__brand strong { font-size: clamp(26px, 4vh, 38px); font-weight: 900; line-height: 1.35; margin-top: 6px; }
.intro__brand small { font-family: Arial, sans-serif; font-weight: 700; letter-spacing: .42em; font-size: clamp(11px, 1.5vh, 14px); direction: ltr; margin-right: -.42em; }

/* scroll hint */
.intro__hint {
  position: absolute; left: 50%; bottom: clamp(70px, 11vh, 110px); transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: none;
  font-weight: 700; font-size: clamp(14px, 1.9vh, 17px); text-shadow: 0 2px 10px rgba(0,0,0,.8); white-space: nowrap;
}
.intro__mouse { width: 26px; height: 40px; border: 2px solid #fff; border-radius: 14px; position: relative; }
.intro__mouse::after {
  content: ""; position: absolute; top: 7px; left: 50%; width: 3px; height: 8px; margin-left: -1.5px;
  border-radius: 2px; background: #fff; animation: intro-wheel 1.6s ease-in-out infinite;
}
@keyframes intro-wheel { 0% { opacity: 0; transform: translateY(-2px); } 30% { opacity: 1; } 80% { opacity: 0; transform: translateY(10px); } 100% { opacity: 0; } }

.intro__chev {
  position: absolute; left: 50%; bottom: clamp(22px, 4vh, 40px); transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; pointer-events: none;
}
.intro__chev svg { width: 30px; height: 15px; color: #ff2436; filter: drop-shadow(0 0 6px rgba(255,30,50,.8)); margin-top: -4px; animation: intro-chev 1.6s ease-in-out infinite; }
.intro__chev svg:nth-child(2) { animation-delay: .18s; }
@keyframes intro-chev { 0%, 100% { opacity: .35; transform: translateY(0); } 50% { opacity: 1; transform: translateY(5px); } }

/* scene 5 — brand screen */
.intro__logo-scene {
  position: absolute; inset: 0; visibility: hidden; opacity: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: 24px;
  background:
    radial-gradient(60% 50% at 50% 42%, rgba(160,14,30,.55), transparent 70%),
    radial-gradient(120% 90% at 50% 100%, #3a0610 0%, transparent 60%),
    linear-gradient(180deg, #14060a 0%, #1d070c 55%, #2a0710 100%);
}
.intro__waves { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 45%; pointer-events: none; }
.intro__waves path { fill: none; stroke: #ff1f35; stroke-linecap: round; filter: drop-shadow(0 0 8px rgba(255,30,50,.8)); }
.intro__waves .w1 { stroke-width: 2; opacity: .55; animation: intro-wave 9s ease-in-out infinite alternate; }
.intro__waves .w2 { stroke-width: 1.2; opacity: .35; animation: intro-wave 12s ease-in-out infinite alternate-reverse; }
.intro__waves .w3 { stroke-width: 3; opacity: .18; animation: intro-wave 15s ease-in-out infinite alternate; }
@keyframes intro-wave { from { transform: translateX(-4%) translateY(0); } to { transform: translateX(4%) translateY(-12px); } }

.intro__logo-inner { position: relative; display: flex; flex-direction: column; align-items: center; will-change: transform, opacity; }
.intro__logo-img { width: auto; height: clamp(220px, 46vh, 420px); filter: drop-shadow(0 0 30px rgba(255,20,40,.55)) drop-shadow(0 10px 40px rgba(0,0,0,.6)); }
.intro__logo-inner > svg { width: clamp(96px, 15vh, 150px); height: clamp(112px, 17.5vh, 175px); color: #ff1428; filter: drop-shadow(0 0 22px rgba(255,20,40,.75)) drop-shadow(0 0 60px rgba(255,20,40,.35)); }
.intro__logo-inner h2 { margin: 10px 0 0; font-size: clamp(40px, 7.5vh, 74px); font-weight: 900; line-height: 1.3; text-shadow: 0 4px 22px rgba(0,0,0,.5); }
.intro__logo-inner .en { font-family: Arial, sans-serif; font-weight: 700; letter-spacing: .5em; margin-right: -.5em; font-size: clamp(14px, 2.4vh, 22px); direction: ltr; }
.intro__logo-inner p { margin-top: clamp(14px, 2.6vh, 26px); font-size: clamp(18px, 3vh, 28px); font-weight: 700; line-height: 1.65; max-width: 520px; }
.intro__bar {
  position: relative; width: min(420px, 78vw); height: 14px; margin-top: clamp(26px, 5vh, 52px);
  border: 2px solid rgba(255,255,255,.75); border-radius: 999px; padding: 2px; overflow: hidden;
}
.intro__bar i {
  display: block; height: 100%; width: 100%; border-radius: inherit; transform-origin: right center; transform: scaleX(0);
  background: linear-gradient(90deg, #ff4b4b, #e3111f); box-shadow: 0 0 14px rgba(255,30,50,.9);
}

/* skip + loader */
.intro__skip {
  position: absolute; top: clamp(16px, 3vh, 28px); left: clamp(16px, 3vw, 32px); z-index: 5;
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px;
  font: 700 14px/1 "Vazirmatn", Tahoma, sans-serif; color: #fff; cursor: pointer;
  background: rgba(20,20,28,.45); border: 1px solid rgba(255,255,255,.35); border-radius: 999px;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); transition: background .25s, border-color .25s;
}
.intro__skip:hover, .intro__skip:focus-visible { background: rgba(227,17,31,.85); border-color: transparent; outline: none; }
.intro__skip svg { width: 16px; height: 16px; transform: scaleX(-1); }

.intro__loader {
  position: absolute; inset: 0; z-index: 4; display: flex; align-items: center; justify-content: center;
  background: #07080c; transition: opacity .6s ease;
}
.intro__loader span { width: 44px; height: 44px; border-radius: 50%; border: 3px solid rgba(255,255,255,.15); border-top-color: #e3111f; animation: intro-spin .8s linear infinite; }
.intro__loader.is-done { opacity: 0; pointer-events: none; }
@keyframes intro-spin { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
  .intro__skip { height: 36px; padding: 0 14px; font-size: 13px; }
}
