/* ============================================================
   MQ//OS — personal interface for Dr. Mohamed Qasem
   deep-space HUD · holographic panels · warp navigation
   ============================================================ */

:root {
  --bg: #02050a;
  --bg-2: #050b14;
  --ink: #d7ecf7;
  --dim: #7d97a8;
  --faint: #44596b;
  --cyan: #41f2ff;
  --cyan-deep: #0095eb;
  --violet: #9a5cff;
  --magenta: #ff3da6;
  --amber: #ffc14d;
  --ok: #4dffa6;
  --line: rgba(65, 242, 255, 0.16);
  --line-2: rgba(65, 242, 255, 0.32);
  --panel-bg: rgba(6, 16, 26, 0.72);
  --glow: 0 0 24px rgba(65, 242, 255, 0.18), 0 0 64px rgba(0, 149, 235, 0.12);
  --font-d: "Orbitron", "IBM Plex Sans Arabic", "Segoe UI", sans-serif;
  --font-m: "Share Tech Mono", "IBM Plex Sans Arabic", Consolas, monospace;
  --font-a: "Cairo", sans-serif;
  --hud-h: 64px;
  --clip: polygon(0 14px, 14px 0, calc(100% - 14px) 0, 100% 14px,
                  100% calc(100% - 14px), calc(100% - 14px) 100%, 14px 100%, 0 calc(100% - 14px));
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }
html.overlay-open { overflow: hidden; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-d);
  font-size: 15px;
  line-height: 1.75;
  overflow-x: hidden;
  min-height: 100vh;
}

::selection { background: rgba(65, 242, 255, 0.35); color: #fff; }

img { display: block; max-width: 100%; height: auto; }
a { color: var(--cyan); text-decoration: none; }
.mono { font-family: var(--font-m); letter-spacing: 0.08em; }
.dim { color: var(--faint); }
.ok { color: var(--ok); }
[hidden] { display: none !important; }

:focus-visible {
  outline: 1px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ============ BACKGROUND LAYERS ============ */

#space {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  display: block;
}

.nebula {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(900px 600px at 82% -10%, rgba(0, 149, 235, 0.16), transparent 60%),
    radial-gradient(700px 700px at -10% 40%, rgba(154, 92, 255, 0.10), transparent 60%),
    radial-gradient(1000px 800px at 50% 120%, rgba(255, 61, 166, 0.07), transparent 60%);
}

.nebula::after {
  /* faint engineering grid */
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(65, 242, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(65, 242, 255, 0.045) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 50%, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 50%, black 30%, transparent 75%);
}

/* ============ BOOT SEQUENCE ============ */

.boot {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #010307;
  display: grid;
  place-content: center;
  gap: 28px;
  text-align: center;
  transition: opacity 0.55s ease, visibility 0.55s;
}

body[data-state="live"] .boot { opacity: 0; visibility: hidden; }

.boot-core { position: relative; width: 120px; height: 120px; margin: 0 auto; }

.boot-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(65, 242, 255, 0.25);
  border-top-color: var(--cyan);
  animation: spin 1.1s linear infinite;
}

.boot-ring::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  border: 1px dashed rgba(65, 242, 255, 0.25);
  animation: spin 3s linear infinite reverse;
}

.boot-logo {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-d);
  font-weight: 900;
  font-size: 30px;
  letter-spacing: 0.08em;
  color: var(--cyan);
  text-shadow: 0 0 18px rgba(65, 242, 255, 0.8);
}

.boot-log {
  font-family: var(--font-m);
  font-size: 12px;
  line-height: 1.9;
  color: var(--dim);
  text-align: left;
  min-height: 132px;
  min-width: min(420px, 84vw);
}

.boot-log .ok { color: var(--ok); }
.boot-skip { font-family: var(--font-m); font-size: 10px; color: var(--faint); letter-spacing: 0.2em; }

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

/* ============ HUD FRAME ============ */

.hud-frame { position: fixed; inset: 10px; z-index: 60; pointer-events: none; }

.hf { position: absolute; width: 26px; height: 26px; border: 1px solid var(--line-2); }
.hf.tl { left: 0; top: 0; border-right: 0; border-bottom: 0; }
.hf.tr { right: 0; top: 0; border-left: 0; border-bottom: 0; }
.hf.bl { left: 0; bottom: 0; border-right: 0; border-top: 0; }
.hf.br { right: 0; bottom: 0; border-left: 0; border-top: 0; }

/* ============ TOP HUD ============ */

