/* INTXA — "Deep Orbit" design system (LMS Spec §3) */

:root,
:root[data-theme="dark"] {
  --void: #060A1F;
  --orbit: #0D1433;
  --nebula: #16204A;
  --line: #25306B;
  --starlight: #E8EEFF;
  --haze: #9AA6D1;
  --ion: #4C8DFF;
  --ion-soft: #7AA8FF;
  --aurora: #2DD4BF;
  --solar: #FFC24B;
  --flare: #FF5C7A;
  --on-primary: #FFFFFF;
  --glow: 0 0 0 1px rgba(76, 141, 255, .35), 0 0 24px rgba(76, 141, 255, .18);
  --nav-bg: rgba(6, 10, 31, .72);
  --sky-edge: 154, 166, 209;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --void: #F6F8FF;
  --orbit: #FFFFFF;
  --nebula: #EDF1FD;
  --line: #D3DAF2;
  --starlight: #0A1238;
  --haze: #4A557F;
  --ion: #2359D6;
  --ion-soft: #2359D6;
  --aurora: #0A7266;
  --solar: #875400;
  --flare: #C8203F;
  --on-primary: #FFFFFF;
  --glow: 0 0 0 1px rgba(35, 89, 214, .3), 0 6px 24px rgba(35, 89, 214, .12);
  --nav-bg: rgba(246, 248, 255, .78);
  --sky-edge: 74, 85, 127;
  color-scheme: light;
}

:root {
  --font: "Readex Pro", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --font-read: "IBM Plex Sans Arabic", "Readex Pro", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --fs-xs: .8rem; --fs-sm: .882rem; --fs-base: 1.0625rem; --fs-lg: 1.3125rem;
  --fs-xl: 1.656rem; --fs-2xl: 2.0625rem; --fs-3xl: 2.594rem; --fs-hero: clamp(2.25rem, 4.6vw, 3.75rem);
  --r-input: 2px; --r-card: 10px; --r-panel: 20px; --r-pill: 999px;
  --ease: cubic-bezier(.2, 0, 0, 1);
  --wrap: 1280px;
  --gutter: clamp(16px, 4vw, 32px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--void);
  color: var(--starlight);
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.75;
  overflow-x: hidden;
}
html[lang="en"] body { line-height: 1.6; }
h1, h2, h3 { line-height: 1.25; margin: 0; font-weight: 600; }
p { margin: 0; }
a { color: var(--ion-soft); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; color: inherit; }
img, svg, canvas { display: block; }
::selection { background: var(--ion); color: var(--on-primary); }

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

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.muted { color: var(--haze); }
.small { font-size: var(--fs-sm); }
.icon { width: 20px; height: 20px; flex: none; }
[dir="rtl"] .icon-dir { transform: scaleX(-1); }

.skip {
  position: absolute; inset-inline-start: 16px; top: -60px; z-index: 100;
  background: var(--ion); color: var(--on-primary); padding: 8px 16px; border-radius: var(--r-card);
}
.skip:focus { top: 12px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px; border-radius: var(--r-pill);
  border: 1px solid transparent; cursor: pointer; font-weight: 500; font-size: var(--fs-base);
  text-decoration: none; white-space: nowrap;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease), transform .15s var(--ease);
}
.btn:hover { text-decoration: none; }
.btn--primary,
button.btn--primary,
a.btn--primary,
input[type="submit"].btn--primary {
  background: var(--ion);
  color: #FFFFFF !important;
}
.btn--primary:hover,
.btn--primary:focus,
.btn--primary:active,
.btn--primary:visited {
  color: #FFFFFF !important;
  box-shadow: var(--glow);
}
.btn--primary *,
button.btn--primary *,
a.btn--primary * {
  color: inherit;
}
.btn--ghost { background: transparent; color: var(--starlight); border-color: var(--line); }
.btn--ghost:hover { background: var(--nebula); border-color: var(--ion); }
.btn--sm { min-height: 36px; padding: 6px 14px; font-size: var(--fs-sm); }
.btn--lg { min-height: 52px; padding: 12px 26px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: progress; }

