/* Theme pulled from the book cover:
   bold vermillion orange + warm gold accent + cream paper. */

:root {
  --orange:        #EC512D;
  --orange-deep:   #D63E1E;
  --orange-soft:   #F36947;
  --yellow:        #F5C944;
  --yellow-deep:   #E5B72E;
  --teal:          #4FBFC6;
  --ink:           #1c1410;
  --ink-soft:      #4a3a30;
  --ink-dim:       #7a6a60;
  --paper:         #FFFBF5;
  --paper-2:       #FFF4E6;
  --line:          rgba(0, 0, 0, 0.10);
  --line-strong:   rgba(0, 0, 0, 0.18);
  --shadow:        0 18px 50px rgba(120, 35, 10, 0.25);
  --shadow-soft:   0 8px 24px rgba(120, 35, 10, 0.18);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: linear-gradient(180deg, var(--orange) 0%, var(--orange-deep) 100%);
  color: var(--paper);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.hidden-until-start { display: none; }

#app.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ───────────────── Splash (premium) ───────────────── */
.splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background:
    radial-gradient(ellipse 1100px 600px at 25% -10%, rgba(245, 201, 68, 0.22), transparent 60%),
    radial-gradient(ellipse 800px 700px at 110% 100%, rgba(214, 62, 30, 0.55), transparent 55%),
    linear-gradient(160deg, #F26B47 0%, #D63E1E 60%, #B6311A 100%);
  animation: splash-fade-in .55s cubic-bezier(.2,.7,.2,1) both;
  overflow: hidden;
}
.splash.leaving {
  animation: splash-fade-out .45s ease forwards;
}

/* subtle grain / dot texture overlay for a printed-paper feel */
.splash-grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  mix-blend-mode: overlay;
  background-image:
    radial-gradient(rgba(255,255,255,0.5) 1px, transparent 1px),
    radial-gradient(rgba(0,0,0,0.4) 1px, transparent 1px);
  background-size: 22px 22px, 22px 22px;
  background-position: 0 0, 11px 11px;
}

.splash-frame {
  position: relative;
  display: grid;
  grid-template-columns: minmax(240px, 340px) minmax(300px, 460px);
  gap: 64px;
  align-items: center;
  max-width: 940px;
  width: 100%;
}
@media (max-width: 820px) {
  .splash-frame {
    grid-template-columns: 1fr;
    gap: 36px;
    text-align: center;
    max-width: 480px;
  }
}

/* cover art with a soft yellow glow */
.splash-art {
  position: relative;
  display: flex;
  justify-content: center;
}
.splash-cover-glow {
  position: absolute;
  inset: -55px;
  background: radial-gradient(circle at center, rgba(255, 230, 140, 0.9), rgba(255, 190, 90, 0.55) 35%, rgba(255, 150, 70, 0.25) 60%, transparent 78%);
  filter: blur(32px);
  z-index: 0;
  pointer-events: none;
  animation: cover-glow-pulse 4s ease-in-out infinite;
}
@keyframes cover-glow-pulse {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50%      { opacity: 1;    transform: scale(1.06); }
}
.splash-cover {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  max-width: 320px;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  transform: rotate(-2deg) translateY(0);
  transition: transform .8s cubic-bezier(.2,.7,.2,1);
  animation: cover-float 5s ease-in-out infinite;
}
@keyframes cover-float {
  0%, 100% { transform: rotate(-2deg) translateY(0); }
  50%      { transform: rotate(-2deg) translateY(-8px); }
}

/* info side */
.splash-info {
  color: var(--paper);
  position: relative;
  z-index: 1;
}
@media (max-width: 820px) {
  .splash-info { display: flex; flex-direction: column; align-items: center; }
}
.splash-eyebrow {
  margin: 0 0 14px;
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--yellow);
  font-weight: 700;
}
.splash-title {
  margin: 0 0 18px;
  font-size: clamp(44px, 6.4vw, 64px);
  line-height: 0.98;
  font-weight: 800;
  letter-spacing: -1px;
  color: #fff;
}
.splash-em {
  font-style: italic;
  font-weight: 700;
  color: var(--yellow);
  padding-right: 0.04em;
}

.splash-lede {
  margin: 0 0 22px;
  font-size: 17px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.92);
  max-width: 420px;
  font-weight: 400;
}
@media (max-width: 820px) {
  .splash-lede { margin-left: auto; margin-right: auto; }
}

