/* =========================================================
   Nava Scientific Bureau — Coming Soon
   ========================================================= */
:root {
  --bg: #f8f6fc;
  --ink: #26214a;
  --muted: #6c6790;
  --line: rgba(90, 85, 165, .14);
  --b1: #5a55a5;
  --b2: #8a74b8;
  --b3: #b395c6;
  --grad: linear-gradient(90deg, var(--b1), var(--b2) 55%, var(--b3));
  --glass: rgba(255, 255, 255, .62);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --font: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-ar: 'Tajawal', 'Nunito', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh;
  min-height: 100svh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
html[lang="ar"] body { font-family: var(--font-ar); }
::selection { background: rgba(138, 116, 184, .25); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Background ---------- */
.bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.bg::after { /* soft vignette */
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(90, 85, 165, .08) 100%);
}
.blob {
  position: absolute; border-radius: 50%;
  filter: blur(60px); opacity: 0;
  animation: blobIn 2.4s var(--ease) .2s forwards;
  will-change: transform;
}
.b1 { width: 60vmax; height: 60vmax; left: -18vmax; top: -24vmax;
  background: radial-gradient(circle, rgba(170, 155, 230, .55), transparent 65%);
  animation: blobIn 2.4s var(--ease) .2s forwards, drift1 24s ease-in-out 2s infinite alternate; }
.b2 { width: 55vmax; height: 55vmax; right: -20vmax; bottom: -22vmax;
  background: radial-gradient(circle, rgba(205, 165, 220, .55), transparent 65%);
  animation: blobIn 2.4s var(--ease) .4s forwards, drift2 28s ease-in-out 2s infinite alternate; }
.b3 { width: 38vmax; height: 38vmax; left: 45%; top: 30%;
  background: radial-gradient(circle, rgba(175, 195, 245, .4), transparent 65%);
  animation: blobIn 2.4s var(--ease) .6s forwards, drift3 32s ease-in-out 2s infinite alternate; }

#network { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; animation: fadeIn 2.5s ease 1.6s forwards; }

.grain {
  position: absolute; inset: 0; opacity: .07; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .3 0 0 0 0 .6 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Layout ---------- */
.page {
  position: relative; z-index: 1;
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column;
  overflow-x: clip;
}
.topbar {
  display: flex; justify-content: flex-end;
  padding: max(18px, env(safe-area-inset-top)) clamp(16px, 4vw, 40px) 0;
  opacity: 0; animation: fadeIn 1s ease 3.3s forwards;
}
.lang-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 14px/1 var(--font);
  color: var(--ink);
  background: var(--glass);
  border: 1px solid var(--line);
  padding: 10px 16px; border-radius: 999px; cursor: pointer;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .3s;
}
.lang-toggle span { font-family: var(--font-ar); }
html[lang="ar"] .lang-toggle span { font-family: var(--font); }
.lang-toggle svg { width: 16px; height: 16px; fill: none; stroke: var(--b1); stroke-width: 1.6; }
.lang-toggle:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -12px rgba(90, 85, 165, .45); border-color: rgba(90, 85, 165, .3); }
.lang-toggle:focus-visible { outline: 2px solid var(--b2); outline-offset: 3px; }

.stage {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: clamp(20px, 5vh, 56px) 16px clamp(24px, 4vh, 40px);
}

/* ---------- Logo ---------- */
.logo-wrap {
  position: relative;
  width: min(600px, 86vw);
  transform: translate3d(calc(var(--mx, 0) * 14px), calc(var(--my, 0) * 10px), 0);
  transition: transform .2s linear;
}
.logo { position: relative; display: block; width: 100%; height: auto; overflow: visible; animation: breathe 8s ease-in-out 3.6s infinite; }

.l {
  stroke-dasharray: 1 1;
  stroke-dashoffset: 1;
  opacity: 0;
  animation: draw 1.35s cubic-bezier(.65, 0, .35, 1) forwards;
}
.l1 { animation-delay: .25s; }
.l2 { animation-delay: .5s; }
.l3 { animation-delay: .75s; }
.l4 { animation-delay: 1s; }

.sheen { opacity: 0; animation: fadeIn .1s linear 3.5s forwards; mix-blend-mode: soft-light; }

.tagline { font-family: 'Nunito', sans-serif; font-weight: 500; font-size: 88px; font-variant-ligatures: none; font-feature-settings: 'liga' 0, 'clig' 0; }
.unveil-rect { transform: translateX(-1400px); animation: unveil 1.6s var(--ease) 1.65s forwards; }

