/* home.css - הבית הרגוע (docs/redesign/calm-home/guidelines.md, הלוחות
   Home-desktop ו-Home-phone בקנבס). נטען ב-index.html בלבד, והבודק
   verify_home_scenes.py שומר על כך. כל hex כאן חייב להופיע ב-guidelines.md.

   מלמעלה למטה: וידאו הכניסה, ובפריים האחרון נקודות שנושמות, כל אחת קישור;
   הכותרת והכפתורים (בטלפון על הנייר מתחת לווידאו; במחשב לקוראי מסך בלבד,
   הבעלים 2026-09-26); חמש הדלתות ושורה אחת שמתחלפת; מי אנחנו; קו גלי;
   ספירת הימים. הפוטר השקט משותף לכל האתר (style.css, build_nav).
   הנקודות והדלתות חולקות מצב אחד, ו-home.js מחזיק אותו. */

/* טוקנים של הבית (השקטים, --text-calm ו---line-calm, ב-:root של style.css). צבעי הנוף נדגמו מהפריים האחרון ומשמשים רק במוטיבים
   ובקו הגלי, לא בממשק. */
body[data-page="home"] {
  --count-rule: #DDD6CA;
  --card-paper: rgb(251, 249, 245);
  --card-veil: rgba(251, 249, 245, .92);
  --scene-crown: #B7AACB;
  --scene-bark: #6E6375;
  --scene-bark-line: #403848;
  --scene-grass: #6A7D4D;
  --scene-iris: #7A68C9;
  --scene-iris-light: #9D8FDB;
  --scene-stream: #B2C4AB;
  --door-bg: var(--iris-soft);
  --door-ring: var(--border);
  background: var(--bg);
}

/* ── הכותרת ──────────────────────────────────────────────────────
   אין כאן דריסות: חבילת אגפי הספרייה (הבעלים, 2026-09-26) דורשת סרגל
   זהה בכל העמודים, בשנהב ובקו תחתון, גם מעל הנוף. */

/* ── הנוף ─────────────────────────────────────────────────────────
   המיכל שומר על יחס התמונה (16:9, ו-9:16 מתחת ל-3/4), עד גובה המסך
   הראשון. כשהגובה נחתך, object-fit: cover חותך מלמעלה ומלמטה, ו-home.js
   ממקם את הנקודות באותו חישוב. --hs-hdr הוא גובה הכותרת בפועל. */
.hs-1 { position: relative; background: var(--bg); }
.hs-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1920 / 1080;
  /* בטלפון לרוחב גובה המינימום לא יכול לדחוף את הספר אל מתחת למסך. */
  min-height: min(420px, calc(100vh - var(--hs-hdr, var(--header-h)) - var(--tabbar-h, 0px)));
  min-height: min(420px, calc(100svh - var(--hs-hdr, var(--header-h)) - var(--tabbar-h, 0px)));
  /* ‏בטלפון גם הסרגל התחתון (‏--tabbar-h, style.css) יושב על המסך הראשון */
  max-height: calc(100vh - var(--hs-hdr, var(--header-h)) - var(--tabbar-h, 0px));
  max-height: calc(100svh - var(--hs-hdr, var(--header-h)) - var(--tabbar-h, 0px));
  overflow: hidden;
  background: var(--aqua-soft);
}
.hs-video,
.hs-still,
.hs-still img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;   /* רקע: גם report.js אינו סופר אותו כתוכן שהמשוב מסתיר */
}
.hs-still { opacity: 0; }
.hs-1.is-landed .hs-still { opacity: 1; }
/* בסיום תקין משאירים את הפריים של הווידאו עצמו; התמונה היא גיבוי בלבד. */
.hs-1.is-video-ended .hs-still { opacity: 0; }
/* ‏iOS בחיסכון בסוללה מצייר כפתור הפעלה על וידאו שלא התחיל */
.hs-video::-webkit-media-controls-start-playback-button { display: none !important; -webkit-appearance: none; }

.hs-life, .hs-travel { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.hs-travel { z-index: 2; }
.hs-motion {
  position: absolute; inset-inline-end: 16px; top: 16px; z-index: 4;
  width: 44px; height: 44px; padding: 0; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); color: var(--iris-deep);
  box-shadow: var(--shadow-lift); font: 600 20px/1 sans-serif; cursor: pointer;
}
.hs-motion:focus-visible { outline: 2px solid var(--iris); outline-offset: 3px; }
/* הסמלים בעיגול (השהיה, הפעלה ודילוג) הם SVG במרכזו, בצבע של הכפתור */
.hs-motion svg { display: block; width: 20px; height: 20px; margin: auto; fill: currentColor; }
.is-travelling .hs-spots { opacity: 0; pointer-events: none; }
.is-travelling .hs-spots a { pointer-events: none; }
.is-travelling .hs-motion { opacity: 0; pointer-events: none; }

