/* ──────────────────────────────────────────────────────────────
   Twseel Station — design system v2
   Brand-locked on #2F80ED. Single-accent. No legacy frameworks.
   ────────────────────────────────────────────────────────────── */

/* ── 1. Tokens ── */
:root {
  /* Brand (locked) */
  --brand:        #2F80ED;
  --brand-600:    #1E6FE0;
  --brand-700:    #145ECC;
  --brand-100:    #DCEBFE;
  --brand-50:     #EFF6FF;

  /* Neutrals (slate) */
  --ink:          #0B1F3A;
  --ink-2:        #334155;
  --ink-3:        #64748B;
  --ink-4:        #94A3B8;
  --line:         #E6EAF0;
  --line-strong:  #CBD5E1;
  --surface:      #FFFFFF;
  --surface-2:    #F8FAFC;
  --bg:           #FBFBFD;

  /* State */
  --success:      #10B981;
  --danger:       #E11D48;

  /* Type */
  --font-ar: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-en: "Geist", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Type scale (fluid) */
  --fs-display: clamp(2.4rem, 1.4rem + 4.5vw, 4.4rem);
  --fs-h1:      clamp(2rem,   1.4rem + 2.6vw, 3rem);
  --fs-h2:      clamp(1.5rem, 1.2rem + 1.4vw, 2.125rem);
  --fs-h3:      clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
  --fs-lead:    clamp(1rem, 0.95rem + 0.3vw, 1.125rem);
  --fs-body:    1rem;
  --fs-small:   0.875rem;
  --fs-micro:   0.75rem;

  /* Spacing */
  --s-1:  4px;
  --s-2:  8px;
  --s-3:  12px;
  --s-4:  16px;
  --s-5:  24px;
  --s-6:  32px;
  --s-7:  48px;
  --s-8:  64px;
  --s-9:  96px;
  --s-10: 128px;

  /* Radius */
  --r-sm:  8px;
  --r-md:  12px;
  --r-lg:  16px;
  --r-xl:  24px;
  --r-2xl: 32px;
  --r-pill: 9999px;

  /* Elevation (tinted to ink) */
  --shadow-sm:  0 1px 2px rgba(11, 31, 58, 0.04), 0 1px 1px rgba(11, 31, 58, 0.03);
  --shadow-md:  0 4px 14px -4px rgba(11, 31, 58, 0.08), 0 2px 4px rgba(11, 31, 58, 0.04);
  --shadow-lg:  0 24px 48px -16px rgba(11, 31, 58, 0.12), 0 8px 16px -8px rgba(11, 31, 58, 0.06);
  --shadow-brand: 0 12px 32px -8px rgba(47, 128, 237, 0.32);

  /* Motion */
  --ease-out:    cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --dur-fast: 160ms;
  --dur-base: 220ms;
  --dur-slow: 380ms;

  /* Container */
  --container-w: 1200px;
  --container-px: 24px;
}

