/* ==========================================================================
   GhostVoice — Design system
   --------------------------------------------------------------------------
   Palette  : near-black blue surfaces, electric-blue primary, cyan "sonar"
              accent (locked to the brand spec).
   Display  : Alexandria  — geometric Arabic+Latin sans; the headlines finally
              render with real character instead of the OS fallback.
   Body     : Rubik       — Arabic/Latin harmony, slightly warm.
   Data     : JetBrains Mono — license keys, IDs, tech labels.
   Wordmark : Space Grotesk — the Latin "GhostVoice" brand only.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Alexandria:wght@500;700;800&family=Rubik:wght@400;500;600&family=JetBrains+Mono:wght@500;600&family=Space+Grotesk:wght@700&display=swap');

:root{
  --bg:            #060911;
  --bg-2:          #090d17;
  --portal:        #0a1226;
  --surface:       #0d1420;
  --surface-2:     #131d2f;
  --surface-3:     #182640;
  --border:        rgba(94, 148, 255, 0.16);
  --border-hi:     rgba(94, 148, 255, 0.34);

  --text:          #eef3fb;
  --muted:         #9db1cf;
  --faint:         #5c6d8a;

  --primary:       #2f7dff;
  --primary-dark:  #1c5fe0;
  --accent:        #38bdf8;
  --ghost:         #7c9cff;
  --grad:          linear-gradient(135deg, var(--primary), var(--accent));

  --success:       #22c55e;
  --warning:       #f59e0b;
  --danger:        #ef4444;

  --font-display:  'Alexandria', 'Segoe UI', system-ui, sans-serif;
  --font-body:     'Rubik', 'Segoe UI', system-ui, sans-serif;
  --font-mono:     'JetBrains Mono', 'Consolas', monospace;
  --font-brand:    'Space Grotesk', var(--font-body);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;

  --shadow-card:  0 1px 0 rgba(255,255,255,0.03) inset, 0 14px 40px -18px rgba(3, 8, 20, 0.9);
  --shadow-glow:  0 0 0 1px var(--border), 0 24px 70px -24px rgba(47, 125, 255, 0.45);
  --shadow-btn:   0 10px 30px -10px rgba(47, 125, 255, 0.55);

  --container: 1120px;
  --nav-h: 72px;
}

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

html{ scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }

body{
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ambient atmosphere: two aurora pools + a faint engineering grid,
   fixed behind everything so every page shares the same depth */
