/* FALCO marketing site — base + components.
   Written with CSS logical properties (margin-inline, text-align:start, etc.)
   so Arabic/RTL is the native layout and LTR falls out automatically —
   DESIGN.md's Arabic-First Rule (site/DESIGN.md:231). */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--fs-body-lg);
  line-height: var(--lh-body-lg);
  min-height: 100dvh;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }

/* Reduced motion: kill everything by default */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Focus rings — never removed */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  inset-inline-start: 8px;
  top: -48px;
  background: var(--surface);
  color: var(--text-primary);
  padding: var(--sp-sm) var(--sp-md);
  border-radius: var(--radius-button);
  box-shadow: var(--shadow-card);
  z-index: 1000;
  transition: top 150ms ease-out;
}
.skip-link:focus { top: 8px; }

/* ---------- Typography ---------- */
.display  { font-family: var(--font-display); font-size: var(--fs-display); font-weight: var(--fw-display); line-height: var(--lh-display); letter-spacing: var(--ls-display); margin: 0; }
.h-lg     { font-family: var(--font-display); font-size: var(--fs-h-lg); font-weight: var(--fw-h-lg); line-height: var(--lh-h-lg); margin: 0; }
.h-md     { font-family: var(--font-display); font-size: var(--fs-h-md); font-weight: var(--fw-h-md); line-height: var(--lh-h-md); margin: 0; }
.title    { font-family: var(--font-display); font-size: var(--fs-title); font-weight: var(--fw-title); line-height: var(--lh-title); margin: 0; }
.body-lg  { font-family: var(--font-body); font-size: var(--fs-body-lg); font-weight: var(--fw-body-lg); line-height: var(--lh-body-lg); }
.body     { font-family: var(--font-body); font-size: var(--fs-body); font-weight: var(--fw-body); line-height: var(--lh-body); }
.label    { font-family: var(--font-body); font-size: var(--fs-label); font-weight: var(--fw-label); line-height: var(--lh-label); letter-spacing: var(--ls-label); }
.text-secondary { color: var(--text-secondary); }
.text-hint { color: var(--text-hint); }
.text-gold { color: var(--gold); }

p { max-width: 65ch; }

/* ---------- Layout ---------- */
.container {
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: var(--sp-md);
}
@media (min-width: 768px) { .container { padding-inline: var(--sp-lg); } }
@media (min-width: 1024px) { .container { padding-inline: var(--sp-xl); } }

.section { padding-block: var(--sp-2xl); }
.stack { display: flex; flex-direction: column; gap: var(--sp-md); }
.row { display: flex; align-items: center; gap: var(--sp-sm); }
.grid { display: grid; gap: var(--sp-lg); }
@media (min-width: 768px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Header (the site's one glass surface) ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  background: var(--glass-tint);
  border-block-end: 0.8px solid var(--glass-border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}
.brand { display: flex; align-items: center; gap: var(--sp-sm); text-decoration: none; }
.brand img { height: 32px; width: auto; }
.brand span { font-family: var(--font-display); font-weight: 700; font-size: 18px; color: var(--text-primary); }

.main-nav { display: none; }
@media (min-width: 1024px) {
  .main-nav { display: flex; gap: var(--sp-lg); }
  .main-nav a { font-family: var(--font-body); font-weight: 600; font-size: 14px; color: var(--text-secondary); text-decoration: none; padding-block: var(--sp-xs); }
  .main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--text-primary); }
}
.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-input);
}
@media (min-width: 1024px) { .nav-toggle { display: none; } }
.nav-toggle:hover { background: var(--surface-variant); }

.mobile-nav {
  display: none;
  flex-direction: column;
  gap: var(--sp-xs);
  padding: var(--sp-md);
  background: var(--surface);
  border-block-end: 1px solid var(--border);
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  display: block;
  padding: var(--sp-sm) var(--sp-md);
  border-radius: var(--radius-input);
  font-weight: 600;
  text-decoration: none;
  color: var(--text-primary);
  min-height: 44px;
  display: flex;
  align-items: center;
}
.mobile-nav a:hover { background: var(--surface-variant); }

.lang-switch { display: flex; gap: 4px; background: var(--surface-variant); border-radius: var(--radius-pill); padding: 3px; }
.lang-switch a {
  min-width: 40px;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  text-decoration: none;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12px;
  color: var(--text-secondary);
}
.lang-switch a[aria-current="true"] { background: var(--gold); color: #fff; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-xs);
  height: 54px;
  padding-inline: var(--sp-lg);
  border-radius: var(--radius-button);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background-color 150ms ease-out, transform 80ms ease-out;
  touch-action: manipulation;
  min-width: 44px;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--gold); color: #fff; }
.btn-primary:hover { background: var(--gold-light); }
.btn-primary:active { background: var(--gold-dark); }
.btn-secondary { background: var(--surface-variant); color: var(--text-primary); }
.btn-secondary:hover { background: var(--border); }
.btn-block { width: 100%; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: var(--sp-md);
  box-shadow: var(--shadow-card);
}
@media (min-width: 1024px) { .card { padding: 20px; } }

