/* ==========================================================================
   מדע מאחורי גיבורי על — Book site
   Design language: Apple / Tesla — big type, calm space, glass, precise motion
   ========================================================================== */

/* ---------- Theme tokens ---------- */
:root {
  --font: 'Heebo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;

  --yellow: #ffd60a;
  --blue: #2f7bff;
  --red: #e5232f;

  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);

  --radius: 22px;
  --radius-sm: 14px;
  --max: 1200px;
  --nav-h: 56px;
}

[data-theme="dark"] {
  --bg: #000000;
  --bg-2: #0a0a0c;
  --surface: rgba(255, 255, 255, .045);
  --surface-2: rgba(255, 255, 255, .08);
  --border: rgba(255, 255, 255, .1);
  --text: #f5f5f7;
  --text-2: #a1a1a6;
  --text-3: #6e6e73;
  --nav-bg: rgba(0, 0, 0, .62);
  --tip-bg: rgba(245, 245, 247, .96);
  --tip-text: #1d1d1f;
  --shadow: 0 30px 80px rgba(0, 0, 0, .6);
  --star: 255, 255, 255;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #fbfbfd;
  --bg-2: #f2f2f5;
  --surface: rgba(0, 0, 0, .03);
  --surface-2: rgba(0, 0, 0, .06);
  --border: rgba(0, 0, 0, .09);
  --text: #1d1d1f;
  --text-2: #515154;
  --text-3: #86868b;
  --nav-bg: rgba(251, 251, 253, .72);
  --tip-bg: rgba(29, 29, 31, .94);
  --tip-text: #f5f5f7;
  --shadow: 0 30px 80px rgba(20, 30, 60, .18);
  --star: 40, 60, 120;
  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .6s var(--ease), color .6s var(--ease);
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

::selection { background: var(--yellow); color: #000; }

.container { width: min(var(--max), 100% - 48px); margin-inline: auto; }
.center { text-align: center; }
.muted { color: var(--text-3); }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 6px; }

/* ---------- Type ---------- */
.eyebrow {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--yellow);
}
[data-theme="light"] .eyebrow { color: #b8860b; }

.section-title {
  margin: 0 0 18px;
  font-size: clamp(40px, 6.4vw, 84px);
  line-height: 1.04;
  font-weight: 800;
  letter-spacing: -.02em;
}

.section-sub {
  max-width: 640px;
  margin: 0 0 48px;
  font-size: clamp(18px, 2vw, 22px);
  color: var(--text-2);
}
.section-sub.center { margin-inline: auto; }

/* ---------- Buttons ---------- */
.btn {
  --pad-y: 14px;
  --pad-x: 26px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: var(--pad-y) var(--pad-x);
  border-radius: 980px;
  font-size: 17px;
  font-weight: 600;
  white-space: nowrap;
  transition: transform .4s var(--ease), background-color .3s, color .3s, box-shadow .4s var(--ease);
  will-change: transform;
}
.btn--sm { --pad-y: 7px; --pad-x: 16px; font-size: 14px; }
.btn--block { width: 100%; }

.btn--primary {
  background: var(--yellow);
  color: #000;
  box-shadow: 0 0 0 0 rgba(255, 214, 10, 0);
}
.btn--primary:hover { box-shadow: 0 10px 40px -6px rgba(255, 214, 10, .55); }

.btn--ghost {
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.btn--ghost:hover { background: var(--surface); border-color: var(--text-3); }

/* ---------- Progress ---------- */
.progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  z-index: 200;
  pointer-events: none;
}
.progress span {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: right;
  transform: scaleX(var(--p, 0));
  background: linear-gradient(90deg, var(--red), var(--yellow), var(--blue));
}

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--nav-h);
  background: transparent;
  transition: background-color .4s var(--ease), backdrop-filter .4s, border-color .4s;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom-color: var(--border);
}
.nav__inner {
  height: 100%;
  width: min(var(--max), 100% - 40px);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.nav__logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 16px;
}
.nav__logo-mark {
  color: var(--yellow);
  display: inline-block;
  animation: spin 8s linear infinite;
}
.nav__links { display: flex; gap: 30px; }
.nav__links a {
  font-size: 14px;
  color: var(--text-2);
  position: relative;
  transition: color .25s;
}
.nav__links a::after {
  content: "";
  position: absolute;
  inset: auto 0 -6px 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transition: transform .35s var(--ease);
}
.nav__links a:hover, .nav__links a.is-active { color: var(--text); }
.nav__links a.is-active::after, .nav__links a:hover::after { transform: scaleX(1); }

