/* =========================================================
   Media — components: loader, nav, buttons, menus, lightbox
   ========================================================= */

/* ---------------- loader ---------------- */
.loader {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: grid;
  place-items: center;
  background: radial-gradient(100% 90% at 50% 20%, #171126 0%, #08070d 62%);
  animation: loaderAway .7s var(--ease) 1.25s forwards;
}
html.is-ready .loader {
  opacity: 0;
  visibility: hidden;
  transition: opacity .6s var(--ease), visibility .6s;
  animation: none;
}
.loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.loader-mark {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 46px;
}
.loader-mark i {
  width: 7px;
  border-radius: 4px;
  background: var(--grad);
  animation: loaderBar 1s var(--ease) infinite alternate;
}
.loader-mark i:nth-child(1) { height: 18px; animation-delay: 0s; }
.loader-mark i:nth-child(2) { height: 38px; animation-delay: .12s; }
.loader-mark i:nth-child(3) { height: 26px; animation-delay: .22s; }
.loader-mark i:nth-child(4) { height: 44px; animation-delay: .32s; }
.loader-word {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .32em;
  color: #f4f1ff;
  padding-left: .32em;
  white-space: nowrap;
}
.loader-track {
  width: 132px;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  overflow: hidden;
}
.loader-track span {
  display: block;
  height: 100%;
  width: 40%;
  border-radius: inherit;
  background: var(--grad);
  animation: loaderTrack 1.2s var(--ease) infinite;
}
@keyframes loaderBar { from { transform: scaleY(.45); opacity: .5; } to { transform: scaleY(1); opacity: 1; } }
@keyframes loaderTrack { 0% { transform: translateX(-110%); } 100% { transform: translateX(360%); } }
@keyframes loaderAway { to { opacity: 0; visibility: hidden; } }

/* ---------------- nav ---------------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 90;
  padding: 14px var(--pad);
  transition: padding .35s var(--ease);
}
.nav-inner {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  height: 64px;
  padding: 0 10px 0 14px;
  display: flex;
  align-items: center;
  gap: 18px;
  border: 1px solid transparent;
  border-radius: 20px;
  transition:
    height .35s var(--ease),
    background-color .35s var(--ease),
    border-color .35s var(--ease),
    box-shadow .35s var(--ease);
}
.nav.is-scrolled { padding-top: 9px; }
.nav.is-scrolled .nav-inner {
  height: 58px;
  background: var(--glass);
  border-color: var(--line);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .22);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  backdrop-filter: blur(22px) saturate(150%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: none;
}
.brand img { border-radius: 10px; box-shadow: 0 6px 18px rgba(124, 92, 255, .35); }
.brand-name {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.03em;
}
.brand-ver {
  margin-left: 2px;
  padding: 2px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.4;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 8px;
}
.nav-links a {
  position: relative;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: color .2s var(--ease), background-color .2s var(--ease);
}
.nav-links a:hover { color: var(--text); background: var(--surface); }
.nav-links a.is-active { color: var(--text); }
.nav-links a.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  transform: translateX(-50%);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .01em;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.pill:hover { color: var(--text); background: var(--surface-2); border-color: var(--line-strong); }
.pill .ic { width: 15px; height: 15px; opacity: .85; }
.pill .ic-chev { width: 12px; height: 12px; transition: transform .25s var(--ease); }
.pill[aria-expanded="true"] .ic-chev { transform: rotate(180deg); }
.pill-region :first-child { color: var(--accent); }
.lang-short {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  color: var(--text);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--muted);
  transition: color .2s var(--ease), background-color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.icon-btn:hover { color: var(--text); background: var(--surface-2); border-color: var(--line-strong); transform: translateY(-1px); }
.icon-btn .ic { width: 17px; height: 17px; }

.theme-btn { position: relative; overflow: hidden; }
.theme-btn .ic { position: absolute; transition: transform .45s var(--ease), opacity .35s var(--ease); }
.theme-btn .ic-sun { transform: translateY(0) rotate(0); opacity: 1; }
.theme-btn .ic-moon { transform: translateY(26px) rotate(-40deg); opacity: 0; }
[data-theme="light"] .theme-btn .ic-sun { transform: translateY(-26px) rotate(40deg); opacity: 0; }
[data-theme="light"] .theme-btn .ic-moon { transform: translateY(0) rotate(0); opacity: 1; }

.menu-btn { display: none; }

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 13px;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: .005em;
  white-space: nowrap;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background-color .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}
.btn .ic { width: 17px; height: 17px; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--btn-bg);
  color: var(--btn-fg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .5);
}
.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(110deg, transparent 20%, rgba(167, 139, 250, .35) 45%, transparent 70%);
  transform: translateX(-120%);
  transition: transform .7s var(--ease);
  pointer-events: none;
}
.btn-primary:hover { box-shadow: 0 14px 40px rgba(124, 92, 255, .35), inset 0 1px 0 rgba(255, 255, 255, .6); }
.btn-primary:hover::after { transform: translateX(120%); }

.btn-ghost {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.btn-ghost:hover { background: var(--surface-2); border-color: var(--line-strong); }

.btn-lg { height: 52px; padding: 0 24px; border-radius: 15px; font-size: 14.5px; }
.btn-sm { height: 36px; padding: 0 14px; border-radius: 11px; font-size: 12.5px; }
.nav-cta { height: 38px; border-radius: 11px; font-size: 12.5px; }

/* ---------------- popovers ---------------- */
.pop-wrap { position: relative; }
.pop {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 100;
  width: min(370px, calc(100vw - 28px));
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: var(--glass-strong);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(26px) saturate(160%);
  backdrop-filter: blur(26px) saturate(160%);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(.985);
  transform-origin: top right;
  transition: opacity .22s var(--ease), transform .22s var(--ease), visibility .22s;
}
.pop.is-open { opacity: 1; visibility: visible; transform: none; }
.pop-lang { width: min(350px, calc(100vw - 28px)); }

.pop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 4px 12px;
}
.pop-head strong { font-size: 14px; font-weight: 750; letter-spacing: -.01em; }
.pop-badge {
  color: var(--dim);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .02em;
}