body::before{
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(1100px 560px at 85% -12%, rgba(47,125,255,0.16), transparent 62%),
    radial-gradient(900px 520px at -12% 8%,  rgba(56,189,248,0.10), transparent 55%),
    radial-gradient(700px 700px at 50% 115%, rgba(124,156,255,0.07), transparent 60%);
  pointer-events: none;
}
body::after{
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(124,156,255,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124,156,255,0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(1200px 700px at 50% 0%, rgba(0,0,0,0.8), transparent 75%);
  -webkit-mask-image: radial-gradient(1200px 700px at 50% 0%, rgba(0,0,0,0.8), transparent 75%);
  pointer-events: none;
}

img{ max-width: 100%; display: block; }
a{ color: inherit; text-decoration: none; }
::selection{ background: rgba(47,125,255,0.35); color: #fff; }

h1, h2, h3, h4{
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.25;
  margin: 0 0 .5em;
}
h3, h4{ font-weight: 700; }
p{ margin: 0 0 1em; color: var(--muted); }
code, .mono{ font-family: var(--font-mono); direction: ltr; unicode-bidi: embed; }

:focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link{
  position: fixed;
  top: -60px;
  inset-inline-start: 16px;
  z-index: 200;
  background: var(--surface-2);
  border: 1px solid var(--border-hi);
  color: var(--text);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  transition: top .2s ease;
}
.skip-link:focus{ top: 12px; }

.container{
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

section{ padding-block: 88px; }

.eyebrow{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .05em;
  color: var(--accent);
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.eyebrow::before{
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(56,189,248,0.16);
}

.section-head{ max-width: 640px; margin-bottom: 48px; }
.section-head.center{ margin-inline: auto; text-align: center; }
.section-head h2{ font-size: clamp(26px, 4vw, 40px); letter-spacing: -0.01em; }
.section-head p{ font-size: 17px; }

.divider{
  border: 0;
  height: 1px;
  margin: 0 auto;
  max-width: var(--container);
  background: linear-gradient(90deg, transparent, var(--border-hi), transparent);
}

/* ---------------------------------------------------------------------- */
/* Buttons                                                                 */
/* ---------------------------------------------------------------------- */
.btn{
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  min-height: 48px;
  padding: 12px 26px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease, filter .2s ease;
  white-space: nowrap;
  touch-action: manipulation;
  overflow: hidden;
}
.btn:active{ transform: translateY(1px) scale(.99); }
.btn svg{ width: 18px; height: 18px; flex: none; }

.btn-primary{
  color: #fff;
  background: var(--grad);
  box-shadow: var(--shadow-btn);
}
/* moving sheen — only on hover, so it stays a reward not a carnival */
.btn-primary::after{
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,0.35) 50%, transparent 70%);
  transform: translateX(160%);
  transition: transform .6s ease;
  pointer-events: none;
}
.btn-primary:hover{ box-shadow: 0 14px 40px -12px rgba(47, 125, 255, 0.7); filter: saturate(1.08); }
.btn-primary:hover::after{ transform: translateX(-160%); }

.btn-ghost{
  color: var(--text);
  background: rgba(19, 29, 47, 0.55);
  border-color: var(--border);
  backdrop-filter: blur(6px);
}
.btn-ghost:hover{ border-color: var(--border-hi); background: var(--surface-2); }

.btn-block{ width: 100%; }
.btn[disabled]{ opacity: .55; cursor: progress; }

/* ---------------------------------------------------------------------- */
/* Navigation — glass bar that gains weight once you scroll                */
/* ---------------------------------------------------------------------- */
.nav{
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  transition: background .25s ease, border-color .25s ease, backdrop-filter .25s ease;
}
.nav.scrolled{
  background: rgba(6, 9, 17, 0.72);
  border-bottom-color: var(--border);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
}
.nav .container{
  width: 100%;
  display: flex;
  align-items: center;
  gap: 28px;
}
.brand{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: .01em;
  color: var(--text);
}
.brand img{ width: 30px; height: 30px; filter: drop-shadow(0 0 10px rgba(56,189,248,0.5)); }

.nav-links{
  display: flex;
  align-items: center;
  gap: 26px;
  margin-inline-start: 10px;
  font-size: 14.5px;
  font-weight: 500;
}
.nav-links a{ position: relative; color: var(--muted); padding-block: 6px; transition: color .18s ease; }
.nav-links a::after{
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .22s ease;
}
.nav-links a:hover{ color: var(--text); }
.nav-links a:hover::after{ transform: scaleX(1); }

.nav-cta{ margin-inline-start: auto; display: flex; gap: 12px; align-items: center; }
.nav-cta .btn{ min-height: 42px; padding-block: 9px; }

.nav-toggle{
  display: none;
  margin-inline-start: auto;
  width: 46px; height: 46px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.nav-toggle svg{ width: 22px; height: 22px; }

@media (max-width: 880px){
  .nav-links{
    position: fixed;
    top: var(--nav-h);
    inset-inline: 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    background: rgba(9, 13, 23, 0.96);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px;
    backdrop-filter: blur(16px);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: transform .2s ease, opacity .2s ease, visibility .2s;
  }
  .nav-links.open{ transform: none; opacity: 1; visibility: visible; }
  .nav-links a{ padding: 12px 14px; border-radius: 10px; }
  .nav-links a:hover{ background: var(--surface-2); }
  .nav-links a::after{ display: none; }
  .nav-toggle{ display: inline-flex; }
  .nav-cta .btn-ghost{ display: none; }
}

/* ---------------------------------------------------------------------- */
/* Cards                                                                   */
/* ---------------------------------------------------------------------- */
.card{
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent 40%), var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  transition: transform .22s ease, border-color .22s ease, box-shadow .25s ease;
}
.card.lift:hover{
  transform: translateY(-4px);
  border-color: var(--border-hi);
  box-shadow: var(--shadow-glow);
}

/* ---------------------------------------------------------------------- */
/* Marquee (trust strip)                                                   */
/* ---------------------------------------------------------------------- */
.marquee{
  border-block: 1px solid var(--border);
  background: rgba(9, 13, 23, 0.6);
  overflow: hidden;
  padding-block: 16px;
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track{
  display: flex;
  gap: 56px;
  width: max-content;
  animation: marquee 26s linear infinite;
}
.marquee:hover .marquee-track{ animation-play-state: paused; }
.marquee-track > span{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .08em;
  color: var(--faint);
  white-space: nowrap;
}
.marquee-track > span svg{ width: 15px; height: 15px; color: var(--accent); opacity: .8; }
@keyframes marquee{ to{ transform: translateX(50%); } } /* RTL: track flows start-ward */

/* ---------------------------------------------------------------------- */
/* Forms                                                                   */
/* ---------------------------------------------------------------------- */
.field{ margin-bottom: 20px; }
.field label{
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
}
.field input{
  width: 100%;
  min-height: 50px;
  padding: 13px 16px;
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.field input::placeholder{ color: var(--faint); }
.field input:focus{
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47,125,255,0.22);
  background: var(--surface-3);
}
.field input.mono{ letter-spacing: .04em; font-size: 14.5px; }
.field select, .field-select{
  width: 100%;
  min-height: 50px;
  padding: 13px 16px;
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.field select:focus, .field-select:focus{
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47,125,255,0.22);
}
.hint{ font-size: 12.5px; color: var(--faint); margin-top: 8px; line-height: 1.6; }

.status-msg{
  display: none;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  line-height: 1.6;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 20px;
}
.status-msg.show{ display: flex; }
.status-msg.ok  { color: #b7f4cd; background: rgba(34,197,94,0.10);  border-color: rgba(34,197,94,0.35); }
.status-msg.err { color: #ffd2d2; background: rgba(239,68,68,0.10);  border-color: rgba(239,68,68,0.35); }
.status-msg.info{ color: #cfe6ff; background: rgba(47,125,255,0.10); border-color: rgba(47,125,255,0.35); }

.key-display{
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--portal);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  box-shadow: 0 0 30px -12px rgba(47,125,255,0.5) inset;
}
.key-display span{
  flex: 1;
  font-size: 13.5px;
  word-break: break-all;
  color: var(--accent);
}
.key-display button{
  font: 600 13px var(--font-body);
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 14px;
  min-height: 40px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
  white-space: nowrap;
}
.key-display button:hover{ border-color: var(--border-hi); background: var(--surface-3); }

/* auth pages ------------------------------------------------------------ */
.auth-shell{
  min-height: calc(100vh - var(--nav-h));
  display: grid;
  place-items: center;
  padding: 56px 20px 80px;
  position: relative;
}
.auth-card{
  position: relative;
  width: 100%;
  max-width: 460px;
  padding: 40px 36px 32px;
  overflow: hidden;
}
.auth-card::before{               /* ghost watermark, whisper-quiet */
  content: "";
  position: absolute;
  inset-inline-end: -70px;
  top: -70px;
  width: 240px; height: 240px;
  background: url("../img/ghost-logo-512.png") center/contain no-repeat;
  opacity: 0.05;
  filter: grayscale(1) brightness(2.4);
  pointer-events: none;
}
.auth-card h1{ font-size: 27px; }
.auth-card > p{ font-size: 15px; }
.form-foot{
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--muted);
}
.form-foot a{ color: var(--accent); font-weight: 500; }
.form-foot a:hover{ text-decoration: underline; }

@media (max-width: 520px){
  .auth-card{ padding: 32px 22px 26px; }
}

/* ---------------------------------------------------------------------- */
/* Footer                                                                  */
/* ---------------------------------------------------------------------- */
footer{
  margin-top: 40px;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, transparent, rgba(9,13,23,0.9));
  padding: 56px 0 36px;
}
.footer-grid{
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 44px;
}
.footer-brand p{ font-size: 14px; max-width: 300px; margin-top: 14px; }
.footer-col h4{
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--faint);
  margin-bottom: 16px;
}
.footer-col a{
  display: block;
  font-size: 14.5px;
  color: var(--muted);
  padding-block: 6px;
  transition: color .15s ease;
}
.footer-col a:hover{ color: var(--accent); }
.footer-bottom{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--faint);
}
.footer-bottom .made{ font-family: var(--font-mono); font-size: 12px; }
@media (max-width: 760px){
  .footer-grid{ grid-template-columns: 1fr; gap: 28px; }
}

/* ---------------------------------------------------------------------- */
/* Scroll reveal                                                           */
/* ---------------------------------------------------------------------- */
.reveal{
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .55s ease, transform .55s cubic-bezier(.2,.7,.2,1);
  transition-delay: var(--d, 0ms);
}
.reveal.in{ opacity: 1; transform: none; }

/* ---------------------------------------------------------------------- */
/* Icon primitives (inline SVG, 1.75px stroke family)                      */
/* ---------------------------------------------------------------------- */
.icon-tile{
  width: 52px; height: 52px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(47,125,255,0.16), rgba(56,189,248,0.06));
  border: 1px solid var(--border-hi);
  color: var(--accent);
  box-shadow: 0 0 24px -8px rgba(47,125,255,0.4);
}
.icon-tile svg{ width: 24px; height: 24px; }

/* ---------------------------------------------------------------------- */
/* Reduced motion — the whole site calms down                              */
/* ---------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *, *::before, *::after{
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal{ opacity: 1; transform: none; }
  .marquee-track{ animation: none; flex-wrap: wrap; width: auto; justify-content: center; }
}

/* ---------------------------------------------------------------------- */
/* Language                                                                */
/* ---------------------------------------------------------------------- */
.lang-btn{
  min-height: 42px;
  padding: 8px 15px;
  font: 600 13px var(--font-mono);
  letter-spacing: .05em;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
  touch-action: manipulation;
}
.lang-btn:hover{ color: var(--text); border-color: var(--border-hi); background: var(--surface-2); }

/* English headlines switch to the Latin display face already used by the
   wordmark; Arabic keeps Alexandria. Body stays Rubik in both (great Latin). */
html[lang="en"] h1, html[lang="en"] h2, html[lang="en"] h3, html[lang="en"] h4{
  font-family: 'Space Grotesk', var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}