.nav__actions { display: flex; align-items: center; gap: 12px; }

.theme-toggle {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: transform .5s var(--ease-spring), background-color .3s;
}
.theme-toggle:hover { transform: rotate(25deg) scale(1.06); }
.theme-toggle svg {
  position: absolute;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  transition: transform .6s var(--ease-spring), opacity .35s;
}
.theme-toggle .icon-sun circle { fill: currentColor; stroke: none; }
.theme-toggle .icon-moon { fill: currentColor; stroke: none; }
[data-theme="dark"] .icon-moon { opacity: 0; transform: rotate(-90deg) scale(.4); }
[data-theme="light"] .icon-sun { opacity: 0; transform: rotate(90deg) scale(.4); }

.nav__burger { display: none; width: 36px; height: 36px; position: relative; }
.nav__burger span {
  position: absolute;
  inset-inline: 9px;
  height: 1.6px;
  background: currentColor;
  border-radius: 2px;
  transition: transform .4s var(--ease), top .4s var(--ease);
}
.nav__burger span:first-child { top: 14px; }
.nav__burger span:last-child { top: 21px; }
.nav__burger[aria-expanded="true"] span:first-child { top: 17.5px; transform: rotate(45deg); }
.nav__burger[aria-expanded="true"] span:last-child { top: 17.5px; transform: rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: center;
  padding: calc(var(--nav-h) + 40px) 0 80px;
  overflow: hidden;
  isolation: isolate;
}
.hero__stars {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
}
.hero__glow {
  position: absolute;
  z-index: -1;
  width: 900px;
  height: 900px;
  inset-inline-end: -200px;
  top: 50%;
  translate: 0 -50%;
  border-radius: 50%;
  background:
    radial-gradient(closest-side, rgba(47, 123, 255, .35), transparent 70%),
    radial-gradient(closest-side at 60% 60%, rgba(229, 35, 47, .22), transparent 70%);
  filter: blur(40px);
  animation: breathe 9s ease-in-out infinite;
}
[data-theme="light"] .hero__glow { opacity: .55; }

.hero__inner {
  width: min(var(--max), 100% - 48px);
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  align-items: center;
  gap: 40px;
}

.hero__title {
  margin: 0 0 24px;
  font-size: clamp(56px, 10vw, 136px);
  line-height: .95;
  font-weight: 900;
  letter-spacing: -.03em;
}
.hero__title .line { display: block; }
.hero__title .accent {
  background: linear-gradient(100deg, #ffe55c 0%, var(--yellow) 40%, #ffb703 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  background-size: 200% auto;
  animation: shimmer 6s linear infinite;
}
[data-theme="light"] .hero__title .accent {
  background-image: linear-gradient(100deg, #e0a800 0%, #c28f00 50%, #e0a800 100%);
}

.hero__sub {
  max-width: 560px;
  margin: 0 0 36px;
  font-size: clamp(18px, 1.9vw, 22px);
  color: var(--text-2);
}
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; }

/* 3D book */
.hero__book { display: grid; place-items: center; }
.book3d {
  --rx: 0deg;
  --ry: 22deg;
  position: relative;
  perspective: 1600px;
  width: min(380px, 70vw);
  aspect-ratio: 1033 / 1522;
  animation: float 7s ease-in-out infinite;
}
.book3d__inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform .9s var(--ease);
}
.book3d__cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 3px 10px 10px 3px;
  transform: translateZ(18px);
  box-shadow: var(--shadow);
}
/* Hebrew book: spine on the right edge, pages on the left edge */
.book3d__spine {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(100% - 18px);
  width: 36px;
  transform: rotateY(90deg);
  border-radius: 3px;
  background: linear-gradient(90deg, #7a0f15, #c41c26 50%, #7a0f15);
}
.book3d__pages {
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: -16px;
  width: 32px;
  transform: rotateY(90deg);
  background: repeating-linear-gradient(90deg, #f3f0e8 0 1px, #d9d4c8 1px 2px);
}
.book3d__shine {
  position: absolute;
  inset: 0;
  transform: translateZ(19px);
  border-radius: 3px 10px 10px 3px;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .28) 48%, transparent 62%);
  background-size: 250% 100%;
  background-position: var(--shine, 100%) 0;
  mix-blend-mode: soft-light;
  pointer-events: none;
}
.book3d__shadow {
  position: absolute;
  inset: auto 10% -50px 10%;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .55), transparent);
  filter: blur(8px);
  animation: shadow 7s ease-in-out infinite;
}
[data-theme="light"] .book3d__shadow { background: radial-gradient(closest-side, rgba(20, 30, 60, .3), transparent); }

