/* KiQ intro — the short animated splash of the KiQ sites (kiqhub.app, kiqmail.app, kiqai.app), like the KiQMail iOS app.
   Plays once per browser session (kq-intro.js); a tap, a click or a key skips it. The same file is used by all three sites:
   the class on #kq-intro (kqi-hub, kqi-mail, kqi-ai) picks the colours. Without JavaScript it still gets out of the way. */
#kq-intro {
  --kqi-ink: #0f1629; --kqi-muted: #64748b; --kqi-accent: #4C5BD4; --kqi-glow: rgba(76, 91, 212, .16);
  --kqi-shadow: rgba(76, 91, 212, .30); --kqi-top: #ffffff; --kqi-bottom: #eef1f7;
  --kqi-streak: linear-gradient(90deg, transparent, #4C5BD4 25%, #7C3AED 75%, transparent);
  position: fixed; inset: 0; z-index: 2147483000; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(60% 46% at 50% 42%, var(--kqi-glow), transparent 70%), linear-gradient(180deg, var(--kqi-top), var(--kqi-bottom));
  cursor: pointer; transition: opacity .55s ease, transform .55s ease;
  animation: kqiAuto .5s 2.8s forwards;
}
#kq-intro.done { opacity: 0; transform: scale(1.04); pointer-events: none; }
.kqi-skip #kq-intro { display: none; }
@media (prefers-reduced-motion: reduce) { #kq-intro { display: none; } }
@keyframes kqiAuto { to { opacity: 0; visibility: hidden; } }

.kqi-stage { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.kqi-mark {
  width: clamp(84px, 20vw, 112px); height: auto; aspect-ratio: 1; border-radius: 24%;
  box-shadow: 0 22px 50px var(--kqi-shadow);
  animation: kqiMark .75s cubic-bezier(.34, 1.56, .64, 1) both;
}
@keyframes kqiMark { from { opacity: 0; transform: scale(.5) translateY(16px); } to { opacity: 1; transform: none; } }
.kqi-word {
  position: relative; display: flex; align-items: baseline;
  font: 800 clamp(36px, 9vw, 54px)/1.05 Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  letter-spacing: -.035em; color: var(--kqi-ink);
  animation: kqiWord .6s .28s cubic-bezier(.22, 1, .36, 1) both;
}
.kqi-word b { font-weight: 800; color: var(--kqi-accent); }
.kqi-word small { margin-left: .42em; font-size: .4em; font-weight: 600; letter-spacing: 0; color: var(--kqi-muted); }
@keyframes kqiWord { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.kqi-dot {
  position: absolute; top: -.02em; right: -.34em; width: .22em; height: .22em; border-radius: 50%; background: #F0643A;
  box-shadow: 0 0 0 .05em var(--kqi-top);
  animation: kqiPop .45s .62s cubic-bezier(.34, 1.56, .64, 1) both;
}
@keyframes kqiPop { from { transform: scale(0); } to { transform: scale(1); } }
.kqi-streak {
  display: flex; gap: 6px; width: min(56vw, 250px); height: 3px; border-radius: 3px; background: var(--kqi-streak);
  transform-origin: left center; animation: kqiStreak 1s .6s cubic-bezier(.22, 1, .36, 1) both;
}
@keyframes kqiStreak { from { transform: scaleX(0); opacity: 0; } 60% { opacity: 1; } to { transform: scaleX(1); opacity: .95; } }

/* kiqhub.app — the four apps' colours: Documents, Spreadsheets, Presentations, Mail */
#kq-intro.kqi-hub { --kqi-glow: rgba(53, 99, 233, .14); --kqi-shadow: rgba(53, 99, 233, .28); }
.kqi-hub .kqi-word b {
  background: linear-gradient(100deg, #3563E9 5%, #7c3aed 50%, #F0643A 95%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.kqi-hub .kqi-streak { background: none; animation: none; }
.kqi-hub .kqi-streak i { flex: 1; border-radius: 3px; transform-origin: left center; animation: kqiStreak .7s cubic-bezier(.22, 1, .36, 1) both; }
.kqi-hub .kqi-streak i:nth-child(1) { background: #3563E9; animation-delay: .55s; }
.kqi-hub .kqi-streak i:nth-child(2) { background: #0E9F6E; animation-delay: .68s; }
.kqi-hub .kqi-streak i:nth-child(3) { background: #F0643A; animation-delay: .81s; }
.kqi-hub .kqi-streak i:nth-child(4) { background: #4C5BD4; animation-delay: .94s; }

/* kiqai.app — violet to pink, the "+" pops in; follows the site's dark theme */
#kq-intro.kqi-ai {
  --kqi-ink: #0f172a; --kqi-glow: rgba(124, 58, 237, .16); --kqi-shadow: rgba(124, 58, 237, .32); --kqi-bottom: #f5f2fd;
  --kqi-streak: linear-gradient(90deg, transparent, #7c3aed 25%, #db2777 75%, transparent);
}
.kqi-ai .kqi-word { gap: .24em; }
.kqi-ai .kqi-word b { background: linear-gradient(100deg, #7c3aed, #db2777); -webkit-background-clip: text; background-clip: text; color: transparent; }
.kqi-plus {
  position: absolute; top: -.2em; right: -.68em; font-size: .72em; font-weight: 800; line-height: 1; color: #db2777;
  animation: kqiPop .45s .62s cubic-bezier(.34, 1.56, .64, 1) both;
}
@media (prefers-color-scheme: dark) {
  #kq-intro.kqi-ai { --kqi-ink: #eceef5; --kqi-muted: #a3a9ba; --kqi-top: #0c0a14; --kqi-bottom: #12101d; --kqi-glow: rgba(124, 58, 237, .28); --kqi-shadow: rgba(124, 58, 237, .45); }
  .kqi-ai .kqi-plus { color: #f472b6; }
}