.splash-features {
  list-style: none;
  margin: 0 0 30px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.splash-features li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.88);
  font-weight: 500;
}
.splash-features .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--yellow);
  flex: 0 0 auto;
  box-shadow: 0 0 0 4px rgba(245, 201, 68, 0.20);
}
@media (max-width: 820px) {
  .splash-features li { justify-content: center; }
}

/* premium CTA */
.splash-cta {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 26px 16px 28px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.1px;
  color: var(--ink);
  background: var(--yellow);
  border: none;
  border-radius: 100px;
  cursor: pointer;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.6) inset,
    0 12px 28px rgba(0, 0, 0, 0.30),
    0 4px 10px rgba(0, 0, 0, 0.20);
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
}
.splash-cta:hover {
  background: #FFD45C;
  transform: translateY(-2px);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.6) inset,
    0 18px 34px rgba(0, 0, 0, 0.34),
    0 6px 14px rgba(0, 0, 0, 0.20);
}
.splash-cta:active {
  transform: translateY(0);
}
.splash-cta svg {
  transition: transform .25s cubic-bezier(.2,.8,.2,1);
}
.splash-cta:hover svg {
  transform: translateX(4px);
}

.splash-credit {
  margin: 24px 0 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.3px;
}
.splash-credit strong {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 600;
}

@keyframes splash-fade-in {
  from { opacity: 0; transform: scale(.98); }
  to   { opacity: 1; transform: none; }
}
@keyframes splash-fade-out {
  to { opacity: 0; transform: scale(1.02); }
}

/* ───────────────── Top bar ───────────────── */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  gap: 16px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--paper);
}
.brand-mark {
  display: inline-flex;
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--yellow);
  color: var(--orange-deep);
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}
.brand-text {
  font-size: 15px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.nav-cluster {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-btn {
  padding: 6px 12px;
  font-size: 16px;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.30);
  color: var(--paper);
  font-weight: 700;
}
.nav-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.22);
}
.nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.progress {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 12px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.bar {
  width: 160px;
  height: 8px;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 100px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.20);
}
.bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--yellow), var(--yellow-deep));
  transition: width 0.45s cubic-bezier(.2,.8,.2,1);
}

/* ───────────────── Stage ───────────────── */
.stage {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(320px, 420px) 1fr;
  gap: 24px;
  padding: 24px 28px 32px;
}
@media (max-width: 920px) {
  .stage { grid-template-columns: 1fr; }
}

.panel {
  background: var(--paper);
  color: var(--ink);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.panel.left {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.panel.right {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

h1 {
  font-size: 24px;
  margin: 0;
  letter-spacing: 0.2px;
  color: var(--ink);
}
.quote {
  margin: 0;
  color: var(--ink-soft);
  font-style: italic;
  font-size: 14px;
  border-left: 4px solid var(--yellow);
  padding: 6px 0 6px 14px;
}
.prompt {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
}

.hint-box {
  background: var(--paper-2);
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--ink-soft);
}
.hint-box strong { color: var(--ink); display: block; margin-bottom: 6px; }
.hint-box ul { margin: 0; padding-left: 18px; }
.hint-box li { margin: 4px 0; line-height: 1.45; }
.hint-box b { color: var(--orange-deep); }
.hint-box kbd {
  display: inline-block;
  padding: 1px 6px;
  font-family: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, monospace;
  font-size: 11px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  color: var(--ink);
}

.controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
}

.btn {
  appearance: none;
  border: 1.5px solid var(--ink);
  background: transparent;
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: transform .08s ease, background .15s ease, color .15s ease, box-shadow .15s ease;
}
.btn:hover { background: rgba(0, 0, 0, 0.06); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn.primary {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
  box-shadow: 0 6px 18px rgba(236, 81, 45, 0.40);
}
.btn.primary:hover { background: var(--orange-deep); border-color: var(--orange-deep); }
.btn.ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink-soft);
}
.btn.ghost:hover { background: rgba(0, 0, 0, 0.04); color: var(--ink); }

.btn.yellow {
  background: var(--yellow);
  border-color: var(--yellow);
  color: var(--ink);
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(229, 183, 46, 0.40);
}
.btn.yellow:hover { background: var(--yellow-deep); border-color: var(--yellow-deep); }