/* Scroll cue */
.scroll-cue {
  position: absolute;
  bottom: 28px;
  left: 50%;
  translate: -50% 0;
  width: 26px;
  height: 42px;
  border: 1.6px solid var(--text-3);
  border-radius: 20px;
}
.scroll-cue span {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 4px;
  height: 8px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--text-2);
  animation: wheel 2s var(--ease) infinite;
}

/* ---------- Marquee ---------- */
.marquee {
  overflow: hidden;
  border-block: 1px solid var(--border);
  padding: 20px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee__track {
  display: flex;
  gap: 36px;
  width: max-content;
  animation: marquee 40s linear infinite;
  font-size: 20px;
  font-weight: 500;
  color: var(--text-3);
}
.marquee__track span:nth-child(4n+2) { color: var(--yellow); font-size: 12px; align-self: center; }
.marquee:hover .marquee__track { animation-play-state: paused; }

/* ---------- Statement ---------- */
.statement { padding: clamp(120px, 18vw, 220px) 0; }
.statement__text {
  max-width: 1000px;
  margin: 0 auto;
  text-align: center;
  font-size: clamp(32px, 4.8vw, 64px);
  line-height: 1.18;
  font-weight: 700;
  letter-spacing: -.015em;
}
.statement__text .w {
  opacity: .14;
  transition: opacity .35s linear;
}
.statement__text .w.on { opacity: 1; }

/* ---------- Stats ---------- */
.stats { padding: 0 0 clamp(100px, 14vw, 180px); }
.stats__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.stat {
  background: var(--bg);
  padding: 44px 24px;
  text-align: center;
  transition: background-color .4s;
  cursor: default;
}
.stat:hover { background: var(--bg-2); }
.stat__num {
  display: block;
  font-size: clamp(44px, 5.5vw, 72px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.stat__label { display: block; margin-top: 10px; color: var(--text-2); font-size: 16px; }

/* ---------- Powers (sticky horizontal) ---------- */
.powers { position: relative; height: var(--powers-h, 300vh); }
.powers__sticky {
  position: sticky;
  top: 0;
  height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding-top: var(--nav-h);
}
.powers__head .section-sub { margin-bottom: 40px; }
.powers__rail {
  display: flex;
  gap: 22px;
  padding-inline: max(24px, (100vw - var(--max)) / 2);
  transform: translate3d(var(--tx, 0px), 0, 0);
  will-change: transform;
}

.power {
  position: relative;
  flex: 0 0 340px;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  padding: 34px 30px 28px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform .5s var(--ease), border-color .4s, background-color .4s;
}
.power::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(500px circle at var(--mx, 50%) var(--my, 0%), rgba(47, 123, 255, .16), transparent 45%);
  opacity: 0;
  transition: opacity .4s;
  pointer-events: none;
}
.power:hover { transform: translateY(-6px); border-color: rgba(47, 123, 255, .45); }
.power:hover::before { opacity: 1; }
.power__icon {
  font-size: 44px;
  line-height: 1;
  margin-bottom: 26px;
  transition: transform .6s var(--ease-spring);
}
.power:hover .power__icon { transform: scale(1.15) rotate(-8deg); }
.power h3 { margin: 0 0 10px; font-size: 28px; font-weight: 700; letter-spacing: -.01em; }
.power p { margin: 0; color: var(--text-2); font-size: 16.5px; }

.meter {
  margin-top: auto;
  padding-top: 26px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-3);
  cursor: help;
}
.meter__bar {
  flex: 1;
  height: 4px;
  border-radius: 4px;
  background: var(--surface-2);
  overflow: hidden;
}
.meter__bar i {
  display: block;
  height: 100%;
  width: var(--v);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--yellow), var(--red));
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 1.4s var(--ease) .2s;
}
.power.in .meter__bar i { transform: scaleX(1); }

/* ---------- Term (tooltip trigger) ---------- */
.term {
  color: var(--text);
  border-bottom: 1.5px dotted var(--yellow);
  cursor: help;
  transition: color .2s, background-color .2s;
  border-radius: 2px;
}
.term:hover, .term:focus { background: rgba(255, 214, 10, .12); }