.orbits {
  position: absolute; left: 50%; top: 30%;
  width: 132%; height: auto;
  transform: translate(-50%, -50%) scale(.92);
  opacity: 0; pointer-events: none;
  animation: orbitsIn 2.4s var(--ease) 2.1s forwards;
}

/* ---------- Content ---------- */
.content { display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 640px; }

.divider {
  display: block; width: 64px; height: 2px; border-radius: 2px;
  background: var(--grad);
  margin: clamp(24px, 4.5vh, 44px) 0 clamp(20px, 3.5vh, 32px);
  transform: scaleX(0); animation: grow 1s var(--ease) 2.15s forwards;
}

.reveal { opacity: 0; transform: translateY(18px); animation: rise 1s var(--ease) var(--d, 0s) forwards; }

.chip {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 16px 8px 12px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: .01em;
}
html[dir="rtl"] .chip { padding: 8px 12px 8px 16px; }
.pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--b2); flex: none; }
.pulse::before, .pulse::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: var(--b2); animation: ping 2.2s cubic-bezier(0, 0, .2, 1) infinite;
}
.pulse::after { animation-delay: 1.1s; }

.title {
  margin: 18px 0 14px;
  font-size: clamp(44px, 9vw, 92px);
  line-height: 1.04;
  font-weight: 300;
  letter-spacing: -.025em;
  color: var(--ink);
}
html[lang="ar"] .title { letter-spacing: 0; font-weight: 400; line-height: 1.25; }
.title .w { display: inline-block; overflow: hidden; vertical-align: top; padding: 0 .02em .12em; margin-bottom: -.12em; }
.title .wi {
  display: inline-block;
  transform: translateY(110%);
  animation: wordUp 1.1s var(--ease) forwards;
  animation-delay: calc(var(--td, 2.45s) + var(--i) * .12s);
}
.title .w.accent .wi {
  font-weight: 800;
  background: var(--grad);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  animation: wordUp 1.1s var(--ease) forwards, gradShift 6s ease-in-out infinite alternate;
  animation-delay: calc(var(--td, 2.45s) + var(--i) * .12s), 0s;
}
html[lang="ar"] .title .w.accent .wi { font-weight: 700; }
body.intro-done { --td: 0s; }

.lead {
  max-width: 34rem;
  font-size: clamp(15.5px, 1.9vw, 18px);
  line-height: 1.75;
  color: var(--muted);
}
html[lang="ar"] .lead { font-size: clamp(16.5px, 2vw, 19px); }

/* ---------- Countdown ---------- */
.countdown {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(8px, 2vw, 16px);
  margin-top: clamp(24px, 4vh, 36px);
  width: min(460px, 100%);
}
html[dir="rtl"] .countdown { direction: rtl; }
.cd-box {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: clamp(12px, 2.4vw, 18px) 6px;
  border-radius: 18px;
  background: var(--glass);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: 0 12px 30px -20px rgba(90, 85, 165, .5);
}
.cd-num {
  font-family: var(--font);
  font-size: clamp(24px, 5.4vw, 38px); font-weight: 700; line-height: 1;
  font-variant-numeric: tabular-nums;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.cd-num.tick { animation: tick .5s var(--ease); }
.cd-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
html[lang="ar"] .cd-label { text-transform: none; letter-spacing: 0; font-size: 13px; }

/* ---------- Form ---------- */
.notify {
  position: relative;
  display: flex; align-items: center; gap: 6px;
  width: min(480px, 100%);
  margin-top: clamp(26px, 4.5vh, 40px);
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .78);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 20px 50px -28px rgba(90, 85, 165, .55);
  transition: box-shadow .4s var(--ease), border-color .3s;
}
.notify:focus-within { border-color: rgba(138, 116, 184, .55); box-shadow: 0 0 0 5px rgba(138, 116, 184, .14), 0 24px 60px -28px rgba(90, 85, 165, .6); }
.notify.shake { animation: rise 0s forwards, shake .45s ease; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.mail-ic { width: 20px; height: 20px; flex: none; margin-inline-start: 12px; fill: none; stroke: var(--b2); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.notify input[type="email"] {
  flex: 1; min-width: 0;
  border: 0; outline: 0; background: transparent;
  font-family: inherit; font-size: 16px; font-weight: 500; line-height: 1.2; color: var(--ink);
  padding: 12px 6px;
}
.notify input::placeholder { color: #9a95b8; }

.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  flex: none;
  border: 0; cursor: pointer;
  padding: 13px 22px;
  border-radius: 999px;
  font-family: inherit; font-size: 15px; font-weight: 700; line-height: 1; color: #fff;
  background: linear-gradient(100deg, #5a55a5, #7d6ab4 55%, #a68bc4);
  background-size: 160% 100%; background-position: 0 0;
  box-shadow: 0 10px 24px -10px rgba(90, 85, 165, .8);
  transition: background-position .6s var(--ease), transform .35s var(--ease), box-shadow .35s var(--ease);
}
.btn::after { /* light sweep */
  content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .45), transparent);
  transform: skewX(-20deg);
  transition: left .8s var(--ease);
}
.btn:hover { background-position: 100% 0; transform: translateY(-1px); box-shadow: 0 14px 30px -10px rgba(90, 85, 165, .9); }
.btn:hover::after { left: 130%; }
.btn:active { transform: translateY(0) scale(.98); }
.btn:focus-visible { outline: 2px solid var(--b1); outline-offset: 3px; }
.btn-ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .35s var(--ease); }
html[dir="rtl"] .btn-ic { transform: scaleX(-1); }
.btn:hover .btn-ic { transform: translateX(3px); }
html[dir="rtl"] .btn:hover .btn-ic { transform: scaleX(-1) translateX(3px); }
.spinner { position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; opacity: 0; }
.notify.loading .btn-text, .notify.loading .btn-ic { opacity: 0; }
.notify.loading .spinner { opacity: 1; animation: spin .7s linear infinite; }
.notify.loading .btn { pointer-events: none; }