.icon-btn {
  display: inline-flex; align-items: center; gap: 6px; min-width: 40px; height: 40px; justify-content: center;
  padding-inline: 10px; border-radius: var(--r-pill); border: 1px solid transparent;
  background: transparent; color: var(--haze); cursor: pointer; font-size: var(--fs-sm);
}
.icon-btn:hover { color: var(--starlight); background: var(--nebula); text-decoration: none; }

/* ---------- Nav (glass #1) ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--void);
  border-bottom: 1px solid var(--line);
}
@supports (backdrop-filter: blur(16px)) {
  .nav { background: var(--nav-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
}
.nav__inner { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--starlight); font-weight: 700; letter-spacing: .06em; font-size: 1.15rem; direction: ltr; }
.brand:hover { text-decoration: none; }
.brand__mark { width: 30px; height: 30px; color: var(--ion); fill: var(--ion); }
.brand__star { fill: var(--aurora); }
.nav__links { display: flex; gap: 4px; margin-inline-start: 8px; }
.nav__links a { color: var(--haze); padding: 8px 12px; border-radius: var(--r-pill); font-size: var(--fs-sm); }
.nav__links a:hover { color: var(--starlight); background: var(--nebula); text-decoration: none; }
.nav__actions { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; }
.nav__burger { display: none; }
.i-close { display: none; }
:root[data-theme="dark"] .i-moon, :root[data-theme="light"] .i-sun { display: none; }

@media (max-width: 960px) {
  .nav__links {
    display: none; position: absolute; inset-inline: 0; top: 68px; flex-direction: column; gap: 0;
    background: var(--orbit); border-bottom: 1px solid var(--line); padding: 8px var(--gutter) 16px; margin: 0;
  }
  .nav__links a { padding: 12px; font-size: var(--fs-base); border-radius: var(--r-card); }
  .nav.is-open .nav__links { display: flex; }
  .nav.is-open .i-menu { display: none; }
  .nav.is-open .i-close { display: block; }
  .nav__burger { display: inline-flex; }
  .icon-btn__label { display: none; }
}
@media (max-width: 520px) { .nav__cta { display: none; } }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(60% 50% at 30% 40%, rgba(76, 141, 255, .10), transparent 70%);
}
.hero__inner {
  position: relative; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 32px; align-items: center; min-height: min(760px, calc(100vh - 68px)); padding-block: 48px 64px;
}
.hero__title { font-size: var(--fs-hero); font-weight: 700; line-height: 1.2; }
html[lang="en"] .hero__title { letter-spacing: -.01em; }
.hero__lead { margin-top: 24px; font-size: var(--fs-lg); color: var(--haze); max-width: 40ch; line-height: 1.7; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero__note { margin-top: 16px; font-size: var(--fs-sm); color: var(--haze); max-width: 46ch; }

.constellation { margin: 0; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.constellation__stage { position: relative; aspect-ratio: 1 / 1; max-height: 620px; width: 100%; }
#skyCanvas { width: 100%; height: 100%; cursor: grab; touch-action: pan-y; }
#skyCanvas.is-hover { cursor: pointer; }
.sky-tip {
  position: absolute; z-index: 2; pointer-events: none; max-width: 240px;
  background: var(--nebula); border: 1px solid var(--line); border-radius: var(--r-card);
  padding: 8px 12px; font-size: var(--fs-sm); line-height: 1.5; box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
  transform: translate(-50%, calc(-100% - 14px));
}
.sky-tip b { display: block; font-weight: 600; }
.sky-tip span { color: var(--haze); font-size: var(--fs-xs); }
.constellation__cap { display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: center; text-align: center; font-size: var(--fs-sm); }
.constellation__stats { color: var(--starlight); font-weight: 500; }
.constellation__hint { color: var(--haze); }

.skill-list { font-size: var(--fs-sm); text-align: center; }
.skill-list summary { cursor: pointer; color: var(--ion-soft); display: inline-block; padding: 4px 8px; }
.skill-list[open] { text-align: start; }
.skill-list__cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px 24px; margin-top: 12px; padding: 16px; background: var(--orbit); border: 1px solid var(--line); border-radius: var(--r-card); max-height: 420px; overflow: auto; }
.skill-list h3 { font-size: var(--fs-sm); color: var(--aurora); margin-bottom: 4px; }
.skill-list ul { margin: 0; padding-inline-start: 18px; line-height: 1.6; }

@media (max-width: 960px) {
  .hero__inner { grid-template-columns: 1fr; min-height: 0; padding-block: 40px 48px; }
  .hero__lead { max-width: none; }
  .constellation__stage { aspect-ratio: 4 / 3; }
}

/* ---------- Principles ---------- */
.principles { border-block: 1px solid var(--line); background: var(--orbit); }
.principles__grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.principle { padding: 32px 24px; }
.principle + .principle { border-inline-start: 1px solid var(--line); }
.principle__t { font-size: var(--fs-lg); margin-bottom: 8px; }
.principle p { color: var(--haze); font-family: var(--font-read); }
@media (max-width: 760px) {
  .principles__grid { grid-template-columns: 1fr; }
  .principle { padding: 24px 0; }
  .principle + .principle { border-inline-start: 0; border-top: 1px solid var(--line); }
}

