/*
 * Landing page styles.
 *
 * Two constraints shape everything here:
 *
 * 1. The page must work identically in Arabic (RTL) and English (LTR), so every
 *    directional rule uses logical properties — inline-start/inline-end,
 *    padding-inline, text-align: start — never left/right. Switching `dir` on
 *    <html> is all it takes to mirror the layout correctly.
 *
 * 2. The page makes no external requests: no web fonts, no icon library, no
 *    analytics. Most visitors arrive from a WhatsApp or Facebook link on a
 *    phone, possibly on a slow connection, and the privacy stance in the copy
 *    has to be true of the page itself.
 */

:root {
  --ink: #14181f;
  --ink-soft: #4a5364;
  --ink-faint: #6b7486;
  --bg: #ffffff;
  --bg-alt: #f5f7fa;
  --bg-tint: #eef3f9;
  --line: #dfe4ec;
  --brand: #0f4c81;
  --brand-soft: #2b6ca8;
  --brand-tint: #e8f0f8;
  --action: #12836b;
  --action-hover: #0e6b57;
  --focus: #b8480f;
  --shadow: 0 1px 2px rgba(20, 24, 31, 0.05), 0 8px 24px rgba(20, 24, 31, 0.06);

  --radius: 14px;
  --radius-sm: 9px;
  --space: 1rem;
  --measure: 62ch;

  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans Arabic', 'Geeza Pro', Tahoma,
    sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #eef1f6;
    --ink-soft: #b3bccb;
    --ink-faint: #939db0;
    --bg: #12151b;
    --bg-alt: #171b23;
    --bg-tint: #1b2029;
    --line: #2b323e;
    --brand: #8fb8e0;
    --brand-soft: #a9c9ea;
    --brand-tint: #1a2735;
    --action: #2aa98a;
    --action-hover: #38bd9c;
    --focus: #ffb066;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Keeps the sticky header from covering whatever an anchor jumps to. */
  scroll-padding-block-start: 5rem;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* Arabic benefits from slightly more line height and size at body copy. */
html[lang='ar'] body {
  font-size: 1.125rem;
  line-height: 1.9;
}

h1,
h2,
h3 {
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}

html[lang='ar'] h1,
html[lang='ar'] h2,
html[lang='ar'] h3 {
  line-height: 1.45;
  letter-spacing: 0;
}

p {
  margin: 0;
}

a {
  color: var(--brand);
  text-underline-offset: 3px;
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  inset-block-start: -100%;
  inset-inline-start: 0;
  z-index: 20;
  padding: 0.75rem 1.25rem;
  background: var(--bg);
  color: var(--ink);
  border: 2px solid var(--brand);
  border-start-start-radius: 0;
  border-end-end-radius: var(--radius-sm);
  text-decoration: none;
}

.skip-link:focus {
  inset-block-start: 0;
}

.container {
  width: 100%;
  max-width: 68rem;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.container.narrow {
  max-width: 48rem;
}

.center {
  text-align: center;
}

/* ---------------------------------------------------------------- header */

.site-header {
  border-block-end: 1px solid var(--line);
  background: var(--bg);
  position: sticky;
  inset-block-start: 0;
  z-index: 10;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 700;
  font-size: 1.1875rem;
  color: var(--ink);
}

.brand__mark {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--action) 100%);
  flex: none;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding-inline: 0.875rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 600;
  background: var(--bg);
}

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

/* ------------------------------------------------------------------ hero */

.hero {
  background:
    radial-gradient(60rem 30rem at 50% -10rem, var(--brand-tint), transparent 70%),
    var(--bg);
  border-block-end: 1px solid var(--line);
}