/* תחתית הדשא נמוגה לנייר, והמקטע הבא מתחיל על אותו צבע בלי קו */
.hs-fade {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  z-index: 1;
  height: min(140px, 22%);
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(247, 244, 238, 0), rgba(247, 244, 238, .55) 55%, var(--bg));
}

/* ── הנקודות ──────────────────────────────────────────────────────
   home.js בונה אותן מרשימת השורות וממקם אותן בפיקסלים (left פיזי: התמונה
   אינה מתהפכת ב-RTL). הן נכנסות רק אחרי שהווידאו נעצר על הפריים האחרון. */
.hs-spots { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.hs-spot {
  position: absolute;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  opacity: 0;
  transition: opacity .6s ease;
}
.hs-spots.is-on .hs-spot { opacity: 1; }
.hs-halo {
  position: absolute;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(251, 249, 245, .28);
  border: 1px solid rgba(251, 249, 245, .85);
  animation: hs-breathe 4s ease-in-out infinite;
}
.hs-pip {
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--card-paper);
  box-shadow: 0 0 0 2px var(--iris);
}
.hs-spot.is-open .hs-pip { background: var(--iris); }
.hs-spot:focus-visible { outline: 3px solid var(--aqua); outline-offset: 2px; }
@keyframes hs-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.28); }
}

/* הכרטיס של נקודה: נפתח לידה, ו-home.js בוחר צד.
   הכרטיס נשאר שקוף למחצה. עם תנועת הכיתה נדרשים 74% נייר כדי
   לשמור על ניגודיות הקישור גם מעל הפריים הכהה ביותר.
   הניגודיות נמדדת מול מה שבאמת מאחורי כל שורה ב-verify_home_doors.js. */
.hs-pop {
  position: absolute;
  z-index: 4;
  box-sizing: border-box;
  width: 260px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(251, 249, 245, .74);
  -webkit-backdrop-filter: blur(18px) brightness(1.5) saturate(1.1);
  backdrop-filter: blur(18px) brightness(1.5) saturate(1.1);
  box-shadow: 0 8px 28px rgba(27, 18, 54, .14);
  display: flex;
  flex-direction: column;
  gap: 4px;
  pointer-events: auto;
}
.hs-pop.is-in { animation: hs-rise .4s ease-out both; }
.hs-pop-obj { font-size: 13px; line-height: 1.4; color: var(--text-heading); }
.hs-pop-name { font-size: 17px; line-height: 1.35; font-weight: 600; color: var(--ink); }
.hs-pop-line { font-size: 15px; line-height: 1.55; color: var(--text-heading); }
.hs-pop-go,
.hs-lines a {
  font-size: 15px;
  font-weight: 500;
  color: var(--iris);
  text-decoration: none;
}
.hs-pop-go { margin-top: 4px; align-self: flex-start; color: var(--iris-deep); }
.hs-pop-go:hover,
.hs-lines a:hover { color: var(--iris-deep); text-decoration: underline; }
/* מעבר ישיר, בלי סרטון (הבעלים, 2026-09-28): מודגש, בצבע הפעולה ועם קו,
   כדי שייראה קישור. 600 הוא המשקל העליון בהנחיות הבית (verify_home_scenes),
   ו-iris-deep כמו הקישור שמעליו: --iris יורד ל-3.97 מעל פריים 1920 (verify_home_doors). */
