:root {
  --ink: #163f76;
  --ink-soft: #49698d;
  --paper: #fffdf8;
  --cream: #fff9ee;
  --pink: #d92062;
  --pink-dark: #a70f45;
  --gold: #eeaa4a;
  --line: rgba(23, 63, 118, 0.14);
  --shadow: 0 24px 70px rgba(71, 50, 37, 0.16), 0 3px 12px rgba(71, 50, 37, 0.11);
}

* { box-sizing: border-box; }

html, body { width: 100%; height: 100%; }

body {
  margin: 0;
  height: 100svh;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  color: var(--ink);
  font-family: "Assistant", Arial, sans-serif;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 202, 99, 0.15), transparent 27%),
    radial-gradient(circle at 88% 76%, rgba(241, 113, 155, 0.10), transparent 30%),
    linear-gradient(140deg, #fffefb 0%, #fff9ef 46%, #fffdf8 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.20;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='110' height='110' viewBox='0 0 110 110'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.09'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(2px);
  pointer-events: none;
}

.ambient-one {
  width: 28rem;
  height: 28rem;
  inset: -12rem auto auto -9rem;
  background: rgba(114, 181, 219, 0.10);
}

.ambient-two {
  width: 23rem;
  height: 23rem;
  inset: auto -10rem -9rem auto;
  background: rgba(255, 180, 96, 0.12);
}

.site-header {
  width: min(1120px, calc(100% - 28px));
  height: clamp(64px, 11svh, 88px);
  min-height: 0;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 150px 1fr 150px;
  align-items: center;
  gap: 18px;
  position: relative;
  z-index: 10;
}

.site-header h1 {
  margin: 0;
  text-align: center;
  font-size: clamp(1.45rem, 3vw, 2.25rem);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.title-block {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 5px;
}

.view-toggle {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  border: 1px solid rgba(23, 63, 118, 0.13);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 5px 16px rgba(63, 52, 45, 0.07);
}

.view-button {
  min-height: 28px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 0;
  border-radius: 999px;
  color: var(--ink-soft);
  background: transparent;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.view-button[aria-pressed="true"] {
  color: #fff;
  background: linear-gradient(135deg, var(--ink), #2d6eaa);
  box-shadow: 0 4px 12px rgba(22, 63, 118, 0.2);
}

.brand-logo {
  justify-self: end;
  width: 68px;
  height: 68px;
  object-fit: contain;
  border-radius: 22px;
  box-shadow: 0 8px 28px rgba(130, 57, 65, 0.09);
}

.whatsapp-link {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid rgba(217, 32, 98, 0.18);
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--pink), #ef6b66);
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(217, 32, 98, 0.19);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.whatsapp-link:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(217, 32, 98, 0.24); }
.whatsapp-link:focus-visible, button:focus-visible { outline: 3px solid rgba(23, 93, 159, 0.33); outline-offset: 3px; }
.whatsapp-icon { font-size: 0.9rem; color: #fff5b8; }

.reader-shell {
  width: min(1220px, calc(100% - 24px));
  height: 100%;
  min-height: 0;
  margin: 0 auto;
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 76px;
}

.reader {
  width: min(1060px, 100%);
  height: 100%;
  min-height: 0;
  margin: 0 auto;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 48px;
}

.book-stage {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 4px 20px 6px;
  display: grid;
  place-items: center;
  perspective: 2100px;
}

.book {
  position: relative;
  direction: ltr;
  width: min(100%, 1020px);
  aspect-ratio: 2 / 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  filter: drop-shadow(0 22px 28px rgba(77, 56, 43, 0.14));
  transform-style: preserve-3d;
}

.book.single {
  width: min(51%, 510px);
  aspect-ratio: 1;
  display: block;
}

.page {
  position: relative;
  overflow: hidden;
  background: var(--paper);
  backface-visibility: hidden;
}

.page.left { border-radius: 14px 2px 2px 14px; }
.page.right { border-radius: 2px 14px 14px 2px; }
.book.single .page { width: 100%; height: 100%; border-radius: 14px; box-shadow: var(--shadow); }

.page img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.book:not(.single)::after {
  content: "";
  position: absolute;
  z-index: 7;
  inset: 0 auto 0 50%;
  width: 18px;
  transform: translateX(-50%);
  pointer-events: none;
  background: linear-gradient(90deg, rgba(40, 27, 22, 0.10), rgba(255,255,255,0.30) 45%, rgba(40, 27, 22, 0.10));
  mix-blend-mode: multiply;
  opacity: 0.65;
}

.page.left::after,
.page.right::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.page.left::after { background: linear-gradient(90deg, transparent 74%, rgba(70, 42, 30, 0.08)); }
.page.right::before { background: linear-gradient(90deg, rgba(70, 42, 30, 0.08), transparent 26%); }

.flip-sheet {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  z-index: 12;
  transform-style: preserve-3d;
  transition: transform 760ms cubic-bezier(.52,.05,.23,.99);
}

.flip-sheet.next { left: 0; transform-origin: right center; }
.flip-sheet.previous { right: 0; transform-origin: left center; }
.flip-sheet.next.turn { transform: rotateY(180deg); }
.flip-sheet.previous.turn { transform: rotateY(-180deg); }

.flip-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--paper);
  backface-visibility: hidden;
}

.flip-face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.flip-face.front { box-shadow: -14px 7px 22px rgba(43, 29, 24, 0.14); }
.flip-face.back { transform: rotateY(180deg); box-shadow: 14px 7px 22px rgba(43, 29, 24, 0.14); }

.book.soft-exit { animation: softExit 270ms ease both; }
.book.soft-enter { animation: softEnter 360ms ease both; }

@keyframes softExit { to { opacity: 0; transform: scale(.965) rotateY(7deg); } }
@keyframes softEnter { from { opacity: 0; transform: scale(.965) rotateY(-7deg); } to { opacity: 1; transform: none; } }

.reader-controls {
  position: relative;
  width: min(720px, calc(100% - 20px));
  height: 48px;
  min-height: 0;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  direction: rtl;
}

button { font: inherit; }

.nav-button,
.fullscreen-button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 8px 24px rgba(63, 52, 45, 0.08);
  cursor: pointer;
  transition: transform 170ms ease, background 170ms ease, opacity 170ms ease;
}

