/* DM Sans is loaded via <link> in the document head, not @import,
   so the font request starts in parallel with this stylesheet.

   The brand's teal and orange accents are not defined here: the only element
   that used them was the brain-node mark, now removed. Full palette lives in
   ../../logo/. */

/* ══ Tokens ══ */
:root {
  --font: 'DM Sans', sans-serif;
  --transition: 0.3s ease;
  --max-width: 960px;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #ECEAF2;
  --surface: rgba(0,0,0,0.025);
  --border: rgba(0,0,0,0.06);
  --border-hover: rgba(0,0,0,0.12);
  --text: #1a1828;
  --text-muted: #7a7890;
  --text-secondary: #5a5870;
  --header-bg: rgba(236,234,242,0.85);
  --header-border: rgba(0,0,0,0.06);
  --purple: #3A2D6B;
  --purple-end: #4F4087;
  --ss-fill: #4F4087;
  --thin-color: #4F4087;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #18161e;
  --surface: #201e28;
  --border: rgba(255,255,255,0.04);
  --border-hover: rgba(255,255,255,0.1);
  --text: #f0f0f0;
  --text-muted: #666680;
  --text-secondary: #9a98ae;
  --header-bg: rgba(24,22,30,0.9);
  --header-border: rgba(255,255,255,0.04);
  --purple: #4F4087;
  --purple-end: #6B5BAE;
  --ss-fill: #6B5BAE;
  --thin-color: #6B5BAE;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--purple-end);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ══ Header ══ */
.header {
  position: sticky; top: 0; z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--header-border);
  transition: background var(--transition), border-color var(--transition);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto; padding: 0 32px;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  direction: ltr;
}

.header-logo { display: flex; align-items: center; flex-shrink: 0; }

.header-controls { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.lang-toggle {
  display: flex; border-radius: 10px;
  border: 1px solid var(--border); overflow: hidden;
}

.lang-btn {
  padding: 6px 10px; font-size: 12px; font-weight: 600;
  border: none; background: none; color: var(--text-muted);
  cursor: pointer; font-family: var(--font);
  transition: all var(--transition); line-height: 1;
}

.lang-btn.active { background: var(--surface); color: var(--text); }
.lang-btn:hover { color: var(--text); }

.theme-toggle {
  width: 40px; height: 40px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition); flex-shrink: 0;
}

.theme-toggle:hover { border-color: var(--border-hover); color: var(--text); }
.theme-toggle svg { width: 18px; height: 18px; }

[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }

/* ══ Wordmark ══ */
.wm {
  font-weight: 700; letter-spacing: -0.5px; line-height: 1;
  color: var(--text); transition: color var(--transition);
  direction: ltr; display: inline-block;
}

.wm-header { font-size: 24px; }
.wm-hero { font-size: 48px; letter-spacing: -1px; }

.wm .split-a { display: inline-block; position: relative; margin: 0 1px; }
.wm .split-a-first { margin-right: -0.11em; }
.wm .split-a .a-left, .wm .split-a .a-right {
  display: inline-block; font-weight: 100;
  background: linear-gradient(135deg, var(--purple), var(--purple-end));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.wm .split-a .a-left { clip-path: polygon(0 0, 50% 0, 50% 100%, 0 100%); transform: translateX(-2px); }
.wm .split-a .a-right { position: absolute; left: 0; top: 0; clip-path: polygon(50% 0, 100% 0, 100% 100%, 50% 100%); transform: translateX(2px); }

.wm .ss-wave { display: inline-block; vertical-align: baseline; position: relative; top: 0.05em; margin: 0 -0.33em; }
.wm .ss-wave svg { height: 1.5em; width: auto; display: block; }
/* fill-rule lives here rather than as a style attribute on the path: the
   glyph is cloned via innerHTML, and strict CSP blocks inline style attrs. */
.wm .ss-wave path { fill: var(--ss-fill); fill-rule: nonzero; transition: fill var(--transition); }

.wm .thin { font-weight: 100; color: var(--thin-color); transition: color var(--transition); }
.wm .edu { font-weight: 700; }

/* Source SVG for the wave, cloned into every .ss-wave by app.js */
.ss-svg { display: none; }

/* ══ Main ══ */
/* The page carries a single short block, so main centres it in the space
   left between header and footer rather than stacking it at the top. */
.main {
  flex: 1;
  max-width: var(--max-width);
  margin: 0 auto; padding: 0 32px;
  width: 100%;
  display: flex; align-items: center; justify-content: center;
}

/* ══ Hero ══ */
.hero {
  display: flex; flex-direction: column;
  align-items: center; text-align: center;
  padding: 80px 0;
  position: relative;
  width: 100%;
}

[data-theme="dark"] .hero::before {
  content: '';
  position: absolute; top: -30%; left: -30%;
  width: 160%; height: 160%;
  background: radial-gradient(ellipse at 30% 30%, rgba(0,180,160,0.02) 0%, transparent 50%),
              radial-gradient(ellipse at 70% 70%, rgba(250,77,2,0.02) 0%, transparent 50%);
  pointer-events: none;
}

.hero-tagline {
  font-weight: 300; font-size: 13px;
  letter-spacing: 5px; text-transform: uppercase;
  color: var(--text-muted); margin-top: 16px;
  position: relative; z-index: 1;
  transition: color var(--transition);
}

[data-lang="he"] .hero-tagline,
[data-lang="ar"] .hero-tagline { letter-spacing: 2px; text-transform: none; }

.hero-subtitle {
  font-size: 16px; color: var(--text-secondary);
  margin-top: 10px; font-weight: 400;
  position: relative; z-index: 1;
  transition: color var(--transition);
  max-width: 500px;
}

/* ══ Not found ══ */
.notfound { padding: 80px 0; text-align: center; width: 100%; }

.notfound-code {
  font-size: 88px; font-weight: 100; line-height: 1;
  letter-spacing: -2px; direction: ltr;
  background: linear-gradient(135deg, var(--purple), var(--purple-end));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

.notfound-text {
  font-size: 16px; color: var(--text-secondary);
  margin-top: 16px; transition: color var(--transition);
}

.notfound-home {
  display: inline-block; margin-top: 32px;
  font-size: 13px; font-weight: 500; letter-spacing: 1px;
  padding: 10px 24px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-secondary);
  transition: all var(--transition);
}

.notfound-home:hover { border-color: var(--border-hover); color: var(--text); }

/* ══ Footer ══ */
.footer {
  border-top: 1px solid var(--border);
  transition: border-color var(--transition);
}

.footer-inner {
  max-width: var(--max-width); margin: 0 auto;
  padding: 40px 32px;
  display: flex; flex-direction: column; align-items: center;
  gap: 10px; text-align: center;
}

.footer-line {
  font-size: 13px; color: var(--text-muted); font-weight: 400;
  transition: color var(--transition);
}

.footer-line strong { font-weight: 700; color: var(--text-secondary); }

.footer-meta { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; }

/* ══ Motion ══ */
@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;
  }
}

/* ══ Responsive ══ */
@media (max-width: 640px) {
  .header-inner { padding: 0 16px; }
  .main { padding: 0 16px; }
  .hero { padding: 56px 0; }
  .wm-hero { font-size: 32px; }
  .notfound { padding: 56px 0; }
  .notfound-code { font-size: 64px; }
  .footer-inner { padding: 32px 16px; }
}
