/* Tokens from packages/ui/design-system.ts */
:root {
  /* Brand */
  --color-primary: hsl(198, 86%, 53%);
  --color-secondary: hsl(270, 70%, 60%);

  /* Greys */
  --grey-100: hsl(198, 25%, 98%);
  --grey-200: hsl(198, 22%, 94%);
  --grey-300: hsl(198, 20%, 88%);
  --grey-400: hsl(198, 18%, 80%);
  --grey-500: hsl(198, 16%, 60%);
  --grey-600: hsl(198, 15%, 40%);
  --grey-700: hsl(198, 18%, 25%);
  --grey-800: hsl(198, 22%, 15%);
  --grey-900: hsl(198, 25%, 10%);

  /* Surface & text */
  --color-background: hsl(198, 20%, 98%);
  --color-surface: hsl(198, 20%, 100%);
  --color-on-surface: hsl(198, 22%, 15%);
  --color-on-surface-variant: hsl(198, 15%, 40%);
  --color-surface-container-low: hsl(198, 25%, 98%);
  --color-surface-container-high: hsl(198, 22%, 94%);
  --color-outline: hsl(198, 18%, 80%);
  --color-outline-variant: hsl(198, 22%, 94%);

  /* Accents */
  --color-error: hsl(0, 84%, 60%);
  --color-success: hsl(142, 71%, 45%);
  --color-warning: hsl(38, 92%, 50%);

  /* Semantic aliases */
  --bg: var(--color-background);
  --surface: var(--color-surface);
  --border: var(--color-outline);
  --border-light: var(--color-outline-variant);
  --text-primary: var(--color-on-surface);
  --text-secondary: var(--color-on-surface-variant);
  --text-tertiary: var(--grey-500);
  --accent: var(--color-primary);
  --accent-bg: hsla(198, 86%, 53%, 0.08);

  /* Typography — FONTS.en */
  --font-title: 'Manrope', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'Manrope', ui-sans-serif, system-ui, sans-serif;
  --font-brand-en: 'Chewy', cursive;
  --font-home-brand-ar: 'Playpen Sans Arabic', cursive;
  --font-brand-ar: 'Alyamama', ui-sans-serif, system-ui, sans-serif;
  --font-body-ar: 'Alyamama', ui-sans-serif, system-ui, sans-serif;

  /* radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  /* borders.width */
  --border-thin: 1px;
  --border-medium: 2px;

  /* spacing — 1rem = 16px */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-xxl: 3rem;

  /* layout */
  --size-hero-logo: 18rem;

  /* fontSize */
  --text-xs: 12px;
  --text-sm: 14px;
  --text-md: 16px;
  --text-lg: 18px;
  --text-xl: 20px;
  --text-header: 28px;
  --text-title: 36px;

  /* shadows — converted from shadows.sm */
  --shadow-sm: 0 4px 6px hsla(198, 86%, 53%, 0.08);
  --shadow-md: 0 6px 10px hsla(198, 86%, 53%, 0.1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--grey-900);
    --surface: var(--grey-800);
    --border: var(--grey-700);
    --border-light: var(--grey-700);
    --text-primary: var(--grey-100);
    --text-secondary: var(--grey-400);
    --text-tertiary: var(--grey-500);
    --accent-bg: hsla(198, 86%, 53%, 0.12);
    --color-surface-container-high: var(--grey-700);
  }
}

* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  padding: var(--space-lg) var(--space-lg) calc(var(--space-xxl) + var(--space-xl));
  margin: 0;
  line-height: 1.6;
}

.wrap {
  max-width: 620px;
  margin: 0 auto;
}

/* Site navigation */
.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  flex-wrap: wrap;
  padding-bottom: var(--space-md);
  margin-bottom: var(--space-lg);
  border-bottom: var(--border-thin) solid var(--border);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.nav-links a {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s;
}

.nav-links a:hover,
.nav-links a.is-active {
  color: var(--accent);
}

.site-nav[dir="rtl"] .nav-links {
  direction: rtl;
}

.site-nav[dir="rtl"] .nav-links a {
  font-family: var(--font-body-ar);
}

.page-logo {
  object-fit: contain;
  display: block;
}

/* Homepage */
.content--home {
  margin-top: var(--space-xxl);
}

.content--home .hero {
  display: grid;
  grid-template-columns: var(--size-hero-logo) minmax(0, 1fr);
  gap: var(--space-xl);
  align-items: center;
  padding: 0;
  margin-bottom: var(--space-xxl);
}

.hero__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-md);
  min-width: 0;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-lg);
  background: var(--accent-bg);
  color: var(--accent);
  border: var(--border-thin) solid hsla(198, 86%, 53%, 0.35);
}

.hero-badge svg {
  width: 0.875rem;
  height: 0.875rem;
  flex-shrink: 0;
}

.content--home .page-logo,
.content--home .hero__logo {
  width: var(--size-hero-logo);
  height: var(--size-hero-logo);
  flex-shrink: 0;
}

.content--home .hero h1 {
  font-family: var(--font-brand-en);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 400;
  line-height: 1.15;
  color: var(--color-primary);
  margin: 0;
}

.content--home .hero p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0;
}

.hero-btns {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-md);
  margin-top: var(--space-xs);
}

.store-badge {
  display: block;
  line-height: 0;
  text-decoration: none;
  transition: opacity 0.15s;
}

.store-badge:hover {
  opacity: 0.85;
}

.store-badge img {
  display: block;
  height: 2.5rem;
  width: auto;
  max-width: 100%;
}

