/* ═══════════════════════════════════════════════════════════════
   Design system — ink on paper, industrial editorial. Hebrew RTL.
   One accent, one motion, real photography, asymmetric grid.
   ═══════════════════════════════════════════════════════════════ */
:root {
  /* palette — five colours, no gradients */
  --ink:      #14181d;
  --ink-2:    #39424d;
  --mut:      #6d7783;
  --paper:    #f6f3ed;
  --paper-2:  #ece7dd;
  --rule:     #d7d0c4;
  --signal:   #b4462a;          /* oxide red — used sparingly, on purpose */
  --deep:     #10151a;

  /* type scale */
  --t-display: clamp(2.5rem, 6.4vw, 5.4rem);
  --t-h2:      clamp(1.65rem, 3.2vw, 2.75rem);
  --t-h3:      clamp(1.12rem, 1.5vw, 1.35rem);
  --t-lead:    clamp(1.02rem, 1.35vw, 1.22rem);
  --t-body:    1.01rem;
  --t-small:   0.86rem;
  --t-label:   0.71rem;

  /* spacing */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px;
  --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px; --s10: 128px; --s11: 168px;

  --wrap: 1240px;
  --gut: 28px;

  /* tracking is a function of size, not a constant */
  --tr-display: -0.022em;
  --tr-head:    -0.014em;
  --tr-body:     0em;
  --tr-label:    0.06em;

  /* one curve, two durations */
  --ease: cubic-bezier(0.25, 1, 0.5, 1);
  --t-fast: 120ms;
  --t-reveal: 240ms;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Heebo', system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-size: var(--t-body);
  line-height: 1.78;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; }

/* ── layout ── */
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gut); }
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gut); }

/* ── type ── */
.display {
  font-size: var(--t-display); font-weight: 900; line-height: 0.99;
  letter-spacing: var(--tr-display); text-wrap: balance;
}
h2 { font-size: var(--t-h2); font-weight: 900; line-height: 1.13; letter-spacing: var(--tr-head); text-wrap: balance; }
h3 { font-size: var(--t-h3); font-weight: 700; line-height: 1.35; letter-spacing: var(--tr-head); }
p { max-width: 62ch; text-wrap: pretty; hanging-punctuation: first last; }
.lead { font-size: var(--t-lead); line-height: 1.66; color: var(--ink-2); font-weight: 400; }
.small { font-size: var(--t-small); color: var(--mut); }
/* running numerals always align */
.num, .chain-num, .pillar .n { font-variant-numeric: tabular-nums; }

/* the label: the one place letterspacing is allowed */
.label {
  font-size: var(--t-label); font-weight: 700; letter-spacing: var(--tr-label);
  color: var(--signal); display: inline-flex; align-items: center; gap: 10px;
}
.label::before { content: ''; width: 26px; height: 1px; background: var(--signal); }
.label.plain::before { display: none; }

/* rules and marks — small craft details */
.rule { height: 1px; background: var(--rule); border: 0; }
.overline { border-top: 1px solid var(--rule); padding-top: var(--s4); }

/* ── the signature motif: the chain ──
   a hairline running down the margin, with each station's number sitting on it */
.chain-num {
  font-size: clamp(2.4rem, 4.6vw, 4rem); font-weight: 900; line-height: 1;
  color: transparent; -webkit-text-stroke: 1.4px var(--rule);
  letter-spacing: -0.03em;
}
.station.is-on .chain-num { -webkit-text-stroke-color: var(--signal); }

/* ── images: one consistent grade for every photograph ── */
.ph { position: relative; }
.ph-frame { position: relative; overflow: hidden; background: var(--paper-2); }
/* ── the slow dissolve ──
   Every frame holds two photographs of the same subject stacked on top of each
   other. Only one is opaque; the swap is a long cross-fade with a slow drift,
   so the page feels alive without ever asking for attention. */
.ph-frame img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(0.34) contrast(1.07) saturate(0.88) brightness(0.98);
  opacity: 0; transform: scale(1.02);
  transition: opacity 1400ms cubic-bezier(0.4, 0, 0.2, 1), transform 9s linear;
  will-change: opacity;
}
.ph-frame img.on { opacity: 1; transform: scale(1.075); }
.ph:hover .ph-frame img.on { transform: scale(1.09); }
/* one image in the frame: nothing to fade between */
.ph-frame img:only-child { opacity: 1; }
/* three ratios, no more */
.ph-frame.tall { aspect-ratio: 4 / 5; }
.ph-frame.doc  { aspect-ratio: 3 / 2; }
.ph-frame.band { aspect-ratio: 16 / 7; }

/* ── the single motion in this site ── */
.rise { opacity: 0; transform: translateY(12px); transition: opacity var(--t-reveal) var(--ease), transform var(--t-reveal) var(--ease); }
.rise.in { opacity: 1; transform: none; }
.rise.d1 { transition-delay: 60ms; } .rise.d2 { transition-delay: 120ms; }
.rise.d3 { transition-delay: 180ms; } .rise.d4 { transition-delay: 240ms; }

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

/* ── buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font: inherit; font-size: 0.95rem; font-weight: 800; text-decoration: none;
  padding: 0.82rem 1.7rem; border: 1px solid var(--ink); border-radius: 2px;
  background: var(--ink); color: var(--paper); cursor: pointer;
  transition: background 0.25s, color 0.25s, transform 0.25s;
}
.btn:hover { background: transparent; color: var(--ink); transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); }
.btn.onDark { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.btn.onDark:hover { background: transparent; color: var(--paper); }

/* ── masthead ── */
.mast {
  position: fixed; top: 0; inset-inline: 0; z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background 0.35s, border-color 0.35s, backdrop-filter 0.35s;
}
.mast.stuck { background: rgba(246,243,237,0.92); backdrop-filter: blur(10px); border-color: var(--rule); }
.mast-in { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.mast a.name { text-decoration: none; font-weight: 900; font-size: 0.98rem; letter-spacing: -0.01em; }
.mast .role { font-size: 0.74rem; color: var(--mut); font-weight: 600; display: block; letter-spacing: 0.02em; }
.mast .acts { display: flex; align-items: center; gap: var(--s5); }
.mast .lnk { text-decoration: none; font-size: 0.84rem; font-weight: 700; color: var(--ink-2); }
.mast .lnk:hover { color: var(--signal); }
.mast .btn { padding: 0.5rem 1.1rem; font-size: 0.82rem; }
/* over the hero photo the masthead is light */
.mast:not(.stuck) a.name, .mast:not(.stuck) .lnk { color: #fff; }
.mast:not(.stuck) .role { color: rgba(255,255,255,0.72); }
.mast:not(.stuck) .btn { background: #fff; color: var(--ink); border-color: #fff; }

/* ── progress hairline ── */
#prog { position: fixed; top: 0; inset-inline-start: 0; height: 2px; width: 0; background: var(--signal); z-index: 60; }

/* ── sections ── */
section { padding-block: var(--s10); }
section.tight { padding-block: var(--s9); }
.dark { background: var(--deep); color: var(--paper); }
.dark .lead { color: #b9c2cc; }
.dark .label { color: #e3a48c; }
.dark .label::before { background: #e3a48c; }
.dark .rule, .dark .overline { border-color: rgba(255,255,255,0.14); background: rgba(255,255,255,0.14); }
.dark .small { color: #97a2ad; }

@media (max-width: 900px) {
  :root { --gut: 20px; }
  .grid { grid-template-columns: repeat(6, 1fr); gap: 18px; }
  section { padding-block: var(--s8); }
  section.tight { padding-block: var(--s7); }
  p { max-width: none; }
}

/* ═══════════════════════════════════════════════════════════════
   נגישות: תפריט העדפות + חזרה לראש הדף + מצבי תצוגה
   כל הפקדים ממוקמים ב-left/right מפורש — לא לוגי — כדי שלא יתהפכו ב-RTL
   ═══════════════════════════════════════════════════════════════ */

/* דילוג לתוכן — הפריט הראשון במסמך, נגלה רק במיקוד מקלדת */
/* clip, never off-canvas: left:-9999px widens the document in RTL */
.skip {
  position: absolute; left: 0; top: 0; z-index: 200;
  background: var(--ink); color: var(--paper); padding: 10px 18px;
  font-weight: 800; text-decoration: none; border-radius: 0 0 3px 0;
  clip-path: inset(50%); width: 1px; height: 1px; padding: 0; overflow: hidden; white-space: nowrap;
}
.skip:focus { clip-path: none; width: auto; height: auto; padding: 10px 18px; overflow: visible; }

/* מיקוד נראה לעין בכל האתר */
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--signal); outline-offset: 3px; border-radius: 2px;
}
h1:focus { outline: none; }

.a11y-dock { position: fixed; left: 18px; bottom: 18px; z-index: 120; }
.a11y-fab {
  display: flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--ink); color: var(--paper);
  border: 1px solid var(--ink); cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.16);
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast), opacity 0.25s;
}
.a11y-fab:hover { background: var(--paper); color: var(--ink); transform: translateY(-1px); }
.a11y-fab.top { margin-bottom: 10px; opacity: 0; pointer-events: none; }
.a11y-dock.scrolled .a11y-fab.top { opacity: 1; pointer-events: auto; }

.a11y-panel {
  position: absolute; left: 0; bottom: 56px; width: 264px;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 3px;
  box-shadow: 0 10px 34px rgba(0,0,0,0.18); padding: var(--s4);
  text-align: right;
}
.a11y-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--s3); }
.a11y-head b { font-size: 0.9rem; }
.a11y-x { background: none; border: 0; font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--mut); padding: 0 4px; }
.a11y-x:hover { color: var(--ink); }
.a11y-opts { display: grid; gap: 5px; }
.a11y-opts button {
  display: flex; justify-content: space-between; align-items: center; gap: var(--s3);
  font: inherit; font-size: 0.86rem; font-weight: 600; text-align: right;
  background: transparent; border: 1px solid var(--rule); border-radius: 2px;
  padding: 9px 11px; cursor: pointer; color: var(--ink-2);
}
.a11y-opts button:hover { border-color: var(--ink-2); color: var(--ink); }
.a11y-opts button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.a11y-opts i { font-style: normal; font-size: 0.78rem; font-weight: 800; }
.a11y-opts i.dot { width: 9px; height: 9px; border: 1px solid currentColor; border-radius: 50%; }
.a11y-opts button[aria-pressed="true"] i.dot { background: currentColor; }
.a11y-reset {
  width: 100%; margin-top: var(--s3); font: inherit; font-size: 0.8rem; font-weight: 700;
  background: transparent; border: 0; border-top: 1px solid var(--rule);
  padding-top: var(--s3); cursor: pointer; color: var(--mut);
}
.a11y-reset:hover { color: var(--signal); }
.a11y-note { font-size: 0.72rem; color: var(--mut); margin-top: var(--s3); line-height: 1.55; max-width: none; }
.a11y-note a { color: var(--ink-2); }