.hud-top {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 70;
  height: var(--hud-h);
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 0 clamp(18px, 3vw, 38px);
  background: linear-gradient(180deg, rgba(2, 5, 10, 0.92), rgba(2, 5, 10, 0.66) 70%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(65, 242, 255, 0.10);
}

.hud-brand { display: flex; align-items: center; gap: 12px; }

.brand-sigil {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  font-weight: 900;
  font-size: 15px;
  color: #021018;
  background: linear-gradient(135deg, var(--cyan), var(--cyan-deep));
  clip-path: polygon(0 8px, 8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%);
  box-shadow: 0 0 22px rgba(65, 242, 255, 0.45);
}

.brand-meta { display: flex; flex-direction: column; line-height: 1.25; }
.brand-meta b { font-size: 13px; letter-spacing: 0.22em; color: var(--ink); }
.brand-meta i { font-style: normal; font-family: var(--font-m); font-size: 9px; color: var(--faint); letter-spacing: 0.18em; }

.hud-readouts { display: flex; gap: clamp(14px, 2.4vw, 34px); margin-inline-start: auto; }

.ro { display: flex; flex-direction: column; line-height: 1.4; }
.ro label { font-family: var(--font-m); font-size: 8.5px; letter-spacing: 0.26em; color: var(--faint); }
.ro b { font-family: var(--font-m); font-size: 12px; font-weight: 400; letter-spacing: 0.12em; color: var(--cyan); }
.ro b.ok { color: var(--ok); text-shadow: 0 0 10px rgba(77, 255, 166, 0.5); }

.hud-actions { display: flex; align-items: center; gap: 12px; }

/* One control treatment for every action in the top bar. */
.chip, .orb, .hud-actions .site-menu summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 42px;
  padding: 0 13px;
  flex-shrink: 0;
  font-family: var(--font-m);
  font-size: 11px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.12em;
  white-space: nowrap;
  color: var(--ink);
  background: rgba(7, 21, 31, 0.9);
  border: 1px solid rgba(124, 188, 207, 0.28);
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.chip:hover, .orb:hover, .hud-actions .site-menu summary:hover,
.hud-actions .site-menu[open] summary, .orb[aria-expanded="true"] {
  color: var(--cyan);
  background: #0b2532;
  border-color: rgba(65, 242, 255, 0.6);
}
.chip-key { display: inline-grid; place-items: center; height: 22px; padding: 0 5px; font-size: 10px; letter-spacing: 0; color: var(--dim); border: 1px solid var(--line); border-radius: 2px; }
.chip-ar, .hud-actions .chip[lang="ar"] { font-family: "IBM Plex Sans Arabic", sans-serif; font-size: 15px; font-weight: 500; letter-spacing: 0; }
.orb { width: 42px; padding: 9px; color: var(--cyan); }
.orb svg { width: 24px; height: 24px; stroke: currentColor; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.25s ease; }
.orb .compass-needle { fill: rgba(65, 242, 255, 0.12); stroke-width: 1.5; }
.orb:hover svg { transform: rotate(15deg); }

/* ============ ORBITAL NAVIGATION ============ */
.omap {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: auto;
  background: rgba(1, 5, 10, 0.86);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  opacity: 0;
  transition: opacity 0.22s ease;
}
.omap.open { opacity: 1; }
.omap-panel {
  width: min(940px, 100%);
  max-height: calc(100dvh - 48px);
  overflow: auto;
  padding: 32px;
  scrollbar-width: thin;
  scrollbar-color: #254859 transparent;
  border: 1px solid rgba(124, 188, 207, 0.25);
  border-radius: 8px;
  background: radial-gradient(ellipse at 0 65%, #0a24312b, transparent 60%), #061019;
  box-shadow: 0 30px 100px #0008;
  transform: translateY(10px);
  transition: transform 0.22s ease;
}
.omap.open .omap-panel { transform: none; }
.omap-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.omap-eyebrow { font: 10px/1.5 var(--font-m); letter-spacing: 0.2em; color: var(--cyan); margin-bottom: 10px; }
.omap-header h2 { font: 500 clamp(20px, 2.3vw, 27px)/1.5 var(--font-d); letter-spacing: -0.02em; }
.omap-intro { margin-top: 8px; font: 14px/1.7 "Segoe UI", sans-serif; color: #91a9ba; }
.omap-close { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 4px; color: var(--dim); background: transparent; cursor: pointer; transition: color 0.2s, background 0.2s; }
.omap-close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.omap-close:hover { color: var(--cyan); background: #0b2532; }
.omap-body { display: grid; grid-template-columns: 0.8fr 1.5fr; gap: 32px; align-items: center; padding: 26px 0; }
.omap-home { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 8px; color: var(--ink); }
.omap-chart { width: 100%; max-width: 255px; }
.chart-axis { stroke: #7d97a825; }
.chart-ring { stroke: #3d697c; stroke-width: 0.75; }
.chart-inner { stroke: #7d97a845; stroke-dasharray: 2 6; }
.chart-center { stroke: #41f2ff55; fill: #09202b; }
.chart-arc { stroke: var(--cyan); stroke-width: 1.25; opacity: 0.75; }
.chart-points { fill: #07131f; stroke: #7ba5b6; stroke-width: 1; }
.chart-beacon { fill: var(--cyan); stroke: #061019; stroke-width: 3; }
.omap-chart text { fill: var(--ink); font: 600 19px var(--font-d); }
.omap-home-name { display: block; margin-top: 10px; font: 15px/1.5 "Segoe UI", sans-serif; }
.omap-home-caption { display: block; margin-top: 8px; font: 9px/1.5 var(--font-m); letter-spacing: 0.12em; color: var(--dim); }
.omap-home:hover .omap-home-caption { color: var(--cyan); }
.omap-system { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.onode { position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr) 12px; gap: 8px; align-items: start; min-height: 86px; padding: 16px 12px; text-align: start; color: var(--ink); border: 1px solid rgba(124, 188, 207, 0.17); border-radius: 4px; background: #081720; transition: background 0.2s, border-color 0.2s; }
.onode-number { padding-top: 2px; font: 10px/1.5 var(--font-m); color: #6b8c9f; }
.onode-copy { min-width: 0; }
.onode-name { display: block; font: 12px/1.5 var(--font-m); letter-spacing: 0.04em; }
.onode-description { display: block; margin-top: 5px; font: 11px/1.5 "Segoe UI", sans-serif; color: #91a9ba; }
.onode-arrow { font: 14px/1.5 "Segoe UI", sans-serif; color: #6b8c9f; transition: color 0.2s, transform 0.2s; }
.onode:hover, .onode:focus-visible { background: #0c2532; border-color: #41f2ff70; }
.onode:hover .onode-name, .onode:focus-visible .onode-name { color: var(--cyan); }
.onode:hover .onode-arrow { color: var(--cyan); transform: translate(1px, -1px); }
.omap-footer { display: flex; justify-content: space-between; gap: 20px; padding-top: 18px; border-top: 1px solid var(--line); color: #7893a4; font: 10px/1.5 var(--font-m); letter-spacing: 0.1em; }
.omap-footer kbd { font: inherit; border: 1px solid var(--line); padding: 2px 5px; border-radius: 3px; margin-inline-end: 5px; color: var(--ink); }
@media (max-width: 680px) {
  .omap { padding: 12px; }
  .omap-panel { padding: 22px 18px; max-height: calc(100dvh - 24px); }
  .omap-header { padding-bottom: 20px; }
  .omap-header h2 { font-size: 21px; }
  .omap-intro { font-size: 13px; }
  .omap-body { grid-template-columns: 1fr; gap: 20px; padding: 20px 0; }
  .omap-home { align-items: flex-start; text-align: start; padding: 0; }
  .omap-chart { display: none; }
  .omap-home-name { margin-top: 0; font-size: 14px; }
  .omap-home-caption { margin-top: 4px; }
  .onode { grid-template-columns: 18px minmax(0, 1fr); min-height: 86px; padding: 13px 10px; gap: 5px; }
  .onode-arrow { display: none; }
  .onode-name { font-size: 11px; }
}
@media (max-width: 380px) {
  .hud-brand .brand-meta { display: none; }
  .omap-panel { padding: 18px 14px; }
  .omap-system { gap: 8px; }
}

/* ============ COMMAND PALETTE ============ */

.palette {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: rgba(1, 3, 7, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: grid;
  place-items: start center;
  padding-top: 16vh;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.palette.open { opacity: 1; }

.palette-panel {
  width: min(620px, calc(100vw - 40px));
  background: var(--panel-bg);
  border: 1px solid var(--line-2);
  clip-path: var(--clip);
  box-shadow: var(--glow), 0 30px 80px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

.palette-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.palette-prompt { font-family: var(--font-m); color: var(--cyan); font-size: 15px; }

.palette-head input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--ink);
  font-family: var(--font-m);
  font-size: 15px;
  letter-spacing: 0.06em;
}

.palette-head input::placeholder { color: var(--faint); }

.palette-head kbd {
  font-family: var(--font-m);
  font-size: 9px;
  color: var(--faint);
  border: 1px solid var(--line);
  padding: 3px 7px;
}

.palette-list { list-style: none; max-height: 320px; overflow-y: auto; }

.palette-list li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 22px;
  font-family: var(--font-m);
  font-size: 12.5px;
  letter-spacing: 0.1em;
  color: var(--dim);
  cursor: pointer;
  border-inline-start: 2px solid transparent;
}

.palette-list li .pl-idx { color: var(--faint); font-size: 10px; }
.palette-list li .pl-name { color: var(--ink); }
.palette-list li .pl-desc { margin-inline-start: auto; font-size: 10px; color: var(--faint); }

.palette-list li.sel, .palette-list li:hover {
  background: rgba(65, 242, 255, 0.08);
  border-inline-start-color: var(--cyan);
}

.palette-list li.sel .pl-name { color: var(--cyan); }

.palette-foot {
  padding: 10px 22px;
  font-family: var(--font-m);
  font-size: 9.5px;
  letter-spacing: 0.2em;
  color: var(--faint);
  border-top: 1px solid var(--line);
}

/* ============ MAIN FEED / MODULES ============ */

#feed { position: relative; z-index: 10; }

.module {
  position: relative;
  width: min(1180px, calc(100% - clamp(32px, 7vw, 96px)));
  margin: 0 auto;
  padding: clamp(90px, 13vh, 150px) 0;
}

/* module index marker on the left rail */
.module::before {
  content: attr(data-index) " // " attr(data-name);
  position: absolute;
  top: clamp(40px, 7vh, 80px);
  left: -10px;
  font-family: var(--font-m);
  font-size: 9.5px;
  letter-spacing: 0.34em;
  color: var(--faint);
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

.mod-head { margin-bottom: clamp(36px, 6vh, 64px); }

.mod-eyebrow {
  font-size: 11px;
  color: var(--cyan);
  letter-spacing: 0.24em;
  margin-bottom: 14px;
  text-shadow: 0 0 14px rgba(65, 242, 255, 0.5);
}

h2 {
  font-size: clamp(26px, 4.6vw, 52px);
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.12;
  color: #fff;
  text-shadow: 0 0 30px rgba(65, 242, 255, 0.25);
}

.mod-sub { margin-top: 16px; color: var(--dim); max-width: 640px; }

/* ---- generic holo panel ---- */
.panel {
  position: relative;
  background: var(--panel-bg);
  border: 1px solid var(--line);
  clip-path: var(--clip);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.panel::after {
  /* scanlines */
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(180deg, rgba(65, 242, 255, 0.025) 0 1px, transparent 1px 4px);
}

.panel-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  font-size: 9.5px;
  letter-spacing: 0.24em;
  color: var(--dim);
  border-bottom: 1px solid var(--line);
  background: rgba(65, 242, 255, 0.04);
}

.panel-id { margin-inline-start: auto; color: var(--faint); }

.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
}

.dot.live { background: var(--ok); box-shadow: 0 0 10px var(--ok); animation: blink 1.6s ease-in-out infinite; }
.dot.warn { background: var(--amber); box-shadow: 0 0 10px var(--amber); }

@keyframes blink { 50% { opacity: 0.25; } }

/* ---- buttons ---- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 26px;
  font-family: var(--font-d);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--ink);
  border: 1px solid var(--line-2);
  background: rgba(65, 242, 255, 0.05);
  clip-path: polygon(0 10px, 10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
  transition: background 0.25s, color 0.25s, box-shadow 0.25s, border-color 0.25s;
  cursor: pointer;
}

.btn:hover { background: rgba(65, 242, 255, 0.16); box-shadow: var(--glow); border-color: var(--cyan); color: #fff; }

.btn-solid {
  background: linear-gradient(120deg, rgba(65, 242, 255, 0.92), rgba(0, 149, 235, 0.92));
  color: #021018;
  border-color: transparent;
  box-shadow: 0 0 28px rgba(65, 242, 255, 0.35);
}

.btn-solid:hover { background: linear-gradient(120deg, #9ff8ff, #28b1ff); color: #021018; box-shadow: 0 0 40px rgba(65, 242, 255, 0.6); }

.btn-ghost { border-style: dashed; color: var(--dim); }

/* ---- reveal & decode ---- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1); transition-delay: calc(var(--d, 0) * 90ms); }
.reveal.in { opacity: 1; transform: none; }

.decode { display: inline-block; }

/* ============ 00 — HERO ============ */

.hero { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding-top: calc(var(--hud-h) + 30px); }

.hero-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: clamp(24px, 5vw, 60px);
}

.hero-over { font-size: 10.5px; color: var(--ok); letter-spacing: 0.3em; margin-bottom: 22px; }

.hero-name { display: flex; flex-direction: column; gap: 2px; color: #fff; line-height: 1.02; }

.hero-name span:first-child {
  font-size: clamp(22px, 3.4vw, 40px);
  font-weight: 500;
  letter-spacing: 0.22em;
  color: var(--dim);
}

.hero-name-big {
  font-size: clamp(56px, 11vw, 134px);
  font-weight: 900;
  letter-spacing: 0.06em;
  background: linear-gradient(110deg, #ffffff 20%, var(--cyan) 55%, var(--cyan-deep) 85%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 28px rgba(65, 242, 255, 0.35));
}

.hero-role { margin-top: 18px; font-size: 11.5px; color: var(--cyan); letter-spacing: 0.22em; }
.hero-role i { color: var(--faint); font-style: normal; margin: 0 6px; }

.hero-bio { margin-top: 26px; max-width: 560px; color: var(--dim); }
.hero-bio b { color: var(--ink); font-weight: 700; }

.hero-cta { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 34px; }

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(20px, 4vw, 52px);
  list-style: none;
  margin-top: 46px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.hero-stats li { display: flex; flex-direction: column; }

.hero-stats b {
  font-size: clamp(22px, 2.6vw, 32px);
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 18px rgba(65, 242, 255, 0.4);
}

.hero-stats span { font-family: var(--font-m); font-size: 9px; letter-spacing: 0.26em; color: var(--faint); margin-top: 4px; }

/* hologram figure */
.hero-holo { position: relative; justify-self: center; width: min(440px, 86vw); }

.holo-disc {
  position: absolute;
  bottom: -4%;
  left: 50%;
  transform: translateX(-50%) rotateX(72deg);
  width: 115%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(65, 242, 255, 0.30) 0%, rgba(65, 242, 255, 0.08) 42%, transparent 65%);
  border: 1px solid rgba(65, 242, 255, 0.35);
  box-shadow: 0 0 60px rgba(65, 242, 255, 0.3);
  animation: disc-pulse 4s ease-in-out infinite;
}

@keyframes disc-pulse { 50% { box-shadow: 0 0 100px rgba(65, 242, 255, 0.5); } }

.holo-person {
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 0 22px rgba(65, 242, 255, 0.28)) drop-shadow(0 30px 50px rgba(0, 0, 0, 0.6));
  -webkit-mask-image: linear-gradient(180deg, black 86%, transparent 99%);
  mask-image: linear-gradient(180deg, black 86%, transparent 99%);
}

.holo-scan {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 0%, rgba(65, 242, 255, 0.18) 48%, rgba(65, 242, 255, 0.5) 50%, rgba(65, 242, 255, 0.18) 52%, transparent 100%);
  background-size: 100% 220%;
  animation: scan 5s linear infinite;
  mix-blend-mode: screen;
  opacity: 0.55;
  /* feather the overlay so the glow dissolves — no hard box edges */
  -webkit-mask-image: radial-gradient(ellipse 60% 56% at 50% 46%, black 32%, transparent 74%);
  mask-image: radial-gradient(ellipse 60% 56% at 50% 46%, black 32%, transparent 74%);
}

@keyframes scan { 0% { background-position: 0 120%; } 100% { background-position: 0 -120%; } }

.htag {
  position: absolute;
  z-index: 4;
  font-size: 8.5px;
  line-height: 1.7;
  letter-spacing: 0.18em;
  color: var(--cyan);
  padding: 8px 12px;
  background: rgba(2, 10, 18, 0.78);
  border: 1px solid var(--line);
  border-inline-start: 2px solid var(--cyan);
  text-align: start;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.htag::before {
  content: "";
  position: absolute;
  width: 30px;
  height: 1px;
  background: linear-gradient(90deg, var(--cyan), transparent);
}

.htag.t1 { top: 13%; left: -10%; animation: float 7s ease-in-out infinite; }
.htag.t1::before { right: -30px; top: 50%; }
.htag.t2 { top: 44%; right: -14%; animation: float 8s ease-in-out 1s infinite; }
.htag.t2::before { left: -30px; top: 50%; transform: scaleX(-1); }
.htag.t3 { bottom: 16%; left: -14%; animation: float 9s ease-in-out 2s infinite; }
.htag.t3::before { right: -30px; top: 50%; }

@keyframes float { 50% { transform: translateY(-9px); } }

.scroll-cue {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 9px;
  letter-spacing: 0.34em;
  color: var(--faint);
}

.scroll-cue i {
  width: 1px;
  height: 44px;
  background: linear-gradient(180deg, var(--cyan), transparent);
  animation: cue 1.8s ease-in-out infinite;
}

@keyframes cue { 0% { transform: scaleY(0); transform-origin: top; } 60% { transform: scaleY(1); transform-origin: top; } 100% { opacity: 0; } }

/* ============ 01 — MISSION DECK ============ */

.deck-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.deck-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 280px;
  padding: 26px 20px;
  background: var(--panel-bg);
  border: 1px solid var(--line);
  clip-path: var(--clip);
  color: var(--dim);
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.3s, box-shadow 0.3s, background 0.3s;
}

.deck-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(220px 160px at var(--mx, 50%) var(--my, 0%), rgba(65, 242, 255, 0.14), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
}

.deck-card:hover { transform: translateY(-8px); border-color: var(--line-2); box-shadow: var(--glow); background: rgba(8, 20, 32, 0.85); }
.deck-card:hover::before { opacity: 1; }

.deck-card img { width: 64px; height: 64px; object-fit: contain; filter: drop-shadow(0 0 12px rgba(65, 242, 255, 0.5)); }
.nawa-orbit { display: block; width: 64px; height: 64px; flex: none; }
.deck-card .nawa-orbit img { display: block; filter: none; }

.deck-card h3 { font-size: 13px; font-weight: 800; letter-spacing: 0.16em; color: var(--ink); line-height: 1.5; }

.deck-card p { font-size: 12px; line-height: 1.7; }

.deck-go { margin-top: auto; font-size: 9.5px; letter-spacing: 0.26em; color: var(--cyan); opacity: 0; transform: translateX(-8px); transition: opacity 0.3s, transform 0.3s; }

.deck-card:hover .deck-go { opacity: 1; transform: none; }

/* ============ 02 — PODCAST ============ */

.podcast-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
}

.pod-mic { position: relative; }

.pod-mic img {
  position: relative;
  z-index: 2;
  width: min(420px, 100%);
  margin: 0 auto;
  mix-blend-mode: screen;
  filter: drop-shadow(0 0 30px rgba(65, 242, 255, 0.2)) brightness(1.1);
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 50% 42%, black 55%, transparent 78%);
  mask-image: radial-gradient(ellipse 75% 70% at 50% 42%, black 55%, transparent 78%);
}

.pod-rings { position: absolute; inset: 0; z-index: 1; }

.pod-rings i {
  position: absolute;
  left: 50%; top: 42%;
  width: 70%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(65, 242, 255, 0.3);
  transform: translate(-50%, -50%);
  animation: ripple 3.6s ease-out infinite;
}

.pod-rings i:nth-child(2) { animation-delay: 1.2s; }
.pod-rings i:nth-child(3) { animation-delay: 2.4s; }

@keyframes ripple {
  0% { transform: translate(-50%, -50%) scale(0.55); opacity: 0.9; }
  100% { transform: translate(-50%, -50%) scale(1.45); opacity: 0; }
}

.pod-console { padding-bottom: 26px; }
.pod-console > p { padding: 22px 26px 0; color: var(--dim); }
.pod-console b { color: var(--ink); }

.pod-wave { display: block; width: 100%; height: 120px; border-bottom: 1px solid var(--line); }

.pod-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; padding: 22px 26px 0; }

.pod-rating { display: flex; align-items: center; gap: 14px; }
.pod-rating img { width: 132px; filter: drop-shadow(0 0 10px rgba(255, 193, 77, 0.5)); }
.pod-rating span { font-size: 10px; color: var(--amber); letter-spacing: 0.2em; }

.pod-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-inline-start: auto; }

/* ============ 03 — TV ============ */

.tv h2 { font-family: var(--font-d), var(--font-a); }

.tv-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.tv-key { display: flex; flex-direction: column; }

.tv-key img { width: 100%; flex: 1; object-fit: cover; filter: saturate(1.1) contrast(1.05); }

.tv-key figcaption { padding: 12px 18px; font-size: 9.5px; letter-spacing: 0.24em; color: var(--faint); border-top: 1px solid var(--line); }

.season { display: flex; flex-direction: column; gap: 16px; padding-bottom: 26px; }
.season h3 { padding: 18px 26px 0; font-size: 19px; font-weight: 800; letter-spacing: 0.12em; color: #fff; }
.season p { padding: 0 26px; font-size: 13px; color: var(--dim); flex: 1; }
.season .btn { margin: 0 26px; align-self: flex-start; }

.tv-orbit { margin-top: clamp(48px, 8vh, 90px); }

.orrery-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 4.5 / 1;
}

.orrery-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  animation: drift 26s ease-in-out infinite;
  filter: drop-shadow(0 12px 40px rgba(0, 0, 0, 0.8));
  transition: opacity 0.9s ease;
}

.orrery-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.9s ease;
}

.orrery-stage.is-live .orrery-fallback { opacity: 0; animation: none; }
.orrery-stage.is-live .orrery-canvas { opacity: 1; }

@keyframes drift { 0%, 100% { transform: translateX(-1.5%); } 50% { transform: translateX(1.5%); } }

.orrery-cap {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  margin-top: 18px;
  font-size: 9px;
  letter-spacing: 0.3em;
  color: var(--faint);
}

#orreryReadout { transition: color 0.25s; }

.tv-orbit:has(.is-scanning) #orreryReadout {
  color: var(--cyan);
  text-shadow: 0 0 12px rgba(65, 242, 255, 0.5);
}

.orrery-credit { text-align: end; }

/* ============ 04 — TALKS ============ */

.talks-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
}

.talks-photo { overflow: visible; }
.talks-photo img { width: 100%; filter: saturate(1.05); }

.talks-cap {
  display: flex;
  justify-content: space-between;
  padding: 12px 18px;
  font-size: 9.5px;
  letter-spacing: 0.24em;
  color: var(--faint);
  border-top: 1px solid var(--line);
}

.htag.t-stage { top: 7%; right: 4%; }

.talks-copy { display: flex; flex-direction: column; gap: 26px; color: var(--dim); }
.talks-copy b { color: var(--ink); }

.quote-panel { padding-bottom: 24px; }
.quote-panel p { padding: 18px 24px; color: var(--dim); }
.quote-panel .btn { margin: 0 24px; }

/* ============ 05 — STORY / FILM ============ */

.film {
  display: flex;
  gap: 22px;
  overflow-x: auto;
  padding: 10px 4px 22px;
  scroll-snap-type: x mandatory;
  cursor: grab;
  scrollbar-width: thin;
  scrollbar-color: var(--cyan-deep) transparent;
}

.film:active { cursor: grabbing; }

.film::-webkit-scrollbar { height: 4px; }
.film::-webkit-scrollbar-thumb { background: var(--cyan-deep); }

.frame {
  flex: 0 0 min(640px, 86%);
  scroll-snap-align: center;
  position: relative;
  border: 1px solid var(--line);
  background: var(--panel-bg);
  clip-path: var(--clip);
  padding: 12px;
}

.frame img { width: 100%; }

.frame figcaption {
  padding: 12px 8px 4px;
  font-size: 9.5px;
  letter-spacing: 0.26em;
  color: var(--faint);
}

.film-hint { margin-top: 6px; text-align: center; font-size: 9px; letter-spacing: 0.3em; color: var(--faint); }

/* ============ 06 — BOOKS ============ */

.codex-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 36px);
  perspective: 1400px;
}

.codex { padding-bottom: 0; transform-style: preserve-3d; will-change: transform; }

.codex img { width: 100%; }

.codex figcaption {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 24px 24px;
  border-top: 1px solid var(--line);
}

.codex figcaption b { font-family: var(--font-a); font-size: 19px; color: #fff; }
.codex figcaption span { font-size: 12px; color: var(--dim); }

/* ============ 07 — AI ============ */

.ai-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
}

#aiNet { display: block; width: 100%; height: auto; }

.ai-copy { display: flex; flex-direction: column; gap: 26px; color: var(--dim); }
.ai-copy b { color: var(--ink); }

.ai-facts { list-style: none; display: flex; flex-direction: column; gap: 12px; }

.ai-facts li {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--dim);
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-inline-start: 2px solid var(--cyan);
  background: rgba(65, 242, 255, 0.03);
}

/* ============ 08 — UPLINK ============ */

.uplink-panel { padding-bottom: 34px; }
.uplink-panel h2 { padding: 26px 30px 0; }
.uplink-panel > p { padding: 12px 30px 8px; color: var(--dim); }

.uplink-rows { display: flex; flex-direction: column; margin-top: 14px; }

.urow {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 30px;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--dim);
  border-top: 1px solid var(--line);
  transition: background 0.25s, padding-left 0.25s;
}

.urow:hover { background: rgba(65, 242, 255, 0.07); padding-inline-start: 40px; }

.ulabel { width: 110px; color: var(--faint); font-size: 10px; }
.uval { color: var(--ink); }
.ugo { margin-inline-start: auto; color: var(--cyan); }

.site-end {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: clamp(60px, 9vh, 110px);
  text-align: center;
}

/* Keep the recovered 169px bitmap sharp on high-density displays. */
.end-logo { width: 72px; max-width: 100%; height: auto; opacity: 0.9; filter: drop-shadow(0 0 8px rgba(65, 242, 255, 0.25)); }

.site-end p { font-size: 9.5px; letter-spacing: 0.26em; color: var(--dim); }

.end-top { margin-top: 16px; }

/* ============ TELEMETRY TICKER ============ */

.hud-bottom {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 34px;
  padding: 0 clamp(14px, 2.5vw, 30px);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  color: var(--faint);
  background: linear-gradient(0deg, rgba(2, 5, 10, 0.94), rgba(2, 5, 10, 0.7) 75%, transparent);
  border-top: 1px solid rgba(65, 242, 255, 0.10);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.tick-label { color: var(--cyan); flex: 0 0 auto; }

.ticker { flex: 1; overflow: hidden; }

.ticker-track { display: inline-block; white-space: nowrap; animation: tick 70s linear infinite; }

.ticker-track span { margin-right: 64px; }
.ticker-track b { color: var(--dim); font-weight: 400; }

@keyframes tick { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

.tick-prog { flex: 0 0 auto; color: var(--cyan); font-variant-numeric: tabular-nums; }

/* ============ TOAST ============ */

.toast {
  position: fixed;
  bottom: 56px;
  left: 50%;
  z-index: 96;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  padding: 16px 30px;
  background: var(--panel-bg);
  border: 1px solid var(--line-2);
  clip-path: var(--clip);
  box-shadow: var(--glow);
  transform: translate(-50%, 20px);
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  text-align: center;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast b { font-family: var(--font-a); font-size: 16px; color: #fff; }
.toast span { font-size: 9px; letter-spacing: 0.26em; color: var(--cyan); }

/* ============ RESPONSIVE ============ */

@media (max-width: 1280px) {
  .deck-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1100px) {
  .deck-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .deck-card { min-height: 240px; }
  .tv-grid { grid-template-columns: 1fr 1fr; }
  .tv-key { grid-column: 1 / -1; max-height: 420px; }
  .tv-key img { object-position: center 30%; }
}

@media (max-width: 880px) {
  .hero-stage { grid-template-columns: 1fr; }
  .hero-holo { order: -1; width: min(330px, 70vw); }
  .htag.t1 { left: -4%; } .htag.t2 { right: -4%; } .htag.t3 { left: -4%; }
  .podcast-grid, .talks-grid, .ai-grid { grid-template-columns: 1fr; }
  .pod-mic img { width: min(300px, 80%); }
  .talks-photo { order: -1; }
  .module::before { display: none; }
  .hide-m { display: none; }
  .hud-readouts { gap: 14px; }
}

@media (max-width: 640px) {
  body { font-size: 14px; }
  .hud-top { gap: 12px; }
  .brand-meta i { display: none; }
  .chip-key { display: none; }
  .hide-s { display: none; }
  .deck-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .deck-card { min-height: 0; padding: 20px 16px; }
  .tv-grid { grid-template-columns: 1fr; }
  .codex-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 18px 28px; }
  .frame { flex-basis: 92%; }
  .hud-bottom { font-size: 8.5px; }
  .orrery-stage { aspect-ratio: 2.4 / 1; }
  .orrery-cap { flex-direction: column; gap: 6px; }
  .orrery-credit { text-align: start; }
  .hero { padding-top: calc(var(--hud-h) + 16px); }
  .scroll-cue { display: none; }
}

/* ============ RTL — ARABIC INTERFACE ============ */

[dir="rtl"] body {
  font-family: "Cairo", "Orbitron", "Segoe UI", sans-serif;
  line-height: 1.95;
}

[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4,
[dir="rtl"] .btn {
  font-family: "Cairo", "Orbitron", sans-serif;
}

/* Arabic is a connected script — tracking must be zero everywhere */
[dir="rtl"], [dir="rtl"] * { letter-spacing: 0 !important; }

[dir="rtl"] h2 { line-height: 1.4; }

[dir="rtl"] .mono,
[dir="rtl"] .palette-head input {
  font-family: var(--font-m);
}

[dir="rtl"] .hero-name-big {
  line-height: 1.3;
  padding-bottom: 0.06em;            /* keep descenders inside the clipped gradient */
}

[dir="rtl"] .hero-role { font-size: 13px; }

[dir="rtl"] .module::before { display: none; }   /* vertical latin rail — off in Arabic */

[dir="rtl"] .boot-log { text-align: right; }

[dir="rtl"] .ticker-track { animation-name: tick-rtl; }

@keyframes tick-rtl {
  0% { transform: translateX(-50%); }
  100% { transform: translateX(0); }
}

[dir="rtl"] .deck-go { transform: translateX(8px); }
[dir="rtl"] .deck-card:hover .deck-go { transform: none; }

/* the language chip shows "EN" on the Arabic page — give it back its latin styling */
[dir="rtl"] .chip-ar {
  font-family: var(--font-m);
  font-size: 11px;
  letter-spacing: 0.12em !important;
}

/* ============ REDUCED MOTION ============ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001s !important; animation-iteration-count: 1 !important; transition-duration: 0.001s !important; }
  .reveal { opacity: 1; transform: none; }
  .holo-scan { display: none; }
}