.feedback {
  min-height: 22px;
  font-size: 14px;
  color: var(--ink-dim);
}
.feedback.ok   { color: #1f8a4c; }
.feedback.meh  { color: #b78108; }
.feedback.bad  { color: #c33b1e; }

/* ───────────────── Chart ───────────────── */
.chart-wrap {
  position: relative;
  width: 100%;
  max-width: 760px;
  aspect-ratio: 16 / 13;
}
.chart-status {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 2;
  font-size: 10.5px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink-dim);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  padding: 5px 11px;
  border-radius: 100px;
  pointer-events: none;
  transition: color .15s ease, background .15s ease;
  user-select: none;
}
.chart-status.active {
  color: #fff;
  background: var(--orange);
  border-color: var(--orange);
}
.chart-status.done {
  color: #fff;
  background: #1f8a4c;
  border-color: #1f8a4c;
}
#chart {
  width: 100%;
  height: 100%;
  display: block;
  background: var(--paper-2);
  border-radius: 14px;
  border: 1px solid var(--line);
  cursor: crosshair;
  touch-action: none;
}
.axis-label {
  position: absolute;
  font-size: 12px;
  color: var(--ink-dim);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  user-select: none;
  pointer-events: none;
  font-weight: 600;
}
.axis-label.y {
  left: -10px;
  top: 50%;
  transform: translateY(-50%) rotate(-90deg);
  transform-origin: left center;
}
.axis-label.x {
  bottom: -24px;
  left: 50%;
  transform: translateX(-50%);
}

/* ───────────────── Modal ───────────────── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(28, 20, 16, 0.55);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 50;
  animation: fade .25s ease both;
}
.modal.hidden { display: none; }
.modal-card {
  background: var(--paper);
  color: var(--ink);
  border-radius: 18px;
  padding: 28px;
  max-width: 560px;
  width: 100%;
  box-shadow: var(--shadow);
  animation: pop .35s cubic-bezier(.2,.9,.25,1.2) both;
  border-top: 6px solid var(--orange);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}
.modal-badge {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 24px;
  margin-bottom: 12px;
  box-shadow: 0 6px 18px rgba(236, 81, 45, 0.45);
}
.modal-card h2 { margin: 0 0 6px; font-size: 24px; color: var(--ink); }
.score { color: var(--ink-soft); margin: 0 0 14px; font-size: 14px; font-weight: 600; }
.explanation {
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.6;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 18px;
}
.explanation p { margin: 0 0 10px; }
.explanation p:last-child { margin-bottom: 0; }

/* Illustration */
.illustration-block {
  margin: 6px 0 18px;
  padding: 16px;
  background: linear-gradient(180deg, #FFF8EC 0%, #FFF1D9 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  text-align: center;
  animation: illus-in .55s cubic-bezier(.2,.9,.25,1.3) both;
}
.illustration {
  width: 100%;
  max-width: 280px;
  margin: 0 auto 8px;
}
.illustration svg {
  width: 100%;
  height: auto;
  display: block;
}
.illustration-caption {
  margin: 0;
  font-size: 14px;
  color: var(--orange-deep);
  font-weight: 700;
  font-style: italic;
  letter-spacing: 0.2px;
}

@keyframes illus-in {
  from { opacity: 0; transform: scale(0.85) rotate(-2deg); }
  to   { opacity: 1; transform: none; }
}

/* Success-modal animated graph */
.success-graph {
  margin: 0 0 16px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--paper-2);
  border: 1px solid var(--line);
  animation: graph-in .35s ease both;
}
.success-graph-svg {
  width: 100%;
  height: auto;
  display: block;
}
.success-graph-svg .target-curve {
  fill: none;
  stroke: var(--orange);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.06));
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw-curve 1.7s cubic-bezier(.45,.05,.25,1) 0.25s forwards;
}
.success-graph-svg .zone-label {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 10px;
  font-weight: 700;
  fill: rgba(28, 20, 16, 0.55);
  opacity: 0;
  animation: zone-fade .4s ease 1.6s forwards;
}
@keyframes draw-curve {
  to { stroke-dashoffset: 0; }
}
@keyframes graph-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
@keyframes zone-fade {
  to { opacity: 1; }
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop  { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }

/* ───────────────── Finish modal (celebratory + curiosity-driven) ───────────────── */
.finish-card {
  text-align: center;
  position: relative;
  overflow: hidden;
  border-top: 6px solid var(--orange);
  background:
    radial-gradient(ellipse 600px 300px at 50% -10%, rgba(245, 201, 68, 0.18), transparent 60%),
    var(--paper);
}
.finish-mark {
  display: inline-flex;
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--orange);
  color: #fff;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  margin: 0 auto 14px;
  box-shadow: 0 6px 18px rgba(236, 81, 45, 0.40);
  animation: mark-pop .55s cubic-bezier(.2,.9,.25,1.4) both;
}
@keyframes mark-pop {
  from { opacity: 0; transform: scale(0.5) rotate(-10deg); }
  to   { opacity: 1; transform: scale(1) rotate(0); }
}
.finish-title {
  font-size: 36px !important;
  margin: 0 0 6px !important;
  letter-spacing: -0.6px;
  color: var(--ink);
  animation: title-rise .45s cubic-bezier(.2,.7,.2,1) .15s both;
}
.finish-subtitle {
  margin: 0 0 18px;
  font-size: 15px;
  color: var(--ink-soft);
  animation: title-rise .45s cubic-bezier(.2,.7,.2,1) .25s both;
}
.finish-subtitle strong { color: var(--ink); font-weight: 700; }
@keyframes title-rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* Cover image block with glow + tilt + floating stamp */
.finish-cover-block {
  position: relative;
  display: inline-block;
  margin: 6px auto 22px;
  animation: cover-in .6s cubic-bezier(.2,.7,.2,1) .35s both;
}
@keyframes cover-in {
  from { opacity: 0; transform: scale(0.85) rotate(-6deg); }
  to   { opacity: 1; transform: none; }
}
.finish-cover-glow {
  position: absolute;
  inset: -28px;
  background: radial-gradient(ellipse at center, rgba(245, 201, 68, 0.65), transparent 65%);
  filter: blur(18px);
  z-index: 0;
  animation: glow-pulse 3.5s ease-in-out infinite;
}
@keyframes glow-pulse {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50%      { opacity: 1;    transform: scale(1.08); }
}
.finish-cover-shine {
  position: absolute;
  top: 0; left: -40%;
  width: 40%; height: 100%;
  background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,0.5) 50%, transparent 65%);
  z-index: 3;
  animation: shine-sweep 4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes shine-sweep {
  0%   { left: -60%; opacity: 0; }
  20%  { opacity: 0.7; }
  60%  { left: 110%; opacity: 0; }
  100% { left: 110%; opacity: 0; }
}
.finish-cover {
  position: relative;
  z-index: 1;
  display: block;
  width: 170px;
  height: auto;
  border-radius: 5px;
  border: 3px solid #fff;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.4) inset,
    0 20px 40px rgba(0, 0, 0, 0.30),
    0 8px 16px rgba(0, 0, 0, 0.20);
  transform: rotate(-3deg);
  animation: cover-bob 4.5s ease-in-out infinite;
}
@keyframes cover-bob {
  0%, 100% { transform: rotate(-3deg) translateY(0); }
  50%      { transform: rotate(-3deg) translateY(-7px); }
}

