/* ============================================================
   base.css — reset, fonts, RTL, focus, accessibility, layout primitives
   Spec §6.3 reduced-motion · §8 RTL · §13 a11y
   ============================================================ */

/* Rubik @font-face lives in styles/fonts.css (self-hosted, subset). */

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

* { margin: 0; }

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

body {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text-primary);
  background: var(--surface-0);
  transition: background-color var(--d-slow) var(--e-inout), color var(--d-slow) var(--e-inout);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
}

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

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button { cursor: pointer; }

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

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

/* Never track out Hebrew (§5.2.2) */
[lang="he"] { letter-spacing: 0; }

/* ── Headings ─────────────────────────────────────────────── */
h1, h2, h3 {
  font-weight: 900;
  line-height: var(--lh-h2);
  letter-spacing: var(--ls-h2);
}

/* ── Typographic helpers ──────────────────────────────────── */
strong { font-weight: 500; }

/* ── RTL logical baseline (§8) ────────────────────────────── */
[dir="rtl"] { text-align: start; }

/* Directional icons mirror in RTL (§8.7) */
[dir="rtl"] .icon--directional { transform: scaleX(-1); }

/* ── Focus (§13.3) ────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}
:focus:not(:focus-visible) { outline: none; }

/* ── Skip link (§13.1) ────────────────────────────────────── */
.skip {
  position: absolute;
  inset-inline-start: var(--sp-4);
  inset-block-start: -100px;
  z-index: 100;
  padding: var(--sp-2) var(--sp-4);
  background: var(--amber);
  color: var(--text-on-amber);
  font-weight: 500;
  border-radius: var(--r-sm);
  transition: inset-block-start var(--d-fast) var(--e-enter);
}
.skip:focus { inset-block-start: var(--sp-4); }

/* ── Visually-hidden (honeypot, sr helpers) (§9.7) ────────── */
.vh,
.hp {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ── Layout primitives ────────────────────────────────────── */
.section {
  padding-block: var(--section-y);
  padding-inline: var(--gutter);
}

.container,
.section > *:not(.timeline):not(.hero__bg):not(.hero__scrim) {
  margin-inline: auto;
}

.container {
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
}

/* ── Icons ────────────────────────────────────────────────── */
.icon {
  width: 24px;
  height: 24px;
  flex: none;
  fill: none;
  stroke: currentColor;
}
.icon--sm { width: 20px; height: 20px; }
.icon--lg { width: 28px; height: 28px; }

/* WhatsApp + star glyphs are filled, not stroked */
.icon use[href$="whatsapp"],
.icon--fill { fill: currentColor; stroke: none; }

/* ── Section header: eyebrow + hairline + h2 (§5.5) ───────── */
.section-header {
  max-width: var(--measure);
  margin-inline: auto;
  margin-block-end: var(--sp-12);
  text-align: center;
}

.eyebrow {
  display: inline-block;
  position: relative;
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--amber);
  padding-block-end: var(--sp-3);
  margin-block-end: var(--sp-4);
}

/* The signature amber hairline — draws from the start edge (§6.6).
   Drawn by default (no-JS safe); motion.css collapses it under `.js`. */
.eyebrow::before {
  content: '';
  position: absolute;
  inset-block-end: 0;
  inset-inline: 0;
  height: 1px;
  width: 100%;
  background: linear-gradient(to left, var(--amber) 0%, var(--amber-glow-20) 100%);
  transform: scaleX(1);
  transform-origin: right center;   /* RTL: grows from the right */
  transition: transform var(--d-slower) var(--e-enter);
}

.section-title {
  font-size: var(--fs-h2);
  line-height: var(--lh-h2);
  color: var(--text-primary);
  text-wrap: balance;
}

/* ── Reduced-motion contract (§6.3) — non-negotiable ──────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  html { scroll-behavior: auto; }
}
