/* YORYX group landing — minimal, fast, RTL-aware. No build step.
 *
 * Theming is driven by the `data-theme` attribute on <html> (set server-side
 * from the yx_theme cookie; the no-FOUC inline script resolves "system" before
 * first paint). Every color used in the page references a CSS variable so the
 * dark/light flip happens by swapping the token block, never per-component. */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("/static/fonts/inter-latin-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("/static/fonts/inter-latin-500.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("/static/fonts/inter-latin-600.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("/static/fonts/inter-latin-700.woff2") format("woff2"); }
@font-face { font-family: "Cairo"; font-style: normal; font-weight: 400; font-display: swap; src: url("/static/fonts/cairo-arabic-400.woff2") format("woff2"); }
@font-face { font-family: "Cairo"; font-style: normal; font-weight: 500; font-display: swap; src: url("/static/fonts/cairo-arabic-500.woff2") format("woff2"); }
@font-face { font-family: "Cairo"; font-style: normal; font-weight: 600; font-display: swap; src: url("/static/fonts/cairo-arabic-600.woff2") format("woff2"); }
@font-face { font-family: "Cairo"; font-style: normal; font-weight: 700; font-display: swap; src: url("/static/fonts/cairo-arabic-700.woff2") format("woff2"); }

/* ============================================================================
 * DESIGN SYSTEM token layer — docs/platform/DESIGN_SYSTEM.md (single source of
 * truth). Raw hex lives ONLY in this token-definition layer, never in
 * components. Light = :root default; [data-theme="dark"] swaps semantics;
 * [data-family]/[data-product] are set on <html> server-side.
 * ==========================================================================*/
:root {
  --yx-radius: 14px;
  --yx-maxw: 1100px;

  --font-sans: "Inter", "Cairo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-ar: "Cairo", "Noto Sans Arabic", "Tajawal", sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", ui-monospace, monospace;
  --leading-normal: 1.55;
  --yx-font: var(--font-sans);

  --ink-950: #0E1626; --ink-900: #14213D; --ink-700: #1D2F56; --ink-500: #3A4A6B;
  --ink-300: #8A97AE; --ink-200: #C2CAD9; --ink-100: #E6EAF1; --ink-50: #F4F6FA;
  --paper: #FAF8F4; --white: #FFFFFF;

  --surface: var(--white);
  --surface-2: var(--ink-50);
  --surface-sunken: var(--paper);
  --border: var(--ink-100);
  --border-strong: var(--ink-200);
  --text: var(--ink-900);
  --text-muted: var(--ink-500);
  --text-inverse: var(--white);
  --primary: var(--ink-900);
  --primary-contrast: var(--white);
  --accent: var(--ink-700);
  --tint: var(--ink-50);

  --success: #1B7F4D; --warning: #B98B2F; --danger: #8C1D2F; --info: #1F6FB2;

  --radius-sm: 6px; --radius-md: 10px; --radius-lg: 16px; --radius-full: 999px;
  --shadow-sm: 0 1px 2px rgba(14,22,38,.06);
  --shadow-md: 0 4px 12px rgba(14,22,38,.10);
  --shadow-lg: 0 12px 32px rgba(14,22,38,.16);
}

[data-theme="dark"] {
  --surface: #0E1626;
  --surface-2: #14213D;
  --surface-sunken: #0B1220;
  --border: #243152;
  --border-strong: #31406A;
  --text: #E8ECF6;
  --text-muted: #9AA8C4;
  --text-inverse: #0E1626;
  --primary-contrast: #0E1626;
  --tint: #1A2747;
  --success: #3FA873; --warning: #D8B65A; --danger: #E0667A; --info: #5AA8E0;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.35);
  --shadow-md: 0 4px 12px rgba(0,0,0,.45);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.55);
}

[data-family="finance"]    { --primary:#0F5C4D; --accent:#1B9E7A; --tint:#E6F4EF; }
[data-family="trust"]      { --primary:#14213D; --accent:#A4243B; --tint:#F6E3E7; }
[data-family="commerce"]   { --primary:#B5430F; --accent:#F2820A; --tint:#FDEEDD; }
[data-family="auto"]       { --primary:#23303A; --accent:#3E7CB1; --tint:#E5EEF5; }
[data-family="realestate"] { --primary:#7A3B2E; --accent:#C77B5A; --tint:#F4E7E1; }
[data-family="mobility"]   { --primary:#0C5566; --accent:#19A0B8; --tint:#E0F2F5; }
[data-family="lifestyle"]  { --primary:#8E2F5A; --accent:#D46A93; --tint:#F8E5EE; }
[data-family="learn"]      { --primary:#2E2C75; --accent:#5C5BCF; --tint:#E8E8FA; }
[data-family="work"]       { --primary:#1C3A5E; --accent:#3E7CB1; --tint:#E5EDF5; }
[data-family="health"]     { --primary:#136B63; --accent:#2FA39A; --tint:#E1F2F0; }
[data-family="media"]      { --primary:#8A1E63; --accent:#D63C9A; --tint:#FBE3F1; }
[data-family="platform"]   { --primary:#14213D; --accent:#3A4A6B; --tint:#E6EAF1; }

[data-theme="dark"][data-family="finance"]    { --accent:#3FC79E; --tint:#103A30; }
[data-theme="dark"][data-family="trust"]      { --accent:#D65C70; --tint:#3A1A24; }
[data-theme="dark"][data-family="commerce"]   { --accent:#FCA23E; --tint:#3A2410; }
[data-theme="dark"][data-family="auto"]       { --accent:#6BA3D6; --tint:#1A2730; }
[data-theme="dark"][data-family="realestate"] { --accent:#E0A186; --tint:#33201A; }
[data-theme="dark"][data-family="mobility"]   { --accent:#46C4DA; --tint:#0E2E36; }
[data-theme="dark"][data-family="lifestyle"]  { --accent:#E895B5; --tint:#341B27; }
[data-theme="dark"][data-family="learn"]      { --accent:#8786E6; --tint:#22214A; }
[data-theme="dark"][data-family="work"]       { --accent:#6BA3D6; --tint:#16263A; }
[data-theme="dark"][data-family="health"]     { --accent:#56C7BE; --tint:#0F322E; }
[data-theme="dark"][data-family="media"]      { --accent:#E96CB8; --tint:#3A132B; }
[data-theme="dark"][data-family="platform"]   { --accent:#6B7DA3; --tint:#1A2747; }

:root[data-family="trust"][data-product="sello"] {
  --sello-ink:#14213D; --sello-ink-700:#1D2F56; --sello-wax:#A4243B;
  --sello-wax-soft:#F6E3E7; --sello-verified:#1B7F4D; --sello-pending:#B98B2F;
  --sello-invalid:#8C1D2F; --sello-paper:#FAF8F4; --sello-border:#D8D3C8;
}

/* Legacy --yx-* bridge: maps the pre-design-system names used throughout this
 * sheet onto the semantic tokens, so the whole page is theme- and
 * family-driven. New styling should target the semantic tokens directly. */
:root {
  --yx-bg: var(--surface-sunken);
  --yx-surface: var(--surface);
  --yx-surface-2: var(--surface-2);
  --yx-text: var(--text);
  --yx-muted: var(--text-muted);
  --yx-accent: var(--accent);
  --yx-accent-hover: var(--primary);
  --yx-accent-ink: var(--primary-contrast);
  --yx-inactive: var(--surface-2);
  --yx-inactive-stroke: var(--border-strong);
  --yx-border: var(--border);
  --yx-badge-active-bg: var(--tint);
  --yx-badge-coming-bg: var(--surface-2);
  --yx-shadow: var(--shadow-lg);
}

[dir="rtl"] body { font-family: var(--font-ar); line-height: var(--leading-normal); }

* { box-sizing: border-box; }

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--yx-bg);
  color: var(--yx-text);
  font-family: var(--yx-font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-inline-size: var(--yx-maxw);
  margin-inline: auto;
  padding-inline: 20px;
}

a { color: var(--yx-accent); text-decoration: none; }
a:hover { color: var(--yx-accent-hover); }

/* ---- Site header + shared chrome ---- */
.site-header {
  padding-block: 18px;
  border-block-end: 1px solid var(--yx-border);
  background: var(--yx-bg);
}
.site-header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.site-header .brand {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.08em;
  color: var(--yx-text);
}

.chrome {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---- Dropdown menu primitive (yx-menu) ----
 * One <details>-based component shared by the language and theme switchers.
 * Works fully with JS OFF: the <summary> toggles [open]. The menuIsland
 * progressive-enhancement script only closes menus on outside-click / Escape.
 * RTL is handled via CSS logical properties (inset-inline-end, padding-inline,
 * text-align: start). Theming flows through the shared color tokens. */
.yx-menu {
  position: relative;
  display: inline-block;
}
.yx-menu__summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: var(--yx-surface-2);
  border: 1px solid var(--yx-border);
  border-radius: 999px;
  color: var(--yx-text);
  font-weight: 600;
  font-size: 0.85rem;
  line-height: 1.2;
  user-select: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.yx-menu__summary::-webkit-details-marker { display: none; }
.yx-menu__summary::marker { content: ""; }
.yx-menu__summary:hover {
  border-color: var(--yx-accent);
}
.yx-menu__summary:focus-visible {
  outline: 2px solid var(--yx-accent-hover);
  outline-offset: 2px;
}
.yx-menu__current {
  white-space: nowrap;
}
.yx-menu__chevron {
  color: var(--yx-muted);
  transition: transform 0.18s ease;
  flex-shrink: 0;
}
.yx-menu[open] .yx-menu__chevron { transform: rotate(180deg); }
.yx-menu[open] .yx-menu__summary { border-color: var(--yx-accent); }

.yx-menu__panel {
  position: absolute;
  inset-block-start: calc(100% + 6px);
  inset-inline-end: 0;
  min-inline-size: 220px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--yx-surface);
  border: 1px solid var(--yx-border);
  border-radius: 12px;
  box-shadow: var(--yx-shadow);
  z-index: 50;
}
.yx-menu__panel li { margin: 0; }

.yx-menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  inline-size: 100%;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  color: var(--yx-text);
  font: inherit;
  font-size: 0.9rem;
  text-align: start;
  text-decoration: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease;
}
.yx-menu__item:hover,
.yx-menu__item:focus-visible {
  background: var(--yx-surface-2);
  color: var(--yx-text);
  outline: none;
}
.yx-menu__item.is-active {
  color: var(--yx-accent);
  font-weight: 700;
}
.yx-menu__check {
  display: inline-block;
  inline-size: 14px;
  text-align: center;
  font-weight: 700;
  color: var(--yx-accent);
  flex-shrink: 0;
}
.yx-menu__label { display: inline-block; }

.yx-menu__nojs {
  display: flex;
  gap: 4px;
  margin-block-start: 6px;
  padding: 6px;
}
.yx-menu__item--nojs {
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--yx-surface-2);
  border: 1px solid var(--yx-border);
  color: var(--yx-text);
  cursor: pointer;
  font-weight: 600;
}

/* ---- Hero ---- */
.hero {
  text-align: center;
  padding-block: 48px 24px;
}
.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin: 0 0 12px;
  font-weight: 800;
}
.hero .tagline {
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  color: var(--yx-accent);
  margin: 0 0 10px;
  font-weight: 600;
}
.hero .subtitle {
  color: var(--yx-muted);
  max-inline-size: 640px;
  margin-inline: auto;
}

/* ---- Africa map ---- */
.map-wrap {
  padding-block: 24px 56px;
}
.africa-map {
  display: block;
  inline-size: 100%;
  block-size: auto;
  max-block-size: 78vh;
  margin-inline: auto;
}
.africa-map .country {
  fill: var(--yx-inactive);
  stroke: var(--yx-inactive-stroke);
  stroke-width: 0.6;
  transition: fill 0.15s ease;
}
.africa-map .country--active {
  fill: var(--yx-accent);
  cursor: pointer;
}
.africa-map a:hover .country--active,
.africa-map a:focus .country--active {
  fill: var(--yx-accent-hover);
}
.africa-map a:focus-visible {
  outline: 3px solid var(--yx-accent-hover);
  outline-offset: 2px;
}
.africa-map .country--inactive {
  pointer-events: none;
}

.map-legend {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-block-start: 18px;
  color: var(--yx-muted);
  font-size: 0.9rem;
  flex-wrap: wrap;
}
.map-legend .swatch {
  display: inline-block;
  inline-size: 14px;
  block-size: 14px;
  border-radius: 3px;
  margin-inline-end: 6px;
  vertical-align: middle;
}
.swatch--active { background: var(--yx-accent); }
.swatch--inactive { background: var(--yx-inactive); }

.preview-chip {
  fill: var(--yx-text);
  font-size: 13px;
}

/* ---- Country product grid ---- */
.country-head {
  padding-block: 40px 16px;
  text-align: center;
}
.country-head h1 { margin: 0 0 8px; font-size: clamp(1.6rem, 3vw, 2.2rem); }
.country-head .blurb { color: var(--yx-muted); max-inline-size: 620px; margin-inline: auto; }
.back-link { display: inline-block; margin-block-start: 14px; color: var(--yx-muted); }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  padding-block: 24px 64px;
}
.product-card {
  background: var(--yx-surface);
  border: 1px solid var(--yx-border);
  border-radius: var(--yx-radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.product-card .logo {
  inline-size: 44px;
  block-size: 44px;
  border-radius: 10px;
  background: var(--yx-surface-2);
  display: grid;
  place-items: center;
  font-weight: 800;
  color: var(--yx-accent);
}
.product-card h2 { margin: 0; font-size: 1.2rem; }
.product-card .desc { color: var(--yx-muted); flex: 1; margin: 0; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  inline-size: fit-content;
}
.badge--active { background: var(--yx-badge-active-bg); color: var(--yx-accent); }
.badge--coming { background: var(--yx-badge-coming-bg); color: var(--yx-muted); }

.cta {
  display: inline-block;
  padding: 9px 16px;
  border-radius: 10px;
  background: var(--yx-accent);
  color: var(--yx-accent-ink);
  font-weight: 700;
  inline-size: fit-content;
}
.cta:hover { background: var(--yx-accent-hover); color: var(--yx-accent-ink); }
.cta--disabled {
  background: var(--yx-surface-2);
  color: var(--yx-muted);
  cursor: not-allowed;
  pointer-events: none;
}

.site-footer {
  border-block-start: 1px solid var(--yx-border);
  padding-block: 24px;
  color: var(--yx-muted);
  font-size: 0.85rem;
  text-align: center;
}
