:root {
  /* Light theme (Porcelain + Signal Blue), matching the app's light mode. */
  --bg: #f8f7f4;
  --bg-2: #f2f0ef;
  --card: #f8f7f4;
  --line: #e4e2db;
  --line-strong: #d4d1c9;
  --text: #252525;
  --text-2: #44423c;
  --muted: #59574f;
  --subtle: #77746b;
  --accent: #0057ff;
  --accent-hover: #003edd;
  --accent-deep: #0020c4;
  --accent-ink: #ffffff;
  --accent-tint: rgba(0, 87, 255, 0.08);
  --blue: #0020c4;
  --blue-tint: rgba(0, 32, 196, 0.08);
  --focus: #0057ff;
  --danger: #b42318;
  --shadow-sm:
    0 1px 2px rgba(37, 37, 37, 0.04), 0 4px 14px rgba(37, 37, 37, 0.06);
  --shadow-lg:
    0 2px 6px rgba(37, 37, 37, 0.06), 0 28px 64px -24px rgba(37, 37, 37, 0.32);
  /* Cosmic Navy, used only for the dark bands (.phone, .closing-cta). */
  --band-bg: #020222;
  --band-bg-2: #050938;
  --band-card: #0c134f;
  --band-line: #25336a;
  --band-text: #ffffff;
  --band-muted: #bfc7dc;
  --band-accent: #d4adfc;
  --band-accent-hover: #dfc3ff;
  --band-accent-ink: #0c134f;
  --band-blue: #518cff;
  --band-focus: #dfc3ff;
  --radius: 14px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-ar: "IBM Plex Sans Arabic", "Inter", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

html[lang="ar"] body {
  font-family: var(--font-ar);
}

a {
  color: var(--accent);
}

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---- top bar ---- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(248, 247, 244, 0.85);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  font-size: 20px;
}

.brand img {
  display: block;
  height: 28px;
  width: auto;
}

.brand .brand-mark {
  display: none;
  height: 32px;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topnav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
}

.topnav a:hover {
  color: var(--text);
}

/* "Create your shop" in the header: a compact primary button (the quiet
   "Sign in" link sits before it). Two labels: the long one, and a short one
   for phone widths. */
.topnav a.nav-cta {
  min-height: 38px;
  padding: 0 16px;
  border-radius: 10px;
  font-size: 15px;
  color: var(--accent-ink);
  white-space: nowrap;
}

.topnav a.nav-cta:hover {
  color: var(--accent-ink);
}

.nav-cta-short {
  display: none;
}

.lang-toggle {
  font: inherit;
  font-size: 15px;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 14px;
  cursor: pointer;
}

.lang-toggle:hover {
  border-color: var(--accent);
}

/* The switch is a link to the other language's page (/ or /ar). Beat the
   generic ".topnav a" colour so it keeps its pill look. */
.topnav a.lang-toggle {
  display: inline-block;
  color: var(--text);
  white-space: nowrap;
}

/* ---- buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 12px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-ghost {
  color: var(--text);
  border-color: var(--line);
}

.btn-ghost {
  background: transparent;
}

.btn-ghost:hover {
  border-color: var(--line-strong);
  background: var(--bg-2);
}

.btn:focus-visible,
.lang-toggle:focus-visible,
input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* ---- hero ---- */
.hero {
  padding: 56px 0 64px;
  background:
    radial-gradient(
      1000px 500px at 80% 0%,
      rgba(0, 87, 255, 0.07),
      transparent
    ),
    var(--bg);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 40px;
  align-items: center;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-weight: 600;
  font-size: 15px;
}

h1 {
  margin: 0 0 16px;
  font-size: clamp(32px, 5vw, 50px);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.02em;
}

html[lang="ar"] h1 {
  letter-spacing: 0;
  line-height: 1.3;
}

.lead {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 19px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.invite {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.hero-media {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--band-card); /* the demo video is dark */
  aspect-ratio: 16 / 9;
  box-shadow: var(--shadow-lg);
}

.demo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sound-toggle {
  position: absolute;
  inset-inline-end: 12px;
  bottom: 12px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--band-text);
  background: rgba(4, 8, 30, 0.75);
  border: 1px solid var(--band-line);
  border-radius: 999px;
  cursor: pointer;
}

.sound-toggle .icon-on,
.sound-toggle[aria-pressed="true"] .icon-muted {
  display: none;
}

.sound-toggle[aria-pressed="true"] .icon-on {
  display: block;
}

.sound-toggle:hover {
  border-color: var(--band-accent);
}

.sound-toggle:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* ---- features ---- */
.features {
  padding: 64px 0;
  background: var(--bg-2);
  border-block: 1px solid var(--line);
}

