/* ============================================================
   Fly GACA — Base & shared components
   Reset, fonts, typography, nav, footer, buttons. Dark-first,
   RTL-aware (logical properties throughout).
   Load order: tokens.css -> base.css -> page CSS.
   ============================================================ */

/* --- Font: Cairo (self-hosted variable, Latin + Arabic) --- */
@font-face {
  font-family: 'Cairo';
  src: url('../fonts/Cairo-Variable.woff2') format('woff2');
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--accent-bright); }
ul, ol { list-style: none; padding: 0; }
button, input { font: inherit; color: inherit; }
::selection { background: rgba(74,156,184,0.35); color: #fff; }

/* --- Accessibility --- */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 3px;
}
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; inset-inline-start: var(--space-4); top: -100px;
  background: var(--brand); color: #fff;
  padding: var(--space-2) var(--space-4); border-radius: var(--radius-sm);
  z-index: 200; transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: var(--space-3); color: #fff; }

/* In-page anchor targets clear the sticky nav instead of hiding beneath it. */
:target { scroll-margin-top: calc(var(--nav-h) + var(--space-3)); }

/* Windows High Contrast / forced-colors: keep interactive affordances visible. */
@media (forced-colors: active) {
  .btn { border: 1px solid currentColor; }
  :focus-visible { outline: 2px solid; }
}
/* Honour a request for less transparency: drop the translucent nav blur. */
@media (prefers-reduced-transparency: reduce) {
  .site-nav { background: var(--falcon-night); backdrop-filter: none; -webkit-backdrop-filter: none; }
}

/* --- Typography --- */
h1, h2, h3, h4 { line-height: var(--lh-tight); font-weight: var(--fw-black); letter-spacing: -0.015em; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); font-weight: var(--fw-bold); }
p { line-height: var(--lh-body); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
  display: inline-flex; align-items: center; gap: var(--space-2);
}
.eyebrow::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold); flex: none;
}
.lead { font-size: var(--fs-lg); color: var(--text-muted); }

/* --- Layout --- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-5);
}
.section { padding-block: var(--space-12); }

/* --- The wordmark: "Fly" solid, "GACA" teal->sage gradient --- */
.wordmark {
  font-weight: var(--fw-black);
  letter-spacing: -0.02em;
  line-height: 1;
  display: inline-flex; align-items: baseline; gap: 0.28em;
  white-space: nowrap;
  /* The Latin brand name always reads "FlyGACA" — never mirror it in RTL. */
  direction: ltr;
}
.wordmark .wm-fly  { color: var(--text); }
.wordmark .wm-gaca {
  background: var(--grad-brand);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

/* --- Brand lockup (mark + wordmark) --- */
.lockup { display: inline-flex; align-items: center; gap: var(--space-3); }
.lockup .mark { width: 34px; height: auto; flex: none; }
.lockup .lockup-text { display: flex; flex-direction: column; gap: 2px; }
.lockup .wordmark { font-size: 1.32rem; }
.lockup .lockup-sub {
  font-family: var(--font-mono);
  font-size: 0.6rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--text-dim);
}

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--space-2);
  font-weight: var(--fw-bold); font-size: var(--fs-sm);
  padding: 0.72rem 1.35rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
              color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