.notify.done .btn { background: linear-gradient(100deg, #4f9b8b, #6fb7a6); box-shadow: 0 10px 24px -10px rgba(79, 155, 139, .8); }

.form-msg {
  min-height: 1.6em;
  margin-top: 14px;
  font-size: 14.5px; font-weight: 600;
  color: var(--muted);
  transition: opacity .3s;
}
.form-msg.ok { color: #3f8a7b; }
.form-msg.err { color: #b0476a; }
.form-msg.show { animation: msgIn .5s var(--ease); }

/* ---------- Footer ---------- */
.footer {
  position: relative; z-index: 1;
  padding: 18px 16px max(22px, env(safe-area-inset-bottom));
  text-align: center;
  font-size: 13px; color: var(--muted);
}
.footer .sep { margin: 0 8px; opacity: .6; }
.footer a { color: var(--b1); text-decoration: none; font-weight: 600; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .35s var(--ease); }
.footer a:hover { background-size: 100% 1px; }

/* language switch crossfade */
.content, .footer { transition: opacity .28s ease, filter .28s ease; }
body.switching .content, body.switching .footer { opacity: 0 !important; filter: blur(6px); }

/* ---------- Keyframes ---------- */
@keyframes draw { 0% { opacity: 0; stroke-dashoffset: 1; } 2% { opacity: 1; } 100% { opacity: 1; stroke-dashoffset: 0; } }
@keyframes unveil { to { transform: translateX(0); } }
@keyframes fadeIn { to { opacity: 1; } }
@keyframes blobIn { to { opacity: 1; } }
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes grow { to { transform: scaleX(1); } }
@keyframes wordUp { to { transform: translateY(0); } }
@keyframes orbitsIn { to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@keyframes breathe { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes gradShift { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
@keyframes ping { 0% { transform: scale(1); opacity: .6; } 100% { transform: scale(3.2); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes tick { 0% { transform: translateY(-30%); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes msgIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
@keyframes drift1 { to { transform: translate(8vmax, 6vmax) scale(1.08); } }
@keyframes drift2 { to { transform: translate(-7vmax, -5vmax) scale(1.12); } }
@keyframes drift3 { to { transform: translate(-14vmax, 4vmax) scale(.9); } }

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
  .notify { flex-wrap: wrap; border-radius: 22px; padding: 8px; }
  .mail-ic { margin-inline-start: 8px; }
  .notify input[type="email"] { flex: 1 1 calc(100% - 40px); }
  .btn { width: 100%; padding: 14px 20px; }
  .orbits { width: 150%; }
}
@media (max-height: 640px) and (min-width: 700px) {
  .logo-wrap { width: min(440px, 70vw); }
  .title { font-size: clamp(38px, 7vw, 64px); }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .logo-wrap { transform: none !important; }
}
