/* ==========================================================================
   Deuce — deucewrld.com
   One stylesheet for every page. No build step, no external requests.

   Palette is lifted verbatim from lib/core/style/app_colors.dart so the site
   and the app stay in sync. If a colour changes there, change it here.

   Direction: every inline-axis property is LOGICAL (margin-inline-start, not
   margin-left). Switching to Arabic flips `dir` on <html> and nothing else
   needs to know.
   ========================================================================== */

:root {
  /* Brand — from AppColors */
  --green: #00450d;        /* AppColors.primary          — primary surfaces */
  --green-mid: #1b5e20;    /* AppColors.primaryContainer — "Court Green"     */
  --lime: #bcf200;         /* AppColors.secondaryContainer — accent, CTAs    */
  --paper: #f9f9f6;        /* AppColors.surface          — page background   */
  --ink: #1a1c1b;          /* AppColors.onSurface        — body text         */

  /* Supporting neutrals — also from AppColors */
  --ink-soft: #41493e;     /* onSurfaceVariant */
  --card: #ffffff;         /* surfaceContainerLowest */
  --card-alt: #f4f4f1;     /* surfaceContainerLow */
  --hairline: #c0c9bb;     /* outlineVariant */
  --outline: #717a6d;      /* outline */

  /* Type — system stacks only. No webfonts: no build step, no third-party
     request, nothing to consent to. */
  --font-latin: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  --font-arabic: "SF Arabic", "Geeza Pro", "Noto Naskh Arabic", "Segoe UI",
    Tahoma, Arial, sans-serif;

  --measure: 62ch;         /* readable line length */
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --radius: 14px;
}

/* ── Bilingual switching ──────────────────────────────────────────────────
   Both languages live in the same document. The inline <head> script sets
   data-lang on <html> before first paint, so there is no flash of the wrong
   language. Elements carrying .lang-swap are the toggle's own labels and
   invert the rule (the button shows the language you are NOT reading).
   With JavaScript off, data-lang is never set — the <noscript> block in the
   head hides Arabic and the page reads as English-only.
   ───────────────────────────────────────────────────────────────────────── */

html[data-lang="en"] [lang="ar"]:not(.lang-swap) { display: none; }
html[data-lang="ar"] [lang="en"]:not(.lang-swap) { display: none; }
html[data-lang="en"] .lang-swap[lang="en"] { display: none; }
html[data-lang="ar"] .lang-swap[lang="ar"] { display: none; }

/* ── Reset-ish ────────────────────────────────────────────────────────── */

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

html {
  font-family: var(--font-latin);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@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(--paper);
  color: var(--ink);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.6;
}

img { max-inline-size: 100%; block-size: auto; }

h1, h2, h3 { line-height: 1.12; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }

a { color: inherit; }

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

/* ── Arabic typography ────────────────────────────────────────────────────
   Two things that are wrong by default for Arabic and have to be undone:

   1. letter-spacing BREAKS Arabic. The script is cursive — spacing the
      glyphs severs the joins and the word stops being readable. Every rule
      below that sets letter-spacing is cancelled for lang="ar".
   2. Arabic needs more leading than Latin at the same size; ascenders and
      diacritics collide otherwise.
   ───────────────────────────────────────────────────────────────────────── */

[lang="ar"] {
  font-family: var(--font-arabic);
  line-height: 1.9;
}

[lang="ar"] h1,
[lang="ar"] h2,
[lang="ar"] h3,
[lang="ar"] .eyebrow,
[lang="ar"] .wordmark,
[lang="ar"] .btn,
[lang="ar"] .badge__label {
  letter-spacing: normal;      /* see (1) above — do not remove */
  text-transform: none;        /* uppercase is meaningless in Arabic */
  line-height: 1.35;
}

/* ── Layout primitives ────────────────────────────────────────────────── */

.wrap {
  inline-size: min(1100px, 100%);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

.eyebrow {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green-mid);
  margin-block-end: 0.75rem;
}

.skip-link {
  position: absolute;
  inset-block-start: -100vh;
  inset-inline-start: 1rem;
  z-index: 10;
  background: var(--lime);
  color: var(--green);
  font-weight: 700;
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 var(--radius) var(--radius);
  text-decoration: none;
}
.skip-link:focus { inset-block-start: 0; }

