/* Shared foundation for the invAIst site: tokens, header, footer, buttons.
   Colors follow the app palette (src/theme/palette.ts) and the logo navy. */

:root {
  color-scheme: light dark;

  --bg: #F5F7FA;
  --surface: #FFFFFF;
  --surface-2: #EEF2F7;
  --ink: #0B1526;
  --muted: #4A5870;
  --border: #E2E8F0;
  --border-strong: #D3DBE7;

  --primary: #0062E0;
  --primary-bg: #E8F1FF;
  --btn-bg: #0062E0;
  --btn-hover: #0052BD;
  --focus: #0062E0;

  --gain: #15803D;
  --gain-bg: #DCFCE7;
  --loss: #C81E1E;
  --loss-bg: #FEE2E2;
  --warning-bg: #FFF6DB;
  --warning-ink: #5F4600;

  --navy: #06112A;
  --shadow-lift: 0 1px 2px rgba(11, 21, 38, 0.05), 0 16px 40px -16px rgba(11, 21, 38, 0.22);

  --font: 'IBM Plex Sans Hebrew', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #060E1F;
    --surface: #0E1A30;
    --surface-2: #16243D;
    --ink: #EAF1FF;
    --muted: #A3B3CC;
    --border: #1B2942;
    --border-strong: #2A3B5A;

    --primary: #6AA6FF;
    --primary-bg: rgba(106, 166, 255, 0.14);
    --btn-bg: #1F6FEB;
    --btn-hover: #3A82F0;
    --focus: #6AA6FF;

    --gain: #4ADE80;
    --gain-bg: rgba(74, 222, 128, 0.14);
    --loss: #F87171;
    --loss-bg: rgba(248, 113, 113, 0.14);
    --warning-bg: rgba(251, 191, 36, 0.12);
    --warning-ink: #FCD34D;

    --navy: #0B1A36;
    --shadow-lift: 0 24px 48px -24px rgba(0, 0, 0, 0.7);
  }
}

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

html { -webkit-text-size-adjust: 100%; }

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

a { color: inherit; }
img, svg { display: block; max-width: 100%; }

.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }

.container {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: 20px;
}

@media (max-width: 380px) {
  .container { padding-inline: 16px; }
}

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

.skip-link {
  position: absolute;
  inset-inline-start: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--btn-bg);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus { top: 12px; }

/* ---------- Brand ---------- */

.wordmark {
  direction: ltr;
  unicode-bidi: isolate;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.accent { color: var(--primary); }

/* ---------- Buttons ---------- */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 24px;
  border-radius: 12px;
  background: var(--btn-bg);
  color: #fff;
  font-family: inherit;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 0.15s ease;
}

.btn-primary:hover { background: var(--btn-hover); }
.btn-primary:active { background: var(--btn-hover); transform: scale(0.98); }

.btn-sm { min-height: 40px; padding: 8px 16px; font-size: 15px; border-radius: 10px; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  border-radius: 10px;
}

.brand-mark { width: 32px; height: 32px; flex: 0 0 auto; }

.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.nav-link:hover { color: var(--ink); background: var(--surface-2); }
.nav-link[aria-current="page"] { color: var(--ink); }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 0 calc(40px + env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: 14px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.footer-word { font-size: 18px; }

.footer-tagline { margin: 6px 0 0; }

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
}

.footer-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
}

.footer-nav a:hover { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: 28px;
  font-size: 13px;
}

.footer-legal::before {
  content: "";
  flex: 0 0 100%;
  height: 1px;
  margin-bottom: 12px;
  background: var(--border);
}

.footer-legal p { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
