/* TawjihiGPT landing — brand tokens mirror the app (AppTheme.swift) */
:root {
  --primary: #2563EB;
  --primary-dark: #1D4ED8;
  --surface: #F0F7FF;
  --card: #FFFFFF;
  --text: #111827;
  --text-muted: #6B7280;
  --border: #E2E8F0;
  --highlight: #FACC15;
  --success: #10B981;
  --danger: #E11D48;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(37, 99, 235, 0.08);
  --maxw: 1040px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Tajawal",
    "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

a { color: var(--primary); text-decoration: none; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 700;
  padding: 14px 24px;
  cursor: pointer;
  transition: transform 0.05s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.btn-sm { padding: 9px 16px; font-size: 14px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); box-shadow: var(--shadow); }
.btn-primary:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(240, 247, 255, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 19px;
  color: var(--text);
}
.brand-mark, .footer-brand img { border-radius: 8px; }
.header-nav { display: flex; align-items: center; gap: 22px; }
.header-nav a { color: var(--text-muted); font-weight: 600; font-size: 15px; }
.header-nav a:hover { color: var(--text); }
.header-nav .btn-primary { color: #fff; }

/* Hero */
.hero { padding: 64px 0 48px; overflow: hidden; }
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 48px;
  align-items: center;
}
.hero-copy { max-width: 600px; }
.eyebrow {
  display: inline-block;
  background: #DBEAFE;
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 14px;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 20px;
}
.hero h1 {
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.25;
  margin: 0 0 18px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
/* Brand signature inside the headline */
.brand-sig {
  display: inline-block;
  direction: ltr;
  unicode-bidi: isolate;
  color: var(--primary);
  font-weight: 800;
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .brand-sig {
    background: linear-gradient(120deg, var(--primary), #7C3AED);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}
.lede {
  font-size: clamp(17px, 2.4vw, 20px);
  color: var(--text-muted);
  margin: 0 0 32px;
  max-width: 560px;
}

/* Store buttons */
.store-buttons {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: #111827;
  color: #fff;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  min-width: 200px;
  transition: transform 0.05s ease, opacity 0.2s ease;
}
.store-btn:hover { transform: translateY(-1px); }
.store-btn:active { transform: translateY(1px); }
.store-btn--soon { background: #475569; }
.store-icon { width: 26px; height: 26px; fill: #fff; flex-shrink: 0; }
.store-btn span {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  font-weight: 700;
  font-size: 17px;
  text-align: start;
}
.store-btn small { font-size: 11px; font-weight: 500; opacity: 0.8; }
.hero-note { color: var(--text-muted); font-size: 14px; margin-top: 18px; }

/* Sections */
.section-title {
  font-size: clamp(24px, 3.5vw, 32px);
  font-weight: 800;
  text-align: center;
  margin: 0 0 36px;
}

/* Features */
.features { padding: 56px 0; }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.feature-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 22px;
  text-align: center;
}
.feature-card--highlight {
  border: 1.5px solid var(--primary);
  box-shadow: var(--shadow);
}
.feature-badge {
  position: absolute;
  top: -11px;
  right: 50%;
  transform: translateX(50%);
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 14px;
  border-radius: 999px;
  white-space: nowrap;
}
.feature-icon { font-size: 34px; margin-bottom: 12px; }
.feature-card h3 { margin: 0 0 8px; font-size: 19px; font-weight: 700; }
.feature-card p { margin: 0; color: var(--text-muted); font-size: 15px; }
.feature-card p strong { color: var(--primary-dark); font-weight: 700; }

/* Subscribe */
.subscribe { padding: 64px 0 80px; }
.subscribe-inner {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 44px 28px;
  box-shadow: var(--shadow);
}
.subscribe-lede { color: var(--text-muted); margin: 0 0 24px; }
.subscribe-form {
  display: flex;
  gap: 10px;
  max-width: 460px;
  margin: 0 auto;
}
.subscribe-form input {
  flex: 1;
  min-width: 0;
  padding: 14px 16px;
  font-size: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font-family: inherit;
}
.subscribe-form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.subscribe-msg { min-height: 22px; margin: 16px 0 0; font-size: 15px; font-weight: 600; }
.subscribe-msg.is-success { color: var(--success); }
.subscribe-msg.is-error { color: var(--danger); }

/* Legal pages */
.legal {
  max-width: 760px;
  padding-top: 48px;
  padding-bottom: 64px;
}
.legal h1 { font-size: clamp(26px, 4vw, 36px); font-weight: 800; margin: 0 0 8px; }
.legal-updated { color: var(--text-muted); font-size: 14px; margin: 0 0 20px; }
.legal h2 { font-size: 20px; font-weight: 700; margin: 32px 0 10px; }
.legal h3 { font-size: 16px; font-weight: 700; margin: 18px 0 6px; }
.legal p, .legal li { color: #374151; }
.legal ul { padding-inline-start: 22px; }
.legal li { margin-bottom: 6px; }
.legal-doc[data-lang="en"] { text-align: left; }

/* Language toggle */
.lang-toggle {
  display: inline-flex;
  gap: 4px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 24px;
}
.lang-toggle button {
  border: none;
  background: transparent;
  padding: 6px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
}
.lang-toggle button.active { background: var(--primary); color: #fff; }

/* Legal callouts */
.legal-note, .legal-warn {
  border-radius: 10px;
  padding: 12px 18px;
  margin: 16px 0;
}
.legal-note { background: #ECFDF5; border: 1px solid #A7F3D0; }
.legal-note p { margin: 5px 0; color: #065F46; font-weight: 600; }
.legal-warn {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  color: #92400E;
  margin: 16px 0;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: #fff;
  padding: 32px 0;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}
.footer-brand { display: flex; align-items: center; gap: 8px; font-weight: 800; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; }
.footer-links a { color: var(--text-muted); font-size: 15px; }
.footer-links a:hover { color: var(--primary); }
.footer-copy { color: var(--text-muted); font-size: 13px; margin: 0; }

@media (max-width: 540px) {
  .header-nav a:not(.btn) { display: none; }
  .subscribe-form { flex-direction: column; }
  .store-btn { width: 100%; justify-content: center; }
}

/* ── Accessibility ── */
.skip-link {
  position: absolute;
  inset-inline-start: -9999px;
  top: 0;
  background: var(--primary);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 8px 8px;
  z-index: 100;
}
.skip-link:focus { inset-inline-start: 12px; }
:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.55);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ── Phone mockup ── */
.phone {
  width: 300px;
  max-width: 80vw;
  border-radius: 34px;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 30px 60px rgba(37, 99, 235, 0.18);
}
.phone img { display: block; width: 100%; height: auto; }

/* ── Hero visual ── */
.hero-visual {
  display: flex;
  justify-content: center;
  position: relative;
  transform: translateY(var(--parallax, 0));
  will-change: transform;
}
.hero-visual::before {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--primary) 22%, transparent), transparent 70%);
  z-index: -1;
}

/* ── Trust row ── */
.trust-row {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0;
  margin: 26px 0 0;
}
.trust-chip {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

/* ── Showcase ── */
.showcase { padding: 64px 0; }
.show-rows {
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 88px;
}
.show-row {
  display: flex;
  align-items: center;
  gap: 56px;
}
.show-row:nth-child(even) { flex-direction: row-reverse; }
.show-text { flex: 1 1 0; max-width: 460px; }
.show-visual {
  flex: 1 1 0;
  display: flex;
  justify-content: center;
  transform: translateY(var(--parallax, 0));
  will-change: transform;
}
.show-visual .phone { width: 264px; }
.show-tag {
  display: inline-block;
  background: #DBEAFE;
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 13px;
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.show-text h3 {
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 800;
  margin: 0 0 12px;
}
.show-text > p { color: var(--text-muted); font-size: 16px; margin: 0 0 18px; }
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li {
  position: relative;
  padding-inline-start: 30px;
  margin-bottom: 10px;
  font-weight: 600;
  color: var(--text);
}
.check-list li::before {
  content: "✓";
  position: absolute;
  inset-inline-start: 0;
  top: -1px;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--success);
  color: #fff;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 800;
}

/* ── Final CTA ── */
.final-cta { padding: 24px 0 72px; }
.final-cta-inner {
  background: linear-gradient(135deg, var(--primary), #6D28D9);
  color: #fff;
  border-radius: 22px;
  padding: 48px 28px;
  text-align: center;
  box-shadow: 0 24px 50px rgba(37, 99, 235, 0.28);
}
.final-cta-inner h2 { font-size: clamp(24px, 3.5vw, 32px); font-weight: 800; margin: 0 0 10px; }
.final-cta-inner > p { margin: 0 0 24px; opacity: 0.92; font-size: 17px; }
.final-cta .store-buttons { justify-content: center; }
.store-btn--light { background: #fff; color: var(--text); }
.store-btn--light .store-icon { fill: var(--text); }
.final-cta-note { margin: 18px 0 0; font-size: 13px; opacity: 0.85; }
.cta-link { color: #fff; text-decoration: underline; font-weight: 700; }
.cta-secondary { margin-top: 16px; }
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--radius-sm);
  padding: 12px 22px;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.05s ease;
}
.share-btn:hover { background: rgba(255, 255, 255, 0.22); }
.share-btn:active { transform: translateY(1px); }
.share-icon { width: 22px; height: 22px; fill: #fff; flex-shrink: 0; }

/* ── Sticky mobile CTA ── */
.mobile-cta {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 30;
  display: none;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
}
.mobile-cta .btn { width: 100%; }

/* ── Scroll reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.in { opacity: 1; transform: none; }
/* Phone "pop" reveal: scale + lift in (transition comes from .phone below) */
.reveal-pop { transform: translateY(34px) scale(0.9); }
.reveal-pop.in { transform: none; }

/* Phones: one unified transition for reveal, hover, and parallax-free transforms */
.phone {
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.35s ease, opacity 0.7s ease;
}
.show-visual .phone:hover,
.hero-visual .phone:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 40px 75px color-mix(in srgb, var(--primary) 30%, transparent);
}

/* Hero phone gentle float (pauses on hover so the lift can apply) */
.floaty { animation: floaty 6s ease-in-out infinite; }
.floaty:hover { animation-play-state: paused; }
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* ── Responsive ── */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 32px; text-align: center; }
  .hero-copy { max-width: 100%; margin: 0 auto; }
  .hero .store-buttons, .trust-row { justify-content: center; }
  .lede { margin-inline: auto; }
  .hero-visual { order: -1; }
  .show-rows { gap: 56px; }
  .show-row, .show-row:nth-child(even) { flex-direction: column-reverse; gap: 26px; text-align: center; }
  .show-text { max-width: 100%; }
  .check-list { display: inline-block; text-align: start; }
}
@media (max-width: 640px) {
  .mobile-cta { display: flex; }
  body { padding-bottom: 76px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .reveal-pop { opacity: 1 !important; transform: none !important; transition: none; }
  .floaty { animation: none; }
  .hero-visual, .show-visual { transform: none !important; }
  .phone { transition: none; }
}

/* ── Theme toggle button ── */
.theme-toggle {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
}
.theme-toggle:hover { transform: rotate(-12deg) scale(1.05); }

/* ── Dark theme ── */
[data-theme="dark"] {
  --primary: #6366F1;
  --primary-dark: #818CF8;
  --surface: #0F172A;
  --card: #1E293B;
  --text: #F8FAFC;
  --text-muted: #CBD5E1;
  --border: #334155;
  --success: #22C55E;
  --danger: #F43F5E;
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
}
[data-theme="dark"] .site-header { background: rgba(15, 23, 42, 0.85); }
[data-theme="dark"] .site-footer { background: var(--card); }
[data-theme="dark"] .subscribe-form input { background: var(--surface); }
[data-theme="dark"] .mobile-cta { background: rgba(15, 23, 42, 0.95); }
[data-theme="dark"] .eyebrow,
[data-theme="dark"] .show-tag {
  background: rgba(129, 140, 248, 0.16);
  color: #C7D2FE;
}
/* Store buttons: make the live App Store CTA an elevated card on dark,
   keep the "coming soon" one visibly muted. */
[data-theme="dark"] .store-btn {
  background: #1F2A3D;
  border: 1px solid #3C4D69;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.5);
}
[data-theme="dark"] .store-btn:hover {
  background: #27374F;
  border-color: #5470A0;
}
[data-theme="dark"] .store-btn--soon {
  background: #131C2C;
  border-color: #2A3650;
  box-shadow: none;
  opacity: 0.85;
}
[data-theme="dark"] .phone { box-shadow: 0 30px 60px rgba(0, 0, 0, 0.55); }
/* Legal page callouts + body text */
[data-theme="dark"] .legal p,
[data-theme="dark"] .legal li { color: var(--text-muted); }
[data-theme="dark"] .legal-note {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
}
[data-theme="dark"] .legal-note p { color: #6EE7B7; }
[data-theme="dark"] .legal-warn {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.4);
  color: #FCD34D;
}