.hero-divider {
  width: 2.5rem;
  height: var(--border-medium);
  background: var(--color-primary);
  border-radius: var(--radius-sm);
  margin: 0 auto var(--space-lg);
  opacity: 0.4;
}

.content--home .sections {
  text-align: center;
}

.content--home .sections section {
  border-bottom: none;
}

.content--home .sections p {
  max-width: 42ch;
  margin-inline: auto;
}

.content--home footer {
  justify-content: center;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-top: 0;
}

body.is-rtl .content--home .hero h1 {
  font-family: var(--font-home-brand-ar);
  font-weight: 500;
}

body.is-rtl .hero-badge,
body.is-rtl .content--home .hero p {
  font-family: var(--font-body-ar);
  font-weight: 500;
}

[dir="rtl"] .hero {
  direction: rtl;
}

[dir="rtl"] .hero__content {
  align-items: flex-start;
  text-align: right;
}

@media (max-width: 640px) {
  .content--home .hero {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .hero__content {
    align-items: center;
  }

  [dir="rtl"] .hero__content {
    align-items: center;
    text-align: center;
  }

  .hero-btns {
    justify-content: center;
  }
}

/* Language switcher */
.lang-switch {
  display: flex;
  gap: var(--space-sm);
  flex-shrink: 0;
}

.lang-btn {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: var(--space-sm) var(--space-md);
  border: var(--border-thin) solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.lang-btn:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.lang-btn.is-active {
  background: var(--accent-bg);
  border-color: hsla(198, 86%, 53%, 0.45);
  color: var(--accent);
}

.content.is-hidden,
.site-nav.is-hidden {
  display: none;
}

/* RTL / Darija */
.lang-btn[data-lang="ar"] {
  font-family: var(--font-brand-ar);
  font-weight: 500;
}

body.is-rtl {
  font-family: var(--font-body-ar);
  font-weight: 300;
}

body.is-rtl .eyebrow {
  font-family: var(--font-body-ar);
}

body.is-rtl header h1 {
  font-family: var(--font-brand-ar);
  font-weight: 500;
}

body.is-rtl h2 {
  font-family: var(--font-body-ar);
  font-weight: 500;
}

body.is-rtl .summary ul li::before {
  content: '✓';
}

body.is-rtl .rights li::before {
  content: '←';
}

body.is-rtl .data-item {
  text-align: right;
}

body.is-rtl footer {
  flex-direction: row-reverse;
}

/* Header */
header {
  margin-bottom: var(--space-lg);
}

.eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: calc(var(--space-sm) + var(--space-xs));
}

h1 {
  font-family: var(--font-title);
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 var(--space-sm);
  color: var(--text-primary);
}

.meta {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  margin: 0;
}

/* Plain-language summary card */
.summary {
  background: var(--accent-bg);
  border: var(--border-thin) solid hsla(198, 86%, 53%, 0.25);
  border-radius: var(--radius-md);
  padding: calc(var(--space-md) + var(--space-xs)) var(--space-lg);
  margin-bottom: var(--space-sm);
  box-shadow: var(--shadow-sm);
}

.summary-title {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-sm);
}

.summary ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin: 0;
  padding: 0;
}

.summary ul li {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  display: flex;
  gap: calc(var(--space-sm) + 0.125rem);
  line-height: 1.5;
}

.summary ul li::before {
  content: '✓';
  color: var(--color-success);
  font-weight: 600;
  flex-shrink: 0;
}

/* Sections */
.sections {
  display: flex;
  flex-direction: column;
}

section {
  padding: calc(var(--space-lg) + var(--space-xs)) 0;
  border-bottom: var(--border-thin) solid var(--border);
}

section:last-of-type {
  border-bottom: none;
}

h2 {
  font-family: var(--font-title);
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 var(--space-sm);
}

p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.75;
  margin: 0 0 var(--space-sm);
}

p:last-child {
  margin-bottom: 0;
}

/* Data list */
.data-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin: calc(var(--space-sm) + var(--space-xs)) 0 0;
}

.data-item {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: var(--space-md);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.data-item dt {
  font-weight: 600;
  color: var(--text-primary);
}

.data-item dd {
  margin: 0;
  color: var(--text-secondary);
}

/* Rights list */
.rights {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin: calc(var(--space-sm) + var(--space-xs)) 0 0;
  padding: 0;
}

.rights li {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  display: flex;
  gap: calc(var(--space-sm) + 0.125rem);
  line-height: 1.6;
}

.rights li::before {
  content: '→';
  color: var(--accent);
  flex-shrink: 0;
}

.rights li strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Contact card */
.contact-box {
  background: var(--surface);
  border: var(--border-thin) solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md) calc(var(--space-md) + var(--space-xs));
  margin-top: calc(var(--space-sm) + var(--space-xs));
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  box-shadow: var(--shadow-sm);
}

.contact-box span {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-tertiary);
  font-weight: 600;
}

.contact-box a {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.contact-box a:hover {
  text-decoration: underline;
}

/* Footer */
footer {
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: var(--border-thin) solid var(--border);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

footer p {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin: 0;
}

footer a {
  color: var(--accent);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

@media (max-width: 480px) {
  .site-nav {
    gap: var(--space-sm);
    flex-wrap: nowrap;
  }

  .nav-links {
    gap: var(--space-sm);
    flex-wrap: nowrap;
  }

  .lang-btn {
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--text-xs);
  }

  .data-item {
    grid-template-columns: 1fr;
    gap: var(--space-xs);
  }

  body {
    padding: var(--space-xl) var(--space-md) calc(var(--space-xxl) + var(--space-md));
  }
}
