/* ============================================================
   YAI — chrome.css · The shared chrome: sticky masthead + site footer
   Loaded on EVERY page. On the homepage it loads BEFORE styles.css,
   which layers the show-after-the-hero behavior on top of this base.
   Tokens are self-contained (--c-*) so they never collide with the
   page-local tokens of the legal/support pages.
   ============================================================ */

:root {
  --c-paper: #FAF8F4;
  --c-dark: #100F0E;
  --c-ink: #121110;
  --c-platinum: #F3F2EF;
  --c-stone: #BDB8B0;
  --c-graphite: #4A443C;
  --c-quiet: rgba(74, 68, 60, 0.85);
  --c-rule-16: rgba(74, 68, 60, 0.16);
  --c-rule-dark: rgba(189, 184, 176, 0.22);
  --c-aubergine: #6A3D6E;
  --c-serif: 'Frank Ruhl Libre', 'Noto Serif Hebrew', Georgia, serif;
  --c-sans: 'Heebo', 'Noto Sans Hebrew', -apple-system, 'Segoe UI', Arial, sans-serif;
  --c-mono: ui-monospace, 'SF Mono', Menlo, 'Courier New', monospace;
}

/* Anchor targets land below the fixed masthead; smooth only when motion is welcome */
html { scroll-padding-block-start: 92px; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* ---------- Masthead bar (shared base) ----------
   הניווט הוא כרטיס-גלולה מרחף: המעטפת שקופה ומשמשת רק למיקום,
   וכל הפקדים יושבים בתוך כרטיס מעוגל עם blur, מסגרת-שיער וצל רך,
   שצף מעל הדף במקום פס מקיר-לקיר. */
.masthead-bar {
  padding: 10px clamp(10px, 2.5vw, 22px) 0;
  background: transparent;
  z-index: 100;
  pointer-events: none; /* רק הכרטיס עצמו קליקבילי, הרצועה השקופה לא */
}
.masthead-bar__card {
  pointer-events: auto;
  max-inline-size: 1156px; /* מיושר לשולי התוכן של .container */
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(250, 248, 244, 0.88);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  backdrop-filter: blur(16px) saturate(1.3);
  border: 1px solid var(--c-rule-16);
  box-shadow: 0 12px 32px rgba(18, 17, 16, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.85);
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
/* Sub-pages: an always-visible sticky header */
.masthead-bar--page {
  position: sticky;
  inset-block-start: 0;
}

.masthead-bar__brand {
  display: inline-flex;
  align-items: center;
  min-block-size: 44px; /* a11y: 44px touch target */
  text-decoration: none;
  flex-shrink: 0;
}

/* The YAI wordmark, drawn via CSS mask (ink on paper) */
.masthead-bar__mark,
.masthead-bar .yai-mark--bar {
  display: inline-block;
  inline-size: 62px;
  block-size: 28px;
  background-color: var(--c-ink);
  -webkit-mask-image: url('../assets/brand/YAIMark.png');
  mask-image: url('../assets/brand/YAIMark.png');
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}

/* In-page nav: גלולות בתוך הגלולה. ממורכז בין המותג ל-CTA */
.masthead-bar__nav {
  display: flex;
  align-items: center;
  gap: 2px;
  min-inline-size: 0;
  margin-inline: auto;
}
.masthead-bar__nav a {
  display: inline-flex;
  align-items: center;
  min-block-size: 44px; /* a11y: 44px touch target */
  font-family: var(--c-sans);
  font-weight: 700;
  font-size: 13.5px;
  color: var(--c-graphite);
  text-decoration: none;
  white-space: nowrap;
  padding: 0 16px;
  border-radius: 999px;
  transition: color 0.16s ease, background-color 0.16s ease;
}
.masthead-bar__nav a:hover {
  color: var(--c-ink);
  background: rgba(74, 68, 60, 0.07);
}
.masthead-bar__nav a.is-current {
  color: var(--c-aubergine);
  background: rgba(106, 61, 110, 0.10);
}
/* Over the dark closing band (homepage JS toggles .on-dark) */
.masthead-bar.on-dark .masthead-bar__card {
  background: rgba(18, 17, 16, 0.80);
  border-color: rgba(243, 242, 239, 0.16);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.masthead-bar.on-dark .masthead-bar__nav a { color: var(--c-stone); }
.masthead-bar.on-dark .masthead-bar__nav a:hover {
  color: var(--c-platinum);
  background: rgba(243, 242, 239, 0.08);
}
.masthead-bar.on-dark .masthead-bar__nav a.is-current {
  color: var(--c-platinum);
  background: rgba(106, 61, 110, 0.38);
}
.masthead-bar.on-dark .masthead-bar__mark { background-color: var(--c-platinum); }

/* Sub-page "back to site" affordance */
.masthead-bar__back {
  margin-inline-start: auto;
  display: inline-flex;
  align-items: center;
  min-block-size: 44px;
  padding-inline: 14px;
  border-radius: 999px;
  font-family: var(--c-mono);
  font-size: 12.5px;
  color: var(--c-quiet);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.16s ease, background-color 0.16s ease;
}
.masthead-bar__back:hover { color: var(--c-ink); background: rgba(74, 68, 60, 0.07); }

/* כשצר: הקישורים גוללים אופקית בתוך הכרטיס, עם רמז-דהייה בקצה
   (ה-JS בדף הבית מדליק את המחלקות לפי מצב הגלילה) */
@media (max-width: 768px) {
  .masthead-bar__nav {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: inline proximity;
  }
  .masthead-bar__nav::-webkit-scrollbar { display: none; }
  .masthead-bar__nav a { scroll-snap-align: start; }
  .masthead-bar__nav.has-more-end {
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 26px);
    mask-image: linear-gradient(to right, transparent 0, #000 26px);
  }
  .masthead-bar__nav.has-more-start {
    -webkit-mask-image: linear-gradient(to left, transparent 0, #000 26px);
    mask-image: linear-gradient(to left, transparent 0, #000 26px);
  }
  .masthead-bar__nav.has-more-start.has-more-end {
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 26px, #000 calc(100% - 26px), transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, #000 26px, #000 calc(100% - 26px), transparent 100%);
  }
}
@media (max-width: 640px) {
  .masthead-bar { padding: 8px 10px 0; }
  .masthead-bar__card { gap: 6px; padding: 5px 8px; }
  .masthead-bar__nav a { padding-inline: 12px; font-size: 12.5px; min-block-size: 40px; }
  .masthead-bar__mark,
  .masthead-bar .yai-mark--bar { inline-size: 54px; block-size: 24px; }
}

/* ---------- Site footer (shared on every page) ---------- */
.site-footer {
  background: var(--c-dark);
  color: var(--c-stone);
  font-family: var(--c-sans);
  border-block-start: 1px solid var(--c-rule-dark);
  padding-block: 64px 28px;
}
.site-footer__inner {
  max-inline-size: 1200px;
  margin-inline: auto;
  padding-inline: 22px;
}
.site-footer__grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.3fr;
  gap: 40px;
  align-items: start;
}

/* Brand column */
.site-footer__mark {
  display: inline-block;
  inline-size: 84px;
  block-size: 38px;
  background-color: var(--c-platinum);
  -webkit-mask-image: url('../assets/brand/YAIMark.png');
  mask-image: url('../assets/brand/YAIMark.png');
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  margin-block-end: 16px;
}
.site-footer__from {
  font-family: var(--c-mono);
  font-size: 12px;
  color: var(--c-stone);
  margin: 0 0 10px;
}
.site-footer__tagline {
  font-family: var(--c-serif);
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--c-stone);
  margin: 0 0 16px;
  max-inline-size: 30rem;
}
.site-footer__ai {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--c-sans);
  font-size: 12.5px;
  color: var(--c-stone);
  border: 1px solid var(--c-rule-dark);
  border-radius: 999px;
  padding: 7px 14px;
  margin: 0;
}
.site-footer__spark { inline-size: 10px; block-size: 10px; fill: var(--c-stone); flex-shrink: 0; }

/* Link columns */
.site-footer__title {
  font-family: var(--c-sans);
  font-weight: 700;
  font-size: 12.5px;
  color: var(--c-platinum);
  margin: 0 0 10px;
}
.site-footer__col a {
  display: block;
  inline-size: fit-content;
  font-family: var(--c-sans);
  font-size: 14px;
  color: var(--c-stone);
  text-decoration: none;
  padding-block: 7px; /* a11y: comfortable tap target */
  border-block-end: 1px solid transparent;
  transition: color 0.15s ease;
}
.site-footer__col a:hover { color: var(--c-platinum); border-block-end-color: var(--c-rule-dark); }
.site-footer__col .ltr { direction: ltr; unicode-bidi: isolate; }

/* Full-width transparency disclaimer */
.site-footer__disclaimer {
  font-family: var(--c-sans);
  font-size: 12px;
  line-height: 1.7;
  color: rgba(189, 184, 176, 0.8);
  max-inline-size: 640px;
  margin: 40px 0 0;
}

/* Bottom strip */
.site-footer__bottom {
  margin-block-start: 28px;
  padding-block-start: 18px;
  border-block-start: 1px solid var(--c-rule-dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.site-footer__bottom p {
  font-family: var(--c-mono);
  font-size: 12px;
  color: var(--c-stone);
  margin: 0;
}
.site-footer__totop {
  display: inline-flex;
  align-items: center;
  min-block-size: 44px;
  font-family: var(--c-mono);
  font-size: 12px;
  color: var(--c-stone);
  text-decoration: none;
}
.site-footer__totop:hover { color: var(--c-platinum); }

.site-footer :focus-visible { outline: 2px solid var(--c-stone); outline-offset: 3px; }

@media (max-width: 900px) {
  .site-footer__grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .site-footer__col--brand { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .site-footer { padding-block-start: 48px; }
  .site-footer__grid { grid-template-columns: 1fr; gap: 28px; }
}
