/* ============================================================
   LEARN — shared styles for the educational modules
   Family tree · Dual timeline · Song lessons
   Built on the Luminous Archive tokens in main.css
   ============================================================ */

/* ── Page hero (shared) ── */
.learn-hero {
  padding: 140px 0 var(--sp-lg);
  background:
    radial-gradient(60% 50% at 50% 0%, var(--gold-soft) 0%, transparent 70%),
    var(--bg);
  text-align: center;
}
.learn-hero .section-label { padding-left: 0; }
.learn-hero .section-label::before { display: none; }
.learn-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 600; line-height: 1.1; color: var(--ink);
  margin-bottom: 18px; text-wrap: balance;
}
.learn-hero p {
  max-width: 660px; margin: 0 auto; color: var(--ink-soft);
  font-size: 1.1rem; text-wrap: pretty;
}
.learn-main { padding: var(--sp-xl) 0; }

/* ════════ FAMILY TREE ════════ */

/* Decorative background tree: trunk grows through every generation,
   branches reach out to each row, roots fan out at the very base. */
.tree-scene { position: relative; overflow: hidden; }
.tree-content { position: relative; z-index: 1; }
.tree-bg {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: min(760px, 92vw); height: 100%; z-index: 0;
  color: var(--gold); opacity: 0.16; pointer-events: none;
}
.tb-draw {
  stroke-dasharray: 900; stroke-dashoffset: 900;
  animation: tbGrow 2.6s var(--ease-gold) forwards;
}
.tb-root { animation-name: tbGrow; }
.tree-bg-branches path:nth-child(1) { animation-delay: 0s; }
.tree-bg-branches path:nth-child(2) { animation-delay: .5s; }
.tree-bg-branches path:nth-child(3) { animation-delay: .5s; }
.tree-bg-branches path:nth-child(4) { animation-delay: 1s; }
.tree-bg-branches path:nth-child(5) { animation-delay: 1.15s; }
.tree-bg-branches path:nth-child(6) { animation-delay: 1.15s; }
.tree-bg-branches path:nth-child(7) { animation-delay: 1s; }
.tree-bg-branches path:nth-child(8) { animation-delay: 1.6s; }
.tree-bg-branches path:nth-child(9) { animation-delay: 1.6s; }
.tree-bg-branches path:nth-child(10) { animation-delay: 2s; }
.tree-bg-branches path:nth-child(11) { animation-delay: 2.1s; }
.tree-bg-branches path:nth-child(12) { animation-delay: 2.2s; }
.tree-bg-branches path:nth-child(13) { animation-delay: 2.1s; }
.tree-bg-branches path:nth-child(14) { animation-delay: 2s; }
@keyframes tbGrow { to { stroke-dashoffset: 0; } }
.tb-leaf {
  opacity: 0; animation: tbLeafIn .6s ease forwards, leafGlow 4.5s ease-in-out 2.6s infinite;
}
.tree-bg-leaves circle:nth-child(1) { animation-delay: 1.1s, 2.6s; }
.tree-bg-leaves circle:nth-child(2) { animation-delay: 1.1s, 3.1s; }
.tree-bg-leaves circle:nth-child(3) { animation-delay: 1.7s, 3.6s; }
.tree-bg-leaves circle:nth-child(4) { animation-delay: 1.7s, 4.1s; }
.tree-bg-leaves circle:nth-child(5) { animation-delay: 1.7s, 3.4s; }
.tree-bg-leaves circle:nth-child(6) { animation-delay: 1.7s, 3.9s; }
.tree-bg-leaves circle:nth-child(7) { animation-delay: 2.2s, 4.4s; }
.tree-bg-leaves circle:nth-child(8) { animation-delay: 2.2s, 4.7s; }
@keyframes tbLeafIn { to { opacity: 1; } }
/* the whole tree breathes very gently once it has grown in */
.tree-bg-branches, .tree-bg-leaves { animation: tbSway 11s ease-in-out 2.6s infinite; transform-origin: 50% 100%; }
@keyframes tbSway { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(0.5deg); } }

.tree-roots-label {
  text-align: center; margin: 6px 0 var(--sp-lg);
  font-family: var(--font-display); font-style: italic; font-size: 1.05rem;
  color: var(--gold-deep); opacity: 0.85;
}
html[lang="he"] .tree-roots-label { font-style: normal; font-weight: 600; }