/* ---------- Chapters ---------- */
.chapters { padding: clamp(120px, 16vw, 200px) 0 clamp(80px, 10vw, 140px); }
.part { margin-top: clamp(64px, 8vw, 104px); }
.part__head {
  display: grid;
  gap: 6px;
  padding-bottom: 22px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border);
}
.part__label {
  justify-self: start;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 5px 12px;
  border-radius: 980px;
  color: var(--yellow);
  background: rgba(255, 214, 10, .1);
  border: 1px solid rgba(255, 214, 10, .25);
  cursor: default;
}
[data-theme="light"] .part__label { color: #8a6500; background: rgba(255, 214, 10, .22); }
.part__title {
  margin: 8px 0 0;
  font-size: clamp(26px, 3.4vw, 42px);
  font-weight: 700;
  letter-spacing: -.015em;
  line-height: 1.15;
}
.part__desc { margin: 0; color: var(--text-2); font-size: 18px; max-width: 640px; }

.toc {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.toc--wide { grid-template-columns: repeat(3, 1fr); }
.toc--five { grid-template-columns: repeat(5, 1fr); }
.toc__item {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 24px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: transform .5s var(--ease), border-color .35s, background-color .35s,
              opacity 1s var(--ease) var(--d, 0s), translate 1s var(--ease) var(--d, 0s), filter 1s var(--ease) var(--d, 0s);
  cursor: default;
}
.toc__item:hover { transform: translateY(-4px); border-color: rgba(255, 214, 10, .45); background: var(--surface-2); }
.toc__num {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  min-width: 22px;
  transition: color .3s;
}
.toc__item:hover .toc__num { color: var(--yellow); }
.toc__name { font-size: clamp(19px, 1.8vw, 22px); font-weight: 600; letter-spacing: -.005em; }
.toc__icon { font-size: 26px; line-height: 1; transition: transform .6s var(--ease-spring); }
.toc__item:hover .toc__icon { transform: scale(1.18) rotate(-8deg); }
.toc--five .toc__item { flex-direction: column; align-items: flex-start; gap: 14px; padding: 28px 24px; }

/* stagger tiles inside a part */
.toc__item:nth-child(3n+2) { --d: .06s; }
.toc__item:nth-child(3n) { --d: .12s; }

/* Appendices */
.appendix-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.appendix {
  padding: 32px 28px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background:
    linear-gradient(160deg, rgba(47, 123, 255, .1), transparent 55%),
    var(--surface);
  transition: transform .5s var(--ease), border-color .4s,
              opacity 1s var(--ease) var(--d, 0s), translate 1s var(--ease) var(--d, 0s), filter 1s var(--ease) var(--d, 0s);
  cursor: help;
}
.appendix:hover { transform: translateY(-6px); border-color: rgba(47, 123, 255, .5); }
.appendix__glyph {
  display: inline-grid;
  place-items: center;
  min-width: 56px;
  height: 56px;
  padding: 0 12px;
  margin-bottom: 22px;
  border-radius: 16px;
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), #1b4fd1);
  box-shadow: 0 10px 30px -8px rgba(47, 123, 255, .6);
}
.appendix h4 { margin: 0 0 4px; font-size: 22px; font-weight: 700; }
.appendix p { margin: 0; color: var(--text-2); font-size: 16px; }

/* ---------- Author ---------- */
.author { padding: clamp(100px, 14vw, 180px) 0; background: var(--bg-2); transition: background-color .6s var(--ease); }
.author__grid {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: clamp(40px, 7vw, 100px);
  align-items: center;
}
.author__photo { position: relative; }
.author__frame {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  box-shadow: var(--shadow);
  transform: translate3d(0, var(--py, 0px), 0);
}
.author__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
  transform: scale(1.08);
  transition: transform 1.2s var(--ease);
}
.author__photo:hover .author__frame img { transform: scale(1.02); }
.author__ring {
  position: absolute;
  inset: -18px;
  z-index: -1;
  border-radius: 40px;
  background: conic-gradient(from var(--a, 0deg), var(--red), var(--yellow), var(--blue), var(--red));
  filter: blur(36px);
  opacity: .45;
  animation: ring 10s linear infinite;
}
.author__lead { font-size: clamp(20px, 2.1vw, 24px); color: var(--text); margin: 0 0 18px; line-height: 1.55; }
.creds {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.cred {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: default;
  transition: transform .5s var(--ease), border-color .35s,
              opacity 1s var(--ease) var(--d, 0s), translate 1s var(--ease) var(--d, 0s), filter 1s var(--ease) var(--d, 0s);
}
.cred:hover { transform: translateY(-3px); border-color: var(--text-3); }
.cred__icon {
  flex: none;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-size: 20px;
  background: var(--surface-2);
}
.cred__body { display: grid; line-height: 1.35; }
.cred__body strong { font-size: 16px; font-weight: 600; }
.cred__body span { font-size: 14px; color: var(--text-2); }
.cred--now { border-color: rgba(255, 214, 10, .35); }
.cred__badge {
  position: absolute;
  top: 10px;
  inset-inline-end: 10px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 980px;
  background: var(--yellow);
  color: #000;
}
@media (max-width: 560px) { .creds { grid-template-columns: 1fr; } }

.author__links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.chip {
  padding: 9px 18px;
  border-radius: 980px;
  font-size: 15px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: background-color .3s, border-color .3s, transform .4s var(--ease);
}
.chip:hover { background: var(--surface-2); border-color: var(--text-3); transform: translateY(-2px); }

/* ---------- Spotlight cards ---------- */
.spotlight { position: relative; overflow: hidden; }
.spotlight::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 214, 10, .1), transparent 45%);
  opacity: 0;
  transition: opacity .4s;
  pointer-events: none;
}
.spotlight:hover::after { opacity: 1; }

