/* ==========================================================================
   nav.css — דפי הניווט (דף הבית ודפי השאלונים), באותה שפה של המצגות:
   שער כהה עם עקומות מונפשות, וכרטיסי נושא שנפתחים ישר למצגת.
   הצבעים של כל דף: --h1 / --h2 (השער) ו---hk (הכיתוב המודגש).
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root { --h1: #1e1b4b; --h2: #312e81; --hk: #fbbf24; --ink: #0f172a; --soft: #475569; --bg: #f3f5fa; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: 'Heebo', 'Segoe UI', Tahoma, sans-serif; background: var(--bg); color: var(--ink); min-height: 100dvh; }

/* ---------- השער ---------- */
.nv-hero {
  position: relative; overflow: hidden; color: #fff;
  background: radial-gradient(120% 140% at 85% 0%, var(--h2), var(--h1) 60%);
  padding: 18px 16px 64px;
}
.nv-hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.nv-top { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; display: flex; gap: 10px; align-items: center; }
.nv-top .sp { flex: 1; }
.nv-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 16px; border-radius: 9999px;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .25); color: #fff;
  font: 700 15px/1.2 inherit; text-decoration: none; cursor: pointer; backdrop-filter: blur(6px);
  transition: background .15s;
}
.nv-btn:hover { background: rgba(255, 255, 255, .26); }
.nv-txt { position: relative; z-index: 1; max-width: 1180px; margin: 40px auto 0; }
.nv-txt .kicker { display: inline-block; font-weight: 700; font-size: 15px; letter-spacing: .5px; color: var(--hk); margin-bottom: 8px; }
.nv-txt h1 { font-size: clamp(34px, 6vw, 68px); font-weight: 900; line-height: 1.05; }
.nv-txt h1 em { font-style: normal; color: var(--hk); }
.nv-txt p { margin-top: 12px; font-size: clamp(16px, 2.1vw, 21px); color: rgba(255, 255, 255, .82); max-width: 560px; }

/* ---------- גוף הדף ---------- */
main { max-width: 1180px; margin: -36px auto 0; padding: 0 16px 48px; position: relative; z-index: 2; }
.nv-sec { margin-bottom: 38px; }
.nv-sec-h { display: flex; align-items: center; gap: 12px; margin: 0 4px 14px; }
.nv-sec-h .q {
  font-weight: 900; font-size: 22px; color: #fff; padding: 4px 14px; border-radius: 12px;
  background: linear-gradient(135deg, var(--c1, #334155), var(--c2, #64748b));
}
.nv-sec-h h2 { font-size: 22px; font-weight: 800; }
.nv-sec-h small { color: var(--soft); font-weight: 600; font-size: 15px; }
.nv-sec-h .sp { flex: 1; }
.nv-sec-h a { color: var(--soft); font-weight: 700; text-decoration: none; font-size: 15px; white-space: nowrap; }
.nv-sec-h h2, .nv-sec-h small { white-space: nowrap; }
.nv-sec-h a:hover { color: var(--ink); }
.nv-sec:first-child .nv-sec-h { color: #fff; }
.nv-sec:first-child .nv-sec-h small, .nv-sec:first-child .nv-sec-h a { color: rgba(255, 255, 255, .8); }

.nv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }

/* ---------- כרטיס נושא ---------- */
.tp {
  --mx: 50%; --my: 0%;
  position: relative; display: flex; flex-direction: column; gap: 12px;
  background: #fff; border-radius: 22px; padding: 22px 22px 18px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 10px 30px rgba(15, 23, 42, .08);
  transition: transform .2s, box-shadow .2s;
  animation: tpIn .55s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 70ms);
}
.tp::before { content: ''; position: absolute; inset: 0 0 auto; height: 6px; background: linear-gradient(90deg, var(--c2), var(--c1)); }
.tp::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .2s;
  background: radial-gradient(420px circle at var(--mx) var(--my), color-mix(in srgb, var(--c2) 14%, transparent), transparent 60%);
}
.tp:hover { transform: translateY(-4px); box-shadow: 0 2px 4px rgba(15, 23, 42, .06), 0 20px 44px color-mix(in srgb, var(--c1) 22%, transparent); }
.tp:hover::after { opacity: 1; }
@keyframes tpIn { from { opacity: 0; transform: translateY(18px); } }

.tp-head { display: flex; gap: 14px; align-items: center; }
.tp-ic {
  flex: none; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; font-size: 30px;
  background: linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: 0 6px 16px color-mix(in srgb, var(--c1) 35%, transparent);
}
.tp-head h3 { font-size: 23px; font-weight: 900; line-height: 1.15; }
.tp-head small { color: var(--soft); font-weight: 600; font-size: 14px; }
.tp-blurb { color: var(--soft); font-size: 16px; line-height: 1.5; }

