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

* { margin: 0; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-he);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

html[lang="en"] body { font-family: var(--font-en); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: var(--lh-tight);
  font-weight: 700;
  letter-spacing: var(--ls-tight);
  color: var(--text-primary);
}

html[lang="he"] h1,
html[lang="he"] h2,
html[lang="he"] h3,
html[lang="he"] h4 {
  font-family: var(--font-he);
  font-weight: 800;
  letter-spacing: normal;
}

p { line-height: var(--lh-normal); color: var(--text-muted); }

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}

a:hover { color: var(--accent); }

img, svg, video { display: block; max-width: 100%; height: auto; }

button {
  font: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  color: inherit;
}

ul, ol { padding: 0; list-style: none; }

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

::selection { background: var(--accent); color: var(--bg-deep); }

/* Scrollbar (dark) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* RTL/LTR layout switches */
html[dir="rtl"] { text-align: right; }
html[dir="ltr"] { text-align: left; }

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

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

/* Print */
@media print {
  body { background: #fff; color: #000; }
  .site-header, .language-switch, .scroll-indicator, .hero__bg { display: none; }
  .section { page-break-inside: avoid; padding: 1rem 0; }
  a::after { content: " (" attr(href) ")"; font-size: 10pt; }
}