/* ---------- Sections ---------- */
.section { padding-block: clamp(64px, 9vw, 112px); }
.section--raised { background: var(--orbit); border-block: 1px solid var(--line); }
.section__head { max-width: 720px; margin-bottom: 48px; }
.section__title { font-size: var(--fs-3xl); }
.section__lead { margin-top: 12px; color: var(--haze); font-size: var(--fs-lg); font-family: var(--font-read); line-height: 1.7; }
@media (max-width: 640px) { .section__title { font-size: var(--fs-2xl); } .section__lead { font-size: var(--fs-base); } }

/* Steps */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; counter-reset: s; }
.step { position: relative; padding: 24px 20px; background: var(--orbit); border: 1px solid var(--line); border-radius: var(--r-card); }
.step__n {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-pill);
  border: 1px solid var(--ion); color: var(--ion-soft); font-weight: 600; margin-bottom: 16px; font-family: var(--font-mono);
}
.step__t { font-size: var(--fs-base); margin-bottom: 6px; }
.step__d { color: var(--haze); font-size: var(--fs-sm); line-height: 1.7; font-family: var(--font-read); }
@media (max-width: 1100px) { .steps { grid-template-columns: repeat(2, 1fr); } .step:last-child { grid-column: 1 / -1; } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }

/* ---------- Lab ---------- */
.lab { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.lab__play, .code, .check { background: var(--void); border: 1px solid var(--line); border-radius: var(--r-panel); }
.lab__play { padding: 20px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.lab__side { min-width: 0; }
.lab__toolbar { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; }
.seg { display: inline-flex; align-items: center; gap: 4px; background: var(--orbit); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 4px; }
.seg__label { font-size: var(--fs-xs); color: var(--haze); padding-inline: 8px 4px; }
.seg__btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 4px 12px; border-radius: var(--r-pill); cursor: pointer; font-size: var(--fs-sm); color: var(--haze); min-height: 32px; }
.seg__btn[aria-checked="true"] { background: var(--nebula); color: var(--starlight); box-shadow: inset 0 0 0 1px var(--line); }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot--a { background: var(--ion); }
.dot--b { background: var(--aurora); border-radius: 2px; transform: rotate(45deg); }
.lab__presets { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 12px;
  border: 1px solid var(--line); border-radius: var(--r-pill); background: transparent; cursor: pointer; font-size: var(--fs-sm); color: var(--haze);
}
.chip .icon { width: 16px; height: 16px; }
.chip:hover { color: var(--starlight); border-color: var(--ion); }
.lab__canvas-wrap { border-radius: var(--r-card); overflow: hidden; border: 1px solid var(--line); background: var(--orbit); }
#labCanvas { width: 100%; height: auto; aspect-ratio: 1; cursor: crosshair; touch-action: manipulation; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: var(--fs-sm); user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__track { position: relative; width: 40px; height: 24px; border-radius: var(--r-pill); background: var(--nebula); border: 1px solid var(--line); flex: none; transition: background-color .2s var(--ease); }
.switch__thumb { position: absolute; top: 3px; inset-inline-start: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--haze); transition: transform .2s var(--ease), background-color .2s var(--ease); }
.switch input:checked + .switch__track { background: var(--ion); border-color: var(--ion); }
.switch input:checked + .switch__track .switch__thumb { background: var(--on-primary); transform: translateX(16px); }
[dir="rtl"] .switch input:checked + .switch__track .switch__thumb { transform: translateX(-16px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--ion); outline-offset: 2px; }

