/* brand.css — neutral brand tokens for the public marketing surfaces
 * (the logged-out homepage). Independent of founders.css so the homepage
 * can evolve without dragging the founder-funnel CSS along with it.
 *
 * Tokens only — no layout, no section-specific styles. Component CSS
 * (HomeHero.css etc.) lives next to each section component and may
 * reference these custom properties.
 *
 * Palette is the SpeakNow brand (gold on charcoal). Same hex values
 * the rest of the app already uses inline, lifted here so the homepage
 * tree has one source of truth without importing tokens.js (which
 * mixes brand colours with logged-in chrome colours).
 */

.brand-scope {
  /* ── Surface colours ──────────────────────────────────────────── */
  --brand-bg:           #07070F;
  --brand-panel:        #1A1A2E;
  --brand-panel-inner:  #0F0F1A;
  --brand-border:       #1E1E2E;
  --brand-border-light: #2D2D4D;

  /* ── Accents ──────────────────────────────────────────────────── */
  --brand-gold:    #C9A84C;
  --brand-gold-on: #3C2F00;   /* foreground for text rendered on gold */
  --brand-teal:    #0E6D77;   /* secondary accent; rare on homepage */

  /* ── Rounded-executive redesign (2026-10-16) ─────────────────────
   * Landing page only. The navy page background is scoped to
   * .brand-scope on purpose — never body / global.css (Al-Majlis and
   * the games keep their own surfaces). The CTA golds are CTA-only;
   * the brand-lock colours above are unchanged. */
  --brand-bg-image:
    radial-gradient(circle at 85% 12%, rgba(14,109,119,0.42) 0%, rgba(14,109,119,0) 64%),
    radial-gradient(circle at 12% 88%, rgba(201,168,76,0.24) 0%, rgba(201,168,76,0) 64%),
    linear-gradient(165deg, #050B18 0%, #08182A 55%, #06101D 100%);
  --brand-surface:    rgba(255,255,255,0.035);
  --brand-hairline:   rgba(255,255,255,0.08);
  --brand-pill-ring:  rgba(201,168,76,0.35);
  --brand-gold-hi:    #E8CC7A;
  --brand-cta-top:    #F3DC9A;
  --brand-cta-bot:    #E2C36E;
  --brand-cta-ink:    #0A0A0A;
  --brand-cta-shadow: 0 4px 20px rgba(212,175,55,0.30);

  /* ── Text ─────────────────────────────────────────────────────── */
  --brand-text-hi:  #F5EFE0;
  --brand-text-mid: #B7AE96;
  --brand-text-lo:  #8A7E66;
  --brand-text-dim: #9CA3AF;
  --brand-text-body: #E4DDCB;

  /* ── Type ─────────────────────────────────────────────────────── */
  --ff-display: 'Cinzel', Georgia, 'Times New Roman', serif;
  --ff-body:    'DM Sans', -apple-system, system-ui, 'Segoe UI',
                Roboto, 'Helvetica Neue', Arial, sans-serif;
  --ff-arabic:  'Amiri', 'Cairo', system-ui, sans-serif;
  --ff-headline: 'Newsreader', Georgia, serif;
  --ff-arabic-headline: 'Cairo', 'Amiri', system-ui, sans-serif;

  /* ── Radius ───────────────────────────────────────────────────── */
  --r-sm:   8px;
  --r-md:   12px;
  --r-lg:   20px;
  --r-pill: 9999px;
  --r-card:  16px;
  --r-cta:   14px;
  --r-photo: 22px;

  /* ── Spacing ──────────────────────────────────────────────────── */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
  --sp-9: 96px;
}

/* RTL flips for AR. The .brand-scope wrapper inherits dir from <html
 * dir="rtl"> set by LanguageContext. Logical CSS properties (margin-
 * inline-start, etc.) handle most cases natively; this block is
 * reserved for legacy physical-property fixes if any section needs them.
 */
[dir="rtl"] .brand-scope {
  /* (none yet — components should use logical properties) */
}

/* ── HomeHero asymmetric grid ────────────────────────────────────
 * Mobile: single column, copy only — portrait hidden via
 * .home-hero-portrait below 880px (j-hide option).
 * Desktop (≥880px): 1.2fr / 1fr split — copy left ~55%, portrait
 * right ~45%. Matches /founders proportions without importing
 * founders.css.
 *
 * RTL: CSS Grid auto-flips column order under dir="rtl", so the AR
 * version puts the portrait on the left, copy on the right —
 * mirror-correct without any extra rules.
 */
.home-hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-6);
  align-items: center;
}
@media (min-width: 880px) {
  .home-hero-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: var(--sp-7);
  }
}