h2 {
  margin: 0 0 28px;
  font-size: clamp(26px, 3.4vw, 34px);
  line-height: 1.2;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow:
    0 1px 2px rgba(37, 37, 37, 0.04),
    0 6px 18px rgba(37, 37, 37, 0.06);
}

.card h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

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

/* ---- shop login ---- */
.login {
  padding: 64px 0;
  background: var(--bg-2);
}

.login-box {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 32px;
  align-items: center;
}

.login h2 {
  margin-bottom: 8px;
}

.login p {
  margin: 0;
  color: var(--muted);
}

.shop-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.shop-input {
  display: flex;
  align-items: center;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  padding: 0 14px;
  overflow: hidden;
}

.shop-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 87, 255, 0.15);
}

.prefix,
.suffix {
  color: var(--muted);
  font-size: 15px;
  white-space: nowrap;
}

.shop-input input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  padding: 10px 4px;
}

.shop-input input:focus {
  outline: none;
}

.form-msg {
  grid-column: 1 / -1;
  min-height: 1.6em;
  font-size: 15px;
}

.form-msg.error {
  color: var(--danger);
}

/* ---- light bands: the phone section and the closing CTA. The page used
   to switch to Cosmic Navy here; the owner wants the whole page light. ---- */
.phone {
  background: var(--bg);
  color: var(--text);
}

.closing-cta {
  background:
    radial-gradient(700px 260px at 50% 0%, var(--accent-tint), transparent),
    var(--bg);
  color: var(--text);
}

/* ---- closing ---- */
.closing-cta {
  padding: 64px 0 72px;
  text-align: center;
  border-top: 1px solid var(--line);
}

.closing-cta h2 {
  margin-bottom: 8px;
}

.closing-cta p {
  margin: 0 0 24px;
  color: var(--muted);
}