.lab__run { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; justify-content: space-between; }
.lab__run .btn .icon { width: 16px; height: 16px; }
.metrics { display: flex; gap: 20px; margin: 0; }
.metrics div { text-align: center; }
.metrics dt { font-size: var(--fs-xs); color: var(--haze); }
.metrics dd { margin: 0; font-family: var(--font-mono); font-size: var(--fs-lg); direction: ltr; min-width: 4ch; }
.metrics dd.is-good { color: var(--aurora); }
.lab__msg { min-height: 1.5em; font-size: var(--fs-sm); color: var(--flare); }

.lab__side { display: flex; flex-direction: column; gap: 24px; }
.code { overflow: hidden; }
.code__bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); color: var(--haze); }
.code__bar > span:first-child { display: inline-flex; gap: 8px; align-items: center; }
.code__bar .icon { width: 16px; height: 16px; }
.code__lang { font-family: var(--font-mono); font-size: var(--fs-xs); }
.code__body, .code__out {
  margin: 0; padding: 16px; font-family: var(--font-mono); font-size: .8125rem; line-height: 1.65;
  overflow-x: auto; text-align: left; white-space: pre; tab-size: 4;
}
.code__body { max-height: 330px; color: var(--starlight); }
.code__out { border-top: 1px solid var(--line); background: var(--orbit); color: var(--aurora); max-height: 180px; }
.code__out.is-err { color: var(--flare); }
.code__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); }
.code__foot .icon { width: 16px; height: 16px; }
.tok-k { color: var(--ion-soft); } .tok-s { color: var(--solar); } .tok-c { color: var(--haze); font-style: italic; } .tok-n { color: var(--aurora); }

.check { padding: 20px; }
.check__title { font-size: var(--fs-xs); color: var(--haze); margin-bottom: 4px; }
.check__q { font-weight: 500; margin-bottom: 12px; font-family: var(--font-read); }
.check__opts { display: flex; flex-direction: column; gap: 8px; }
.check__opt {
  text-align: start; padding: 10px 14px; border-radius: var(--r-card); border: 1px solid var(--line);
  background: var(--orbit); cursor: pointer; line-height: 1.6; font-size: var(--fs-sm);
  transition: border-color .15s var(--ease), background-color .15s var(--ease);
}
.check__opt:hover { border-color: var(--ion); }
.check__opt.is-right { border-color: var(--aurora); background: color-mix(in srgb, var(--aurora) 12%, var(--orbit)); }
.check__opt.is-wrong { border-color: var(--flare); background: color-mix(in srgb, var(--flare) 10%, var(--orbit)); }
.check__fb { min-height: 1.5em; margin-block: 12px 8px; font-size: var(--fs-sm); font-family: var(--font-read); }
.check__fb.is-right { color: var(--aurora); } .check__fb.is-wrong { color: var(--flare); }