/* Sticker / stamp overlay on top of cover: "47 more inside" */
.finish-cover-stamp {
  position: absolute;
  top: -14px;
  right: -28px;
  z-index: 4;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: 800;
  border: 2.5px solid #fff;
  box-shadow: 0 8px 20px rgba(0,0,0,0.25), 0 0 0 4px rgba(245, 201, 68, 0.30);
  transform: rotate(12deg);
  animation: stamp-bounce .7s cubic-bezier(.2,.9,.25,1.5) .6s both, stamp-wobble 3s ease-in-out 1.3s infinite;
}
@keyframes stamp-bounce {
  from { opacity: 0; transform: rotate(20deg) scale(0); }
  to   { opacity: 1; transform: rotate(12deg) scale(1); }
}
@keyframes stamp-wobble {
  0%, 100% { transform: rotate(12deg) scale(1); }
  50%      { transform: rotate(14deg) scale(1.04); }
}
.stamp-num {
  font-size: 26px;
  line-height: 1;
  letter-spacing: -1px;
  color: var(--orange-deep);
}
.stamp-label {
  font-size: 9px;
  line-height: 1.1;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  color: var(--ink);
}

/* Hook line + teaser */
.finish-hook {
  margin: 0 0 10px;
  font-size: 18px;
  letter-spacing: -0.2px;
  color: var(--ink);
}
.finish-hook strong {
  font-weight: 800;
  background: linear-gradient(120deg, var(--orange-deep), var(--orange));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--orange-deep);
}
.finish-tease {
  margin: 0 0 22px;
  padding: 0 6px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-soft);
}