.nav-button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 700;
}

.nav-button.previous { justify-self: end; }
.nav-button.next { justify-self: start; }
.nav-button:hover:not(:disabled), .fullscreen-button:hover { transform: translateY(-2px); background: #fff; }
.nav-button:disabled { opacity: 0.34; cursor: default; box-shadow: none; }

.progress-pill {
  min-width: 156px;
  text-align: center;
  color: var(--ink-soft);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.fullscreen-button {
  position: absolute;
  inset-inline-start: -58px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 1.25rem;
}

.below-book {
  height: 76px;
  min-height: 0;
  position: relative;
  display: grid;
  place-items: start center;
  padding-top: 7px;
}

.download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 22px;
  border: 1px solid rgba(23, 63, 118, 0.14);
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--ink), #2d6eaa);
  box-shadow: 0 10px 26px rgba(22, 63, 118, 0.18);
  text-decoration: none;
  font-weight: 700;
  transition: transform 170ms ease, box-shadow 170ms ease;
}

.download-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(22, 63, 118, 0.23);
}

.download-link:focus-visible {
  outline: 3px solid rgba(23, 93, 159, 0.33);
  outline-offset: 3px;
}

.yael-mini {
  position: absolute;
  z-index: 2;
  inset-inline-start: 20px;
  bottom: 0;
  width: 60px;
  height: 75px;
  object-fit: cover;
  object-position: center;
  border: 7px solid rgba(255, 255, 255, 0.92);
  border-radius: 48% 52% 44% 56% / 55% 48% 52% 45%;
  box-shadow: 0 18px 44px rgba(79, 55, 44, 0.15);
  transform: rotate(-2deg);
}

footer {
  height: 34px;
  min-height: 0;
  display: grid;
  place-items: center;
  color: rgba(22, 63, 118, 0.72);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

@media (max-width: 1180px) {
  .yael-mini { width: 60px; height: 75px; inset-inline-start: 0; }
  .reader { width: calc(100% - 88px); }
}

@media (max-width: 720px) {
  .site-header {
    height: clamp(60px, 10svh, 76px);
    min-height: 0;
    width: calc(100% - 22px);
    grid-template-columns: 116px 1fr 68px;
    gap: 8px;
  }

  .site-header h1 { font-size: clamp(1.06rem, 4.7vw, 1.45rem); }
  .title-block { gap: 3px; }
  .view-toggle { padding: 2px; }
  .view-button { min-height: 24px; padding: 0 7px; gap: 3px; font-size: 0.69rem; }
  .brand-logo { width: 54px; height: 54px; border-radius: 15px; }
  .whatsapp-link { min-height: 38px; padding: 0 10px; font-size: 0.78rem; gap: 5px; white-space: nowrap; }
  .reader-shell { width: 100%; }
  .reader { width: 100%; }
  .reader-shell { grid-template-rows: minmax(0, 1fr) 78px; }
  .reader { grid-template-rows: minmax(0, 1fr) 44px; }
  .book-stage { min-height: 0; padding: 3px 12px 5px; }
  .book { width: min(94vw, 1020px); aspect-ratio: 2 / 1; display: grid; grid-template-columns: 1fr 1fr; }
  .book.single { width: min(92vw, 520px); aspect-ratio: 1; display: block; }
  .book .page { width: 100%; height: 100%; border-radius: 13px; box-shadow: var(--shadow); }
  .book:not(.single)::after { width: 8px; opacity: 0.48; }
  .below-book { height: 78px; min-height: 0; padding-top: 7px; }
  .download-link { min-height: 40px; padding: 0 15px; font-size: 0.92rem; }
  .yael-mini { width: 56px; height: 70px; inset-inline-start: 10px; border-width: 4px; opacity: 0.96; }
  .reader-controls { width: calc(100% - 34px); grid-template-columns: 1fr auto 1fr; gap: 5px; }
  .nav-button { min-height: 42px; padding: 0 13px; font-size: 0.92rem; }
  .progress-pill { min-width: 116px; font-size: 0.9rem; }
  .fullscreen-button { inset-inline-start: 0; top: -54px; width: 38px; height: 38px; }
  footer { height: 30px; min-height: 0; font-size: 0.82rem; }
}

@media (max-width: 420px) {
  .site-header { grid-template-columns: 108px 1fr 56px; }
  .brand-logo { width: 54px; height: 54px; }
  .whatsapp-link { padding: 0 8px; font-size: 0.73rem; }
  .progress-pill { min-width: 98px; font-size: 0.82rem; }
  .nav-button { padding: 0 10px; }
  .yael-mini { width: 65px; height: 82px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 1ms !important; transition-duration: 1ms !important; }
}