@media (max-width: 960px) { .lab { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Paths ---------- */
.paths { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.path {
  display: flex; flex-direction: column; gap: 12px; padding: 24px; background: var(--orbit);
  border: 1px solid var(--line); border-radius: var(--r-card);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.path:hover, .path:focus-within, .path.is-active { border-color: var(--ion); box-shadow: var(--glow); }
.path__top { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { font-size: var(--fs-xs); padding: 2px 10px; border-radius: var(--r-pill); background: var(--nebula); color: var(--ion-soft); border: 1px solid var(--line); }
.badge--muted { color: var(--haze); }
.path__t { font-size: var(--fs-lg); }
.path__d { color: var(--haze); font-size: var(--fs-sm); line-height: 1.7; font-family: var(--font-read); }
.path__courses { flex: 1; }
.path__courses { list-style: none; margin: 4px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.path__courses li { display: flex; gap: 10px; align-items: flex-start; font-size: var(--fs-sm); line-height: 1.7; }
.path__num {
  flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; margin-top: 1px;
  border-radius: var(--r-pill); border: 1px solid var(--line); color: var(--ion-soft);
  font-family: var(--font-mono); font-size: .75rem; line-height: 1;
}
.path__meta { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--haze); padding-top: 4px; }
.path__meta .icon { width: 16px; height: 16px; color: var(--aurora); }
.path__cta { align-self: flex-start; }
.path__cta .icon, .split .icon, .biz .btn .icon { width: 16px; height: 16px; }
.paths__note { margin-top: 16px; }
@media (max-width: 1100px) { .paths { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .paths { grid-template-columns: 1fr; } }

/* ---------- Projects ---------- */
.projects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.project { padding: 24px; background: var(--void); border: 1px solid var(--line); border-radius: var(--r-card); display: flex; flex-direction: column; gap: 8px; }
.project__path { font-size: var(--fs-xs); color: var(--aurora); }
.project__t { font-size: var(--fs-lg); }
.project__d { color: var(--haze); font-size: var(--fs-sm); line-height: 1.7; flex: 1; font-family: var(--font-read); }
.tags { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: var(--fs-xs); padding: 2px 8px; border-radius: var(--r-input); border: 1px solid var(--line); color: var(--haze); }
.honest { margin-top: 24px; padding: 16px 20px; border-inline-start: 2px solid var(--ion); background: var(--void); border-radius: var(--r-input); color: var(--haze); font-size: var(--fs-sm); }
@media (max-width: 1000px) { .projects { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .projects { grid-template-columns: 1fr; } }

/* ---------- Split / business ---------- */
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 32px; align-items: end; }
.split__action { justify-self: end; }
.biz { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.biz .btn { margin-top: 32px; }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.checks li { display: flex; gap: 12px; align-items: flex-start; font-family: var(--font-read); }
.checks .icon { color: var(--aurora); margin-top: 5px; }
.checks--sm { gap: 10px; font-size: var(--fs-sm); }
.checks--sm .icon { width: 16px; height: 16px; margin-top: 4px; }
@media (max-width: 860px) {
  .split, .biz { grid-template-columns: 1fr; gap: 24px; }
  .split__action { justify-self: start; }
}

/* ---------- Pricing ---------- */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: stretch; }
.plan { display: flex; flex-direction: column; gap: 12px; padding: 28px 24px; background: var(--orbit); border: 1px solid var(--line); border-radius: var(--r-card); }
.plan--featured { border-color: var(--ion); box-shadow: var(--glow); }
.plan__name { font-size: var(--fs-xl); }
.plan__desc { color: var(--haze); font-size: var(--fs-sm); }
.plan__price { min-height: 56px; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; padding-block: 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.plan__amount { font-size: var(--fs-3xl); font-weight: 700; font-family: var(--font-mono); }
.plan__tba { font-size: var(--fs-base); color: var(--starlight); font-weight: 500; }
.plan .checks { flex: 1; }
.plan__cta { margin-top: 12px; }
@media (max-width: 900px) { .plans { grid-template-columns: 1fr; max-width: 520px; } }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding-block: 40px; }
.footer__inner { display: flex; flex-wrap: wrap; gap: 24px 48px; justify-content: space-between; align-items: flex-start; }
.footer__inner .brand { margin-bottom: 8px; }
.footer__links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.footer__links a { color: var(--haze); font-size: var(--fs-sm); }
.footer__copy { width: 100%; }

/* ---------- Modal ---------- */
.modal {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 1px solid var(--line);
  border-radius: var(--r-panel); background: var(--orbit); color: var(--starlight);
}
.modal::backdrop { background: rgba(3, 5, 16, .72); }
.modal[open] { animation: pop .2s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.modal__body { position: relative; padding: 28px; display: flex; flex-direction: column; }
#joinFields { display: flex; flex-direction: column; gap: 14px; }
#joinFields[hidden] { display: none; }
.modal__close { position: absolute; top: 12px; inset-inline-end: 12px; }
.modal__title { font-size: var(--fs-xl); padding-inline-end: 40px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: var(--fs-sm); color: var(--haze); }
.field input, .field select {
  width: 100%; min-height: 44px; padding: 8px 12px; border-radius: var(--r-input);
  background: var(--nebula); border: 1px solid var(--line); color: var(--starlight);
}
.field input:focus, .field select:focus { border-color: var(--ion); outline: none; box-shadow: 0 0 0 2px color-mix(in srgb, var(--ion) 40%, transparent); }
.field input[aria-invalid="true"], .field select[aria-invalid="true"] { border-color: var(--flare); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .field-row { grid-template-columns: 1fr; } .modal__body { padding: 24px 20px; } }
.hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-err { min-height: 0; color: var(--flare); font-size: var(--fs-sm); }
.form-err:empty { display: none; }
.done { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; padding-block: 16px; }
.done[hidden] { display: none; }
.done__star { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--aurora) 16%, transparent); color: var(--aurora); animation: lit .4s var(--ease); }
.done__star .icon { width: 30px; height: 30px; }
.done .modal__title { padding: 0; }
@keyframes lit { from { transform: scale(.6); opacity: 0; box-shadow: 0 0 0 0 var(--aurora); } }

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

/* ---------- Arabic typography: comfortable line spacing ---------- */
html[lang="ar"] body { line-height: 1.95; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3 { line-height: 1.55; }
html[lang="ar"] .hero__title { line-height: 1.45; }
html[lang="ar"] .hero__lead { line-height: 2; }
html[lang="ar"] .hero__note { line-height: 1.95; }
html[lang="ar"] .section__lead { line-height: 2; }
html[lang="ar"] .section__head { margin-bottom: 56px; }
html[lang="ar"] .principle p,
html[lang="ar"] .step__d,
html[lang="ar"] .path__d,
html[lang="ar"] .project__d,
html[lang="ar"] .check__q,
html[lang="ar"] .check__fb,
html[lang="ar"] .checks li,
html[lang="ar"] .honest,
html[lang="ar"] .plan__desc { line-height: 1.95; }
html[lang="ar"] .path__courses li { line-height: 1.85; }
html[lang="ar"] .check__opt { line-height: 1.85; padding-block: 12px; }
html[lang="ar"] .step__t, html[lang="ar"] .principle__t { margin-bottom: 10px; }
html[lang="ar"] .constellation__cap, html[lang="ar"] .skill-list ul { line-height: 1.9; }
html[lang="ar"] .modal .muted { line-height: 1.9; }
html[lang="ar"] bdi { white-space: nowrap; }