.region-current {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.code-tile {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 12px;
  background: var(--grad-soft);
  border: 1px solid var(--line-strong);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
}
.region-current-text { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.region-current-text b { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.region-current-text small { color: var(--dim); font-size: 10px; }

.mini-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  padding: 6px 8px;
  border-radius: 8px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  transition: background-color .2s var(--ease);
}
.mini-btn:hover { background: var(--accent-soft); }
.mini-btn .ic { width: 12px; height: 12px; }
.mini-btn.is-busy .ic { animation: spin 1s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }

.region-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-top: 10px;
  max-height: 284px;
  overflow-y: auto;
  padding-right: 2px;
}
.region-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 11px;
  text-align: left;
  transition: background-color .16s var(--ease), color .16s var(--ease);
}
.region-opt:hover { background: var(--surface-2); color: var(--text); }
.region-opt.is-current { background: var(--accent-soft); color: var(--text); }
.region-opt .ro-code {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 20px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  color: var(--accent);
}
.region-opt .ro-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.region-opt .ro-check { margin-left: auto; width: 12px; height: 12px; color: var(--accent); opacity: 0; }
.region-opt.is-current .ro-check { opacity: 1; }

.lang-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}
.lang-opt {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 12px;
  text-align: left;
  transition: background-color .16s var(--ease), color .16s var(--ease);
}
.lang-opt:hover { background: var(--surface-2); color: var(--text); }
.lang-opt.is-current { background: var(--accent-soft); color: var(--text); }
.lang-opt .lo-code {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 24px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
}
.lang-opt .lo-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lang-opt .ro-check { margin-left: auto; width: 12px; height: 12px; opacity: 0; }
.lang-opt.is-current .ro-check { opacity: 1; }

.pop-note {
  margin-top: 11px;
  padding: 10px 4px 0;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 10px;
  line-height: 1.55;
}