/* ---------- Reviews ---------- */
.reviews { padding: clamp(120px, 16vw, 200px) 0; }
.reviews__grid {
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.review {
  margin: 0;
  padding: 36px 32px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: transform .5s var(--ease), border-color .4s,
              opacity 1s var(--ease) var(--d, 0s), translate 1s var(--ease) var(--d, 0s), filter 1s var(--ease) var(--d, 0s);
}
.review:hover { transform: translateY(-6px); border-color: var(--text-3); }
.review__stars { color: var(--yellow); letter-spacing: 3px; margin-bottom: 18px; }
.review blockquote { margin: 0 0 22px; font-size: 19px; line-height: 1.55; font-weight: 500; }
.review figcaption { color: var(--text-3); font-size: 15px; }

/* ---------- Order ---------- */
.order { position: relative; padding: clamp(120px, 16vw, 200px) 0; overflow: hidden; isolation: isolate; }
.order__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 50% at 50% 0%, rgba(255, 214, 10, .14), transparent 70%),
    radial-gradient(50% 50% at 15% 100%, rgba(47, 123, 255, .16), transparent 70%),
    radial-gradient(50% 50% at 85% 100%, rgba(229, 35, 47, .14), transparent 70%);
}
.formats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 380px));
  justify-content: center;
  gap: 22px;
}
.format {
  position: relative;
  padding: 40px 34px 34px;
  border-radius: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  transition: transform .5s var(--ease), border-color .4s,
              opacity 1s var(--ease) var(--d, 0s), translate 1s var(--ease) var(--d, 0s), filter 1s var(--ease) var(--d, 0s);
}
.format:hover { transform: translateY(-8px); border-color: rgba(255, 214, 10, .5); }
.format__badge {
  position: absolute;
  top: 18px;
  inset-inline-end: 18px;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 980px;
  background: var(--yellow);
  color: #000;
}
.format h3 { margin: 0 0 6px; font-size: 28px; font-weight: 700; }
.format__price { margin: 0 0 22px; font-size: 44px; font-weight: 800; letter-spacing: -.02em; cursor: help; }
.format ul { list-style: none; margin: 0 0 30px; padding: 0; color: var(--text-2); }
.format li { padding: 9px 0; border-bottom: 1px solid var(--border); display: flex; gap: 10px; }
.format li::before { content: "✓"; color: var(--yellow); font-weight: 700; }
.format .btn { margin-top: auto; }