.footer {
  background: var(--bg);
  border-top: 1px solid var(--line);
  padding: 20px 0;
  color: var(--muted);
  font-size: 14px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.footer a {
  color: var(--muted);
}

/* ---- narrow screens ---- */
@media (max-width: 960px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 800px) {
  .hero {
    padding-top: 32px;
  }
  .hero-grid,
  .login-box {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .feature-grid,
  .shop-form {
    grid-template-columns: 1fr;
  }
  .cta-row .btn {
    width: 100%;
  }
  /* Both doors stay visible on a phone: tighter spacing and the short
     button label, and the brand keeps only its logo on the narrowest. */
  .topnav {
    gap: 10px;
  }
  .topnav a.nav-signin {
    font-size: 14px;
    white-space: nowrap;
  }
  .topnav a.nav-cta {
    min-height: 34px;
    padding: 0 10px;
    font-size: 14px;
  }
  .nav-cta-long {
    display: none;
  }
  .nav-cta-short {
    display: inline;
  }
  .lang-toggle {
    font-size: 14px;
    padding: 3px 10px;
  }
  .prefix {
    display: none;
  }
}

@media (max-width: 520px) {
  .brand .brand-logo {
    display: none;
  }
  .brand .brand-mark {
    display: block;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* ---- feature card that points to the phone section ---- */
.card-link a {
  display: inline-block;
  margin-top: 10px;
  font-size: 15px;
  font-weight: 600;
}

/* ---- phone app ---- */
.phone {
  padding: 64px 0;
  border-bottom: 1px solid var(--line);
}

.phone-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 40px;
  align-items: center;
}

.phone h2 {
  margin-bottom: 12px;
}

.phone .lead {
  margin-bottom: 20px;
  font-size: 17px;
}

.phone-list {
  margin: 0 0 20px;
  padding-inline-start: 20px;
  color: var(--text);
}

.phone-list li {
  margin-bottom: 8px;
}

.phone-list li::marker {
  color: var(--accent);
}

.phone-note {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.phone-card {
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: 32px 20px;
  text-align: center;
  background:
    radial-gradient(400px 220px at 50% 0%, var(--accent-tint), transparent),
    var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.phone-card img {
  display: block;
  width: 120px;
  height: auto;
}

.phone-soon {
  margin: 0;
  padding: 4px 14px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-weight: 600;
  font-size: 15px;
}

.phone-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.phone-tabs li {
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 800px) {
  .phone-grid {
    grid-template-columns: 1fr;
  }
}

/* ---- feature icons (shared sprite: /assets/icons.svg) ---- */
.card-ic,
.mega-ic,
.badge-ic {
  display: grid;
  place-items: center;
  flex: none;
  color: var(--accent);
  border: 1px solid var(--line);
  background: var(--accent-tint);
}

.card-ic.tone-b,
.mega-ic.tone-b,
.badge-ic.tone-b {
  color: var(--blue);
  background: var(--blue-tint);
}

.card-ic {
  width: 40px;
  height: 40px;
  margin-bottom: 12px;
  border-radius: 10px;
}

/* Cards are menu targets: land below the sticky top bar. */
.card {
  scroll-margin-top: 88px;
}

/* ---- Features menu ---- */
.menu {
  position: relative;
}

.menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 38px;
  padding: 0 12px;
  font: inherit;
  font-size: 15px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
}

.menu-btn:hover,
.menu-btn[aria-expanded="true"] {
  color: var(--text);
  background: var(--bg-2);
  border-color: var(--line);
}

.menu-btn svg {
  transition: transform 0.2s ease;
}

.menu-btn[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.menu-btn:focus-visible,
.mega a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.mega {
  position: absolute;
  top: calc(100% + 12px);
  inset-inline-start: 50%;
  translate: -50% 0;
  width: min(640px, calc(100vw - 32px));
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  animation: mega-in 0.16s ease-out;
}

html[dir="rtl"] .mega {
  translate: 50% 0;
}

@keyframes mega-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}

.mega[hidden] {
  display: none;
}

.mega-title {
  margin: 0 8px 8px;
  color: var(--muted);
  font-size: 14px;
}

.mega-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.topnav .mega a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 10px;
  color: var(--text);
}

.topnav .mega a:hover {
  background: var(--bg-2);
  color: var(--text);
}

.mega-ic {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.mega-text {
  display: block;
  line-height: 1.3;
}

.mega-text strong {
  font-size: 15px;
  font-weight: 600;
}

.mega-text small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.soon {
  display: inline-block;
  margin-inline-start: 6px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  vertical-align: 1px;
}

/* The menu is a wide-screen shortcut; on a phone the feature cards are one
   scroll away and the top bar has no room. */
@media (max-width: 800px) {
  .menu {
    display: none;
  }
}

/* ---- animated hero background ---- */
.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  /* Light theme: a soft Signal Blue glow instead of the old dark grid. */
  background:
    radial-gradient(
      ellipse 60% 55% at 15% 20%,
      rgba(0, 87, 255, 0.06),
      transparent 70%
    ),
    radial-gradient(
      ellipse 50% 50% at 90% 80%,
      rgba(0, 32, 196, 0.04),
      transparent 70%
    );
}

.badge {
  position: absolute;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: drift 7s ease-in-out infinite;
}

.badge-ic {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background-color: var(--bg);
  box-shadow: 0 6px 20px -6px rgba(0, 87, 255, 0.3);
}

.badge-ic.tone-b {
  background-color: var(--bg);
  box-shadow: 0 6px 20px -6px rgba(0, 32, 196, 0.3);
}

.badge-label {
  color: var(--text-2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

html[lang="ar"] .badge-label {
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
}

@keyframes drift {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}

/* Badges only where there is room around the hero (from 1240px wide). */
@media (min-width: 1240px) {
  .hero {
    padding: 96px 0 112px;
  }
  .badge {
    display: flex;
  }
  .badge-1 {
    animation-delay: 0s;
  }
  .badge-2 {
    animation-delay: -2.5s;
    animation-duration: 8s;
  }
  .badge-3 {
    animation-delay: -4s;
    animation-duration: 9s;
  }
  .badge-4 {
    animation-delay: -1.5s;
    animation-duration: 8.5s;
  }
  .badge-5 {
    animation-delay: -3.5s;
  }
  .badge-6 {
    animation-delay: -5s;
    animation-duration: 7.5s;
  }
  /* Narrow gutters: all six sit in the bands above and below the content. */
  .badge-1 {
    inset-inline-start: 4%;
    top: 6px;
  }
  .badge-4 {
    inset-inline-end: 4%;
    top: 6px;
  }
  .badge-2 {
    inset-inline-start: 3%;
    bottom: 3%;
  }
  .badge-3 {
    inset-inline-start: 30%;
    bottom: 3%;
  }
  .badge-6 {
    inset-inline-end: 30%;
    bottom: 3%;
  }
  .badge-5 {
    inset-inline-end: 3%;
    bottom: 3%;
  }
}

/* Wide screens: the gutters beside the column are wide enough for badges. */
@media (min-width: 1440px) {
  .badge-1 {
    inset-inline-start: 2.5%;
    top: 9%;
  }
  .badge-2 {
    inset-inline-start: 1%;
    top: 52%;
    bottom: auto;
  }
  .badge-4 {
    inset-inline-end: 2.5%;
    top: 7%;
  }
  .badge-5 {
    inset-inline-end: 1%;
    top: 56%;
    bottom: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .badge,
  .mega {
    animation: none;
  }
}

/* ---- hero top line as a pill with a live dot ---- */
.eyebrow.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 5px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--accent-tint);
  border-color: rgba(0, 87, 255, 0.18);
}

.pill-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
}

.pill-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--accent);
  animation: ping 1.6s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes ping {
  75%,
  100% {
    transform: scale(2.4);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pill-dot::after {
    animation: none;
    display: none;
  }
}
