:root {
  --bg: #0a0e17;
  --bg-soft: #0d1420;
  --panel: #111827;
  --panel-2: #0f1624;
  --border: #1f2a3a;
  --border-strong: #2b3a50;
  --text: #eef2f7;
  --muted: #97a3b6;
  --red: #e11d48;
  --red-hover: #be123c;
  --gold: #f59e0b;
  --green: #22c55e;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03), 0 16px 44px rgba(0, 0, 0, 0.24);
  --font: system-ui, -apple-system, "Segoe UI", Tahoma, "Noto Sans Arabic",
    "Noto Naskh Arabic", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: auto;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background-color: var(--bg);
  background-image: radial-gradient(
    900px 420px at 50% -180px,
    rgba(225, 29, 72, 0.12),
    transparent 70%
  );
  background-repeat: no-repeat;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
p {
  overflow-wrap: break-word;
}

code {
  font-family: var(--mono);
  font-size: 0.92em;
  color: var(--gold);
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.16);
  border-radius: 5px;
  padding: 1px 5px;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.wrap {
  width: min(1120px, calc(100% - 48px));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  top: 12px;
  inset-inline-start: 12px;
  z-index: 200;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
  font-size: 13px;
  font-weight: 700;
  transform: translateY(-200%);
  transition: transform 0.15s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

/* Header ------------------------------------------------------------------ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 14, 23, 0.98);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--red);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text strong {
  font-size: 15px;
  letter-spacing: 0.08em;
}

.brand-text small {
  color: var(--muted);
  font-size: 11px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-inline-start: auto;
}

.site-nav a {
  padding: 8px 11px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.site-nav a:hover {
  color: var(--text);
  background: var(--bg-soft);
}

.header-cta {
  flex: none;
}

/* Buttons ----------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease,
    color 0.15s ease, box-shadow 0.15s ease;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--red);
  color: #fff;
  box-shadow: 0 8px 20px rgba(225, 29, 72, 0.18);
}

.btn-primary:hover:not(:disabled) {
  background: var(--red-hover);
}

.btn-ghost {
  background: var(--bg-soft);
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-ghost:hover:not(:disabled) {
  background: #131d2d;
  border-color: #3a4d68;
}

.btn-sm {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 13px;
}

.btn-wide {
  min-width: 220px;
}

/* Hero -------------------------------------------------------------------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: 52px;
  padding-block: 64px 56px;
}

.hero-content {
  min-width: 0;
}

.eyebrow {
  display: inline-block;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.hero h1 {
  margin: 0 0 18px;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.12;
  letter-spacing: -1.2px;
}

.hero h1 span {
  display: block;
  color: var(--red);
}

.hero-lead {
  margin: 0 0 26px;
  max-width: 58ch;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.85;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 36px;
  max-width: 620px;
}

.stat {
  min-height: 84px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel);
}

.stat strong {
  display: block;
  margin-bottom: 2px;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
}

.stat span {
  color: var(--muted);
  font-size: 12px;
}

.hero-card {
  width: 100%;
  max-width: 340px;
  justify-self: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.poster-frame {
  aspect-ratio: 2 / 3;
  background: var(--bg-soft);
}

.poster-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-card-body {
  padding: 16px 18px 18px;
  border-top: 1px solid var(--border);
}

.tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 5px;
  background: var(--gold);
  color: #1a1203;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.hero-card-body h2 {
  margin: 8px 0 2px;
  font-size: 20px;
  line-height: 1.3;
}

.hero-card-body p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

/* Sections ---------------------------------------------------------------- */

.section {
  padding-block: 56px;
  scroll-margin-top: 80px;
}

.section-head {
  margin-bottom: 24px;
}

.section-head-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.section-head h2 {
  margin: 0 0 6px;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.25;
  letter-spacing: -0.6px;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.status-chip {
  flex: none;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

/* Features ---------------------------------------------------------------- */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.feature {
  display: flex;
  flex-direction: column;
  min-height: 172px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  transition: border-color 0.15s ease;
}

.feature:hover {
  border-color: var(--border-strong);
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-soft);
  color: var(--gold);
  font-size: 17px;
}

.feature h3 {
  margin: 0 0 6px;
  font-size: 16px;
  line-height: 1.35;
}

.feature p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

/* Config ------------------------------------------------------------------ */

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.config-card {
  padding: 4px 28px;
}

.form-section {
  padding-block: 24px;
  border-bottom: 1px solid var(--border);
}

.form-section:last-of-type {
  border-bottom: 0;
}

.form-section-head h3 {
  margin: 0 0 4px;
  font-size: 17px;
  line-height: 1.35;
}

.form-section-head p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field > span {
  color: #d7deea;
  font-size: 13px;
  font-weight: 700;
}

select {
  width: 100%;
  min-height: 48px;
  padding: 0 13px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--bg-soft);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease;
}

select:hover {
  border-color: #3a4d68;
}

select:focus {
  border-color: var(--gold);
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 66px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.choice:hover {
  border-color: var(--border-strong);
}

.choice.is-selected {
  border-color: rgba(225, 29, 72, 0.55);
  background: rgba(225, 29, 72, 0.07);
}

.choice input {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--red);
}

.choice-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.choice-body strong {
  font-size: 14px;
  line-height: 1.4;
}

.choice-body small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.switch-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-soft);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: border-color 0.15s ease;
}