.newsletter { max-width: 560px; margin: 80px auto 0; text-align: center; }
.newsletter__label { display: block; font-size: 20px; font-weight: 600; margin-bottom: 16px; }
.newsletter__row {
  display: flex;
  gap: 8px;
  padding: 6px;
  border-radius: 980px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: border-color .3s, box-shadow .3s;
}
.newsletter__row:focus-within { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(47, 123, 255, .2); }
.newsletter input {
  flex: 1;
  min-width: 0;
  padding: 10px 18px;
  font: inherit;
  font-size: 16px;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: none;
  text-align: right;
}
.newsletter input::placeholder { color: var(--text-3); }
.newsletter.shake .newsletter__row { animation: shake .45s; border-color: var(--red); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 40px 0 48px; font-size: 15px; }
.footer__inner { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.footer p { margin: 4px 0 0; }
.footer__links { display: flex; gap: 24px; color: var(--text-2); }
.footer__links a:hover { color: var(--text); }

/* ---------- Tooltip ---------- */
.tooltip {
  position: fixed;
  z-index: 300;
  top: 0;
  left: 0;
  max-width: 280px;
  padding: 9px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 500;
  color: var(--tip-text);
  background: var(--tip-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .3);
  pointer-events: none;
  opacity: 0;
  transform: translate3d(var(--x, 0), var(--y, 0), 0) scale(.94);
  transition: opacity .18s ease, transform .25s var(--ease);
  text-align: right;
}
.tooltip.show { opacity: 1; transform: translate3d(var(--x, 0), var(--y, 0), 0) scale(1); }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  z-index: 300;
  bottom: 28px;
  left: 50%;
  padding: 14px 24px;
  border-radius: 980px;
  background: var(--tip-bg);
  color: var(--tip-text);
  font-weight: 600;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .35);
  transform: translate(-50%, calc(100% + 60px));
  visibility: hidden;
  transition: transform .6s var(--ease-spring), visibility 0s .6s;
}
.toast.show { transform: translate(-50%, 0); visibility: visible; transition: transform .6s var(--ease-spring); }

/* ---------- Reveal ---------- */
/* Uses `translate` (not `transform`) so hover transforms on cards still work */
.reveal {
  --reveal-t: opacity 1s var(--ease) var(--d, 0s), translate 1s var(--ease) var(--d, 0s), filter 1s var(--ease) var(--d, 0s);
  opacity: 0;
  translate: 0 36px;
  filter: blur(6px);
  transition: var(--reveal-t);
}
.reveal.in { opacity: 1; translate: none; filter: none; }

/* ---------- Keyframes ---------- */
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -16px; } }
@keyframes shadow { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.85); opacity: .6; } }
@keyframes breathe { 0%, 100% { transform: scale(1); opacity: .9; } 50% { transform: scale(1.12); opacity: 1; } }
@keyframes shimmer { to { background-position: 200% center; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes wheel { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(14px); opacity: 0; } 100% { opacity: 0; } }
@keyframes marquee { to { transform: translateX(50%); } }
@keyframes drop { from { opacity: 0; transform: translateY(-8px); } }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
@property --a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes ring { to { --a: 360deg; } }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero__inner { grid-template-columns: 1fr; text-align: center; }
  .hero__text { order: 2; }
  .hero__book { order: 1; }
  .hero__sub { margin-inline: auto; }
  .hero__cta { justify-content: center; }
  .book3d { width: min(260px, 60vw); }
  .hero__title { font-size: clamp(52px, 13vw, 96px); }
  .stats__grid { grid-template-columns: repeat(2, 1fr); }
  .author__grid { grid-template-columns: 1fr; }
  .author__photo { max-width: 420px; margin-inline: auto; width: 100%; }
  .reviews__grid { grid-template-columns: 1fr; }
  .toc, .toc--wide { grid-template-columns: repeat(2, 1fr); }
  .toc--five { grid-template-columns: repeat(2, 1fr); }
  .toc--five .toc__item:last-child { grid-column: 1 / -1; }
  .appendix-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .nav__links {
    position: fixed;
    inset: var(--nav-h) 0 auto 0;
    flex-direction: column;
    gap: 0;
    padding: 12px 24px 28px;
    background: var(--nav-bg);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border);
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .35s var(--ease), transform .45s var(--ease);
  }
  .nav__links.open { opacity: 1; transform: none; pointer-events: auto; }
  .nav__links a { font-size: 22px; font-weight: 600; padding: 12px 0; color: var(--text); border-bottom: 1px solid var(--border); }
  .nav__links a::after { display: none; }
  .nav__burger { display: block; }
  .nav.menu-open { background: var(--nav-bg); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }

  /* Powers become a swipeable rail on small screens */
  .powers { height: auto !important; padding: 100px 0; }
  .powers__sticky { position: static; height: auto; padding-top: 0; }
  .powers__rail {
    transform: none !important;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 12px;
    scrollbar-width: none;
  }
  .powers__rail::-webkit-scrollbar { display: none; }
  .power { flex-basis: 80vw; scroll-snap-align: center; }
}

@media (max-width: 560px) {
  body { font-size: 17px; }
  .nav__actions .btn--sm { display: none; }
  .formats { grid-template-columns: 1fr; }
  .toc__item { padding: 18px 18px; gap: 12px; }
  .footer__inner { flex-direction: column; align-items: flex-start; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; translate: none; filter: none; }
  .statement__text .w { opacity: 1; }
}
