.home-page {
  --canvas: #080d19;
  --surface: #101a2a;
  --border: #304256;
  --text: #f2f6fa;
  --secondary: #c2d0df;
  --muted: #a2b6c9;
  --primary: #67f5d0;
  --preview-rule: #415d73;
  --preview-mono: "JetBrains Mono", monospace;
}

.home-page .wrap { width: min(1320px, calc(100% - 9vw)); }
.home-page .site-header { background: var(--canvas); }
.home-page .site-header::after { height: 1px; background: var(--border); }
.home-page .site-header nav > a { font-size: 16px; }
.home-page .header-store .store-badge img { height: 46px; }
.home-page .hero-columns { grid-template-columns: minmax(0, .78fr) minmax(0, 1.22fr); gap: clamp(24px, 3.4vw, 58px); }
.home-page .hero-copy { padding: 0; }
.home-page .hero h1 { font-size: clamp(47px, 5.65vw, 96px); line-height: 1.02; letter-spacing: -.052em; margin-block-end: 28px; }
html[lang=ar] .home-page .hero h1 { font-size: clamp(40px, 4.6vw, 74px); line-height: 1.34; letter-spacing: 0; }
.home-page .hero .lead { max-width: 29ch; font-size: clamp(18px, 1.65vw, 25px); line-height: 1.48; margin-block-end: 28px; }
html[lang=ar] .home-page .hero .lead { max-width: 38ch; line-height: 1.78; }
.home-page .hero-actions { align-items: center; gap: 12px 23px; }
.home-page .hero-badge img { width: clamp(185px, 16vw, 246px); height: auto; }
.home-page .hero-see { color: var(--text); font-size: 15px; text-decoration: underline; text-decoration-color: var(--muted); }
.home-page .hero-see:hover { color: var(--primary); }
.home-page .hero-beta-links { display: flex; flex-wrap: wrap; margin-block-start: 10px; }
.home-page .beta-link { padding: 0; border: 0; background: none; color: var(--secondary); text-decoration: underline; text-decoration-color: var(--muted); }
.home-page .beta-link:hover { color: var(--primary); background: none; }
html[dir=rtl] .home-page .arrow { transform: none; scale: -1 1; }