.tree-intro {
  max-width: 720px; margin: 0 auto var(--sp-xl);
  text-align: center; color: var(--ink-soft); font-size: 1.06rem;
}
.tree-gen {
  display: flex; flex-wrap: wrap; gap: 20px;
  justify-content: center; margin-bottom: 26px;
}
.tree-gen-label {
  text-align: center; font-family: var(--font-ui);
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--gold-deep);
  margin-bottom: 18px; position: relative;
}
.tree-gen-label::before,
.tree-gen-label::after {
  content: ""; position: absolute; top: 50%; width: 60px; height: 1px;
  background: var(--gold); opacity: 0.45;
}
.tree-gen-label::before { right: calc(50% + 90px); }
.tree-gen-label::after  { left:  calc(50% + 90px); }

.person {
  width: 210px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-md); overflow: hidden; box-shadow: var(--shadow-sm);
  cursor: pointer; text-align: center; padding-bottom: 18px;
  transition: transform var(--t-base), box-shadow var(--t-base), border-color var(--t-base);
  position: relative;
}
.person:hover, .person:focus-visible {
  transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--gold);
}
/* small gold leaf ornament, echoes the background family tree */
.person::before {
  content: ""; position: absolute; top: 10px; right: 10px; width: 16px; height: 16px;
  z-index: 2; opacity: 0.55; transition: opacity var(--t-fast), transform var(--t-fast);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23B07C2A' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M12 21c4-1 7-5 7-10a13 13 0 0 0-7-9 13 13 0 0 0-7 9c0 5 3 9 7 10z'/%3E%3Cpath d='M12 21V9'/%3E%3C/svg%3E") center / contain no-repeat;
}
html[dir="rtl"] .person::before { right: auto; left: 10px; }
.person:hover::before { opacity: 1; transform: rotate(-8deg) scale(1.1); }
.person-photo {
  width: 100%; aspect-ratio: 1/1; object-fit: cover; object-position: center 25%;
  display: block; background: var(--bg-soft);
}
.person-photo.placeholder {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 2.4rem; color: var(--gold);
  background: var(--gold-soft);
}
.person-name {
  font-family: var(--font-display); font-size: 1.12rem; font-weight: 600;
  color: var(--ink); margin: 14px 12px 4px;
}
.person-role {
  font-family: var(--font-ui); font-size: 0.72rem; color: var(--ink-dim);
  margin: 0 12px 8px;
}
.person-fate {
  display: inline-block; font-family: var(--font-ui); font-size: 0.66rem;
  font-weight: 600; padding: 4px 12px; border-radius: var(--r-pill);
}
.fate-survived { background: rgba(46,74,102,0.10); color: #24445f; }
.fate-murdered { background: rgba(110,78,19,0.10); color: var(--gold-deep); }
.fate-living   { background: var(--gold-soft); color: var(--gold-deep); }
/* thin gold connector under each generation */
.tree-connector {
  width: 1px; height: 34px; margin: 0 auto 26px;
  background: linear-gradient(var(--gold), transparent);
}

/* Person detail panel */
.person-panel {
  position: fixed; inset: 0; z-index: 3000; display: flex;
  align-items: center; justify-content: center; padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity var(--t-base);
}
.person-panel.open { opacity: 1; pointer-events: auto; }
.person-panel-backdrop { position: absolute; inset: 0; background: rgba(20,17,10,0.55); }
.person-panel-inner {
  position: relative; background: var(--card); border-radius: var(--r-lg);
  max-width: 640px; width: 100%; max-height: 88vh; overflow-y: auto;
  box-shadow: var(--shadow-lg); padding: 40px 36px;
  transform: translateY(14px) scale(0.98); transition: transform var(--t-base);
}
.person-panel.open .person-panel-inner { transform: none; }
.person-panel-close {
  position: absolute; top: 14px; right: 16px; width: 38px; height: 38px;
  border-radius: 50%; border: 1.5px solid var(--line-2); background: var(--card);
  font-size: 1.1rem; color: var(--ink-soft); display: flex;
  align-items: center; justify-content: center;
}
.person-panel-close:hover { border-color: var(--gold); color: var(--gold-deep); }
.pp-photo {
  width: 128px; height: 128px; border-radius: 50%; object-fit: cover;
  object-position: center 25%; border: 3px solid var(--gold-soft); margin-bottom: 18px;
}
.pp-name { font-family: var(--font-display); font-size: 1.7rem; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.pp-years { font-family: var(--font-ui); font-size: 0.85rem; color: var(--gold-deep); font-weight: 600; margin-bottom: 20px; }
.pp-body p { color: var(--ink-soft); line-height: 1.85; margin-bottom: 16px; }
.pp-known {
  background: var(--bg-soft); border-left: 3px solid var(--gold);
  border-radius: 0 var(--r-sm) var(--r-sm) 0; padding: 16px 18px; margin: 18px 0;
}
html[dir="rtl"] .pp-known { border-left: none; border-right: 3px solid var(--gold); border-radius: var(--r-sm) 0 0 var(--r-sm); }
.pp-known h4 {
  font-family: var(--font-ui); font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-deep); margin-bottom: 8px;
}
.pp-known p { font-size: 0.95rem; margin: 0; }
.pp-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

/* ════════ DUAL TIMELINE ════════ */
.tl-wrap { position: relative; max-width: 1000px; margin: 0 auto; }
.tl-spine {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 2px;
  background: linear-gradient(180deg, transparent, var(--gold) 6%, var(--gold) 94%, transparent);
  transform: translateX(-50%);
}
.tl-key {
  display: flex; gap: 26px; justify-content: center; flex-wrap: wrap;
  margin-bottom: var(--sp-lg); font-family: var(--font-ui); font-size: 0.8rem;
}
.tl-key span { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-soft); }
.tl-key i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.tl-key .k-world  { background: #24445f; }
.tl-key .k-family { background: var(--gold); }

.tl-row { position: relative; display: flex; margin-bottom: 30px; align-items: flex-start; }
.tl-row .tl-entry {
  position: relative; width: calc(50% - 40px); background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 20px 22px; box-shadow: var(--shadow-sm);
  transition: transform var(--t-base), box-shadow var(--t-base);
}
.tl-icon {
  position: absolute; top: 16px; right: 18px; width: 22px; height: 22px;
  opacity: 0.16; color: var(--ink); transition: opacity var(--t-fast);
}
.tl-entry:hover .tl-icon { opacity: 0.3; }
.tl-row.world .tl-icon { color: #24445f; }
.tl-row.family .tl-icon { color: var(--gold); }
html[dir="rtl"] .tl-icon { right: auto; left: 18px; }
.tl-row .tl-entry:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.tl-row.world  { justify-content: flex-start; }
.tl-row.family { justify-content: flex-end; }
.tl-row.world  .tl-entry { border-top: 3px solid #24445f; }
.tl-row.family .tl-entry { border-top: 3px solid var(--gold); }
.tl-dot-marker {
  position: absolute; left: 50%; top: 22px; width: 14px; height: 14px;
  border-radius: 50%; transform: translateX(-50%); z-index: 2; border: 3px solid var(--bg);
}
.tl-row.world  .tl-dot-marker { background: #24445f; }
.tl-row.family .tl-dot-marker { background: var(--gold); }
.tl-date {
  font-family: var(--font-ui); font-size: 0.74rem; font-weight: 700;
  letter-spacing: 0.08em; color: var(--gold-deep); margin-bottom: 6px;
}
.tl-row.world .tl-date { color: #24445f; }
.tl-entry h3 { font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.tl-entry p { font-size: 0.92rem; color: var(--ink-soft); line-height: 1.65; }
.tl-scope {
  display: inline-block; font-family: var(--font-ui); font-size: 0.6rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; padding: 3px 10px;
  border-radius: var(--r-pill); margin-bottom: 10px;
}
.tl-row.world  .tl-scope { background: rgba(36,68,95,0.10); color: #24445f; }
.tl-row.family .tl-scope { background: var(--gold-soft); color: var(--gold-deep); }

@media (max-width: 820px) {
  .tl-spine { left: 14px; }
  .tl-row, .tl-row.world, .tl-row.family { justify-content: flex-start; padding-left: 40px; }
  .tl-row .tl-entry { width: 100%; }
  .tl-dot-marker { left: 14px; }
  html[dir="rtl"] .tl-spine { left: auto; right: 14px; }
  html[dir="rtl"] .tl-row { padding-left: 0; padding-right: 40px; }
  html[dir="rtl"] .tl-dot-marker { left: auto; right: 14px; transform: translateX(50%); }
}

/* ════════ WHY THIS MATTERS (lessons page) ════════ */
.importance-band {
  display: flex; gap: 40px; align-items: center;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 40px; margin-bottom: var(--sp-xl);
  box-shadow: var(--shadow);
}
.importance-text h2 {
  font-family: var(--font-display); font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  font-weight: 600; color: var(--ink); margin-bottom: 16px; text-wrap: balance;
}
.importance-text p { color: var(--ink-soft); line-height: 1.8; margin-bottom: 14px; font-size: 1rem; }
.importance-text p:last-child { margin-bottom: 0; }
.importance-stat {
  flex-shrink: 0; width: 220px; text-align: center; padding: 30px 20px;
  background: linear-gradient(160deg, var(--gold-soft), var(--card));
  border: 1px solid rgba(176,124,42,0.22); border-radius: var(--r-md);
  position: relative; overflow: hidden;
}
.importance-stat-watermark {
  position: absolute; top: 50%; left: 50%; width: 130px; height: 130px;
  transform: translate(-50%, -50%); color: var(--gold); opacity: 0.08; pointer-events: none;
}
.importance-stat strong {
  display: block; font-family: var(--font-display); font-weight: 700;
  font-size: 2.6rem; color: var(--gold-deep); margin-bottom: 10px; line-height: 1;
  position: relative; font-variant-numeric: tabular-nums;
}
.importance-stat span { display: block; font-size: 0.85rem; color: var(--ink-soft); line-height: 1.55; position: relative; }
@media (max-width: 820px) {
  .importance-band { flex-direction: column; padding: 30px 26px; }
  .importance-stat { width: 100%; }
}

/* ════════ SONG LESSONS ════════ */
.lesson-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 26px; }
.lesson {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  overflow: hidden; box-shadow: var(--shadow-sm);
  transition: transform var(--t-base), box-shadow var(--t-base);
  display: flex; flex-direction: column;
}
.lesson:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.lesson-head { padding: 26px 26px 0; position: relative; }
.lesson-icon {
  position: absolute; top: 24px; right: 24px; width: 42px; height: 42px;
  border-radius: 12px; background: var(--gold-soft); color: var(--gold-deep);
  display: flex; align-items: center; justify-content: center;
}
html[dir="rtl"] .lesson-icon { right: auto; left: 24px; }
.lesson-icon svg { width: 22px; height: 22px; }
.lesson-num {
  font-family: var(--font-ui); font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold-deep); margin-bottom: 10px;
}
.lesson-sources {
  margin-top: 18px; padding: 12px 14px; background: var(--bg-soft);
  border-radius: var(--r-sm); font-size: 0.8rem; color: var(--ink-dim); line-height: 1.6;
}
.lesson-sources strong { color: var(--ink-soft); }
.lesson-dl {
  border-color: rgba(176,124,42,0.35) !important; color: var(--gold-deep) !important;
}
.lesson-dl:hover { background: var(--gold) !important; color: #fff !important; }
.lesson h2 { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.lesson-meta { font-family: var(--font-ui); font-size: 0.82rem; color: var(--ink-dim); margin-bottom: 18px; }
.lesson-body { padding: 0 26px 26px; flex: 1; display: flex; flex-direction: column; }
.lesson-body h3 {
  font-family: var(--font-ui); font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-deep);
  margin: 20px 0 8px;
}
.lesson-body p, .lesson-body li { font-size: 0.95rem; color: var(--ink-soft); line-height: 1.75; }
.lesson-body ul { padding-left: 20px; }
html[dir="rtl"] .lesson-body ul { padding-left: 0; padding-right: 20px; }
.lesson-body li { list-style: disc; margin-bottom: 7px; }
.lesson-quote {
  font-family: var(--font-display); font-style: italic; font-size: 1.05rem;
  color: var(--ink); background: var(--bg-soft); border-radius: var(--r-md);
  padding: 18px 20px; margin: 6px 0 4px; line-height: 1.6;
}
html[lang="he"] .lesson-quote { font-style: normal; font-weight: 500; }
.lesson-actions { margin-top: auto; padding-top: 22px; display: flex; gap: 10px; flex-wrap: wrap; }
.lesson-embed { width: 100%; aspect-ratio: 16/9; border: 0; display: block; background: var(--bg-soft); }

/* ── Download panel (shared across family / timeline / lessons) ── */
.download-panel {
  max-width: 920px; margin: var(--sp-xl) auto 0;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 34px 32px; box-shadow: var(--shadow);
}
.download-panel-head { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 26px; }
.download-glyph {
  flex-shrink: 0; width: 48px; height: 48px; border-radius: 14px;
  background: var(--gold-soft); color: var(--gold-deep);
  display: flex; align-items: center; justify-content: center;
}
.download-glyph svg { width: 22px; height: 22px; }
.download-panel-head h3 { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.download-panel-head p { color: var(--ink-soft); font-size: 0.95rem; line-height: 1.6; }
.download-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.dl-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 14px 16px;
  text-decoration: none; transition: var(--t-fast);
}
.dl-item:hover { border-color: var(--gold); background: var(--gold-soft); transform: translateY(-2px); }
.dl-icon {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 9px;
  background: var(--card); border: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: center; color: var(--gold-deep);
}
.dl-icon svg { width: 16px; height: 16px; }
.dl-text { min-width: 0; }
.dl-name { font-family: var(--font-ui); font-size: 0.86rem; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-meta { font-family: var(--font-ui); font-size: 0.7rem; color: var(--ink-dim); }
.download-panel-all { text-align: center; margin-top: 22px; }

/* ── Educator note (shared) ── */
.educator-note {
  max-width: 780px; margin: var(--sp-xl) auto 0; text-align: center;
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 32px 30px;
}
.educator-note h3 { font-family: var(--font-display); font-size: 1.3rem; color: var(--ink); margin-bottom: 10px; }
.educator-note p { color: var(--ink-soft); margin-bottom: 18px; }

/* ── Citation block in the archive modal ── */
.cite-box {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 18px 20px; margin-top: 22px;
}
.cite-box h4 {
  font-family: var(--font-ui); font-size: 0.66rem; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-deep);
  margin-bottom: 10px; display: flex; align-items: center; gap: 8px;
}
.cite-box p { font-size: 0.86rem; color: var(--ink-soft); line-height: 1.7; margin-bottom: 6px; }
.cite-text {
  font-family: var(--font-ui); font-size: 0.82rem; color: var(--ink);
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 12px 14px; margin: 12px 0 10px;
  line-height: 1.6; word-break: break-word;
}
.cite-copy {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 40px; box-sizing: border-box;
  font-family: var(--font-ui); font-size: 0.72rem; font-weight: 600;
  color: var(--gold-deep); background: var(--gold-soft);
  border: 1px solid rgba(176,124,42,0.25); border-radius: var(--r-pill);
  padding: 8px 20px; cursor: pointer; transition: var(--t-fast);
}
.cite-copy:hover { background: var(--gold); color: #fff; }

/* ════════ INTERACTIVE + DECORATIVE LAYER ════════ */

/* Person cards: staggered rise, photo settles from a slight zoom */
.person { opacity: 0; transform: translateY(20px); }
.person.in {
  opacity: 1; transform: none;
  transition: opacity .7s var(--ease-spring), transform .7s var(--ease-spring),
              box-shadow var(--t-base), border-color var(--t-base);
  transition-delay: calc(var(--i, 0) * 70ms);
}
.person.in:hover { transform: translateY(-6px); }
.person-media { display: block; overflow: hidden; }
.person-media .person-photo { transition: transform 1s var(--ease-gold), filter .5s ease; filter: saturate(.85); }
.person:hover .person-photo { transform: scale(1.06); filter: saturate(1); }
/* a thin gold rule slides across the card on hover */
.person::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
  transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease-gold);
}
.person:hover::after { transform: scaleX(1); }

/* Memorial flame on the cards of those who were murdered */
.fate-flame {
  width: 9px; height: 12px; margin-right: 6px; vertical-align: -1px;
  color: var(--gold); animation: flameFlicker 2.6s ease-in-out infinite;
  transform-origin: 50% 100%;
}
html[dir="rtl"] .fate-flame { margin-right: 0; margin-left: 6px; }
@keyframes flameFlicker {
  0%, 100% { opacity: .75; transform: scaleY(1) scaleX(1); }
  30%      { opacity: 1;   transform: scaleY(1.14) scaleX(.92); }
  60%      { opacity: .85; transform: scaleY(.94) scaleX(1.06); }
}

/* Big pull quote inside the person panel */
.pp-pull {
  font-family: var(--font-display); font-style: italic;
  font-size: clamp(1.15rem, 2.4vw, 1.45rem); line-height: 1.45;
  color: var(--ink); border-left: 3px solid var(--gold);
  padding: 4px 0 4px 20px; margin: 22px 0 24px;
}
html[dir="rtl"] .pp-pull { border-left: none; border-right: 3px solid var(--gold); padding: 4px 20px 4px 0; }
html[lang="he"] .pp-pull { font-style: normal; font-weight: 500; }
.pp-pull cite {
  display: block; margin-top: 10px; font-family: var(--font-ui);
  font-size: 0.72rem; font-style: normal; font-weight: 600;
  letter-spacing: 0.06em; color: var(--gold-deep);
}
.pp-initials {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 2.6rem; color: var(--gold-deep);
  background: var(--gold-soft); border: 3px solid var(--gold-soft);
}

/* Timeline filters */
.tl-filters {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
  margin-bottom: var(--sp-lg);
}
.tl-filter {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-ui); font-size: 0.8rem; font-weight: 600;
  color: var(--ink-soft); background: var(--card);
  border: 1.5px solid var(--line-2); border-radius: var(--r-pill);
  padding: 10px 20px; cursor: pointer; transition: var(--t-fast);
}
.tl-filter:hover { border-color: var(--gold); color: var(--gold-deep); }
.tl-filter.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.tl-filter i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.tl-filter .k-world  { background: #24445f; }
.tl-filter .k-family { background: var(--gold); }
.tl-filter.active .k-world, .tl-filter.active .k-family { box-shadow: 0 0 0 2px rgba(255,255,255,0.3); }

/* Timeline rows animate in from their own side */
.tl-row { opacity: 0; transition: opacity .75s ease, transform .75s var(--ease-spring); }
.tl-row.world  { transform: translateX(-26px); }
.tl-row.family { transform: translateX(26px); }
.tl-row.in { opacity: 1; transform: none; }
.tl-dot-marker { transition: transform .5s var(--ease-spring), box-shadow .3s ease; }
.tl-row.in .tl-dot-marker { animation: dotPop .6s var(--ease-spring) both; }
@keyframes dotPop { from { transform: translateX(-50%) scale(0); } to { transform: translateX(-50%) scale(1); } }
.tl-row .tl-entry:hover .tl-dot-marker { box-shadow: 0 0 0 6px rgba(176,124,42,0.16); }

/* The spine fills with gold as you scroll */
.tl-spine-fill {
  position: absolute; top: 0; left: 50%; width: 2px; height: 0;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  transform: translateX(-50%); z-index: 1; border-radius: 2px;
  box-shadow: 0 0 12px rgba(219,179,94,0.5);
}
@media (max-width: 820px) {
  .tl-spine-fill { left: 14px; }
  html[dir="rtl"] .tl-spine-fill { left: auto; right: 14px; }
  .tl-row.world, .tl-row.family { transform: translateY(20px); }
  .tl-row.in { transform: none; }
}

/* Lessons: numbered plate + hover sheen */
.lesson { position: relative; }
.lesson::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright), var(--gold));
  transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease-gold); z-index: 2;
}
.lesson:hover::before { transform: scaleX(1); }
.lesson-num {
  display: inline-block; padding: 5px 12px; border-radius: var(--r-pill);
  background: var(--gold-soft); color: var(--gold-deep);
}

/* Educator note: soft gold field */
.educator-note {
  position: relative; overflow: hidden;
  background: linear-gradient(140deg, var(--card), var(--gold-soft));
}
.educator-note::before {
  content: ""; position: absolute; inset: -40%;
  background: radial-gradient(30% 40% at 30% 30%, rgba(255,255,255,0.7), transparent 60%);
  pointer-events: none;
}
.educator-note > * { position: relative; }

@media (prefers-reduced-motion: reduce) {
  .person, .tl-row { opacity: 1 !important; transform: none !important; }
  .fate-flame, .tl-row.in .tl-dot-marker { animation: none !important; }
}

@media (max-width: 620px) {
  .learn-hero { padding: 110px 0 var(--sp-md); }
  .person { width: 100%; max-width: 280px; }
  .person-panel-inner { padding: 32px 22px; }
  .tl-filter { font-size: 0.74rem; padding: 9px 15px; }
}

/* ════════ AMBIENT FLOATING MOTES (reusable decorative layer) ════════
   Drop <div class="ambient-motes" aria-hidden="true"><span></span>×N</div>
   into any position:relative; overflow:hidden container. */
.ambient-motes { position: absolute; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.ambient-motes span {
  position: absolute; bottom: -10%; width: 5px; height: 5px; border-radius: 50%;
  background: radial-gradient(circle, var(--gold-bright) 0%, var(--gold) 60%, transparent 100%);
  opacity: 0; animation: moteRise linear infinite;
}
@keyframes moteRise {
  0%   { transform: translateY(0) scale(0.6); opacity: 0; }
  12%  { opacity: 0.55; }
  85%  { opacity: 0.35; }
  100% { transform: translateY(-260px) scale(1.15); opacity: 0; }
}
.ambient-motes span:nth-child(1) { left: 6%;  width: 4px; height: 4px; animation-duration: 9s;  animation-delay: 0s; }
.ambient-motes span:nth-child(2) { left: 18%; width: 6px; height: 6px; animation-duration: 12s; animation-delay: 1.4s; }
.ambient-motes span:nth-child(3) { left: 32%; width: 3px; height: 3px; animation-duration: 8s;  animation-delay: 2.8s; }
.ambient-motes span:nth-child(4) { left: 48%; width: 5px; height: 5px; animation-duration: 11s; animation-delay: 0.6s; }
.ambient-motes span:nth-child(5) { left: 63%; width: 4px; height: 4px; animation-duration: 10s; animation-delay: 3.6s; }
.ambient-motes span:nth-child(6) { left: 77%; width: 6px; height: 6px; animation-duration: 13s; animation-delay: 1.9s; }
.ambient-motes span:nth-child(7) { left: 88%; width: 3px; height: 3px; animation-duration: 9.5s; animation-delay: 4.4s; }
.ambient-motes span:nth-child(8) { left: 96%; width: 4px; height: 4px; animation-duration: 10.5s; animation-delay: 2.2s; }

.importance-band, .download-panel { position: relative; overflow: hidden; }
.importance-band > *, .download-panel > * { position: relative; z-index: 1; }

@media (prefers-reduced-motion: reduce) { .ambient-motes span { animation: none; opacity: 0; } }

/* ════════ EXTRA MOTION + MOBILE POLISH ════════ */

/* Hero: title rises, subtitle follows, gold rule draws itself */
.learn-hero .section-label { animation: lhFade .7s ease .05s both; }
.learn-hero h1 { animation: lhRise .9s var(--ease-spring) .12s both; }
.learn-hero p  { animation: lhRise .9s var(--ease-spring) .24s both; }
.learn-hero::after {
  content: ""; display: block; width: 0; height: 2px; margin: 30px auto 0;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  animation: lhRule 1.1s var(--ease-gold) .5s forwards;
}
@keyframes lhFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes lhRise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes lhRule { to { width: min(220px, 50%); } }

/* Generation labels draw their flanking rules on entry */
.tree-gen-label { animation: lhFade .8s ease both; }

/* Person panel: content stages in */
.person-panel.open .pp-photo,
.person-panel.open .pp-initials { animation: ppPop .6s var(--ease-spring) both; }
.person-panel.open .pp-name   { animation: lhRise .55s var(--ease-spring) .06s both; }
.person-panel.open .pp-years  { animation: lhRise .55s var(--ease-spring) .12s both; }
.person-panel.open .pp-pull   { animation: lhRise .6s  var(--ease-spring) .18s both; }
.person-panel.open .pp-body   { animation: lhRise .6s  var(--ease-spring) .24s both; }
.person-panel.open .pp-known  { animation: lhRise .6s  var(--ease-spring) .32s both; }
.person-panel.open .pp-links  { animation: lhRise .6s  var(--ease-spring) .4s  both; }
@keyframes ppPop { from { opacity: 0; transform: scale(.86); } to { opacity: 1; transform: none; } }

/* Lesson cards rise in sequence */
.lesson { opacity: 0; transform: translateY(26px); animation: lhRise .8s var(--ease-spring) both; }
.lesson:nth-child(1) { animation-delay: .05s; }
.lesson:nth-child(2) { animation-delay: .15s; }
.lesson:nth-child(3) { animation-delay: .25s; }
.lesson:nth-child(4) { animation-delay: .35s; }

/* Timeline entries lift and glow a little on hover */
.tl-entry { position: relative; overflow: hidden; }
.tl-entry::after {
  content: ""; position: absolute; top: 0; left: -120%; width: 55%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.55), transparent);
  transform: skewX(-18deg); transition: left .8s var(--ease-gold); pointer-events: none;
}
.tl-entry:hover::after { left: 160%; }

