/* AI בגובה העיניים — course reading theme
   Light background per aging-eyes research (Piepenbrock 60-85yo study, NN/g dark-mode guidance):
   positive polarity wins for older readers; dark mode causes halation with astigmatism. */

:root {
  --paper: #faf8f4;
  --paper-card: #ffffff;
  --ink: #1c2333;
  --ink-soft: #3d475c;
  --navy: #14264d;
  --blue: #1f4fb0;
  --blue-soft: #eaf0fb;
  --orange: #d1490a;
  --orange-soft: #fdeee4;
  --green: #1e6b3a;
  --green-soft: #e9f4ec;
  --amber-soft: #fdf3d9;
  --amber-border: #d9a520;
  --line: #e3ddd2;
  --fs-body: 22px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  font-family: 'Assistant', sans-serif;
  font-size: var(--fs-body);
  line-height: 1.75;
  color: var(--ink);
  background: var(--paper);
  direction: rtl;
}

h1, h2, h3, h4 { font-family: 'Heebo', sans-serif; color: var(--navy); line-height: 1.35; }
h1 { font-size: 1.9em; margin: 10px 0 14px; }
h2 { font-size: 1.45em; margin: 48px 0 14px; }
h3 { font-size: 1.15em; margin: 30px 0 10px; }
p { margin: 0 0 18px; }
ul, ol { margin: 0 0 18px; padding-right: 26px; }
li { margin-bottom: 10px; }
strong { color: var(--navy); }
a { color: var(--blue); }