.home-page .section { padding-block: clamp(60px, 7vw, 108px); }
.home-page h2 { font-size: clamp(34px, 4.2vw, 66px); font-weight: 700; margin-block-end: 24px; }
.home-page .home-split, .home-page #local > .wrap, .home-page #faq > .wrap { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(38px, 7vw, 110px); align-items: start; }
.feature-heading { display: grid; grid-template-columns: 1.55fr 1fr; align-items: center; gap: 24px; }
.feature-heading p { margin: 0; font-size: clamp(18px, 1.8vw, 26px); max-width: 38ch; }
.feature-heading img { width: 100%; height: auto; max-height: 250px; mask-image: radial-gradient(ellipse 60% 60%, #000 51%, transparent 81%); }
.feature-rail { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-block-start: 24px; }
.feature-rail article { display: flex; gap: 17px; padding: 28px clamp(15px, 2.3vw, 36px); border-block-start: 1px solid var(--border); position: relative; }
.feature-rail article:not(:nth-child(3n+1))::before { content: ""; position: absolute; inset-block: 28px; inset-inline-start: 0; border-inline-start: 1px solid var(--border); }
.feature-rail article:nth-child(3n+1) { padding-inline-start: 0; }
.feature-rail .icon { color: var(--primary); margin-block-start: 3px; }
.feature-rail h3 { font-size: 20px; margin-block-end: 8px; }
.feature-rail p { font-size: 15px; margin: 0; }
.home-page #how { background: var(--surface); }
.home-page #how .text-link, .home-page #local .text-link { gap: 8px; }
.workflow-list { list-style: none; padding: 0; margin: 0; border-block-start: 1px solid var(--border); }
.workflow-list li { display: grid; grid-template-columns: 32px minmax(105px, .7fr) minmax(0, 1.3fr); align-items: baseline; gap: 20px; padding: 20px 16px; border-block-end: 1px solid var(--border); }
.workflow-list li:first-child { box-shadow: inset 3px 0 var(--primary); }
html[dir=rtl] .workflow-list li:first-child { box-shadow: inset -3px 0 var(--primary); }
.workflow-list li > span { font-family: var(--preview-mono); color: var(--muted); font-size: 13px; }
.workflow-list li:first-child > span { color: var(--primary); }
.workflow-list li h3 { margin: 0; font-size: 19px; }
.workflow-list li p { margin: 0; font-size: 15px; }
.home-page #ship .section-intro { margin: 0 0 34px; }
.home-page #local { border-block-start: 1px solid var(--border); }
.home-page #local > .wrap { padding: 0; border: 0; border-radius: 0; background: none; }
.home-page #local .local-layout { display: block; margin: 0; grid-column: auto; grid-row: auto; }
.home-page #local .local-layout > div { border-inline-start: 1px solid var(--border); padding: 0; padding-inline-start: 32px; }
.home-page #local h2, .home-page #faq h2, .home-page #requirements h2 { font-size: clamp(34px, 4.2vw, 66px); }
.home-page #requirements > .wrap { display: block; }
.home-page .requirements > div { grid-template-columns: minmax(130px, .55fr) minmax(0, 1.9fr); gap: 24px; }
.home-page .requirements > div:first-child { padding-block-start: 20px; }
.home-page .requirements dt { font-size: 16px; }
.home-page .requirements dd { font-size: 16px; }
.home-page #faq .faq-list { margin: 0; }
.home-page #faq summary { display: flex; align-items: center; gap: 18px; font-size: clamp(16px, 1.4vw, 21px); font-weight: 500; padding-block: 16px; }
.home-page #faq summary::after { content: none; }
.faq-chevron {
  width: 12px;
  height: 12px;
  margin-inline-start: auto;
  flex: none;
}
.home-page #faq details[open] .faq-chevron { rotate: 180deg; }
.home-page .cta {
  background: radial-gradient(ellipse at 4% -35%, #277d73 0, #14313f 42%, transparent 77%), url("/assets/img/mission-orbit-v1.webp") center 36% / cover, #0c1826;
  text-align: center;
  border-block-start: 1px solid var(--border);
}
.home-page .cta::before { display: none; }
.home-page .cta h2 { max-width: none; font-size: clamp(33px, 4.2vw, 62px); }
.home-page .cta .final-line { display: inline; color: inherit; }

@media (max-width: 1100px) {
  .home-page .hero-columns { grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); }
  .home-page .hero h1 { font-size: clamp(41px, 5.3vw, 68px); }
  .workflow-list li { gap: 12px; }
}
@media (max-width: 767px) {
  .home-page .wrap { width: calc(100% - 36px); }
  .home-page .hero-columns, .home-page .home-split, .home-page #local > .wrap, .home-page #faq > .wrap { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .home-page .hero h1 { font-size: clamp(36px, 11.5vw, 78px); margin-block-end: 22px; }
  html[lang=ar] .home-page .hero h1 { font-size: clamp(37px, 9.8vw, 66px); }
  .home-page .hero .lead { max-width: 40ch; }
  .home-page .hero-actions .store-control { width: auto; }
  .feature-rail { grid-template-columns: 1fr; }
  .feature-rail article { padding-inline: 0; padding-block: 23px; }
  .feature-rail article:not(:nth-child(3n+1))::before { display: none; }
  .feature-heading { grid-template-columns: 1fr; gap: 8px; }
  .feature-heading img { max-height: 175px; }
  .workflow-list li { grid-template-columns: 29px minmax(0, 1fr); padding-inline: 12px; }
  .workflow-list li p { grid-column: 2; }
  .home-page #local .local-layout > div { border: 0; padding: 0; }
  .home-page .requirements > div { grid-template-columns: minmax(0, 1fr); gap: 5px; }
}
.home-page .hero {
  padding-block: clamp(24px, 4vw, 58px) clamp(64px, 6vw, 94px);
}
.home-page .hero > .wrap {
  --hero-pad: clamp(20px, 3.25vw, 48px);
  padding: var(--hero-pad);
  border: 1px solid #293b56;
  border-radius: clamp(18px, 2.2vw, 32px);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 76% 36%, #142b43 0, transparent 58%),
    linear-gradient(160deg, #101b2c, #0b1120 58%, #101526);
}
html[dir=rtl] .home-page .hero > .wrap {
  background:
    radial-gradient(ellipse at 24% 36%, #142b43 0, transparent 58%),
    linear-gradient(200deg, #101b2c, #0b1120 58%, #101526);
}
.home-page .hero > .wrap::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background-image: linear-gradient(#a9c7e20a 1px, transparent 1px), linear-gradient(90deg, #a9c7e20a 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(#000, transparent 78%);
  pointer-events: none;
}
.home-page .hero-columns { grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: clamp(20px, 2.7vw, 40px); }
.home-page .hero h1 { font-size: clamp(40px, 5.3vw, 88px); }
.home-page .hero h1 .accent {
  background: linear-gradient(105deg, #b1d6ff, #70f3cb 53%, #9ac4fe 95%);
  background-clip: text;
  color: transparent;
}
html[dir=rtl] .home-page .hero h1 .accent {
  background-image: linear-gradient(255deg, #b1d6ff, #70f3cb 53%, #9ac4fe 95%);
}

.mission-display {
  margin: 0;
  width: 100%;
  min-width: 0;
  border: 1px solid #40556f;
  border-radius: 18px;
  background: linear-gradient(172deg, #121d2ec2 0%, #0d1628c2 54%, #091321 100%);
  box-shadow: 0 22px 55px #02061180, inset 0 1px #edfbff0b;
  overflow: hidden;
}
.demo-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-height: 54px;
  padding: 5px clamp(10px, 2vw, 20px);
  border-block-end: 1px solid #31445d;
  background: #0d172880;
}
.demo-top figcaption { margin: 0; font-weight: 600; font-size: 14px; color: var(--text); }
.demo-player {
  min-height: 44px;
  display: inline-flex;
  gap: 7px;
  align-items: center;
  border-radius: 8px;
  border: 1px solid #467180;
  padding: 5px 10px;
  background: #16293b;
  color: #a9f5e2;
  cursor: pointer;
  font-size: 12px;
  white-space: nowrap;
}
.demo-player:hover { background: #1b3547; }
.demo-player svg { width: 16px; height: 16px; flex: none; }
.demo-player [data-player-label], .demo-player [data-player-icon] { display: none; }
[data-player=play] [data-player-label=play], [data-player=play] [data-player-icon=play],
[data-player=pause] [data-player-label=pause], [data-player=pause] [data-player-icon=pause] { display: inline; }

.demo-space {
  --scene-height: clamp(182px, 20vw, 290px);
  height: var(--scene-height);
  direction: ltr;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 55%, #18516a57, transparent 63%);
}
.demo-space::after {
  content: "";
  position: absolute;
  inset: 16% 20%;
  background: radial-gradient(ellipse, #85ffda41, transparent 67%);
  opacity: 0;
  pointer-events: none;
  z-index: -1;
  transition: opacity 500ms ease;
}
[data-phase="4"] .demo-space::after { opacity: 1; }
.demo-glass {
  position: absolute;
  width: min(36%, calc(var(--scene-height) * .72));
  aspect-ratio: 1;
  height: auto;
  left: 50%;
  top: 51%;
  translate: -50% -50%;
  filter: drop-shadow(0 4px 23px #49d8e953);
}
.demo-orbit {
  --light: #ffba82;
  --tilt: 18deg;
  --orbit-speed: 6.1s;
  position: absolute;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--light) 46%, transparent);
  width: 77%;
  height: 42%;
  left: 50%;
  top: 51%;
  translate: -50% -50%;
  rotate: var(--tilt);
  pointer-events: none;
}
.demo-orbit-codex { --light: #8bc4ff; --tilt: -18deg; --orbit-speed: 5.2s; }
.demo-front { clip-path: inset(52% -4% -35% -4%); opacity: .78; }
.demo-orbit i {
  position: absolute;
  width: 8px;
  height: 8px;
  inset-inline-start: calc(100% - 4px);
  inset-block-start: calc(50% - 4px);
  border-radius: 50%;
  background: #f2fbff;
  box-shadow: 0 0 10px 3px var(--light), 0 0 22px 8px color-mix(in srgb, var(--light) 47%, transparent);
  opacity: .8;
}
@supports (offset-path: ellipse(50% 50%)) {
  .demo-orbit i {
    inset: 0 auto auto 0;
    offset-path: ellipse(50% 50%);
    animation: demo-orbit var(--orbit-speed) linear infinite paused;
  }
  .demo-orbit-codex i { animation-direction: reverse; animation-delay: -2s; }
  [data-running] .demo-orbit i { animation-play-state: running; }
}
@keyframes demo-orbit { to { offset-distance: 100%; } }

.demo-node {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #40556e;
  border-radius: 9px;
  padding: 5px 9px;
  color: #d9e6f2;
  background: #101c2e;
  font-size: clamp(10px, 1vw, 13px);
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
  transition: transform 350ms cubic-bezier(.22,1,.36,1), border-color 250ms, color 250ms;
}
.demo-node .icon { color: var(--node-light); width: 15px; height: 15px; }
.demo-input { --node-light: #b9d1ed; top: 6%; left: 50%; translate: -50%; }
.demo-output { --node-light: #78efcf; bottom: 6%; left: 50%; translate: -50%; }
.demo-builder { --node-light: #ffba82; left: 5%; bottom: 17%; }
.demo-reviewer { --node-light: #8bc4ff; right: 5%; bottom: 17%; }
[data-phase="0"] .demo-input, [data-phase="1"] .demo-builder, [data-phase="2"] .demo-reviewer,
[data-phase="3"] .demo-reviewer, [data-phase="4"] .demo-output {
  color: var(--node-light);
  border-color: var(--node-light);
  transform: translateY(-3px);
}

.demo-workbench { padding: 0 clamp(8px, 1.3vw, 17px) 12px; }
.demo-stages {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 3px;
  border-block-end: 1px solid #354a61;
}
.demo-stages button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 44px;
  padding: 5px 2px;
  line-height: 1.2;
  background: transparent;
  color: #adbed1;
  border: 0;
  border-radius: 6px 6px 0 0;
  border-block-end: 2px solid transparent;
  cursor: pointer;
  font-size: clamp(10px, .95vw, 13px);
}
.demo-stages button:disabled { cursor: default; }
.demo-stages button:hover:not(:disabled) { color: #fff; background: #172c40; }
.demo-stages button[aria-pressed="true"] { color: var(--primary); border-block-end-color: currentColor; background: #162b3d; }
.demo-stages button:focus-visible { outline-offset: -2px; }
.demo-index { font-family: var(--preview-mono); opacity: .72; font-size: 10px; }
.demo-file { background: #152237; padding: 6px 12px; border-radius: 7px 7px 0 0; margin-block-start: 8px; color: #d4e8fa; font-family: var(--preview-mono); font-size: 11px; }
.demo-code {
  display: block;
  margin: 0;
  padding: 10px 12px;
  min-height: 96px;
  background: #080f1c;
  border-radius: 0 0 7px 7px;
  color: #dae7f5;
  text-align: left;
  font: 12px/1.56 var(--preview-mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.demo-code code { font: inherit; display: grid; grid-auto-rows: minmax(1.56em, auto); }
.demo-line { display: grid; grid-template-columns: 2ch 1fr; gap: 1.2ch; min-width: 0; }
.demo-line-number { color: #91a7be; user-select: none; }
.syntax-keyword { color: #d6b2ff; }
.syntax-key { color: #9bcbff; }
.syntax-string, .syntax-comment { color: #88e8c7; }
.mission-display[data-running] [data-caret]::after {
  content: "";
  display: inline-block;
  height: .9em;
  border-inline-start: 2px solid var(--primary);
  vertical-align: -.1em;
  animation: demo-caret 850ms steps(1) infinite;
}
@keyframes demo-caret { 50% { opacity: 0; } }
.demo-detail { margin: 8px 0 0; min-height: 42px; color: #b9cfe1; font-size: 13px; line-height: 1.5; }

@media (max-width: 1120px) {
  .demo-index { display: none; }
}
@media (max-width: 1020px) {
  .demo-code { min-height: 120px; }
}
@media (max-width: 850px) {
  .home-page .hero-columns { grid-template-columns: minmax(0, 1fr); }
  .home-page .hero h1 { font-size: clamp(34px, 10vw, 72px); }
  html[lang=ar] .home-page .hero h1 { font-size: clamp(34px, 9.2vw, 64px); }
  .mission-display { max-width: 620px; justify-self: center; }
}
@media (max-width: 480px) {
  .home-page .hero { padding-block-start: 16px; }
  .home-page .hero > .wrap { --hero-pad: 13px; width: calc(100% - 24px); }
  .home-page .hero-columns { gap: 16px; }
  .home-page .hero-copy { padding: 12px 3px 0; }
  .home-page .hero h1 { margin-block-end: 16px; }
  html[lang=ar] .home-page .hero h1 { line-height: 1.27; }
  .home-page .hero .lead { font-size: 16px; line-height: 1.55; margin-block-end: 18px; }
  .home-page .hero-actions { gap: 8px 12px; }
  .home-page .hero-badge img { width: 164px; }
  .home-page .hero-see, .home-page .beta-link { font-size: 13px; }
  .home-page .hero-beta-links { margin-block-start: 4px; }
  .demo-space { --scene-height: 177px; }
  .demo-glass { width: min(44%, 136px); }
  .demo-code { font-size: 11px; min-height: 130px; padding: 8px; }
  .demo-line { gap: .7ch; }
  .demo-builder { left: 4%; bottom: 19%; }
  .demo-reviewer { right: 4%; bottom: 19%; }
}
@media (max-width: 360px) {
  .demo-code { min-height: 144px; }
}
@media (prefers-reduced-motion: reduce) {
  .demo-orbit i { animation: none; }
}