/* ── MOBILE ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .tree-gen { gap: 14px; }
  .person { width: calc(50% - 7px); }
  .person-name { font-size: 1rem; margin: 12px 8px 3px; }
  .person-role { font-size: 0.66rem; margin: 0 8px 8px; }
  .person-fate { font-size: 0.6rem; padding: 3px 9px; }
}
@media (max-width: 620px) {
  .learn-hero { padding: 104px 0 var(--sp-md); }
  .learn-hero p { font-size: 1rem; }
  .learn-hero::after { margin-top: 22px; }
  .tree-intro { font-size: 0.98rem; margin-bottom: var(--sp-lg); }
  .tree-gen-label::before, .tree-gen-label::after { width: 34px; }
  .tree-gen-label::before { right: calc(50% + 74px); }
  .tree-gen-label::after  { left:  calc(50% + 74px); }
  .tree-connector { height: 22px; margin-bottom: 18px; }

  /* person cards stay two-up but get comfortable */
  .person { width: calc(50% - 6px); max-width: none; padding-bottom: 14px; }
  .person-photo { aspect-ratio: 4/5; }

  /* panel behaves like a bottom sheet */
  .person-panel { padding: 0; align-items: flex-end; }
  .person-panel-inner {
    max-height: 92vh; border-radius: var(--r-lg) var(--r-lg) 0 0;
    padding: 30px 20px 34px; transform: translateY(100%);
  }
  .person-panel.open .person-panel-inner { transform: none; }
  .person-panel-inner::before {
    content: ""; display: block; width: 42px; height: 4px; border-radius: 3px;
    background: var(--line-2); margin: -12px auto 18px;
  }
  .pp-photo, .pp-initials { width: 96px; height: 96px; }
  .pp-name { font-size: 1.4rem; }
  .pp-pull { font-size: 1.05rem; padding-left: 14px; }
  html[dir="rtl"] .pp-pull { padding-right: 14px; padding-left: 0; }
  .pp-links { flex-direction: column; }
  .pp-links .btn { width: 100%; justify-content: center; }

  /* timeline reads as a single column with a tighter rail */
  .tl-filters { gap: 8px; }
  .tl-entry h3 { font-size: 1.02rem; }
  .tl-entry p { font-size: 0.88rem; }
  .tl-row { margin-bottom: 20px; }

  /* lessons full width, video first */
  .lesson-grid { gap: 18px; }
  .lesson-head { padding: 22px 20px 0; }
  .lesson-body { padding: 0 20px 22px; }
  .lesson h2 { font-size: 1.3rem; }
  .lesson-actions { flex-direction: column; }
  .lesson-actions .btn { width: 100%; justify-content: center; }
  .educator-note { padding: 26px 20px; }
}
@media (max-width: 400px) {
  .person { width: 100%; }
  .person-photo { aspect-ratio: 16/10; }
}

@media (prefers-reduced-motion: reduce) {
  .learn-hero .section-label, .learn-hero h1, .learn-hero p,
  .lesson, .person-panel.open .pp-photo, .person-panel.open .pp-name,
  .person-panel.open .pp-years, .person-panel.open .pp-pull,
  .person-panel.open .pp-body, .person-panel.open .pp-known,
  .person-panel.open .pp-links {
    animation: none !important; opacity: 1 !important; transform: none !important;
  }
  .learn-hero::after { animation: none; width: min(220px, 50%); }
}