/* The big call to action */
.finish-buy-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 30px;
  font-size: 16.5px;
  font-weight: 800;
  letter-spacing: 0.2px;
  color: #fff;
  background: var(--orange);
  border: none;
  border-radius: 100px;
  text-decoration: none;
  cursor: pointer;
  margin: 0 0 14px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.45) inset,
    0 10px 26px rgba(236, 81, 45, 0.45),
    0 4px 10px rgba(0, 0, 0, 0.15);
  transition: background .2s ease, transform .15s ease;
  position: relative;
  animation: cta-attention 2.4s ease-in-out infinite;
}
.finish-buy-cta::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 100px;
  border: 2px solid var(--orange);
  opacity: 0;
  animation: cta-ripple 2.4s ease-out infinite;
  pointer-events: none;
}
@keyframes cta-attention {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-3px); }
}
@keyframes cta-ripple {
  0%   { transform: scale(0.95); opacity: 0.6; }
  100% { transform: scale(1.18); opacity: 0; }
}
.finish-buy-cta:hover {
  background: var(--orange-deep);
  transform: translateY(-3px);
  animation-play-state: paused;
}
.finish-buy-cta:active { transform: translateY(-1px); }
.finish-buy-cta svg { transition: transform .25s cubic-bezier(.2,.8,.2,1); }
.finish-buy-cta:hover svg { transform: translateX(5px); }

/* ───────────────── Explanation format ───────────────── */
.explanation .exp-tagline {
  margin: 0 0 10px;
  font-size: 13.5px;
  color: var(--ink-dim);
}
.explanation .exp-intro {
  margin: 0 0 12px;
  font-size: 14.5px;
  color: var(--ink);
}
.explanation .exp-bullets {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
}
.explanation .exp-bullets li {
  position: relative;
  padding-left: 22px;
  margin: 8px 0;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink);
}
.explanation .exp-bullets li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
}
.explanation .exp-bullets li strong {
  color: var(--orange-deep);
  font-weight: 700;
}
.explanation .exp-summary {
  margin: 14px 0 0;
  padding: 10px 14px;
  border-left: 3px solid var(--yellow);
  background: rgba(245, 201, 68, 0.13);
  border-radius: 0 8px 8px 0;
  font-size: 14px;
  color: var(--ink);
}
.explanation .exp-summary strong {
  color: var(--orange-deep);
  font-weight: 800;
  letter-spacing: 0.3px;
  margin-right: 4px;
}

/* ───────────────── Splash extra polish ───────────────── */
.splash-cta {
  position: relative;
}
.splash-cta::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 100px;
  background: var(--yellow);
  opacity: 0.55;
  z-index: -1;
  animation: splash-cta-pulse 2.6s ease-out infinite;
}
@keyframes splash-cta-pulse {
  0%   { transform: scale(1);    opacity: 0.55; }
  100% { transform: scale(1.25); opacity: 0; }
}

/* Tiny "press Enter" hint under the CTA */
.splash-cta-hint {
  display: block;
  margin-top: 14px;
  font-size: 11.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 600;
}
.splash-cta-hint kbd {
  display: inline-block;
  padding: 1px 7px;
  font-family: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, monospace;
  font-size: 10.5px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.85);
  margin: 0 2px;
  letter-spacing: 0;
}