/* Portrait wrapper — hidden on mobile (j-hide), shown on ≥880px.
 * The glow now lives on .brand-photo-frame (box-shadow), not here. */
.home-hero-portrait {
  display: none;
}
@media (min-width: 880px) {
  .home-hero-portrait {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-3);
  }
}

/* ── Section base padding rhythm (H) ─────────────────────────────
 * Mid-page sections (ValueProps, HowItWorks, SocialProof) opt in
 * via className="home-section". Hero + TrialCta keep their own
 * larger breathing room since they're the page bookends. */
.home-section {
  padding: var(--sp-7) var(--sp-5);
}
@media (min-width: 880px) {
  .home-section {
    padding: var(--sp-9) var(--sp-5);
  }
}

/* ── ValueProps grid (A) ─────────────────────────────────────────
 * Mobile: 1 col. Desktop: 2x2 grid — caps the sprawl from
 * the previous auto-fit-minmax. */
.home-vp-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-4);
}
@media (min-width: 880px) {
  .home-vp-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-5);
  }
}

/* ── HowItWorks layout (B) ───────────────────────────────────────
 * Each step is a .brand-card row at every width: outlined numeral on
 * the inline-start side (right in AR — flex follows dir), title + body
 * beside it. A 3-col grid would leave ~140px of text beside a 52px
 * "01", so the rows stay stacked and the body keeps a readable measure. */
.home-hiw-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.home-hiw-step {
  display: flex;
  gap: var(--sp-4);
  align-items: flex-start;
}
.home-hiw-step .brand-step-num {
  flex: 0 0 72px;
}
.home-hiw-step > div {
  max-width: 62ch;
}
@media (max-width: 399px) {
  .home-hiw-step {
    gap: var(--sp-3);
  }
  .home-hiw-step .brand-step-num {
    flex-basis: 54px;
  }
}

/* ── SocialProof grid (C) ────────────────────────────────────────
 * Mobile: 1 col. Tablet: 2 cols. Desktop: 3 cols (caps at 3,
 * so 5 cards lay out as 3 + 2 predictably). */
/* Testimonials: one column on mobile. From 600px a centred wrapping
 * row with fixed equal widths, so the last row of an odd count sits in
 * the middle (5 cards: 2 + 2 + 1 on tablet, 3 + 2 on desktop). */
.home-sp-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-4);
}
@media (min-width: 600px) {
  .home-sp-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
  }
  .home-sp-grid > * {
    flex: 0 0 calc((100% - var(--sp-4)) / 2);
    min-width: 0;
    box-sizing: border-box;
  }
}
@media (min-width: 880px) {
  .home-sp-grid > * {
    flex-basis: calc((100% - 2 * var(--sp-4)) / 3);
  }
}

/* ── Footer 3-zone layout (G) ────────────────────────────────────
 * Mobile: vertical centered stack (unchanged).
 * Desktop: 3 zones — nav inline-start, language toggle center,
 * brand line inline-end. Order in JSX is nav → toggle → brand so
 * the visual order matches the source order at both breakpoints. */
.home-footer-row {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  align-items: center;
}
@media (min-width: 880px) {
  .home-footer-row {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: var(--sp-5);
  }
}

/* ── Rounded-executive shared classes (2026-10-16) ───────────────
 * Landing page only, all under .brand-scope. Not used by any
 * component yet — the sections move onto them one step at a time.
 * No backdrop-filter, no clip-path. */
.brand-scope .brand-card {
  border-radius: var(--r-card);
  border: 1px solid var(--brand-hairline);
  background: var(--brand-surface);
  padding: 20px 18px;
}
@media (min-width: 768px) {
  .brand-scope .brand-card {
    padding: 24px;
  }
}

.brand-scope .brand-pill {
  border-radius: var(--r-pill);
  border: 1px solid var(--brand-pill-ring);
  color: var(--brand-gold-hi);
}

/* Primary CTA. Hover/focus live here so the inline onMouseEnter /
 * onMouseLeave handlers in HomeHero / HomeTrialCta can go. */
.brand-scope .brand-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--r-cta);
  background: linear-gradient(180deg, var(--brand-cta-top), var(--brand-cta-bot));
  color: var(--brand-cta-ink);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--brand-cta-shadow);
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.brand-scope .brand-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(212,175,55,0.40);
}
.brand-scope .brand-cta:focus-visible {
  outline: 2px solid var(--brand-gold-hi);
  outline-offset: 3px;
}
.brand-scope .brand-cta:active {
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .brand-scope .brand-cta { transition: none; }
  .brand-scope .brand-cta:hover { transform: none; }
}