.tp-go {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; justify-content: space-between;
  padding: 13px 18px; border-radius: 14px; color: #fff; text-decoration: none; font-weight: 800; font-size: 18px;
  background: linear-gradient(135deg, var(--c1), var(--c2)); transition: filter .15s, transform .15s;
}
.tp-go:hover { filter: brightness(1.08); }
.tp-go:active { transform: scale(.98); }
.tp-go small { font-weight: 600; font-size: 14px; opacity: .9; }


.tp-foot { position: relative; z-index: 1; display: flex; gap: 14px; margin-top: auto; padding-top: 4px; }
.tp-foot a { color: var(--soft); font-size: 14px; font-weight: 700; text-decoration: none; }
.tp-foot a:hover { color: var(--c1); }

/* כרטיס חדר (471) — בלי מצגות */
.tp.room ul { list-style: none; color: var(--soft); font-size: 15px; line-height: 1.75; }
.tp.room li::before { content: '▸ '; color: var(--c1); font-weight: 800; }

.nv-help { text-align: center; color: var(--soft); font-size: 14px; margin-top: 8px; }
.nv-help kbd { font: 700 13px inherit; background: #fff; border: 1px solid #cbd5e1; border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; }

@media (max-width: 640px) {
  .nv-hero { padding-bottom: 52px; }
  .nv-txt { margin-top: 26px; }
  .nv-grid { grid-template-columns: 1fr; }
  .nv-top .nv-btn.fs { display: none; }
}
@media (prefers-reduced-motion: reduce) { .tp { animation: none; } }

/* ---------- דף השיעורים של נושא (lessons.html) ---------- */
.nv-resume {
  display: flex; align-items: center; gap: 18px; padding: 18px 26px; margin-bottom: 22px; border-radius: 22px;
  color: #fff; text-decoration: none; background: linear-gradient(135deg, var(--c1), var(--c2));
  box-shadow: 0 16px 40px color-mix(in srgb, var(--c1) 35%, transparent); transition: transform .15s, filter .15s;
  animation: tpIn .5s cubic-bezier(.2, .8, .2, 1) both;
}
.nv-resume:hover { transform: translateY(-3px); filter: brightness(1.06); }
.nv-resume .go { font-size: 26px; font-weight: 900; white-space: nowrap; }
.nv-resume .what { flex: 1; font-size: 22px; font-weight: 700; }
.nv-resume .what small { display: block; font-size: 14px; font-weight: 600; opacity: .85; }
.nv-resume .arr { font-size: 28px; transition: transform .2s; }
.nv-resume:hover .arr { transform: translateX(-6px); }

.nv-lessons { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.nv-lesson {
  position: relative; display: block; padding: 18px 20px 18px; border-radius: 20px; background: #fff; color: var(--ink);
  text-decoration: none; box-shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .07);
  border: 2px solid transparent; transition: transform .18s, box-shadow .18s, border-color .18s;
  animation: tpIn .5s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 45ms + 120ms);
}
.nv-lesson:hover { transform: translateY(-4px); border-color: var(--c2); box-shadow: 0 18px 36px color-mix(in srgb, var(--c1) 20%, transparent); }
.nv-lesson .n {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; font-size: 19px; font-weight: 900;
  color: #fff; background: linear-gradient(135deg, var(--c1), var(--c2));
}
.nv-lesson b { display: block; margin: 10px 0 4px; font-size: 20px; font-weight: 800; line-height: 1.2; }
.nv-lesson .d { display: block; font-size: 15px; line-height: 1.5; color: var(--soft); }
.nv-lesson.last { border-color: var(--c1); }
.nv-lesson.last::after {
  content: 'כאן עצרתם'; position: absolute; top: 16px; left: 16px; padding: 2px 10px; border-radius: 9999px;
  font-size: 13px; font-weight: 800; color: #fff; background: var(--c1);
}
@media (max-width: 640px) {
  .nv-resume { flex-wrap: wrap; gap: 6px 14px; padding: 16px 18px; }
  .nv-resume .go { font-size: 22px; }
  .nv-resume .what { font-size: 18px; }
  .nv-resume .arr { display: none; }
  .nv-lessons { grid-template-columns: 1fr; gap: 10px; }
  .nv-lesson { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; align-items: center; padding: 14px 16px; }
  .nv-lesson .n { grid-row: span 2; width: 36px; height: 36px; font-size: 17px; }
  .nv-lesson b { margin: 0; font-size: 18px; }
  .nv-lesson .d { font-size: 14px; }
  .nv-lesson.last::after { top: 8px; left: 10px; font-size: 12px; }
  .nv-sec-h { flex-wrap: wrap; gap: 6px 10px; }
  .nv-sec-h small, .nv-sec-h .sp { display: none; }
  .nv-sec-h a { margin-inline-start: auto; }
}
@media (prefers-reduced-motion: reduce) { .nv-resume, .nv-lesson { animation: none; } }