/* ── מצבי התצוגה שהתפריט מפעיל ── */
html.a11y-text-1 body { font-size: 1.12rem; }
html.a11y-text-2 body { font-size: 1.24rem; }
html.a11y-text-3 body { font-size: 1.38rem; }
html[class*="a11y-text-"] .display { font-size: clamp(2.2rem, 5vw, 4rem); }

html.a11y-contrast body { background: #fff; color: #000; }
html.a11y-contrast .dark, html.a11y-contrast .op-txt { background: #000; color: #fff; }
html.a11y-contrast p, html.a11y-contrast .lead, html.a11y-contrast .small,
html.a11y-contrast .st-block p, html.a11y-contrast .pillar p { color: #000; }
html.a11y-contrast .dark p, html.a11y-contrast .dark .lead, html.a11y-contrast .dark .small,
html.a11y-contrast .risk p, html.a11y-contrast .op-txt p { color: #fff; }
html.a11y-contrast .label, html.a11y-contrast .st-biz .k { color: #a3301a; }
html.a11y-contrast .ph img, html.a11y-contrast .hero-ph img, html.a11y-contrast .op-ph img { filter: grayscale(1) contrast(1.3); }

html.a11y-grayscale body { filter: grayscale(1); }

html.a11y-links a { text-decoration: underline; text-underline-offset: 3px; font-weight: 700; }
html.a11y-links a:focus, html.a11y-links a:hover { background: #ffe9a8; color: #000; }

html.a11y-readable body { font-family: Arial, 'Segoe UI', sans-serif; letter-spacing: 0.01em; }
html.a11y-readable .display, html.a11y-readable h2, html.a11y-readable h3 { letter-spacing: 0; }
html.a11y-readable p, html.a11y-readable .lead { line-height: 1.95; }

html.a11y-motion *, html.a11y-motion *::before, html.a11y-motion *::after {
  animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important;
}
html.a11y-motion .rise { opacity: 1 !important; transform: none !important; }

@media (max-width: 900px) {
  .a11y-dock { left: 12px; bottom: 12px; }
  .a11y-panel { width: min(78vw, 264px); }
}
@media print {
  .a11y-dock, .mast, #toc, #prog { display: none !important; }
}

/* ═══════════════════════════════════════════════════════════════
   דפי מידע (נגישות, פרטיות, תנאי שימוש) — עמוד טקסט צר וקריא
   ═══════════════════════════════════════════════════════════════ */
.doc { padding-block: calc(66px + var(--s8)) var(--s9); }
.doc .wrap { max-width: 860px; }
.doc h1 { font-size: clamp(1.9rem, 4vw, 3rem); font-weight: 900; line-height: 1.08; letter-spacing: var(--tr-head); }
.doc .updated { font-size: 0.82rem; color: var(--mut); margin-top: var(--s3); }
.doc h2 { font-size: clamp(1.15rem, 2vw, 1.45rem); margin-top: var(--s8); padding-top: var(--s4); border-top: 1px solid var(--rule); }
.doc h3 { margin-top: var(--s5); font-size: 1.02rem; }
.doc p, .doc li { color: var(--ink-2); font-size: 0.98rem; max-width: 68ch; }
.doc p { margin-top: var(--s3); }
.doc ul, .doc ol { margin-top: var(--s3); padding-inline-start: 1.25rem; display: grid; gap: 7px; }
.doc a { color: var(--signal); text-underline-offset: 3px; }
.doc .box {
  margin-top: var(--s5); background: var(--paper-2);
  border-inline-start: 3px solid var(--signal); padding: var(--s4) var(--s5);
}
.doc .box p:first-child { margin-top: 0; }
.doc dl { margin-top: var(--s4); display: grid; gap: var(--s3); }
.doc dl div { display: flex; gap: var(--s4); flex-wrap: wrap; border-bottom: 1px solid var(--rule); padding-bottom: var(--s3); font-size: 0.95rem; }
.doc dl div:last-child { border-bottom: 0; padding-bottom: 0; }
.doc dt { font-weight: 800; min-width: 10rem; color: var(--ink); }
.doc dd { color: var(--ink-2); }
.doc .back { display: inline-flex; align-items: center; gap: 8px; margin-top: var(--s8); font-weight: 700; text-decoration: none; color: var(--ink); }
.doc .back:hover { color: var(--signal); }