/* Headline — Newsreader for Latin. Newsreader has no Arabic glyphs, so
 * AR switches to Amiri with room for its marks (shadda etc.). */
.brand-scope .brand-headline {
  font-family: var(--ff-headline);
  font-weight: 500;
  font-size: clamp(1.75rem, 5vw, 2.125rem);
  line-height: 1.12;
  letter-spacing: -0.012em;
}
[dir="rtl"] .brand-scope .brand-headline {
  font-family: var(--ff-arabic-headline);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0;
}
.brand-scope .brand-headline-accent {
  color: var(--brand-gold-hi);
}

/* Step numeral — outlined Cinzel digit. Decorative (aria-hidden at the
 * call site); the <ol> carries the numbering. */
.brand-scope .brand-step-num {
  font-family: var(--ff-display);
  font-weight: 500;
  font-size: 52px;
  line-height: 1;
  color: transparent;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 1.4px #C9A84C;
}
[dir="rtl"] .brand-scope .brand-step-num {
  letter-spacing: 0;
}
@media (max-width: 399px) {
  .brand-scope .brand-step-num {
    font-size: 40px;
  }
}

/* ── Landing page application (steps 4-8, 10 — 2026-10-16) ──────── */

/* Page background — fixed overlay, as founders.css does it. Scoped to
 * the landing wrapper only; body / global.css keep #07070F. Direct
 * children sit above it (the sticky header keeps its own inline
 * position + z-index, which wins over this rule). */
.brand-scope.brand-page {
  position: relative;
  isolation: isolate;
}
.brand-scope.brand-page::before {
  content: '';
  position: fixed;
  inset: 0;
  background: var(--brand-bg-image);
  pointer-events: none;
  z-index: 0;
}
.brand-scope.brand-page > * {
  position: relative;
  z-index: 1;
}

/* Small label pill — eyebrows and the Founding 100 badge. */
.brand-scope .brand-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 5px 12px;
  background: rgba(201,168,76,0.06);
  font-family: var(--ff-body);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.04em;
  color: var(--brand-text-hi);
}
.brand-scope .brand-dot {
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-gold);
  box-shadow: 0 0 6px rgba(201,168,76,0.6);
}

/* Outline pill button (header sign-in, PreFooter WhatsApp trial). */
.brand-scope .brand-pill-btn {
  background: transparent;
  cursor: pointer;
  transition: background 120ms ease;
}
.brand-scope .brand-pill-btn:hover {
  background: rgba(201,168,76,0.12);
}
.brand-scope .brand-pill-btn:focus-visible {
  outline: 2px solid var(--brand-gold-hi);
  outline-offset: 3px;
}

/* Founder photo — 1px gold gradient ring (padding-box trick, no
 * clip-path) + soft gold glow. */
.brand-scope .brand-photo-frame {
  padding: 1px;
  border-radius: var(--r-photo);
  background: linear-gradient(160deg, rgba(232,204,122,0.45), rgba(201,168,76,0.12) 55%, rgba(255,255,255,0.08));
  box-shadow: 0 0 60px rgba(201,168,76,0.16);
}
.brand-scope .brand-photo-inner {
  width: 100%;
  height: 100%;
  border-radius: calc(var(--r-photo) - 1px);
  overflow: hidden;
  background: var(--brand-panel-inner);
}

/* Landing header spacing (2026-10-16). Below 400px the FR sign-in label
 * left the wordmark, pill and language toggle almost touching; tighter
 * side padding and action gap give them room without hiding anything. */
.brand-scope .home-header {
  padding: max(env(safe-area-inset-top), var(--sp-4)) var(--sp-5) var(--sp-4);
  gap: var(--sp-3);
}
.brand-scope .home-header-actions {
  gap: var(--sp-4);
}
@media (max-width: 399px) {
  .brand-scope .home-header {
    padding-inline: var(--sp-4);
  }
  .brand-scope .home-header-actions {
    gap: var(--sp-2);
  }
}

/* PreFooter WhatsApp trial button — brighter ring and label than the
 * header pill, still an outline so the gold CTA stays primary. */
.brand-scope .home-pf-trial-btn {
  border-color: rgba(232,204,122,0.75);
  color: var(--brand-cta-top);
}

/* Footer links: hover and a visible keyboard focus ring. */
.brand-scope .home-footer-link {
  border-radius: 4px;
}
.brand-scope .home-footer-link:hover {
  color: var(--brand-text-hi);
  text-decoration: underline;
}
.brand-scope .home-footer-link:focus-visible {
  outline: 2px solid var(--brand-gold-hi);
  outline-offset: 2px;
  color: var(--brand-text-hi);
}