.hero__inner {
  padding-block: clamp(3rem, 9vw, 5.5rem);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.eyebrow {
  display: inline-block;
  padding: 0.3125rem 0.875rem;
  border-radius: 999px;
  background: var(--brand-tint);
  color: var(--brand);
  border: 1px solid color-mix(in srgb, var(--brand) 25%, transparent);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.hero__title {
  font-size: clamp(2rem, 6vw, 3.375rem);
  font-weight: 800;
  max-width: 22ch;
}

.hero__subtitle {
  font-size: clamp(1.0625rem, 2.4vw, 1.3125rem);
  color: var(--ink-soft);
  max-width: var(--measure);
}

.hero__cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-block-start: 0.5rem;
}

.cta-note {
  font-size: 0.9375rem;
  color: var(--ink-faint);
  max-width: 46ch;
}

.cta-note--pending {
  font-weight: 600;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
}

.badge {
  padding: 0.375rem 0.875rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  font-size: 0.875rem;
  color: var(--ink-soft);
  font-weight: 600;
}

/* --------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  /* 3rem minimum keeps the tap target comfortable on a phone. */
  min-height: 3rem;
  padding-inline: 1.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.btn--lg {
  min-height: 3.375rem;
  padding-inline: 2rem;
  font-size: 1.0625rem;
}

.btn--primary {
  background: var(--action);
  color: #ffffff;
}

/* :not(.btn--pending) is belt and braces — the template already withholds
   btn--primary from a disabled control, and neither route should ever give a
   non-actionable button a hover state. */
.btn--primary:not(.btn--pending):hover {
  background: var(--action-hover);
}

/* Rendered when no invite link is configured: visibly not clickable, so the
   page never promises an action it cannot perform. */
.btn--pending {
  background: var(--bg-tint);
  color: var(--ink-faint);
  border-color: var(--line);
  cursor: not-allowed;
}

.btn__icon {
  width: 1.375rem;
  height: 1.375rem;
  flex: none;
}

/* -------------------------------------------------------------- sections */

.section {
  padding-block: clamp(3rem, 8vw, 5rem);
}

.section--alt {
  background: var(--bg-alt);
  border-block: 1px solid var(--line);
}

.section__title {
  font-size: clamp(1.5rem, 3.6vw, 2.125rem);
  font-weight: 800;
  max-width: 24ch;
}

.section__lead {
  margin-block-start: 0.75rem;
  color: var(--ink-soft);
  max-width: var(--measure);
  font-size: 1.0625rem;
}

.center .section__title,
.center .section__lead {
  margin-inline: auto;
}

/* ----------------------------------------------------------------- grids */

.grid {
  display: grid;
  gap: 1rem;
  margin-block-start: 2rem;
}

@media (min-width: 40rem) {
  .grid--2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 56rem) {
  .grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card-list {
  list-style: none;
  padding: 0;
}

.card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.card--accent {
  border-color: color-mix(in srgb, var(--brand) 30%, var(--line));
  box-shadow: var(--shadow);
}

.card--muted {
  background: var(--bg-tint);
}

.card__title {
  font-size: 1.125rem;
  font-weight: 700;
}

.card__body {
  margin-block-start: 0.625rem;
  color: var(--ink-soft);
}

/* ----------------------------------------------------------------- steps */

.steps {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

@media (min-width: 52rem) {
  .steps {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

.step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.step__n {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--brand-tint);
  color: var(--brand);
  font-weight: 800;
  font-size: 1.125rem;
}

.step__title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-block-end: 0.5rem;
}

.step__body p {
  color: var(--ink-soft);
}

/* ------------------------------------------------------------- checklist */

.checklist {
  list-style: none;
  margin: 1.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.875rem;
}

.checklist--tight {
  margin-block-start: 1rem;
  gap: 0.625rem;
}

.checklist li {
  position: relative;
  padding-inline-start: 2rem;
  color: var(--ink-soft);
}

/* The tick is drawn with *physical* borders on purpose. Logical properties
   would mirror it under `dir="rtl"`, turning the checkmark into a chevron
   pointing the wrong way — a checkmark is an icon, not text, so it must look
   the same in both directions. Only its placement is logical. */
.checklist li::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  inset-block-start: 0.5em;
  width: 1.0625rem;
  height: 0.5rem;
  border-left: 2.5px solid var(--action);
  border-bottom: 2.5px solid var(--action);
  transform: rotate(-45deg);
}

/* The "not a fit" list uses a dash rather than a cross: these are honest scope
   limits, not failures. A horizontal rule reads the same in both directions. */
.checklist--no li::before {
  inset-block-start: 0.85em;
  width: 0.875rem;
  height: 0;
  border-left: none;
  border-bottom: 2.5px solid var(--ink-faint);
  transform: none;
}

.fit .card--fit {
  padding: 1.75rem;
}

/* ------------------------------------------------------------------- faq */

.faq {
  margin-block-start: 2rem;
  border-block-start: 1px solid var(--line);
}

.faq__item {
  border-block-end: 1px solid var(--line);
}

.faq__q {
  cursor: pointer;
  list-style: none;
  padding-block: 1.125rem;
  padding-inline-end: 2rem;
  font-weight: 700;
  font-size: 1.0625rem;
  position: relative;
}

.faq__q::-webkit-details-marker {
  display: none;
}

/* Physical borders again: the disclosure chevron must point down when closed
   and up when open in both writing directions. Its position is logical, so it
   still sits at the end of the line. */
.faq__q::after {
  content: '';
  position: absolute;
  inset-inline-end: 0.25rem;
  inset-block-start: 1.55rem;
  width: 0.625rem;
  height: 0.625rem;
  border-right: 2.5px solid var(--ink-faint);
  border-bottom: 2.5px solid var(--ink-faint);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}

.faq__item[open] .faq__q::after {
  transform: rotate(-135deg);
  inset-block-start: 1.75rem;
}

.faq__a {
  padding-block-end: 1.25rem;
  color: var(--ink-soft);
  max-width: var(--measure);
}

/* ------------------------------------------------------------- final cta */

.final-cta {
  background:
    radial-gradient(50rem 24rem at 50% 120%, var(--brand-tint), transparent 70%),
    var(--bg);
}

/* ---------------------------------------------------------------- footer */

.site-footer {
  border-block-start: 1px solid var(--line);
  background: var(--bg-alt);
  padding-block: 2.5rem;
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: space-between;
  align-items: flex-start;
}

.footer-brand {
  font-weight: 800;
  font-size: 1.0625rem;
}

.footer-tagline {
  color: var(--ink-soft);
  max-width: 34ch;
  margin-block-start: 0.25rem;
}

.footer-meta {
  color: var(--ink-faint);
  font-size: 0.9375rem;
  text-align: end;
  display: grid;
  gap: 0.25rem;
}

@media (max-width: 40rem) {
  .footer-meta {
    text-align: start;
  }
}