.hs-pop-direct {
  align-self: flex-start;
  font-size: 15px;
  font-weight: 600;
  color: var(--iris-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.hs-pop-direct:hover { text-decoration-thickness: 2px; }
@keyframes hs-rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ── הכותרת והכפתורים ────────────────────────────────────────────
   במחשב אין כרטיס על הנוף (הבעלים, 2026-09-26: "תיבת הטקסט יורדת, כולל
   הכיתוב"); את מקומו תופסת נקודת "המשך התרגול" על הכיסא. הכותרת נשארת
   לקוראי מסך, והכפתורים יורדים. בטלפון הכול על הנייר, מתחת לנוף. */
.hs-copy {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.hs-copy .hs-cta { visibility: hidden; }   /* לא במיקוד ולא בעץ הנגישות */
.hs-copy h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.35;
  font-weight: 600;
  color: var(--ink);
}
.hs-cta { display: flex; gap: 12px; }
.hs-btn {
  box-sizing: border-box;
  display: inline-flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 20px;
  border-radius: 12px;
  border: 1px solid var(--iris-pale);
  color: var(--iris-deep);
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.hs-btn:hover { border-color: var(--iris); background: var(--iris-soft); }
.hs-btn.is-primary { background: var(--iris); border-color: var(--iris); color: var(--on-accent); font-weight: 600; }
.hs-btn.is-primary:hover { background: var(--iris-deep); border-color: var(--iris-deep); }
.hs-btn:focus-visible { outline: 3px solid var(--aqua); outline-offset: 2px; }

/* ── כפתור התרגול החכם (הבעלים, 5.10; home.js practiceBtn) ──
   "למצוא את התרגול שלי" הופך ל"להמשיך: <התרגיל> · <סעיף>". המילה והסעיף נשארים
   שלמים, ושם הארוך נחתך בשלוש נקודות; הכפתור אינו גדל מעבר לרוחב שלו. */
.hs-pb-t { min-width: 0; }
.has-last { min-width: 0; max-width: 100%; }
.has-last .hs-pb-t { display: flex; align-items: center; gap: .3em; }
.hs-pb-k, .hs-pb-p { flex: none; }
.hs-pb-p { font-weight: 500; }
.hs-pb-n { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── הדלתות, מי אנחנו, הספירה ───────────────────────────────
   עמודה של 640 (הדלתות 920), בלי כרטיסים ובלי פסי צבע. */
.hs-body {
  display: flex;
  flex-direction: column;
  gap: 56px;
  padding: 48px 20px 88px;
  color: var(--text-calm);
}
.hs-body > * {
  box-sizing: border-box;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
}
.hs-body > .hs-doors { max-width: 920px; }

.hs-doors { display: flex; flex-direction: column; gap: 20px; }
.hs-door-row {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}
.hs-door-row > li { display: flex; justify-content: center; }
.hs-door-name { text-align: center; }
.hs-door {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 4px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  font: inherit;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}
.hs-ring {
  box-sizing: border-box;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--door-bg);
  border: 2px solid var(--door-ring);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .4s ease;
}
.hs-ring svg { width: 56px; height: 56px; }
.hs-door-name { font-size: 18px; line-height: 1.3; font-weight: 500; color: var(--ink); }
.hs-door.is-open .hs-ring,
.hs-door:hover .hs-ring { border-color: var(--scene-iris); }
.hs-door.is-open .hs-door-name { color: var(--iris-deep); }
.hs-door:focus-visible { outline: 3px solid var(--aqua); outline-offset: 2px; }

/* הציורים בדלתות: העלה, העץ, המחברת של ניוטי והאירוס */
.m-leaf { fill: var(--scene-crown); stroke: var(--lilac-deep); stroke-width: 1.4; }
.m-vein { fill: none; stroke: var(--lilac-deep); stroke-width: 1.4; stroke-linecap: round; }
.m-crown { fill: var(--scene-crown); stroke: var(--lilac-deep); stroke-width: 1.4; }
.m-trunk { fill: var(--scene-bark); stroke: var(--scene-bark-line); stroke-width: 1.4; stroke-linejoin: round; }
.m-page { fill: var(--card-paper); stroke: var(--scene-bark-line); stroke-width: 1.4; stroke-linejoin: round; }
.m-ink { fill: none; stroke: var(--iris); stroke-width: 1.4; stroke-linecap: round; }
.m-stem { fill: none; stroke: var(--scene-grass); stroke-width: 1.6; stroke-linecap: round; }
.m-petal { fill: var(--scene-iris); stroke: var(--scene-bark-line); stroke-width: 1.2; }
.m-fall { fill: var(--scene-iris-light); stroke: var(--scene-bark-line); stroke-width: 1.2; }

/* השורה המתחלפת: גובה שמור מראש, כך ששום דבר לא קופץ */
.hs-line {
  box-sizing: border-box;
  min-height: 76px;
  margin: 0;
  padding-top: 18px;
  border-top: 1px solid var(--line-calm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}
.hs-line-text { font-size: 17px; line-height: 1.6; color: var(--text-calm); }
.hs-line.is-in > * { animation: hs-rise .4s ease-out both; }

/* השורות כרשימה קבועה: בלי JS ובתנועה מופחתת. חמש שורות צפופות, כדי
   שהבית יישאר עד 2,000px (verify_home_doors, 1280x800) */
.hs-lines {
  list-style: none;
  margin: 0;
  padding: 18px 0 0;
  border-top: 1px solid var(--line-calm);
  display: grid;
  gap: 4px;
}
.hs-lines li { font-size: 16px; line-height: 1.5; color: var(--text-calm); }
.hs-lines b { font-weight: 600; color: var(--ink); }
.hs-lines a { white-space: nowrap; }

.hs-about { display: flex; flex-direction: column; gap: 14px; }
.hs-about h2 { margin: 0; font-size: 24px; line-height: 1.3; font-weight: 600; color: var(--ink); }
.hs-about p { margin: 0; font-size: 19px; line-height: 1.85; color: var(--text-calm); }
.hs-about .hs-meta { font-size: 15px; line-height: 1.6; color: var(--text-muted); }
/* "המליצו על האתר" (הבעלים, 5.10): הכפתור של "עזרו לנו להשתפר" בשורה, ופותח
   את אותו חלון ישר על ההמלצה (report.js). ב-HTML מראש, ולכן אינו דוחף דבר. */
.hs-rec {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 16px 8px 14px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--iris);
  background: var(--surface);
  border: 2px solid var(--iris);
  border-radius: 999px;
  cursor: pointer;
}
.hs-rec svg { width: 18px; height: 18px; }
.hs-rec:hover { background: var(--iris); color: var(--on-accent); }

.hs-wave svg { display: block; width: 120px; height: 12px; }
.hs-wave path { fill: none; stroke: var(--scene-stream); stroke-width: 1.6; stroke-linecap: round; }

/* ספירת הימים: שתי יחידות בשורה, מספר ותווית על קו בסיס אחד.
   שורת countdown.js (#exam-countdown) נשארת בעמוד ומוסתרת כאן. */
.hs-count { display: flex; flex-direction: column; gap: 8px; }
.hs-count-lead { margin: 0; font-size: 15px; line-height: 1.5; color: var(--text-muted); }
.hs-count-row {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 40px;
}
.hs-day { position: relative; display: flex; align-items: baseline; gap: 6px; }
.hs-day + .hs-day::before {
  content: "";
  position: absolute;
  inset-inline-start: -20px;
  top: 50%;
  width: 1px;
  height: 28px;
  transform: translateY(-50%);
  background: var(--count-rule);
}
.hs-n { font-size: 30px; line-height: 1.2; font-weight: 500; color: var(--ink); }
.hs-l { font-size: 16px; line-height: 1.5; color: var(--text-calm); }
.hs-count-note { margin: 0; font-size: 13px; line-height: 1.5; color: var(--text-muted); }
.hs-count .exam-countdown { display: none; }

/* הפוטר השקט משותף לכל האתר; בבית הריווח שמעליו הוא 88 של העמודה */
body[data-page="home"] .site-footer { margin-top: 0; }

/* "עזרו לנו" אינו מופיע בבית בטלפון (הבעלים, 2026-10-01). אותו תנאי של טלפון
   כמו ב-style.css, ששם הוא עובר לפוטר בשאר העמודים; במחשב הוא צף גם כאן. */
@media (max-width: 599px), (pointer: coarse) and (max-height: 520px) {
  body[data-page="home"] .rp-fab { display: none; }
}

/* ── טלפון (אותו תנאי של home.js: הווידאו 9:16) ────────────────────
   הכותרת והכפתורים יורדים מתחת לווידאו, על הנייר, בלי כרטיס. */
@media (max-aspect-ratio: 3/4) {
  .hs-stage { aspect-ratio: 540 / 960; }
  .hs-fade { height: 150px; }
  .hs-pop { width: 236px; }
  .hs-copy {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 8px 20px 32px;
  }
  .hs-copy .hs-cta { visibility: visible; }
  .hs-copy h1 { font-size: 22px; line-height: 1.4; }
  .hs-cta { flex-direction: column; }
  .hs-btn { width: 100%; }
}
@media (max-width: 620px) {
  .hs-body { gap: 40px; padding: 8px 20px 64px; }
  .hs-doors { gap: 16px; }
  /* ארבע דלתות בשורה אחת (הבעלים, 5.10); ב-360 העיגול 72 עדיין נכנס */
  .hs-door-row { gap: 12px 8px; }
  .hs-ring { width: 72px; height: 72px; }
  .hs-ring svg { width: 44px; height: 44px; }
  .hs-door-name { font-size: 16px; }
  .hs-line { min-height: 104px; padding: 16px 4px 0; }
  .hs-line-text { font-size: 16px; }
  .hs-about { gap: 12px; }
  .hs-about h2 { font-size: 21px; }
  .hs-about p { font-size: 17px; line-height: 1.8; }
  .hs-about .hs-meta { font-size: 14px; }
  .hs-count-lead { font-size: 14px; }
  .hs-count-row { gap: 8px 24px; }
  .hs-day + .hs-day::before { display: none; }
  .hs-day + .hs-day .hs-w { display: none; }
  .hs-n { font-size: 26px; }
  .hs-l { font-size: 15px; }
}

/* תנועה מופחתת: תמונת הבסיס במקום הווידאו (home.js אינו נותן לו src),
   הנקודות גלויות מיד, בלי נשימה ובלי מעברים. */
@media (prefers-reduced-motion: reduce) {
  .hs-life, .hs-travel, .hs-motion { display: none; }
  .hs-video { display: none; }
  .hs-still, .hs-1.is-video-ended .hs-still { opacity: 1; }
  .hs-1 *, .hs-body *, .hs-1 *::before, .hs-body *::before { animation: none !important; transition: none !important; }
}