/* ---------- header ---------- */
.book-header {
  background: #0b1730;
  color: #eef3fb;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.book-header .brand { font-family: 'Heebo', sans-serif; font-weight: 800; font-size: 18px; color: #fff; text-decoration: none; }
.book-header .chap-label { font-size: 16px; color: #b6c4da; }
.book-header .toc-link {
  color: #fff; text-decoration: none; font-size: 16px;
  border: 1px solid rgba(255,255,255,0.35); border-radius: 999px; padding: 7px 16px;
  min-height: 44px; display: inline-flex; align-items: center; cursor: pointer;
}
.book-header .toc-link:hover { background: rgba(255,255,255,0.12); }

/* scroll progress — deliberately quiet */
.scrollbar-track { position: sticky; top: 0; height: 4px; background: #ece7dc; z-index: 50; }
.scrollbar-fill { height: 100%; width: 0; background: #b9c3d6; }

/* font size toggle */
.atoggle { display: flex; gap: 6px; align-items: center; }
.atoggle button {
  font-family: 'Heebo', sans-serif; font-weight: 700; cursor: pointer;
  background: rgba(255,255,255,0.1); color: #fff;
  border: 1px solid rgba(255,255,255,0.35); border-radius: 8px;
  min-width: 44px; min-height: 44px; font-size: 15px;
}
.atoggle button:nth-child(2) { font-size: 18px; }
.atoggle button:nth-child(3) { font-size: 21px; }
.atoggle button[aria-pressed="true"] { background: var(--orange); border-color: var(--orange); }
.atoggle button:focus-visible, .toc-link:focus-visible, a:focus-visible, button:focus-visible {
  outline: 3px solid var(--orange); outline-offset: 2px;
}

/* ---------- page ---------- */
main { max-width: 760px; margin: 0 auto; padding: 34px 22px 90px; }
.kicker { font-family: 'Heebo', sans-serif; color: var(--orange); font-weight: 700; font-size: 0.95em; }

/* ---------- boxes ---------- */
.goal-box, .story, .tip, .warn, .safe, .try-box, .recap {
  border-radius: 14px; padding: 20px 22px; margin: 24px 0;
}
.box-title {
  font-family: 'Heebo', sans-serif; font-weight: 800; font-size: 1.05em;
  display: block; margin-bottom: 8px;
}

.goal-box { background: var(--blue-soft); border: 1.5px solid #c5d5f2; }
.goal-box .box-title { color: var(--blue); }
.goal-box ul { margin-bottom: 0; }

.story { background: #f4efe6; border-right: 5px solid var(--amber-border); }
.story .box-title { color: #8a6a10; }
.story p:last-child { margin-bottom: 0; }

.tip { background: var(--green-soft); border: 1.5px solid #bfdcc9; }
.tip .box-title { color: var(--green); }
.tip p:last-child, .tip ul:last-child { margin-bottom: 0; }

.warn { background: var(--amber-soft); border: 1.5px solid #e6c96a; }
.warn .box-title { color: #7a5a00; }
.warn p:last-child, .warn ul:last-child { margin-bottom: 0; }

.safe { background: var(--blue-soft); border: 1.5px dashed #9db8e6; text-align: center; font-weight: 600; }
.safe p { margin: 0; color: var(--navy); }

/* ---------- numbered steps ---------- */
.steps { list-style: none; padding: 0; margin: 22px 0; counter-reset: step; }
.steps > li {
  counter-increment: step;
  position: relative;
  padding: 0 62px 22px 0;
  margin: 0;
}
.steps > li::before {
  content: counter(step);
  position: absolute; right: 0; top: 0;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--navy); color: #fff;
  font-family: 'Heebo', sans-serif; font-weight: 800; font-size: 20px;
  display: flex; align-items: center; justify-content: center;
}
.steps > li:not(:last-child)::after {
  content: ""; position: absolute; right: 21px; top: 48px; bottom: 4px;
  width: 2px; background: var(--line);
}
.steps .step-title { font-family: 'Heebo', sans-serif; font-weight: 700; color: var(--navy); display: block; padding-top: 6px; }

/* ---------- prompt card (copy-paste) ---------- */
.prompt-card {
  background: var(--paper-card); border: 2px solid var(--navy); border-radius: 14px;
  margin: 24px 0; overflow: hidden;
}
.prompt-card .prompt-head {
  background: var(--navy); color: #fff; padding: 10px 18px;
  font-family: 'Heebo', sans-serif; font-weight: 700; font-size: 0.95em;
}
.prompt-card .prompt-text { padding: 18px 20px 6px; font-size: 1.02em; }
.prompt-card .prompt-foot { padding: 0 20px 16px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.copy-btn {
  font-family: 'Heebo', sans-serif; font-weight: 700; font-size: 18px; cursor: pointer;
  background: var(--orange); color: #fff; border: none; border-radius: 10px;
  padding: 12px 26px; min-height: 48px;
}
.copy-btn:hover { background: #b93f08; }
.copy-note { color: var(--green); font-weight: 700; visibility: hidden; }
.copy-note.shown { visibility: visible; }
.prompt-swap { font-size: 0.92em; color: var(--ink-soft); padding: 0 20px 16px; }
.prompt-swap strong { color: var(--orange); }

/* ---------- try box ---------- */
.try-box { background: var(--orange-soft); border: 1.5px solid #f0bc9c; }
.try-box .box-title { color: var(--orange); }
.try-box p:last-child, .try-box ol:last-child { margin-bottom: 0; }

/* ---------- phone mockup ---------- */
.phone-wrap { margin: 28px auto; max-width: 360px; }
.phone {
  background: #111; border-radius: 42px; padding: 12px;
  box-shadow: 0 18px 45px rgba(20, 38, 77, 0.22);
}
.phone-screen {
  background: #fff; border-radius: 32px; overflow: hidden;
  font-size: 15.5px; line-height: 1.5; position: relative;
}
.ph-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid #f0f0f0; direction: ltr;
}
.ph-top .ph-title { font-weight: 700; color: #0d0d0d; font-family: 'Heebo', sans-serif; direction: ltr; }
.ph-top .ph-title span { color: #8e8e8e; font-weight: 400; }
.ph-icon { width: 22px; height: 22px; color: #0d0d0d; flex: none; }
.ph-body { padding: 14px; min-height: 200px; display: flex; flex-direction: column; gap: 12px; }
.ph-greet { text-align: center; color: #0d0d0d; font-weight: 600; font-size: 17px; margin: 46px 0; direction: ltr; }
.msg-user {
  align-self: flex-start;
  background: #e9e9eb; color: #0d0d0d;
  border-radius: 20px; padding: 10px 16px; max-width: 85%;
}
.msg-ai { color: #0d0d0d; padding: 2px 2px 0; }
.msg-ai p { margin-bottom: 8px; }
.msg-ai p:last-child { margin-bottom: 0; }
.msg-actions { display: flex; gap: 14px; padding: 2px; color: #8e8e8e; }
.msg-actions svg { width: 17px; height: 17px; }
.ph-composer {
  margin: 10px 12px 14px; background: #f4f4f4; border-radius: 999px;
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; direction: ltr;
}
.ph-composer .ph-icon { width: 20px; height: 20px; color: #555; }
.ph-composer .ph-ask { color: #8e8e8e; flex: 1; direction: ltr; text-align: left; font-size: 15px; }
.ph-composer .ph-ask.he { direction: rtl; text-align: right; color: #0d0d0d; }
.ph-send {
  width: 30px; height: 30px; border-radius: 50%; background: #0d0d0d; color: #fff;
  display: flex; align-items: center; justify-content: center; flex: none;
}
.ph-send svg { width: 16px; height: 16px; }

/* voice orb screen */
.ph-voice { min-height: 330px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 30px; }
.ph-orb {
  width: 130px; height: 130px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #dbe9ff 0%, #7fb0f4 45%, #2f6fe0 100%);
  box-shadow: 0 0 50px rgba(83, 141, 233, 0.5);
}
.ph-voice-btns { display: flex; gap: 26px; }
.ph-voice-btns .vbtn {
  width: 52px; height: 52px; border-radius: 50%; background: #f0f0f0; color: #333;
  display: flex; align-items: center; justify-content: center;
}
.ph-voice-btns .vbtn svg { width: 22px; height: 22px; }

/* plus menu sheet */
.ph-sheet { border-top: 1px solid #eee; padding: 8px 0 4px; }
.ph-sheet .sheet-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 18px;
  color: #0d0d0d; font-weight: 600; direction: ltr;
}
.ph-sheet .sheet-item svg { width: 20px; height: 20px; color: #555; }

/* annotation callouts */
.callout-list { margin: 14px 0 0; padding: 0; list-style: none; counter-reset: co; }
.callout-list li { counter-increment: co; position: relative; padding: 0 44px 8px 0; }
.callout-list li::before {
  content: counter(co);
  position: absolute; right: 0; top: 2px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--orange); color: #fff;
  font-family: 'Heebo', sans-serif; font-weight: 800; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
}
.co-dot {
  position: absolute; width: 26px; height: 26px; border-radius: 50%;
  background: var(--orange); color: #fff; font-family: 'Heebo', sans-serif;
  font-weight: 800; font-size: 14px; display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.3); z-index: 2;
}
.phone-caption { text-align: center; font-size: 0.88em; color: var(--ink-soft); margin-top: 10px; }

/* ---------- quiz ---------- */
.quiz { background: var(--paper-card); border: 1.5px solid var(--line); border-radius: 14px; padding: 22px; margin: 26px 0; }
.quiz h3 { margin-top: 0; }
.quiz .q { margin-bottom: 22px; }
.quiz .q:last-child { margin-bottom: 0; }
.quiz .q-text { font-weight: 700; color: var(--navy); margin-bottom: 10px; }
.quiz .answers { display: flex; flex-direction: column; gap: 10px; }
.quiz .answers button {
  font-family: 'Assistant', sans-serif; font-size: 1em; text-align: right; cursor: pointer;
  background: var(--paper); border: 1.5px solid var(--line); border-radius: 10px;
  padding: 12px 16px; min-height: 48px; color: var(--ink);
}
.quiz .answers button:hover { border-color: var(--navy); }
.quiz .answers button.correct { background: var(--green-soft); border-color: var(--green); color: var(--green); font-weight: 700; }
.quiz .answers button.wrong { background: #fbe9e7; border-color: #c0392b; color: #8c2b20; }
.quiz .feedback { margin-top: 10px; font-weight: 600; display: none; }
.quiz .feedback.shown { display: block; }
.quiz .feedback.good { color: var(--green); }
.quiz .feedback.bad { color: #8c2b20; }

/* ---------- recap ---------- */
.recap { background: var(--paper-card); border: 2px solid var(--navy); }
.recap .box-title { color: var(--navy); font-size: 1.15em; }
.recap ul { margin-bottom: 0; }
.recap li::marker { color: var(--orange); }

/* ---------- chapter nav ---------- */
.next-nav { margin-top: 46px; display: flex; flex-direction: column; gap: 14px; }
.done-btn {
  font-family: 'Heebo', sans-serif; font-weight: 800; font-size: 20px; cursor: pointer;
  background: var(--green); color: #fff; border: none; border-radius: 12px;
  padding: 16px 20px; min-height: 56px; width: 100%;
}
.done-btn:hover { background: #17552e; }
.done-btn.done { background: var(--green-soft); color: var(--green); border: 2px solid var(--green); cursor: default; }
.nav-row { display: flex; gap: 14px; flex-wrap: wrap; }
.nav-row a {
  flex: 1; min-width: 200px; text-align: center; text-decoration: none;
  font-family: 'Heebo', sans-serif; font-weight: 700; font-size: 18px;
  border-radius: 12px; padding: 14px 18px; min-height: 52px;
  display: flex; align-items: center; justify-content: center;
}
.nav-next { background: var(--orange); color: #fff; }
.nav-next:hover { background: #b93f08; }
.nav-prev { background: var(--paper-card); color: var(--navy); border: 1.5px solid var(--navy); }

/* ---------- TOC page ---------- */
.toc-hero { text-align: center; padding: 10px 0 6px; }
.toc-stage { margin: 40px 0 6px; display: flex; align-items: center; gap: 12px; }
.toc-stage .stage-pill {
  background: var(--blue-soft); border: 1px solid #b7cbee; color: var(--blue);
  border-radius: 999px; padding: 3px 14px; font-family: 'Heebo', sans-serif; font-weight: 700; font-size: 0.9em;
}
.toc-stage h2 { margin: 0; font-size: 1.25em; }
.toc-list { list-style: none; padding: 0; margin: 14px 0 0; }
.toc-list a {
  display: flex; align-items: center; gap: 14px; text-decoration: none;
  background: var(--paper-card); border: 1.5px solid var(--line); border-radius: 12px;
  padding: 14px 18px; margin-bottom: 10px; color: var(--ink); min-height: 56px;
}
.toc-list a:hover { border-color: var(--navy); }
.toc-num {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  background: var(--navy); color: #fff; font-family: 'Heebo', sans-serif; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.toc-name { font-weight: 700; color: var(--navy); }
.toc-sub { font-size: 0.88em; color: var(--ink-soft); }
.toc-check { margin-right: auto; color: var(--green); font-weight: 800; visibility: hidden; }
.toc-list a.completed { border-color: var(--green); }
.toc-list a.completed .toc-check { visibility: visible; }
.toc-list a.completed .toc-num { background: var(--green); }

/* ---------- chapter opener image ---------- */
.chap-opener {
  width: 100%; display: block; border-radius: 14px;
  border: 1px solid var(--line); margin: 18px 0 26px;
}

/* ---------- ביני, floating course companion (top-left corner) ---------- */
.bini-fab {
  position: fixed; top: 86px; left: 10px; z-index: 60;
  display: flex; align-items: flex-start; gap: 8px; direction: ltr;
}
.bini-fab img {
  width: 64px; height: 64px; cursor: pointer; flex: none;
  filter: drop-shadow(0 6px 14px rgba(20, 38, 77, 0.3));
  animation: biniFloat 3.6s ease-in-out infinite;
}
.bini-x {
  position: absolute; top: -10px; left: 48px; z-index: 61;
  width: 26px; height: 26px; border-radius: 50%; padding: 0;
  background: #fff; color: var(--ink-soft); border: 1.5px solid var(--line);
  font-family: inherit; font-size: 16px; font-weight: 700; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
@keyframes biniFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}
.bini-pop {
  cursor: pointer; direction: rtl;
  background: var(--paper-card); border: 1.5px solid var(--line); border-radius: 14px;
  box-shadow: 0 10px 28px rgba(20, 38, 77, 0.18);
  padding: 10px 14px; max-width: 250px; font-size: 16px; line-height: 1.55;
  color: var(--ink-soft); font-weight: 600;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
}
.bini-pop.shown { opacity: 1; visibility: visible; transform: none; }
@media (max-width: 480px) {
  .bini-fab { top: auto; bottom: 14px; align-items: flex-end; }
  .bini-fab img { width: 56px; height: 56px; }
  .bini-x { top: -8px; left: 40px; }
  .bini-pop { max-width: 210px; font-size: 15px; }
}

/* ---------- click-to-try ChatGPT buttons ---------- */
.gpt-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: 'Heebo', sans-serif; font-weight: 800; font-size: 19px;
  background: var(--blue); color: #fff !important; text-decoration: none;
  border-radius: 10px; padding: 12px 26px; min-height: 48px; cursor: pointer;
}
.gpt-btn:hover { background: #173f8f; }
.gpt-note { width: 100%; font-size: 0.85em; color: var(--ink-soft); margin: 6px 0 0; }
.try-go {
  display: inline-block; margin-right: 10px; cursor: pointer;
  font-family: 'Heebo', sans-serif; font-weight: 700; font-size: 16px;
  background: var(--orange); color: #fff !important; text-decoration: none;
  border-radius: 999px; padding: 6px 18px; white-space: nowrap;
}
.try-go:hover { background: #b93f08; }

/* ---------- chapter 1 upsell banner (non-buyers) ---------- */
.upsell-banner {
  background: linear-gradient(160deg, #0b1730, #14264d);
  border-radius: 18px; padding: 34px 26px; margin: 46px 0 10px;
  text-align: center; color: #eef3fb;
}
.upsell-banner img { width: 92px; height: 92px; }
.upsell-banner .up-kick { color: #ffb180; font-family: 'Heebo', sans-serif; font-weight: 700; margin: 10px 0 4px; }
.upsell-banner .up-head { font-family: 'Heebo', sans-serif; font-weight: 900; font-size: 1.4em; color: #fff; margin: 0 0 16px; line-height: 1.3; }
.upsell-banner .up-list {
  list-style: none; padding: 0; margin: 0 auto 22px; max-width: 420px; text-align: right;
}
.upsell-banner .up-list li { padding-right: 30px; position: relative; margin-bottom: 8px; color: #d7e2f5; }
.upsell-banner .up-list li::before {
  content: ""; position: absolute; right: 4px; top: 0.62em;
  width: 12px; height: 12px; border-radius: 50%; background: var(--orange);
}
.upsell-banner .up-btn {
  display: inline-block; background: var(--orange); color: #fff; text-decoration: none;
  font-family: 'Heebo', sans-serif; font-weight: 900; font-size: 21px;
  border-radius: 12px; padding: 16px 34px;
}
.upsell-banner .up-btn:hover { background: #b93f08; }
.upsell-banner .up-note { color: #b6c4da; font-size: 0.85em; margin: 12px 0 0; }

/* ---------- community banner (buyers) ---------- */
.comm-banner {
  background: linear-gradient(160deg, #0b1730, #14264d);
  border-radius: 18px; padding: 28px 24px; margin: 40px 0 8px;
  text-align: center; color: #eef3fb;
}
.comm-banner .cb-kick { color: #8fb8ff; font-family: 'Heebo', sans-serif; font-weight: 700; margin: 0 0 4px; }
.comm-banner .cb-head { font-family: 'Heebo', sans-serif; font-weight: 900; font-size: 1.3em; color: #fff; margin: 0 0 10px; line-height: 1.3; }
.comm-banner p.cb-txt { color: #d7e2f5; max-width: 520px; margin: 0 auto 18px; }
.comm-banner button {
  font-family: 'Heebo', sans-serif; font-weight: 800; font-size: 19px; cursor: pointer;
  background: var(--orange); color: #fff; border: none; border-radius: 12px;
  padding: 14px 30px; min-height: 52px;
}
.comm-banner button:hover { background: #b93f08; }
.comm-banner .cb-ok { color: #7fe0a0; font-weight: 700; margin: 10px 0 0; display: none; }
.comm-banner .cb-ok.shown { display: block; }

/* TOC quiet progress line */
.toc-progress { text-align: center; color: var(--ink-soft); font-size: 0.95em; margin: 6px 0 0; }

/* before / after */
.ba-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 26px 0; }
.ba-grid figure { margin: 0; }
.ba-grid img { width: 100%; border-radius: 12px; border: 1px solid var(--line); display: block; }
.ba-grid figcaption {
  text-align: center; font-family: 'Heebo', sans-serif; font-weight: 700;
  margin-top: 8px; color: var(--navy);
}
.ba-grid .before figcaption { color: var(--ink-soft); }
@media (max-width: 480px) { .ba-grid { grid-template-columns: 1fr; } }

@media (max-width: 480px) {
  :root { --fs-body: 20px; }
  main { padding: 26px 16px 80px; }
  .steps > li { padding-right: 56px; }
}

@media print {
  .book-header, .scrollbar-track, .next-nav, .quiz, .copy-btn { display: none; }
  body { background: #fff; }
}