/* ── 2. Reset & base ── */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-en);
  font-size: var(--fs-body);
  line-height: 1.55;
  color: var(--ink-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

img, svg, video { max-width: 100%; display: block; height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
input, textarea, select { font: inherit; color: inherit; }

::selection { background: var(--brand); color: #fff; }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 6px;
}
.btn:focus-visible {
  outline-offset: 4px;
}
.nav__lang:focus-visible,
.faq__head:focus-visible {
  outline-offset: 4px;
  border-radius: var(--r-pill);
}

/* Skip to content — visually hidden until focused */
.skip-link {
  position: fixed;
  top: 12px;
  inset-inline-start: 12px;
  z-index: 100;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--r-pill);
  font-size: 0.875rem;
  font-weight: 600;
  transform: translateY(-200%);
  transition: transform var(--dur-base) var(--ease-out);
}
.skip-link:focus-visible {
  transform: translateY(0);
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

/* ── 3. Typography ── */
h1, h2, h3, h4, h5, h6 {
  color: var(--ink);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4,
html[dir="rtl"] h5,
html[dir="rtl"] h6 { letter-spacing: 0; }

.display {
  font-size: var(--fs-display);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 700;
}
html[dir="rtl"] .display { letter-spacing: -0.01em; line-height: 1.15; }

h1, .h1 { font-size: var(--fs-h1); }
h2, .h2 { font-size: var(--fs-h2); }
h3, .h3 { font-size: var(--fs-h3); }

.lead {
  font-size: var(--fs-lead);
  color: var(--ink-2);
  line-height: 1.55;
  max-width: 56ch;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--brand-600);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
html[dir="rtl"] .eyebrow {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
}
.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

.muted { color: var(--ink-3); }

/* ── 4. Layout primitives ── */
.container {
  width: 100%;
  max-width: var(--container-w);
  margin-inline: auto;
  padding-inline: var(--container-px);
}

.section {
  padding-block: clamp(var(--s-7), 4vw + 1rem, var(--s-10));
}

.section--tight { padding-block: clamp(var(--s-6), 3vw + 1rem, var(--s-8)); }

.stack > * + * { margin-block-start: var(--stack, var(--s-4)); }

.divider {
  border: 0;
  height: 1px;
  background: var(--line);
  margin: 0;
}

/* ── 5. Buttons ── */
.btn {
  --btn-bg: var(--brand);
  --btn-fg: #fff;
  --btn-border: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 14px 22px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid var(--btn-border);
  border-radius: var(--r-pill);
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1;
  transition: transform var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
  white-space: nowrap;
  text-decoration: none;
  user-select: none;
}

.btn:hover { background: var(--brand-600); border-color: var(--brand-600); box-shadow: var(--shadow-brand); }
.btn:active { transform: scale(0.97); }
.btn[disabled],
.btn[aria-busy="true"] {
  opacity: 0.7;
  cursor: progress;
  pointer-events: none;
}
.btn[aria-busy="true"] .icon {
  animation: spin 0.85s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
html[dir="rtl"] .btn[aria-busy="true"] .icon { animation-direction: reverse; }

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  --btn-border: var(--line-strong);
}
.btn--ghost:hover { background: var(--surface-2); border-color: var(--ink-4); box-shadow: none; }

.btn--soft {
  --btn-bg: var(--brand-50);
  --btn-fg: var(--brand-700);
  --btn-border: transparent;
}
.btn--soft:hover { background: var(--brand-100); border-color: transparent; box-shadow: none; }

.btn--lg { padding: 16px 28px; font-size: 1rem; }
.btn--sm { padding: 10px 16px; font-size: 0.875rem; }

.btn .icon { width: 18px; height: 18px; flex: none; transition: transform var(--dur-fast) var(--ease-out); }
.btn:hover .icon { transform: translateX(2px); }
html[dir="rtl"] .btn:hover .icon { transform: translateX(-2px); }

/* Link arrow */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  color: var(--brand-600);
  font-weight: 600;
  font-size: 0.9375rem;
  justify-self: start;
  white-space: nowrap;
}
html[dir="rtl"] .link-arrow { justify-self: end; }
.link-arrow .icon {
  width: 18px;
  height: 18px;
  flex: none;
  transition: transform var(--dur-fast) var(--ease-out);
}
.link-arrow:hover .icon { transform: translateX(2px); }
html[dir="rtl"] .link-arrow:hover .icon { transform: translateX(-2px); }

/* ── 6. Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: var(--s-6);
  transition: transform var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .card--interactive:hover {
    border-color: var(--line-strong);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
  }
}

/* ── 7. Navigation ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 251, 253, 0.72);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-base) var(--ease-out),
              background var(--dur-base) var(--ease-out);
}
.nav.is-scrolled { border-bottom-color: var(--line); }

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
  height: 72px;
}

.nav__brand img { height: 32px; width: auto; }

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--s-5);
}
.nav__links a:not(.btn) {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink-2);
  padding: 8px 4px;
  transition: color var(--dur-fast) var(--ease-out);
}
.nav__links a:not(.btn):hover { color: var(--ink); }

.nav__lang {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-2);
  transition: border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.nav__lang:hover { color: var(--ink); border-color: var(--ink-4); }

.nav__toggle {
  display: none;
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  transition: background var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
}
.nav__toggle:hover { background: var(--surface-2); }
.nav__toggle:active { transform: scale(0.96); }
.nav__toggle span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--ink);
  border-radius: var(--r-pill);
  transition: transform var(--dur-base) var(--ease-out),
              opacity var(--dur-fast) var(--ease-out);
}
.nav__toggle span + span { margin-top: 0; }
.nav.is-open .nav__toggle span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav.is-open .nav__toggle span:nth-child(2) { opacity: 0; }
.nav.is-open .nav__toggle span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Mobile drawer */
.nav__drawer {
  position: fixed;
  inset-inline: 0;
  top: 72px;
  height: calc(100dvh - 72px);
  background: var(--surface);
  padding: var(--s-6) var(--container-px);
  display: none;
  flex-direction: column;
  gap: var(--s-2);
  z-index: 60;
  overflow-y: auto;
  border-top: 1px solid var(--line);
  box-shadow: 0 24px 48px -32px rgba(11, 31, 58, 0.24);
}
.nav__drawer.is-open { display: flex; animation: drawer-in var(--dur-base) var(--ease-out); }
.nav__drawer a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: var(--s-4);
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  border-radius: var(--r-sm);
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.nav__drawer a:hover { background: var(--brand-50); color: var(--brand-700); }
.nav__drawer .btn {
  margin-top: var(--s-4);
  align-self: stretch;
  border-bottom: 0;
  color: #fff;
}
.nav__drawer .btn:hover { color: #fff; background: var(--brand-600); }

@keyframes drawer-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 880px) {
  .nav.is-open {
    position: fixed;
    inset: 0;
    height: 100dvh;
    overflow: hidden;
    background: var(--surface);
  }
  .nav__links.desktop { display: none; }
  .nav__toggle { display: inline-flex; }
  .nav__inner { height: 64px; }
  .nav__drawer {
    position: static;
    height: calc(100dvh - 64px);
  }
}

/* ── 8. Footer ── */
.footer {
  background: var(--ink);
  color: rgba(255, 255, 255, 0.74);
  padding-block: var(--s-9) var(--s-7);
  margin-top: var(--s-9);
}
.footer h4 {
  color: #fff;
  font-size: 0.9375rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: var(--s-4);
  font-weight: 600;
}
html[dir="rtl"] .footer h4 { text-transform: none; letter-spacing: 0; }

.footer a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9375rem;
  display: inline-block;
  padding: 4px 0;
  transition: color var(--dur-fast) var(--ease-out);
}
.footer a:hover { color: #fff; }

.footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: var(--s-7);
}
@media (max-width: 880px) {
  .footer__grid { grid-template-columns: 1fr 1fr; gap: var(--s-6); }
}
@media (max-width: 540px) {
  .footer__grid { grid-template-columns: 1fr; }
}

.footer__brand img { height: 32px; width: auto; margin-bottom: var(--s-5); }
.footer__brand p { color: rgba(255, 255, 255, 0.6); font-size: 0.875rem; line-height: 1.7; }

.footer__socials {
  display: flex;
  gap: var(--s-3);
  margin-top: var(--s-3);
}
.footer__socials a {
  width: 40px; height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--r-pill);
  transition: all var(--dur-fast) var(--ease-out);
}
.footer__socials a:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.24); }
.footer__socials svg { width: 16px; height: 16px; fill: currentColor; }