.btn:disabled:active { transform: none; }
.btn-primary { background: var(--brand); color: var(--text-on-brand); }
.btn-primary:hover { background: var(--brand-hover); color: #fff; }
.btn-ghost {
  background: transparent; color: var(--text);
  border-color: var(--border-bright);
}
.btn-ghost:hover { border-color: var(--teal-bright); color: var(--accent-bright); background: rgba(74,156,184,0.07); }
.btn-lg { padding: 0.9rem 1.7rem; font-size: var(--fs-base); }

/* --- Card --- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

/* --- Chip --- */
.chip {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-family: var(--font-mono); font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  padding: 0.32rem 0.7rem;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
}

/* --- Top disclaimer strip (legal: every surface is unofficial) --- */
.disclaimer-strip {
  position: relative;
  background: var(--falcon-deep);
  border-block-end: 1px solid var(--border);
  font-size: var(--fs-xs);
  color: var(--text-dim);
  text-align: center;
}
.disclaimer-strip .container {
  padding-block: 0.5rem;
  padding-inline-end: var(--space-8);
  display: flex; gap: var(--space-2); justify-content: center;
  flex-wrap: wrap;
}
.disclaimer-strip strong { color: var(--text-muted); font-weight: var(--fw-semibold); }
.disclaimer-strip a { color: var(--link); }
.disclaimer-dismiss {
  position: absolute; inset-block-start: 50%; inset-inline-end: var(--space-3);
  transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  background: transparent; border: 0; cursor: pointer;
  color: var(--text-dim); border-radius: var(--radius-sm);
}
.disclaimer-dismiss:hover { color: var(--text); background: rgba(255,255,255,0.06); }

/* --- Site navigation --- */
.site-nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10,14,18,0.82);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-block-end: 1px solid var(--border);
}
.site-nav .nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-5);
  min-height: var(--nav-h);
}
.nav-links { display: flex; align-items: center; gap: var(--space-5); }
.nav-links a {
  color: var(--text-muted); font-size: var(--fs-sm); font-weight: var(--fw-medium);
  white-space: nowrap;
  transition: color var(--dur) var(--ease);
}
.nav-links a:hover { color: var(--text); }
/* The current section reads brighter + heavier than its muted siblings. */
.nav-links a[aria-current="page"] { color: var(--text); font-weight: var(--fw-semibold); }
.nav-actions { display: flex; align-items: center; gap: var(--space-3); }
.lang-toggle {
  background: transparent; border: 1px solid var(--border-bright);
  color: var(--text-muted); border-radius: var(--radius-pill);
  padding: 0.36rem 0.7rem; font-size: var(--fs-xs); cursor: pointer;
  font-family: var(--font-mono); letter-spacing: 0.06em;
}
.lang-toggle:hover { border-color: var(--teal-bright); color: var(--text); }
.nav-search {
  display: inline-flex; align-items: center; gap: var(--space-2);
  background: transparent; border: 1px solid var(--border-bright);
  color: var(--text-muted); border-radius: var(--radius-pill);
  padding: 0.36rem 0.8rem; font-size: var(--fs-xs); cursor: pointer;
  font-family: var(--font-mono); letter-spacing: 0.04em;
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.nav-search:hover { border-color: var(--teal-bright); color: var(--text); }
.nav-search svg { width: 15px; height: 15px; flex: none; }
.nav-toggle { display: none; }

/* --- Site footer --- */
.site-footer {
  border-block-start: 1px solid var(--border);
  background: #080B0F;
  padding-block: var(--space-10) var(--space-6);
}
.footer-top {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: var(--space-8); padding-block-end: var(--space-8);
  border-block-end: 1px solid var(--border);
}
.footer-brand .wordmark { font-size: 1.2rem; }
.footer-brand p { color: var(--text-dim); font-size: var(--fs-sm); margin-block-start: var(--space-3); max-width: 30ch; }
.footer-col h4 {
  font-family: var(--font-mono); font-size: var(--fs-xs);
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-dim); font-weight: var(--fw-semibold);
  margin-block-end: var(--space-4);
}
.footer-col ul { display: flex; flex-direction: column; gap: var(--space-3); }
.footer-col a { color: var(--text-muted); font-size: var(--fs-sm); }
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  display: flex; flex-wrap: wrap; gap: var(--space-4);
  justify-content: space-between; align-items: center;
  padding-block-start: var(--space-6);
}
.footer-bottom .copyright { color: var(--text-dim); font-size: var(--fs-sm); }
.footer-bottom .footer-contact { color: var(--text-muted); font-size: var(--fs-sm); }
.footer-bottom .footer-contact:hover { color: var(--text); }
.install-btn {
  display: inline-flex; align-items: center; gap: var(--space-2);
  background: transparent; border: 1px solid var(--border-bright);
  color: var(--text-muted); border-radius: var(--radius-pill);
  padding: 0.34rem 0.8rem; font-size: var(--fs-xs); cursor: pointer;
  font-family: var(--font-mono); letter-spacing: 0.03em;
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.install-btn:hover { border-color: var(--teal-bright); color: var(--text); }

/* --- Offline status bar --- */
.offline-bar {
  position: fixed; inset-inline: 0; inset-block-end: 0; z-index: 250;
  display: flex; align-items: center; justify-content: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--falcon-gold); color: var(--falcon-night);
  font-size: var(--fs-sm); font-weight: var(--fw-semibold);
  text-align: center;
}
.offline-bar svg { flex: none; }
.footer-disclaimer {
  color: var(--text-dim); font-size: var(--fs-sm);
  max-width: 62ch; margin-block-start: var(--space-5);
  line-height: var(--lh-snug);
}