.switch:hover {
  border-color: var(--border-strong);
}

.switch:focus-within {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.switch-track {
  position: relative;
  flex: none;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: #2a3648;
  transition: background-color 0.15s ease;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  inset-inline-start: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s ease;
}

.switch input:checked ~ .switch-track {
  background: var(--green);
}

.switch input:checked ~ .switch-track::after {
  transform: translateX(-16px);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-block: 20px 24px;
}

/* Install result ---------------------------------------------------------- */

.install-result {
  margin-top: 16px;
  padding: 24px;
  border: 1px solid rgba(34, 197, 94, 0.35);
  border-radius: var(--radius);
  background: rgba(34, 197, 94, 0.06);
  scroll-margin-top: 88px;
}

.install-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.install-head h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.3;
}

.check-badge {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--green);
  color: #04150a;
  font-size: 19px;
  font-weight: 900;
}

.install-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-block: 18px 12px;
}

.manifest-box {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #080d16;
  color: #c7d2e3;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  text-align: left;
  overflow-wrap: anywhere;
}

.hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.75;
}

/* Steps ------------------------------------------------------------------- */

.step-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.step {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
}

.step-number {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.step h3 {
  margin: 0 0 6px;
  font-size: 17px;
  line-height: 1.35;
}

.step p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

/* FAQ --------------------------------------------------------------------- */

.faq-list {
  display: grid;
  gap: 10px;
}

details {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel);
  overflow: hidden;
}

summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  list-style: none;
  transition: background-color 0.15s ease;
}

summary:hover {
  background: var(--bg-soft);
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "+";
  flex: none;
  color: var(--gold);
  font-size: 18px;
  line-height: 1;
}

details[open] summary::after {
  content: "−";
}

details p {
  margin: 0;
  padding: 0 18px 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.85;
}

/* Footer ------------------------------------------------------------------ */

.site-footer {
  margin-top: 40px;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 26px;
  color: var(--muted);
  font-size: 12px;
}

.footer-brand {
  flex: none;
  color: var(--text);
  font-weight: 700;
}

.footer-inner p {
  margin: 0;
  max-width: 68ch;
  line-height: 1.7;
}

/* Toast ------------------------------------------------------------------- */

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  z-index: 150;
  max-width: min(420px, calc(100% - 32px));
  padding: 11px 16px;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Responsive -------------------------------------------------------------- */

@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 36px;
    padding-block: 48px 40px;
  }

  .hero-card {
    justify-self: start;
    max-width: 300px;
  }

  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .step-grid {
    grid-template-columns: 1fr;
  }

  .site-nav {
    display: none;
  }

  .header-cta {
    margin-inline-start: auto;
  }
}

@media (max-width: 720px) {
  .wrap {
    width: calc(100% - 32px);
  }

  .section-head-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .status-chip {
    white-space: normal;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .config-card {
    padding-inline: 18px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

@media (max-width: 600px) {
  .header-inner {
    height: 58px;
  }

  .brand-text small {
    display: none;
  }

  .hero {
    padding-block: 36px 32px;
  }

  .hero h1 {
    font-size: 34px;
    letter-spacing: -0.8px;
  }

  .hero-lead {
    font-size: 15px;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .feature {
    min-height: 0;
  }

  .config-card {
    padding-inline: 14px;
  }

  .choice-grid {
    grid-template-columns: 1fr;
  }

  .install-head h3 {
    font-size: 19px;
  }

  .btn-wide {
    width: 100%;
    min-width: 0;
  }

  .form-actions .btn {
    flex: 1 1 100%;
  }
}

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