/* ---------- Chips / pills ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding-inline: var(--sp-md);
  border-radius: var(--radius-chip);
  background: var(--surface-variant);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
}
.chip[aria-current="true"] {
  background: var(--gold);
  color: #fff;
  box-shadow: 0 6px 16px rgba(201,168,76,0.32), 0 1px 4px rgba(201,168,76,0.12);
}

/* ---------- Category rail ---------- */
.category-rail {
  display: flex;
  gap: var(--sp-md);
  overflow-x: auto;
  padding-block: var(--sp-xs);
  margin-inline: calc(-1 * var(--sp-md));
  padding-inline: var(--sp-md);
  scroll-padding-inline: var(--sp-md);
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}
@media (min-width: 768px) {
  .category-rail { margin-inline: calc(-1 * var(--sp-lg)); padding-inline: var(--sp-lg); scroll-padding-inline: var(--sp-lg); }
}
@media (min-width: 1024px) {
  .category-rail { margin-inline: calc(-1 * var(--sp-xl)); padding-inline: var(--sp-xl); scroll-padding-inline: var(--sp-xl); }
}
.category-rail .cat {
  flex: 0 0 auto;
  width: 88px;
  text-align: center;
}
.category-rail .cat .tile {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-card);
  background: linear-gradient(180deg, var(--cream-light), var(--cream));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-inline: auto;
  margin-block-end: var(--sp-xs);
}
.category-rail .cat img { width: 52px; height: 52px; object-fit: contain; }
.category-rail .cat { scroll-snap-align: start; }
.category-rail .cat span { font-size: 12px; color: var(--text-secondary); }

/* ---------- App cards (Home) ---------- */
.app-card {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: var(--sp-lg);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
}
.app-card .app-icon { width: 48px; height: 48px; border-radius: 12px; }

/* ---------- Trust strip ---------- */
.trust-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-md);
}
@media (min-width: 768px) { .trust-strip { grid-template-columns: repeat(4, 1fr); } }
.trust-strip .item { text-align: center; padding: var(--sp-md); }

/* ---------- FAQ accordion ---------- */
.faq-tabs { display: flex; gap: var(--sp-xs); margin-block-end: var(--sp-lg); flex-wrap: wrap; }
.faq-item {
  border-block-end: 1px solid var(--divider);
}
.faq-item summary {
  cursor: pointer;
  padding-block: var(--sp-md);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14.5px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-md);
  min-height: 44px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  font-size: 20px;
  color: var(--gold);
  flex-shrink: 0;
  transition: transform 200ms ease-out;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { padding-block-end: var(--sp-md); color: var(--text-secondary); font-size: 14px; line-height: 1.7; max-width: none; }

/* ---------- Legal track selector ---------- */
.track-selector { display: flex; gap: var(--sp-xs); margin-block-end: var(--sp-lg); flex-wrap: wrap; }
.track-panel { border-block-end: 1px solid var(--divider); margin-block-end: var(--sp-xs); }
.track-panel summary { list-style: none; }
.track-panel summary::-webkit-details-marker { display: none; }
.track-panel summary::after {
  content: '+';
  font-size: 20px;
  color: var(--gold);
  margin-inline-start: auto;
  transition: transform 200ms ease-out;
}
.track-panel[open] summary::after { transform: rotate(45deg); }
.track-panel summary { display: flex; justify-content: space-between; align-items: center; }
.legal-doc h2 { font-family: var(--font-display); font-size: 17px; font-weight: 800; color: var(--gold); margin-block: var(--sp-lg) var(--sp-xs); }
.legal-doc p { font-size: 14.5px; line-height: 1.7; color: var(--text-primary); margin-block-end: var(--sp-xs); max-width: none; }
.legal-doc ul { margin-block-end: var(--sp-xs); }
.legal-doc li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding-block: 3px;
  font-size: 14.5px;
  line-height: 1.7;
}
.legal-doc li::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  margin-block-start: 9px;
  flex-shrink: 0;
}
.qa { margin-block-end: 14px; }
.qa .q { font-weight: 700; font-size: 14.5px; line-height: 1.6; margin-block-end: 2px; }
.qa .a { font-size: 14px; line-height: 1.7; color: var(--text-secondary); }

.contact-block {
  margin-block-start: var(--sp-md);
  padding: var(--sp-md);
  border-radius: var(--radius-input);
  background: var(--surface-variant);
  border: 1px solid var(--border);
}
.contact-block .row { padding-block: 6px; min-height: 44px; }
.contact-block .row a { text-decoration: none; font-weight: 600; font-size: 14px; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--surface);
  border-block-start: 1px solid var(--border);
  padding-block: var(--sp-xl);
  margin-block-start: var(--sp-2xl);
}
.footer-grid { display: grid; gap: var(--sp-lg); }
@media (min-width: 768px) { .footer-grid { grid-template-columns: repeat(4, 1fr); } }
.footer-grid h3 { font-size: 13px; font-weight: 700; margin-block-end: var(--sp-sm); }
.footer-grid a { display: block; color: var(--text-secondary); text-decoration: none; font-size: 13px; padding-block: 4px; }
.footer-grid a:hover { color: var(--gold); }
.footer-bottom {
  margin-block-start: var(--sp-xl);
  padding-block-start: var(--sp-md);
  border-block-start: 1px solid var(--divider);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-sm);
  font-size: 12px;
  color: var(--text-hint);
}

/* ---------- 404 ---------- */
.error-page { min-height: 60dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: var(--sp-md); padding: var(--sp-lg); }