/* ---------------- mobile menu ---------------- */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: var(--bg);
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-12px);
  transition: opacity .3s var(--ease), transform .3s var(--ease), visibility .3s;
}
.mobile-menu.is-open { opacity: 1; visibility: visible; transform: none; }
.mm-inner {
  min-height: 100%;
  padding: 16px var(--pad) 34px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.mm-head { display: flex; align-items: center; justify-content: space-between; }
.mm-links { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.mm-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.02em;
}
.mm-links a .ic { width: 18px; height: 18px; color: var(--dim); }
.mm-block { display: flex; flex-direction: column; gap: 10px; }
.mm-title {
  color: var(--dim);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.mm-block .lang-grid { grid-template-columns: 1fr 1fr; }
.mm-block .region-grid { grid-template-columns: 1fr 1fr; max-height: none; overflow: visible; }
.mm-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 10px;
}
.mm-foot .btn { flex: 1; }

/* ---------------- marquee ---------------- */
.marquee {
  position: relative;
  overflow: hidden;
  padding: 17px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track {
  display: flex;
  align-items: center;
  gap: 30px;
  width: max-content;
  animation: marquee 46s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  white-space: nowrap;
}
.marquee-track i {
  width: 4px;
  height: 4px;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  opacity: .7;
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------------- to top ---------------- */
.to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 60;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--glass-strong);
  color: var(--text);
  box-shadow: var(--shadow-soft);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity .25s var(--ease), transform .25s var(--ease), visibility .25s;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { transform: translateY(-2px); border-color: var(--accent); }
.to-top .ic { width: 18px; height: 18px; }

/* ---------------- lightbox ---------------- */
.lightbox {
  width: min(1080px, 94vw);
  max-width: none;
  max-height: 92vh;
  padding: 0;
  border: 0;
  background: transparent;
  color: #f4f1ff;
  overflow: visible;
}
.lightbox::backdrop {
  background: rgba(3, 2, 7, .78);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  backdrop-filter: blur(16px) saturate(120%);
}
.lightbox[open] { display: block; }
.lb-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 30px;
  background: rgba(13, 11, 21, .72);
  box-shadow: 0 40px 120px rgba(0, 0, 0, .6);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  animation: lbIn .35s var(--ease-out);
}
@keyframes lbIn { from { opacity: 0; transform: scale(.96) translateY(12px); } to { opacity: 1; transform: none; } }
.lb-stage { display: grid; place-items: center; min-height: 380px; }
.lb-stage .phone-shell { --s: 1.34 !important; }
.lb-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 50%;
  background: rgba(255, 255, 255, .06);
  color: #fff;
  transition: background-color .2s var(--ease), transform .2s var(--ease);
}
.lb-close:hover { background: rgba(255, 255, 255, .14); transform: rotate(90deg); }
.lb-nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 50%;
  background: rgba(255, 255, 255, .06);
  color: #fff;
  transform: translateY(-50%);
  transition: background-color .2s var(--ease);
}
.lb-nav:hover { background: rgba(255, 255, 255, .14); }
.lb-prev { left: 14px; }
.lb-next { right: 14px; }
.lb-nav .ic { width: 18px; height: 18px; }
.lb-cap {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: .02em;
}
.lb-cap #lb-index { color: rgba(255, 255, 255, .4); font-family: var(--font-mono); font-size: 10px; }

/* ---------------- busy state ---------------- */
.btn.is-busy .ic,
.mini-btn.is-busy .ic { animation: spin 1s linear infinite; }

/* ---------------- lightbox content ---------------- */
body.lb-open { overflow: hidden; }
.lb-inner { max-height: 92vh; overflow: auto; scrollbar-width: none; }
.lb-inner::-webkit-scrollbar { display: none; }
.lb-stage .shot {
  width: auto;
  margin: 0;
  transform: none !important;
  scroll-snap-align: none;
}
.lb-stage .shot-frame {
  padding: 12px 20px;
  background: rgba(255, 255, 255, .03);
  border-color: rgba(255, 255, 255, .1);
}
.lb-stage .shot-photo { border-radius: 20px; }
.lb-stage .phone-shell { flex: none; }

/* ---------------- brand / loader ---------------- */
.loader-brand {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, .14),
    0 0 42px rgba(34, 211, 238, .18),
    0 18px 38px rgba(0, 0, 0, .5);
  animation: brandPulse 2.4s ease-in-out infinite;
}
@keyframes brandPulse {
  0%, 100% { transform: translateY(0) scale(1); filter: brightness(.92); }
  50% { transform: translateY(-4px) scale(1.03); filter: brightness(1.08); }
}

/* ---------------- first act / intro ---------------- */
.intro {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: clamp(22px, 5vw, 64px);
  background: var(--bg);
  color: var(--intro-ink);
  transition: opacity .7s var(--ease), visibility .7s var(--ease);
}
[data-theme="dark"] .intro { --intro-ink: #ece9f4; }
[data-theme="light"] .intro { --intro-ink: #2c2933; }
.intro.is-out { opacity: 0; visibility: hidden; pointer-events: none; }
.intro-lines { display: flex; flex-direction: column; align-items: flex-start; gap: .02em; }
.intro-name,
.intro-product {
  display: block;
  color: var(--intro-ink);
  font-weight: 800;
  letter-spacing: -.065em;
  line-height: .82;
  animation: introUp .9s var(--ease-out) both;
}
.intro-name { font-size: clamp(2.5rem, 8.4vw, 8.2rem); }
.intro-product { font-size: clamp(2.3rem, 7.2vw, 7.2rem); animation-delay: .12s; }
@keyframes introUp {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .intro-name, .intro-product { animation: none; }
  .intro { transition: none; }
}
