/* Da7_Tech ship test. Shares the site's tokens: one dark theme, one blue accent, pills for every control, 24px surfaces. */
:root {
  color-scheme: dark;
  --bg: #07090d;
  --surface: #0d1016;
  --surface-2: #121620;
  --line: rgba(168, 186, 222, .1);
  --line-2: rgba(168, 186, 222, .18);
  --text: #edf1f7;
  --text-2: #a9b2c1;
  --text-3: #7a8392;
  --blue: #3b82f6;
  --blue-soft: #79a7ff;
  --field: #07112b;
  --glass: rgba(9, 13, 22, .58);
  --glass-line: rgba(245, 248, 255, .16);
  --ease: cubic-bezier(.16, 1, .3, 1);
  --nav-h: 68px;
  --pad: clamp(20px, 4vw, 48px);
  --flow: 90deg;
  --sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --arabic: 'IBM Plex Sans Arabic', 'Geist', ui-sans-serif, system-ui, sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
}
html[dir="rtl"] { --flow: 270deg; }

*, *::before, *::after { box-sizing: border-box; }
html {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 12px);
}
html[lang="ar"] { font-family: var(--arabic); }
body { margin: 0; min-height: 100vh; overflow-x: clip; font-size: 17px; line-height: 1.6; }
body:has(dialog[open]) { overflow: hidden; }
img, svg, video { display: block; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { padding: 0; border: 0; background: none; cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
::selection { background: rgba(59, 130, 246, .38); color: #fff; }
:focus-visible { outline: 2px solid var(--blue-soft); outline-offset: 3px; border-radius: 6px; }

.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.wrap { width: 100%; max-width: 1440px; margin-inline: auto; padding-inline: var(--pad); }
.icon { width: 18px; height: 18px; flex: none; fill: currentColor; }
[dir="rtl"] .icon--dir { transform: scaleX(-1); }

/* Film grain: fixed and non-interactive so it never repaints with scroll. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: .05;
  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='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.skip {
  position: fixed;
  inset-inline-start: 16px;
  top: 12px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-size: 14px;
  font-weight: 500;
  transform: translateY(-160%);
  transition: transform .3s var(--ease);
}
.skip:focus { transform: none; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  padding: 0 26px;
  border-radius: 999px;
  background: #f5f8ff;
  color: #0b1a4d;
  font-size: 16px;
  font-weight: 550;
  letter-spacing: -.01em;
  white-space: nowrap;
  transition: background-color .25s ease, transform .25s var(--ease), border-color .25s ease;
}
html[lang="ar"] .btn { letter-spacing: 0; font-weight: 600; }
.btn:hover { background: #fff; }
.btn:active { transform: scale(.97); }
.btn--sm { height: 40px; padding: 0 18px; gap: 8px; font-size: 14px; }
.btn--glass {
  background: var(--glass);
  color: #f5f8ff;
  border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
}
.btn--glass:hover { background: rgba(22, 30, 48, .7); border-color: rgba(245, 248, 255, .34); }
.round {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 50%;
  color: #f5f8ff;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .25s var(--ease);
}
.round:hover { background: rgba(28, 38, 60, .78); border-color: rgba(245, 248, 255, .36); }
.round:active { transform: scale(.94); }
.round:focus-visible, .btn:focus-visible { border-radius: 999px; }

/* ---------- navigation ---------- */
.nav {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 70;
  height: var(--nav-h);
  border-bottom: 1px solid transparent;
  transition: background-color .35s ease, border-color .35s ease;
}
.nav.is-stuck {
  background: rgba(7, 9, 13, .78);
  border-bottom-color: var(--line);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
}
.nav-in { height: 100%; display: flex; align-items: center; gap: 40px; }
.word { font-family: var(--sans); font-weight: 600; font-size: 17px; letter-spacing: -.025em; padding-block: 10px; }
.nav-links { display: flex; gap: 30px; margin-inline-start: auto; }
.nav-links a { position: relative; padding-block: 10px; font-size: 14px; color: rgba(245, 248, 255, .74); transition: color .2s ease; }
.nav-links a:hover, .nav-links a.is-active { color: #f5f8ff; }
.nav-links a::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 4px;
  height: 1px;
  background: var(--blue-soft);
  transform: scaleX(0);
  transition: transform .4s var(--ease);
}
.nav-links a.is-active::after { transform: scaleX(1); }
.nav-end { display: flex; align-items: center; gap: 18px; }
.lang { padding: 10px 2px; font-size: 14px; color: rgba(245, 248, 255, .74); transition: color .2s ease; }
.lang:hover { color: #f5f8ff; }
.lang[lang="ar"] { font-family: var(--arabic); }
.lang[lang="en"] { font-family: var(--sans); }
.nav .btn .icon { width: 17px; height: 17px; }

/* ---------- hero ---------- */
/* The film is the page's one colour field. It keeps the site's rounded cobalt sheet. */
.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  min-height: clamp(600px, 54vw, min(100svh, 900px));
  overflow: hidden;
  color: #f5f8ff;
  background: var(--field);
  border-radius: 0 0 36px 36px;
}
.hero-film { position: absolute; inset: 0; z-index: -2; background: #0b1226 url(assets/hero-poster.webp) center / cover no-repeat; }
/* Mirrored for right-to-left pages so the ship sails clear of the headline. The mask is written for the unmirrored box. */
[dir="rtl"] .hero-film { transform: scaleX(-1); }
@media (min-width: 721px) {
  .hero-film { inset-inline-start: 24%; -webkit-mask-image: linear-gradient(90deg, transparent, #000 26%); mask-image: linear-gradient(90deg, transparent, #000 26%); }
}
#hero-motion { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .9s ease; }
#hero-motion.started { opacity: 1; }
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to top, rgba(4, 8, 24, .9) 0%, rgba(4, 8, 24, .5) 24%, rgba(4, 8, 24, 0) 52%),
    linear-gradient(var(--flow), rgba(5, 10, 32, .9) 0%, rgba(5, 10, 32, .62) 30%, rgba(5, 10, 32, 0) 62%),
    linear-gradient(to bottom, rgba(4, 8, 24, .62), rgba(4, 8, 24, 0) 24%);
}
.hero ::selection { background: rgba(245, 248, 255, .92); color: var(--field); }
.hero :focus-visible { outline-color: #f5f8ff; }
.hero-in { position: relative; padding-top: calc(var(--nav-h) + 40px); padding-bottom: clamp(40px, 6.4vh, 76px); }
.hero-copy { max-width: min(100%, 720px); }
.hero h1 {
  font-size: clamp(56px, 1rem + 7.2vw, 120px);
  font-weight: 600;
  line-height: .98;
  letter-spacing: -.048em;
  text-wrap: balance;
}
html[lang="ar"] .hero h1 { font-size: clamp(52px, 1rem + 6.2vw, 112px); letter-spacing: 0; line-height: 1.24; }
.hero-lead {
  max-width: 34rem;
  margin-top: clamp(18px, 2vw, 28px);
  font-size: clamp(17px, .9rem + .4vw, 20px);
  line-height: 1.6;
  color: rgba(245, 248, 255, .88);
  text-wrap: pretty;
}
html[lang="ar"] .hero-lead { line-height: 1.85; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: clamp(26px, 3vw, 40px); }
.hero-credit {
  position: absolute;
  inset-inline-end: var(--pad);
  bottom: clamp(40px, 6.4vh, 76px);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: rgba(245, 248, 255, .86);
}
.hero-credit span { text-align: end; line-height: 1.35; text-shadow: 0 1px 12px rgba(0, 0, 0, .5); }
#hero-switch .icon { width: 15px; height: 15px; }
#hero-switch[data-playing="true"] .icon:last-child, #hero-switch:not([data-playing="true"]) .icon:first-child { display: none; }

/* Words rise out of a blur on load, the same entrance the home page uses. */
.js .hero [data-in] { opacity: 0; transform: translateY(14px); filter: blur(6px); }
.is-ready .hero [data-in] { opacity: 1; transform: none; filter: none; transition: opacity 1s var(--ease), transform 1.1s var(--ease), filter 1s var(--ease); transition-delay: calc(var(--i, 0) * 90ms + 80ms); }

/* ---------- gallery ---------- */
.fleet { padding-block: clamp(56px, 7vw, 108px) clamp(72px, 9vw, 132px); }
.fleet-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px 32px; flex-wrap: wrap; }
.fleet-title { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.fleet-title h2 { font-size: clamp(32px, 1rem + 2.5vw, 56px); font-weight: 600; line-height: 1.08; letter-spacing: -.038em; }
html[lang="ar"] .fleet-title h2 { letter-spacing: 0; line-height: 1.35; }
#count { font-family: var(--mono); font-size: 13px; color: var(--text-3); font-variant-numeric: tabular-nums; }
html[lang="ar"] #count { font-family: var(--arabic); font-size: 15px; }
.search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(100%, 340px);
  height: 48px;
  padding-inline: 18px 6px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  color: var(--text-2);
  transition: border-color .2s ease, background-color .2s ease;
}
.search:hover { border-color: rgba(168, 186, 222, .32); }
.search:focus-within { border-color: var(--blue-soft); background: var(--surface-2); box-shadow: 0 0 0 4px rgba(121, 167, 255, .16); }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font-size: 16px; color: var(--text); }
.search input::-webkit-search-cancel-button { display: none; }
.search-prompt { position: absolute; inset-inline-start: 46px; font-size: 16px; color: var(--text-3); pointer-events: none; }
.search input:not(:placeholder-shown) + .search-prompt { opacity: 0; }
.search button { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: var(--text-2); }
.search button:hover { background: var(--line-2); color: var(--text); }
.search button .icon { width: 15px; height: 15px; }

.chips { display: flex; gap: 8px; margin-top: clamp(22px, 2.4vw, 32px); margin-bottom: clamp(20px, 2.2vw, 30px); overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--pad) * -1); padding: 4px var(--pad); }
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  flex: none;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.chip i { font-style: normal; font-family: var(--mono); font-size: 12px; opacity: .6; font-variant-numeric: tabular-nums; }
html[lang="ar"] .chip i { font-family: var(--arabic); font-size: 13px; }
.chip:hover { color: var(--text); border-color: rgba(168, 186, 222, .36); }
.chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: #07090d; }
.chip:focus-visible { border-radius: 999px; }

.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(12px, 1.4vw, 22px); }
.card {
  position: relative;
  aspect-ratio: 16 / 10;
  min-width: 0;
  overflow: hidden;
  border-radius: 22px;
  background: var(--surface);
  isolation: isolate;
}
.card--featured { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; }
.card-open { position: absolute; inset: 0; display: block; width: 100%; height: 100%; text-align: start; border-radius: inherit; }
.card-open:focus-visible { outline-offset: -3px; border-radius: 22px; }
.card-open img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--ease); }
.card-open::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(to top, rgba(4, 6, 12, .86) 0%, rgba(4, 6, 12, .34) 30%, rgba(4, 6, 12, 0) 56%);
  box-shadow: inset 0 0 0 1px rgba(245, 248, 255, .09);
  transition: box-shadow .3s ease;
}
.card-name {
  position: absolute;
  z-index: 1;
  inset-inline: 16px 62px;
  bottom: 14px;
  font-size: clamp(15px, .8rem + .32vw, 18px);
  font-weight: 550;
  line-height: 1.3;
  letter-spacing: -.012em;
  color: #f5f8ff;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
html[lang="ar"] .card-name { letter-spacing: 0; font-weight: 600; line-height: 1.5; }
.card--featured .card-name { inset-inline: clamp(18px, 2vw, 30px) 84px; bottom: clamp(18px, 2vw, 28px); font-size: clamp(22px, 1rem + 1.5vw, 38px); font-weight: 600; letter-spacing: -.03em; line-height: 1.12; }
html[lang="ar"] .card--featured .card-name { letter-spacing: 0; line-height: 1.4; }
.card-go {
  position: absolute;
  z-index: 1;
  inset-inline-end: 12px;
  bottom: 12px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #f5f8ff;
  background: rgba(9, 13, 22, .5);
  border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: background-color .3s ease, color .3s ease, border-color .3s ease, transform .5s var(--ease);
}
.card-go .icon { width: 15px; height: 15px; }
.card--featured .card-go { inset-inline-end: clamp(16px, 2vw, 26px); bottom: clamp(16px, 2vw, 26px); width: 48px; height: 48px; }
.card--featured .card-go .icon { width: 19px; height: 19px; }
.card-pick {
  position: absolute;
  z-index: 2;
  top: 10px;
  inset-inline-end: 10px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #f5f8ff;
  background: rgba(9, 13, 22, .5);
  border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: opacity .25s ease, background-color .2s ease, border-color .2s ease, transform .25s var(--ease);
}
.card-pick::before { content: ""; position: absolute; inset: -5px; }
.card-pick .icon { width: 16px; height: 16px; }
.card-pick:hover { background: rgba(28, 38, 60, .8); border-color: rgba(245, 248, 255, .4); }
.card-pick[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); }
.card-pick:disabled { opacity: .35; }
.card-pick:focus-visible, .card-go:focus-visible { border-radius: 50%; }
.card-badge {
  position: absolute;
  z-index: 1;
  top: 12px;
  inset-inline-start: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  font-size: 13px;
  color: #f5f8ff;
  background: rgba(9, 13, 22, .58);
  border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  pointer-events: none;
}
.card-badge .icon { width: 14px; height: 14px; }
.card-runs { position: absolute; z-index: 2; inset-inline-end: 12px; bottom: 11px; display: flex; gap: 6px; }
.card-runs button {
  height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: #f5f8ff;
  background: rgba(9, 13, 22, .55);
  border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.card-runs button:hover { background: #f5f8ff; border-color: #f5f8ff; color: #07090d; }
.card-runs button:focus-visible { border-radius: 999px; }
.card--runs .card-name { inset-inline-end: 16px; bottom: 56px; }
@media (hover: hover) {
  .card-pick { opacity: 0; }
  .card:hover .card-pick, .card:focus-within .card-pick, .card-pick[aria-pressed="true"], .picking .card-pick { opacity: 1; }
  .card:hover .card-open img { transform: scale(1.06); }
  .card:hover .card-open::after { box-shadow: inset 0 0 0 1px rgba(245, 248, 255, .3); }
  .card:hover .card-go { background: #f5f8ff; border-color: #f5f8ff; color: #07090d; }
}
.empty { grid-column: 1 / -1; display: grid; justify-items: center; gap: 14px; padding: 72px 16px; text-align: center; color: var(--text-2); border: 1px dashed var(--line-2); border-radius: 24px; }
.empty > .icon { width: 28px; height: 28px; color: var(--text-3); }

/* ---------- compare tray ---------- */
.tray {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 24px);
  padding: 8px;
  padding-inline-start: 10px;
  border-radius: 999px;
  background: rgba(13, 17, 27, .78);
  border: 1px solid var(--glass-line);
  box-shadow: 0 18px 60px rgba(0, 0, 0, .55);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
  transform: translate(-50%, 0);
  animation: tray-in .5s var(--ease);
}
@keyframes tray-in { from { opacity: 0; transform: translate(-50%, 24px); } }
.tray-thumbs { display: flex; }
.tray-thumbs button { position: relative; width: 44px; height: 44px; border-radius: 50%; overflow: hidden; border: 2px solid rgba(13, 17, 27, 1); background: var(--surface-2); }
.tray-thumbs button + button { margin-inline-start: -12px; }
.tray-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.tray-thumbs button::after { content: "×"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 20px; line-height: 1; color: #fff; background: rgba(4, 6, 12, .62); opacity: 0; transition: opacity .2s ease; }
.tray-thumbs button:hover::after, .tray-thumbs button:focus-visible::after { opacity: 1; }
.tray-thumbs button:focus-visible { border-radius: 50%; outline-offset: 1px; }
.tray-text { font-size: 14px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tray .btn { height: 44px; padding: 0 20px; font-size: 15px; flex: none; }
.tray-clear { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 50%; color: var(--text-2); }
.tray-clear:hover { background: var(--line-2); color: var(--text); }
.tray-clear .icon { width: 15px; height: 15px; }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); }
.foot-in { display: flex; align-items: center; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; padding-block: 28px 36px; font-size: 14px; color: var(--text-3); }
.foot-in p { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.foot-links { display: flex; align-items: center; gap: 24px; }
.foot-links a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--text-2); transition: color .2s ease; }
.foot-links a:hover { color: var(--text); }
.foot-links .icon { width: 15px; height: 15px; }

/* ---------- dialogs ---------- */
dialog { color: var(--text); padding: 0; border: 0; }
dialog::backdrop { background: rgba(4, 6, 10, .76); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.985); } }
@keyframes fade { from { opacity: 0; } }