/* ───────────────── Mobile (≤640px) ───────────────── */
@media (max-width: 640px) {
  html,
  body {
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .splash {
    position: relative;
    min-height: 100svh;
    align-items: stretch;
    padding: 10px 16px 18px;
    overflow-y: auto;
  }
  .splash-frame {
    gap: clamp(14px, 3svh, 24px);
    max-width: 420px;
    min-height: calc(100svh - 28px);
    align-content: center;
  }
  .splash-cover-glow { inset: -14px; filter: blur(14px); }
  .splash-cover {
    max-width: min(310px, 82vw);
    max-height: 44svh;
    object-fit: contain;
  }
  .splash-eyebrow {
    margin-bottom: 8px;
    font-size: 9px;
    letter-spacing: 0.28em;
  }
  .splash-title {
    margin-bottom: 10px;
    font-size: clamp(48px, 13vw, 58px);
    line-height: 0.96;
    letter-spacing: 0;
  }
  .splash-lede {
    margin-bottom: 18px;
    font-size: clamp(16.5px, 4.4vw, 19px);
    line-height: 1.42;
  }
  .splash-features {
    gap: 6px;
    margin-bottom: 18px;
  }
  .splash-features li { font-size: 13px; }
  .splash-cta {
    justify-content: center;
    width: min(100%, 360px);
    padding: 16px 28px;
    min-height: 58px;
    font-size: 17px;
  }
  .splash-cta-hint,
  .splash-credit { display: none; }

  .topbar {
    padding: 10px 12px !important;
    gap: 8px;
  }
  .brand-text { font-size: 12px; }
  .brand-mark { font-size: 16px; }
  .nav-cluster { gap: 6px; }
  .nav-btn { padding: 6px 10px !important; font-size: 13px; }
  #levelLabel { font-size: 11px; }

  .stage {
    padding: 12px 12px 20px;
    gap: 12px;
  }
  .panel { padding: 14px; border-radius: 14px; }
  .panel.right { padding: 8px; }

  .panel.left { gap: 10px; }
  h1#chapterTitle { font-size: 20px; }
  .quote { font-size: 13px; }
  .prompt { font-size: 14px; line-height: 1.45; }
  .hint-box { font-size: 12px; padding: 10px 12px; }
  .hint-box ul { padding-left: 16px; }

  .controls { gap: 6px; }
  .btn { padding: 9px 12px; font-size: 13px; }

  .chart-wrap {
    aspect-ratio: 1 / 1;
    max-width: 100%;
  }
  .chart-status {
    font-size: 9.5px;
    padding: 4px 8px;
    top: 6px;
    right: 6px;
    letter-spacing: 0.4px;
  }
  .axis-label { font-size: 11px; }

  /* Modals: keep them readable on small screens */
  .modal-card {
    padding: 18px !important;
    max-width: calc(100vw - 24px) !important;
    max-height: calc(100vh - 24px);
    overflow-y: auto;
  }
  .modal-card h2 { font-size: 22px; }
  .modal-actions { flex-wrap: wrap; gap: 8px; }
  .modal-actions .btn { flex: 1 1 auto; }
}

@media (max-width: 640px) {
  #app.app { min-height: 100svh; }
  .topbar { justify-content: center; }
  .brand { width: 100%; justify-content: center; gap: 8px; }
  .brand-mark { width: 30px; height: 30px; }
  .nav-cluster { width: 100%; justify-content: center; }
  .bar { width: min(150px, 38vw); }

  .stage { padding-top: 10px; }
  .stage {
    align-content: start;
    align-items: start;
  }
  .panel.left { padding: 16px 16px 14px; }
  .panel.left { min-height: 0; align-self: start; }
  h1#chapterTitle { font-size: 19px; line-height: 1.15; }
  .quote { font-size: 12.5px; line-height: 1.4; margin: 0; }
  .prompt { font-size: 13.5px; line-height: 1.4; }
  .hint-box { font-size: 12px; padding: 10px 12px; }
  .hint-box ul { padding-left: 16px; }
  .hint-box li { margin: 3px 0; line-height: 1.4; }
  .controls {
    margin-top: 2px;
    display: grid;
    grid-template-columns: 0.85fr 1.25fr 1fr;
  }
  .controls .btn {
    min-height: 44px;
    padding: 8px 8px;
    border-radius: 10px;
    white-space: nowrap;
  }

  .panel.right {
    padding: 10px;
    min-height: 0;
    align-self: start;
  }
  .chart-wrap {
    width: 100%;
    aspect-ratio: 1 / 0.88;
  }
  .axis-label.y {
    left: -36px;
    top: 50%;
    width: 120px;
    text-align: center;
    transform: translateY(-50%) rotate(-90deg);
    transform-origin: center;
    font-size: 9px;
    line-height: 1.1;
    z-index: 2;
  }
  .axis-label.x {
    bottom: 10px;
    left: 50%;
    width: 100%;
    text-align: center;
    font-size: 9px;
    line-height: 1.1;
    z-index: 2;
  }
}

@media (max-width: 640px) and (max-height: 760px) {
  .splash {
    padding: 8px 16px 18px;
    align-items: stretch;
    min-height: 100svh;
    overflow-y: auto;
  }
  .splash-frame {
    gap: clamp(10px, 2svh, 16px);
    min-height: auto;
    max-width: 420px;
    align-content: center;
  }
  .splash-cover {
    max-width: min(285px, 78vw);
    max-height: 38svh;
  }
  .splash-eyebrow { margin-bottom: 8px; font-size: 10px; letter-spacing: 0.3em; }
  .splash-title { margin-bottom: 10px; font-size: clamp(50px, 14vw, 62px); line-height: 0.96; }
  .splash-lede { margin-bottom: 16px; font-size: clamp(17px, 4.6vw, 20px); line-height: 1.4; }
  .splash-features { display: none; }
  .splash-cta { min-height: 60px; padding: 16px 28px; font-size: 18px; }

  .topbar { padding: 8px 10px !important; }
  .stage { padding: 8px 10px 16px; gap: 10px; }
  .panel.left { padding: 14px; gap: 8px; }
  h1#chapterTitle { font-size: 18px; }
  .panel.right { padding: 10px; }
  .chart-wrap { aspect-ratio: 1 / 0.82; }
}

/* ───────────────── Language toggle + RTL ───────────────── */
.lang-toggle {
  position: fixed;
  bottom: 14px;
  inset-inline-start: 14px;
  z-index: 10000;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 100px;
  border: 1px solid rgba(28, 20, 16, 0.18);
  background: rgba(255, 253, 247, 0.95);
  color: #1c1410;
  font: 700 12px/1 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  letter-spacing: 0.6px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  direction: ltr;
}
.lang-toggle span { opacity: 0.45; transition: opacity .15s ease, color .15s ease; }
.lang-toggle span.on { opacity: 1; color: #EC512D; }
.lang-toggle .sep { opacity: 0.3; }

.chart-wrap { direction: ltr; }
.axis-label { unicode-bidi: plaintext; }

[dir="rtl"] body { font-family: Arial, "Arial Hebrew", "Segoe UI", sans-serif; }
[dir="rtl"] body :is(h1, h2, h3, p, strong, span, a, button, input, li, text),
[dir="rtl"] .success-graph-svg .zone-label {
  font-family: Arial, "Arial Hebrew", "Segoe UI", sans-serif;
  font-style: normal;
  letter-spacing: 0;
}
[dir="rtl"] .finish-hook strong { font-weight: 700; }
[dir="rtl"] h1.splash-title,
[dir="rtl"] h1.splash-title .splash-em {
  font-family: Arial, "Arial Hebrew", "Segoe UI", sans-serif;
  font-weight: 700;
  font-style: normal;
}
[dir="rtl"] .splash-title, [dir="rtl"] .finish-title, [dir="rtl"] #chapterTitle { letter-spacing: 0; }
[dir="rtl"] .quote { border-left: 0; border-right: 4px solid var(--yellow); padding: 6px 14px 6px 0; }
[dir="rtl"] .hint-box ul { padding-left: 0; padding-right: 18px; }
[dir="rtl"] .explanation .exp-bullets li { padding-left: 0; padding-right: 22px; }
[dir="rtl"] .explanation .exp-bullets li::before { left: auto; right: 4px; }
[dir="rtl"] .explanation .exp-summary { border-left: 0; border-right: 3px solid var(--yellow); border-radius: 8px 0 0 8px; }
[dir="rtl"] .explanation .exp-summary strong { margin-right: 0; margin-left: 4px; }
[dir="rtl"] .nav-btn,
[dir="rtl"] .splash-cta svg,
[dir="rtl"] .finish-buy-cta svg { transform: scaleX(-1); }
[dir="rtl"] #emailGateInput { direction: ltr; text-align: right; }
[dir="rtl"] #emailGate h2, [dir="rtl"] #emailGate p { direction: rtl; }
[dir="rtl"] .splash-eyebrow, [dir="rtl"] .chart-status, [dir="rtl"] .axis-label, [dir="rtl"] .splash-cta, [dir="rtl"] .progress { letter-spacing: 0; }