/* ── Brand ────────────────────────────────────────────────────────────────
   THERE IS NO LOGO YET (FUL-119 is open and the design is undecided).
   The brand is carried entirely by type and colour. `.brand-mark` below is a
   reserved, correctly-sized empty box sitting where the mark will go: drop an
   <img>/<svg> into the LOGO SLOT in the HTML and nothing around it reflows.
   Do not improvise a mark here.
   ───────────────────────────────────────────────────────────────────────── */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
}

.brand-mark {
  inline-size: 2rem;
  block-size: 2rem;
  flex: none;
  /* Deliberately invisible while empty — a placeholder swatch on a live page
     looks like a broken image. The space is held, not decorated. */
}

.wordmark {
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

/* ── Header ───────────────────────────────────────────────────────────── */

.masthead {
  background: var(--green);
  color: var(--paper);
}

.masthead__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.25rem;
  flex-wrap: wrap;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 3vw, 1.75rem);
  flex-wrap: wrap;
}

.nav a {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9375rem;
  opacity: 0.85;
}
.nav a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }

.lang-toggle {
  font: inherit;
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--paper);
  background: transparent;
  border: 1.5px solid rgba(249, 249, 246, 0.45);
  border-radius: 999px;
  padding: 0.4rem 0.95rem;
  cursor: pointer;
}
.lang-toggle:hover { border-color: var(--lime); color: var(--lime); }

/* ── Hero ─────────────────────────────────────────────────────────────── */

.hero {
  background: var(--green);
  color: var(--paper);
  padding-block: clamp(3rem, 9vw, 6.5rem) clamp(3.5rem, 10vw, 7rem);
}

.hero h1 {
  font-size: clamp(2.4rem, 7vw, 4.25rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  max-inline-size: 18ch;
}

.hero__accent { color: var(--lime); }

.hero p {
  margin-block-start: 1.5rem;
  max-inline-size: 46ch;
  font-size: clamp(1.0625rem, 1rem + 0.4vw, 1.25rem);
  color: rgba(249, 249, 246, 0.82);
}

/* ── Store badges — deliberately non-functional ───────────────────────────
   No App Store or Play listing exists yet. These are inert <span>s, not
   links: nothing to click, nothing to 404. They also carry no Apple/Google
   logo art — using the official badges is trademark-licensed and the real
   badges arrive with the real listings.
   ───────────────────────────────────────────────────────────────────────── */

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-block-start: 2.25rem;
  padding: 0;
  list-style: none;
}

.badge {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.7rem 1.15rem;
  border: 1.5px dashed rgba(249, 249, 246, 0.4);
  border-radius: var(--radius);
  color: rgba(249, 249, 246, 0.62);
  cursor: not-allowed;
}

.badge__label { font-weight: 700; font-size: 0.9375rem; letter-spacing: -0.01em; }
.badge__note { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; }

.hero__badges-caption {
  margin-block-start: 1rem;
  font-size: 0.875rem;
  color: rgba(249, 249, 246, 0.6);
}

/* ── Steps ────────────────────────────────────────────────────────────── */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-block-start: 2.5rem;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

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

.step__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 2.25rem;
  block-size: 2.25rem;
  border-radius: 999px;
  background: var(--lime);
  color: var(--green);
  font-weight: 800;
  font-size: 1.0625rem;
  margin-block-end: 1rem;
}

.step h3 {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-block-end: 0.5rem;
}

.step p { color: var(--ink-soft); font-size: 0.9375rem; }

/* ── Secondary feature band ───────────────────────────────────────────── */

.band { background: var(--card-alt); }

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
  margin-block-start: 2.5rem;
  padding: 0;
  list-style: none;
}

.feature {
  border-inline-start: 3px solid var(--lime);
  padding-inline-start: 1.25rem;
}

.feature h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-block-end: 0.4rem;
}

.feature p { color: var(--ink-soft); font-size: 0.9375rem; }

/* ── Section headings ─────────────────────────────────────────────────── */

.section h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  max-inline-size: 20ch;
}