.sheet { max-width: none; overflow: hidden; border-radius: 24px; background: rgba(13, 16, 22, .94); border: 1px solid var(--line-2); box-shadow: 0 30px 100px rgba(0, 0, 0, .6); }
.sheet[open] { animation: rise .45s var(--ease); }
.sheet-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 14px 14px 22px; }
[dir="rtl"] .sheet-bar { padding: 14px 22px 14px 14px; }
.sheet-bar h2 { font-size: 19px; font-weight: 600; letter-spacing: -.02em; }
html[lang="ar"] .sheet-bar h2 { letter-spacing: 0; }
.sheet-bar .round { width: 40px; height: 40px; background: transparent; border-color: var(--line-2); }
.sheet-bar .round .icon { width: 15px; height: 15px; }

#tour { width: min(1120px, calc(100vw - 32px)); }
#tour video { width: 100%; max-height: calc(92dvh - 70px); background: #04060a; }

/* ---------- viewer ---------- */
/* The scenes fill the window. Every control floats over them as glass. */
#viewer { position: fixed; inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; overflow: hidden; background: #04060a; }
#viewer[open] { display: block; animation: fade .4s ease; }
#stages { position: absolute; inset: 0; display: grid; gap: 1px; background: rgba(245, 248, 255, .2); }
#viewer[data-layout="cols"] #stages { grid-template-columns: repeat(var(--n, 1), minmax(0, 1fr)); }
#viewer[data-layout="rows"] #stages { grid-template-rows: repeat(var(--n, 1), minmax(0, 1fr)); }
.stage { position: relative; overflow: hidden; min-width: 0; min-height: 0; background: #0a0f18 center / cover no-repeat; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.stage:active { cursor: grabbing; }
/* The scene's iframe covers an outline, so the stage draws its focus ring above it. */
.stage:focus-visible { outline: none; }
.stage:focus-visible::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; box-shadow: inset 0 0 0 2px var(--blue-soft); }
.stage.quiet:focus-visible::after { content: none; }
.quiet:focus-visible { outline: none; }
.stage::before { content: ""; position: absolute; inset: 0; background: rgba(4, 6, 10, .5); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.stage iframe, .stage video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.stage iframe { opacity: 0; pointer-events: none; transition: opacity .6s ease; }
.stage.ready iframe { opacity: 1; }
.stage video { object-fit: contain; background: #04060a; }
.recorded .stage { cursor: default; touch-action: auto; }

.plate {
  position: absolute;
  z-index: 2;
  top: 14px;
  inset-inline-start: 14px;
  display: flex;
  align-items: center;
  max-width: calc(100% - 28px);
  height: 44px;
  padding: 3px;
  border-radius: 999px;
  color: #f5f8ff;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  animation: fade .5s ease;
}
.stage.under-window .plate { max-width: calc(100% - 136px); }
.plate-name { display: flex; align-items: center; gap: 8px; min-width: 0; height: 100%; padding-inline: 14px 12px; border-radius: 999px; font-size: 14px; font-weight: 550; transition: background-color .2s ease; }
html[lang="ar"] .plate-name { font-weight: 600; }
.plate-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plate-name .icon { width: 12px; height: 12px; opacity: .7; }
button.plate-name:hover { background: rgba(245, 248, 255, .12); }
.plate-btn { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 50%; color: rgba(245, 248, 255, .82); transition: background-color .2s ease, color .2s ease; }
.plate-btn:hover { background: rgba(245, 248, 255, .14); color: #fff; }
.plate-btn .icon { width: 14px; height: 14px; }
.plate-btn:focus-visible, .plate-name:focus-visible { border-radius: 999px; outline-offset: 1px; }
.plate-sep { width: 1px; height: 18px; flex: none; background: var(--glass-line); }

.loading {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 28px);
  padding: 10px 18px 10px 14px;
  border-radius: 999px;
  font-size: 14px;
  color: #f5f8ff;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}
[dir="rtl"] .loading { padding: 10px 14px 10px 18px; }
.loading::before { content: ""; width: 16px; height: 16px; flex: none; border-radius: 50%; border: 2px solid rgba(245, 248, 255, .25); border-top-color: #f5f8ff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.retry { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

.v-window { position: absolute; z-index: 3; top: 14px; inset-inline-end: 14px; display: flex; gap: 8px; }
.v-window .icon { width: 16px; height: 16px; }

.dock {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: calc(100% - 20px);
  padding: 6px;
  border-radius: 999px;
  background: rgba(9, 13, 22, .66);
  border: 1px solid var(--glass-line);
  box-shadow: 0 18px 60px rgba(0, 0, 0, .5);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
  animation: tray-in .6s var(--ease) .1s backwards;
}
.dock button { display: grid; place-items: center; grid-auto-flow: column; gap: 8px; min-width: 44px; height: 44px; flex: none; border-radius: 999px; color: rgba(245, 248, 255, .86); font-size: 14px; font-weight: 550; transition: background-color .2s ease, color .2s ease, transform .25s var(--ease); }
.dock button:hover { background: rgba(245, 248, 255, .12); color: #fff; }
.dock button:active { transform: scale(.94); }
.dock button:focus-visible { border-radius: 999px; outline-offset: 1px; }
.dock .icon { width: 17px; height: 17px; }
#auto { width: 48px; height: 48px; background: #f5f8ff; color: #0b1a4d; }
#auto:hover { background: #fff; color: #0b1a4d; }
#speed { min-width: 54px; padding-inline: 10px; font-family: var(--mono); font-size: 13px; font-variant-numeric: tabular-nums; }
html[lang="ar"] #speed { font-family: var(--arabic); font-size: 15px; }
#link-cameras[aria-checked="true"] { background: rgba(59, 130, 246, .3); color: #cfe0ff; box-shadow: inset 0 0 0 1px rgba(121, 167, 255, .55); }
#add { padding-inline: 14px 18px; }
.dock-sep { width: 1px; height: 22px; margin-inline: 4px; flex: none; background: var(--glass-line); }
.recorded .dock, .recorded #hint { display: none; }

#hint {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: calc(max(18px, env(safe-area-inset-bottom)) + 76px);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 28px);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  line-height: 1.35;
  color: rgba(245, 248, 255, .9);
  background: var(--glass);
  border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  pointer-events: none;
  opacity: 0;
  transition: opacity .6s ease;
}
#hint.show { opacity: 1; }
#hint .icon { width: 16px; height: 16px; }

/* ---------- model picker ---------- */
#model-picker { width: min(780px, calc(100vw - 32px)); max-height: min(740px, 88dvh); }
#model-picker[open] { display: flex; flex-direction: column; }
.picker-search { width: auto; margin: 0 16px 14px; flex: none; background: rgba(245, 248, 255, .05); }
#picker-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 2px 10px 14px; overflow: auto; overscroll-behavior: contain; scrollbar-color: rgba(168, 186, 222, .3) transparent; }
#picker-list button { position: relative; display: flex; flex-direction: column; gap: 9px; padding: 6px 6px 11px; border-radius: 16px; text-align: start; transition: background-color .2s ease; }
#picker-list img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 11px; background: var(--surface-2); }
#picker-list span { padding-inline: 6px; font-size: 14px; font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; }
#picker-list small { position: absolute; top: 12px; inset-inline-start: 12px; padding: 3px 9px; border-radius: 999px; font-size: 12px; color: #f5f8ff; background: rgba(9, 13, 22, .72); border: 1px solid var(--glass-line); }
#picker-list button:not(:disabled):hover, #picker-list button:focus-visible { background: rgba(245, 248, 255, .08); }
#picker-list button:focus-visible { border-radius: 16px; outline-offset: -2px; }
#picker-list button:disabled img, #picker-list button:disabled span { opacity: .42; }
#picker-list .current img { outline: 2px solid var(--blue-soft); outline-offset: 2px; }
#picker-list .current small { background: var(--blue); border-color: var(--blue); }
#picker-list p { grid-column: 1 / -1; padding: 40px 10px; text-align: center; color: var(--text-2); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-end { margin-inline-start: auto; }
}
@media (max-width: 720px) {
  :root { --nav-h: 60px; }
  body { font-size: 16px; }
  .hero { min-height: clamp(560px, 86svh, 760px); border-radius: 0 0 28px 28px; }
  .hero::before {
    background:
      linear-gradient(to top, rgba(4, 8, 24, .96) 0%, rgba(4, 8, 24, .84) 30%, rgba(4, 8, 24, .3) 56%, rgba(4, 8, 24, 0) 72%),
      linear-gradient(to bottom, rgba(4, 8, 24, .6), rgba(4, 8, 24, 0) 20%);
  }
  .hero-film { bottom: 42%; -webkit-mask-image: linear-gradient(to bottom, #000 58%, transparent); mask-image: linear-gradient(to bottom, #000 58%, transparent); }
  .hero-in { padding-bottom: 30px; }
  .hero-actions { gap: 10px; }
  .hero-actions .btn { flex: 1 1 auto; height: 50px; padding: 0 18px; font-size: 15px; }
  .hero-credit { position: static; margin-top: 22px; justify-content: space-between; }
  .hero-credit span { text-align: start; }
  .fleet-head { align-items: stretch; flex-direction: column; }
  .fleet .search { width: 100%; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card { border-radius: 16px; aspect-ratio: 4 / 3.3; }
  .card-open:focus-visible { border-radius: 16px; }
  .card--featured { grid-row: auto; aspect-ratio: 16 / 10.5; }
  .card-name { inset-inline: 12px; bottom: 11px; font-size: 14px; }
  .card--featured .card-name { inset-inline: 16px 70px; font-size: 22px; }
  .card-go { display: none; }
  .card--featured .card-go { display: grid; width: 42px; height: 42px; }
  .card-pick { top: 8px; inset-inline-end: 8px; width: 34px; height: 34px; }
  .card--runs .card-name { bottom: 52px; }
  .card-runs { inset-inline: 10px; bottom: 10px; }
  .card-runs button { flex: 1; }
  .tray { gap: 8px; }
  .tray-text { display: none; }
  .foot-in { flex-direction: column; align-items: flex-start; }

  .sheet { border-radius: 24px 24px 0 0; }
  #model-picker { width: 100%; max-width: 100%; max-height: 86dvh; margin: auto 0 0; border-bottom: 0; }
  #model-picker[open] { animation: sheet-up .45s var(--ease); }
  #picker-list { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-bottom: max(14px, env(safe-area-inset-bottom)); }
  #tour { width: 100%; max-width: 100%; margin: auto 0; border-radius: 20px; border-inline: 0; }

  .plate { top: 10px; inset-inline-start: 10px; height: 42px; max-width: calc(100% - 20px); }
  .stage.under-window .plate { max-width: calc(100% - 122px); }
  .plate-name { padding-inline: 12px 10px; font-size: 13px; }
  .plate-btn { width: 34px; height: 34px; }
  .v-window { top: 10px; inset-inline-end: 10px; gap: 6px; }
  .v-window .round { width: 42px; height: 42px; }
  .dock { gap: 2px; }
  #add { padding-inline: 0; }
  #add span { display: none; }
  .dock-sep { margin-inline: 2px; }
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
@media (max-width: 400px) {
  .hero h1 { font-size: min(52px, 13.2vw); }
  .nav .btn--sm { padding: 0 14px; }
  .nav-in, .nav-end { gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js .hero [data-in] { opacity: 1; transform: none; filter: none; }
}