.footer__stores { display: flex; flex-direction: column; gap: var(--s-3); }
.footer__stores a { padding: 0; transition: transform var(--dur-fast) var(--ease-out); }
.footer__stores a:hover { transform: translateY(-2px); }
.footer__stores img { height: 44px; width: auto; }

.footer__pay {
  display: flex;
  gap: var(--s-2);
  flex-wrap: wrap;
  margin-top: var(--s-3);
}
.footer__pay span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 34px;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 5px 8px;
  box-shadow: 0 1px 2px rgba(11, 31, 58, 0.10);
}
.footer__pay img { height: 20px; width: auto; max-width: 40px; object-fit: contain; }

.footer__bottom {
  margin-top: var(--s-8);
  padding-top: var(--s-5);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s-3);
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.5);
}
.footer__bottom-links { display: flex; gap: var(--s-5); flex-wrap: wrap; }
.footer__bottom-links a { font-size: 0.8125rem; color: rgba(255, 255, 255, 0.55); }

/* ── 9. Reveal on scroll ── */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--dur-slow) var(--ease-out),
              transform var(--dur-slow) var(--ease-out);
}
.reveal.is-in { opacity: 1; transform: translateY(0); }
.reveal[data-delay="1"] { transition-delay: 60ms; }
.reveal[data-delay="2"] { transition-delay: 120ms; }
.reveal[data-delay="3"] { transition-delay: 180ms; }
.reveal[data-delay="4"] { transition-delay: 240ms; }
.reveal[data-delay="5"] { transition-delay: 300ms; }
.reveal[data-delay="6"] { transition-delay: 360ms; }

/* ── 10. Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ── 11. Utility ── */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.no-shrink { flex: none; }
.hide-mobile { @media (max-width: 640px) { display: none; } }

.tnum { font-variant-numeric: tabular-nums; letter-spacing: 0; }

/* Tabular nums on phone/CR numbers in footer legal block */
.footer__legal p { font-variant-numeric: tabular-nums; }