.section__lede {
  margin-block-start: 1rem;
  max-inline-size: var(--measure);
  color: var(--ink-soft);
}

/* ── Support ──────────────────────────────────────────────────────────── */

.support-card {
  margin-block-start: 2rem;
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  max-inline-size: var(--measure);
}

.btn {
  display: inline-block;
  margin-block-start: 1.25rem;
  background: var(--lime);
  color: var(--green);
  font-weight: 800;
  letter-spacing: -0.01em;
  text-decoration: none;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
}
.btn:hover { background: var(--green); color: var(--lime); }

/* ── Footer ───────────────────────────────────────────────────────────── */

.colophon {
  background: var(--green);
  color: rgba(249, 249, 246, 0.75);
  padding-block: 3rem;
  font-size: 0.9375rem;
}

.colophon__top {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: space-between;
  align-items: center;
  padding-block-end: 2rem;
  border-block-end: 1px solid rgba(249, 249, 246, 0.18);
}

.colophon .brand { color: var(--paper); }

.colophon__links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.colophon__links a { text-decoration: none; font-weight: 600; }
.colophon__links a:hover { color: var(--lime); text-decoration: underline; text-underline-offset: 4px; }

.colophon__legal {
  padding-block-start: 2rem;
  display: grid;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: rgba(249, 249, 246, 0.6);
}

/* Placeholders that must survive review — visually flagged so nobody ships
   the page with [ENTITY: …] or [TBD: …] still in it by accident. */
.placeholder {
  background: rgba(188, 242, 0, 0.14);
  border-block-end: 1px dashed var(--lime);
  color: var(--lime);
  padding-inline: 0.2em;
  font-style: normal;
}

/* ── Long-form documents (privacy, terms) ─────────────────────────────── */

.doc { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.doc__body { max-inline-size: var(--measure); }
.doc__body h2 { font-size: 1.5rem; margin-block: 2.5rem 0.75rem; letter-spacing: -0.02em; }
.doc__body h3 { font-size: 1.125rem; margin-block: 1.75rem 0.5rem; }
.doc__body p, .doc__body li { color: var(--ink-soft); }
.doc__body p + p { margin-block-start: 1rem; }
.doc__body ul, .doc__body ol { padding-inline-start: 1.5rem; }
.doc__body li + li { margin-block-start: 0.4rem; }

.doc__meta {
  margin-block-start: 1.5rem;
  font-size: 0.875rem;
  color: var(--ink-soft);
}
.doc__meta dt { font-weight: 700; color: var(--ink); }
.doc__meta dd { margin: 0 0 0.5rem; padding-inline-start: 0; }

.notice {
  background: rgba(188, 242, 0, 0.18);
  border-inline-start: 4px solid var(--lime);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.25rem 1.5rem;
  margin-block: 1.5rem;
}
.notice p { color: var(--ink); }
.notice h2 { margin-block-start: 0; font-size: 1.25rem; }

/* Draft banner — deliberately loud. These documents must not be mistaken for
   published policy while they still carry [ENTITY: …] placeholders. */
.notice--draft {
  background: #fff3f2;                 /* AppColors.errorContainer, lightened */
  border-inline-start-color: #ba1a1a;  /* AppColors.error */
}

/* Tables inside long-form documents. They scroll inside their own container
   rather than making the page scroll sideways — which matters most in Arabic
   on a small screen, where these get wide. */
.table-scroll {
  overflow-x: auto;
  margin-block: 1.5rem;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
}

.doc__body table {
  border-collapse: collapse;
  inline-size: 100%;
  min-inline-size: 32rem;
  font-size: 0.9375rem;
}

.doc__body th,
.doc__body td {
  text-align: start;
  padding: 0.75rem 1rem;
  border-block-end: 1px solid var(--hairline);
  vertical-align: top;
  color: var(--ink-soft);
}

.doc__body thead th {
  background: var(--card-alt);
  color: var(--ink);
  font-weight: 700;
}

.doc__body tbody tr:last-child th,
.doc__body tbody tr:last-child td { border-block-end: 0; }

@media print {
  .masthead, .colophon__links, .lang-toggle, .skip-link { display: none; }
}