/* --- Responsive nav ---
   Eight primary links plus a CTA do not fit a laptop-width bar, so the
   hamburger takes over early (1024px) — before the bar ever crowds. */
@media (max-width: 1024px) {
  .nav-links {
    position: absolute; inset-inline: 0; top: var(--nav-h);
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--falcon-deep);
    border-block-end: 1px solid var(--border);
    padding: var(--space-3) var(--space-5) var(--space-5);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding-block: var(--space-3); border-block-end: 1px solid var(--border); }
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px;
    background: transparent; border: 1px solid var(--border-bright);
    border-radius: var(--radius-sm); cursor: pointer;
  }
}
@media (max-width: 760px) {
  /* On the narrowest screens the bar shows only the lang toggle and menu —
     the hero CTA and the menu's Pricing link carry the conversion path. */
  .nav-actions .btn-primary { display: none; }
  .lockup .lockup-sub { display: none; }
  .nav-search-label { display: none; }
  .footer-top { grid-template-columns: 1fr 1fr; gap: var(--space-6); }
}
@media (max-width: 480px) {
  .footer-top { grid-template-columns: 1fr; }
}

/* --- Command palette (Cmd / Ctrl + K) --- */
.cmdk {
  position: fixed; inset: 0; z-index: 300;
  display: flex; justify-content: center; align-items: flex-start;
  padding-block-start: 12vh; padding-inline: var(--space-4);
  background: rgba(5, 8, 11, 0.74);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.cmdk[hidden] { display: none; }
.cmdk-box {
  width: min(94vw, 560px);
  display: flex; flex-direction: column; max-height: 70vh;
  background: var(--surface-raised);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
}
.cmdk-input {
  background: transparent; border: 0;
  border-block-end: 1px solid var(--border);
  color: var(--text); font-size: var(--fs-lg); font-family: var(--font-sans);
  padding: var(--space-4) var(--space-5); outline: none;
}
.cmdk-input::placeholder { color: var(--text-dim); }
.cmdk-list { list-style: none; margin: 0; padding: var(--space-2); overflow-y: auto; }
.cmdk-item {
  display: flex; align-items: baseline; gap: var(--space-3);
  padding: var(--space-3); border-radius: var(--radius-md); cursor: pointer;
}
.cmdk-item.sel { background: rgba(74, 156, 184, 0.16); }
.cmdk-item .ci-label { color: var(--text); font-weight: var(--fw-semibold); font-size: var(--fs-sm); }
.cmdk-item .ci-sub {
  margin-inline-start: auto; flex: none;
  color: var(--text-dim); font-size: var(--fs-xs);
  font-family: var(--font-mono); letter-spacing: 0.04em;
}
.cmdk-empty { padding: var(--space-6); text-align: center; color: var(--text-dim); font-size: var(--fs-sm); }
.cmdk-foot {
  display: flex; gap: var(--space-4);
  padding: var(--space-2) var(--space-4);
  border-block-start: 1px solid var(--border);
  color: var(--text-dim); font-size: var(--fs-xs); font-family: var(--font-mono);
}

/* Command-palette type filters */
.cmdk-filters {
  display: flex; flex-wrap: wrap; gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-block-end: 1px solid var(--border);
}
.cmdk-chip {
  background: transparent; border: 1px solid var(--border-bright);
  color: var(--text-muted); border-radius: var(--radius-pill);
  padding: 0.22rem 0.65rem; font-size: var(--fs-xs); cursor: pointer;
  font-family: var(--font-mono); letter-spacing: 0.03em;
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.cmdk-chip:hover { color: var(--text); border-color: var(--teal-bright); }
.cmdk-chip[aria-pressed="true"] {
  background: var(--brand); border-color: var(--brand); color: var(--text-on-brand);
}
.cmdk-item.cmdk-fulltext { margin-block-start: var(--space-1); border-block-start: 1px solid var(--border); }
.cmdk-item.cmdk-fulltext .ci-label { color: var(--link); font-weight: var(--fw-semibold); }
