:root {
  color-scheme: dark;
  --accent: #70e1ff;
  --bg: #071014;
  --panel: #0b171c;
  --panel-strong: #102128;
  --line: #1c3942;
  --line-soft: #132a31;
  --text: #f0f8f9;
  --muted: #86a2a9;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { min-height: 100vh; min-height: 100svh; margin: 0; overflow-x: hidden; background: var(--bg); color: var(--text); }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
[hidden] { display: none !important; }

.ambient { position: fixed; z-index: 0; border: 1px solid rgba(112,225,255,.1); border-radius: 50%; pointer-events: none; }
.ambient-one { width: 320px; height: 320px; top: -190px; right: -145px; box-shadow: 0 0 90px rgba(112,225,255,.06); }
.ambient-two { width: 230px; height: 230px; bottom: -145px; left: -130px; box-shadow: 0 0 70px rgba(112,225,255,.05); }
.site-shell { position: relative; z-index: 1; width: min(100% - 34px, 620px); min-height: 100vh; min-height: 100svh; margin: 0 auto; display: flex; flex-direction: column; padding: max(18px, env(safe-area-inset-top)) 0 max(16px, env(safe-area-inset-bottom)); }
.site-header { height: 52px; display: flex; align-items: center; justify-content: space-between; }
.header-actions { display: flex; align-items: center; gap: 7px; }
.identity { min-width: 0; display: flex; align-items: center; }
.logo-wordmark { min-width: 31px; max-width: 160px; height: 31px; display: inline-flex; align-items: center; justify-content: center; flex: 0 1 auto; padding: 0 9px; overflow: hidden; border: 1px solid #397888; border-radius: 10px; background: #0c2027; color: var(--accent); font-size: 12px; font-weight: 850; letter-spacing: .06em; line-height: 1; text-overflow: ellipsis; white-space: nowrap; box-shadow: 0 0 22px rgba(112,225,255,.08); }
.logo-wordmark-single { width: 31px; padding-right: 0; padding-left: 0; }
.logo-image { width: auto; max-width: 160px; height: 31px; display: block; object-fit: contain; border-radius: 9px; }
.secure-chip { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 999px; color: #6f929a; font-size: 8px; font-weight: 850; letter-spacing: .14em; }
.secure-chip i, .online-dot { width: 5px; height: 5px; border-radius: 50%; background: #6de3ad; box-shadow: 0 0 9px rgba(109,227,173,.6); }
.language-picker { position: relative; z-index: 30; }
.language-toggle { min-width: 88px; height: 38px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 10px; border: 1px solid var(--line); border-radius: 12px; outline: 0; background: rgba(8,20,25,.92); color: var(--text); cursor: pointer; box-shadow: 0 7px 20px rgba(0,0,0,.12); transition: border-color .2s, background .2s, box-shadow .2s; }
.language-toggle:hover, .language-toggle:focus-visible, .language-picker.is-open .language-toggle { border-color: #367889; background: #0c2027; box-shadow: 0 9px 26px rgba(0,0,0,.2), 0 0 20px rgba(112,225,255,.06); }
.language-toggle .language-flag { width: 27px; height: 19px; display: block; border-radius: 2px; object-fit: cover; box-shadow: 0 0 0 1px rgba(255,255,255,.12); }
.language-code { min-width: 20px; font-size: 10px; font-weight: 850; letter-spacing: .08em; }
.language-toggle svg { width: 12px; fill: none; stroke: #718f96; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.language-picker.is-open .language-toggle svg { transform: rotate(180deg); }
.language-menu { position: absolute; top: calc(100% + 9px); right: 0; z-index: 40; width: min(248px, calc(100vw - 34px)); max-height: min(62vh, 438px); padding: 7px; overflow-y: auto; border: 1px solid #234750; border-radius: 16px; background: rgba(8,20,25,.98); box-shadow: 0 20px 55px rgba(0,0,0,.42), 0 0 35px rgba(112,225,255,.05); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.language-menu::-webkit-scrollbar { width: 4px; }
.language-menu::-webkit-scrollbar-thumb { border-radius: 999px; background: #294b53; }
.language-option { width: 100%; min-height: 43px; display: grid; grid-template-columns: 28px minmax(0,1fr) auto 16px; align-items: center; gap: 8px; padding: 7px 9px; border: 0; border-radius: 10px; outline: 0; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.language-option:hover, .language-option:focus-visible { background: #10252b; }
.language-option[aria-checked="true"] { background: #0d2931; color: var(--accent); }
.language-option-flag { width: 28px; height: 21px; display: block; border-radius: 2px; object-fit: cover; box-shadow: 0 0 0 1px rgba(255,255,255,.1); }
.language-option-icon { width: 28px; height: 21px; display: grid; place-items: center; color: var(--accent); }
.language-option-icon svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.45; stroke-linecap: round; stroke-linejoin: round; }
.language-option-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 720; }
.language-option-code { color: #66868e; font-size: 8px; font-weight: 800; letter-spacing: .08em; }
.language-check { color: transparent; font-size: 11px; font-weight: 900; }
.language-option[aria-checked="true"] .language-check { color: var(--accent); }

.stage { width: 100%; flex: 1; }
.matching-stage, .connecting-stage { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 44px 0 74px; text-align: center; }
.stage-kicker { margin: 0 0 12px; color: var(--accent); font-size: 9px; font-weight: 850; letter-spacing: .2em; }
.stage h1 { margin: 0; font-size: clamp(27px, 8vw, 38px); line-height: 1.15; letter-spacing: -.045em; }
.stage-copy { margin: 12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }

.scanner { position: relative; width: 168px; height: 168px; display: grid; place-items: center; margin-bottom: 36px; }
.scanner-ring { position: absolute; border: 1px solid; border-radius: 50%; }
.ring-one { inset: 0; border-color: rgba(112,225,255,.22); animation: rotate-clockwise 4s linear infinite; }
.ring-one::before, .ring-one::after { content: ""; position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 15px rgba(112,225,255,.65); }
.ring-one::before { top: 16px; left: 24px; }
.ring-one::after { right: 8px; bottom: 50px; width: 4px; height: 4px; }
.ring-two { inset: 18px; border-color: rgba(112,225,255,.12); border-style: dashed; animation: rotate-counter 8s linear infinite; }
.scanner-core { width: 72px; height: 72px; display: grid; place-items: center; border: 1px solid #2a6877; border-radius: 24px; background: #0b2229; box-shadow: 0 0 42px rgba(112,225,255,.11); transform: rotate(45deg); }
.scanner-core i { width: 13px; height: 13px; border: 2px solid var(--accent); border-radius: 50%; box-shadow: 0 0 18px rgba(112,225,255,.7); animation: core-pulse 1.2s ease-in-out infinite; }
.match-progress { width: min(255px, 72vw); height: 2px; margin-top: 31px; overflow: hidden; background: #13262c; }
.match-progress span { display: block; width: 100%; height: 100%; transform-origin: left; background: var(--accent); box-shadow: 0 0 9px rgba(112,225,255,.55); animation: progress-fill 1800ms linear both; }
.signal-row { height: 13px; display: flex; align-items: flex-end; gap: 3px; margin-top: 17px; }
.signal-row i { width: 2px; height: 4px; background: #2b4b53; animation: signal 1s ease-in-out infinite alternate; }
.signal-row i:nth-child(2), .signal-row i:nth-child(4) { height: 8px; animation-delay: .15s; }
.signal-row i:nth-child(3) { height: 12px; animation-delay: .3s; }

.destination-stage { align-self: center; display: flex; flex-direction: column; justify-content: center; padding: 40px 0 35px; }
.intro { margin-bottom: 28px; }
.intro h1 { max-width: 500px; }
.intro > p:last-child { max-width: 480px; margin: 12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.intro .stage-kicker { display: flex; align-items: center; gap: 7px; }
.route-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.route-button { position: relative; min-width: 0; min-height: 92px; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 15px 13px; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: var(--panel); color: var(--text); text-decoration: none; box-shadow: 0 9px 26px rgba(0,0,0,.12); transition: border-color .2s, background .2s, transform .15s; }
.route-button:active { transform: scale(.98); }
.route-button:hover { border-color: #347081; background: var(--panel-strong); }
.route-index { align-self: flex-start; color: #38545b; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 8px; font-weight: 800; letter-spacing: .08em; }
.route-copy { min-width: 0; display: grid; gap: 6px; }
.route-copy strong, .route-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.route-copy strong { font-size: 14px; letter-spacing: -.02em; }
.route-copy small { color: var(--muted); font-size: 9px; }
.route-button svg { width: 15px; fill: none; stroke: var(--accent); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.system-note { display: flex; align-items: center; gap: 8px; margin-top: 18px; padding: 10px 2px; color: #66868e; font-size: 9px; }
.system-note span { width: 5px; height: 5px; border-radius: 50%; background: #6de3ad; }
.system-note p { margin: 0; flex: 1; }
.system-note code { color: #446169; font-size: 8px; }

.connection-orbit { position: relative; width: 124px; height: 124px; display: grid; place-items: center; margin-bottom: 34px; border: 1px solid rgba(112,225,255,.19); border-radius: 50%; animation: rotate-clockwise 2.3s linear infinite; }
.connection-orbit::after { content: ""; position: absolute; inset: 16px; border: 1px dashed rgba(112,225,255,.2); border-radius: 50%; }
.connection-orbit i, .connection-orbit span { position: absolute; border-radius: 50%; background: var(--accent); box-shadow: 0 0 16px rgba(112,225,255,.7); }
.connection-orbit i { width: 7px; height: 7px; top: -4px; }
.connection-orbit span { width: 15px; height: 15px; }
.connection-lines { display: flex; gap: 5px; margin-top: 28px; }
.connection-lines span { width: 28px; height: 2px; background: #173139; animation: connection-blink 1.2s ease-in-out infinite; }
.connection-lines span:nth-child(2) { animation-delay: .2s; }
.connection-lines span:nth-child(3) { animation-delay: .4s; }

.site-footer { height: 26px; display: flex; align-items: center; justify-content: center; gap: 9px; color: #39545b; font-size: 7px; font-weight: 750; letter-spacing: .15em; }
.site-footer i { width: 2px; height: 2px; border-radius: 50%; background: #36535a; }

html[dir="rtl"] body { direction: rtl; }
html[dir="rtl"] .route-button svg { transform: rotate(180deg); }
html[dir="rtl"] .stage-kicker { letter-spacing: .05em; }
html[dir="rtl"] .language-menu { right: auto; left: 0; }
html[dir="rtl"] .language-option { text-align: right; }

@keyframes rotate-clockwise { to { transform: rotate(360deg); } }
@keyframes rotate-counter { to { transform: rotate(-360deg); } }
@keyframes core-pulse { 50% { transform: scale(.72); opacity: .55; } }
@keyframes progress-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes signal { to { background: var(--accent); box-shadow: 0 0 5px rgba(112,225,255,.45); } }
@keyframes connection-blink { 50% { background: var(--accent); box-shadow: 0 0 8px rgba(112,225,255,.45); } }

@media (max-width: 380px) {
  .logo-wordmark, .logo-image { max-width: 120px; }
  .secure-chip { display: none; }
  .language-toggle { min-width: 84px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
