:root {
  --book-bg: #0d273e;
  --book-blue: #2b4c5d;
  --gold: #d9b54a;
  --gold-soft: #f0d77d;
  --ivory: #f6f1e8;
  --white: #ffffff;
  --line: rgba(255, 255, 255, 0.13);
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.30);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--book-bg);
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100svh;
  background: var(--book-bg);
  color: var(--ivory);
  font-family: Georgia, "Times New Roman", serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  width: 100%;
  height: auto;
}

.page-shell {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background: var(--book-bg);
}

.page-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% -10%, rgba(217, 181, 74, 0.09), transparent 34%),
    radial-gradient(circle at 50% 112%, rgba(43, 76, 93, 0.26), transparent 42%);
}

.bsd {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: max(18px, env(safe-area-inset-right));
  z-index: 10;
  color: var(--gold-soft);
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1;
  opacity: 0.95;
}

.magen-david {
  position: absolute;
  z-index: -2;
  width: min(54vw, 660px);
  aspect-ratio: 1;
  left: 50%;
  top: 48%;
  transform: translate(-50%, -50%);
  opacity: 0.055;
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.5;
  transform-origin: center;
  animation: star-breathe 10s ease-in-out infinite, star-turn 55s linear infinite;
  pointer-events: none;
}

@keyframes star-breathe {
  0%, 100% { opacity: 0.035; }
  50% { opacity: 0.08; }
}

@keyframes star-turn {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.landing {
  width: min(1180px, calc(100% - 44px));
  min-height: 100svh;
  margin-inline: auto;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding:
    max(22px, env(safe-area-inset-top))
    0
    max(18px, env(safe-area-inset-bottom));
}

.brand-row {
  min-height: 64px;
  display: flex;
  align-items: center;
  padding-right: 86px;
  border-bottom: 1px solid var(--line);
}

.brand {
  margin: 0;
  color: var(--white);
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 800;
  font-size: clamp(1.1rem, 2.4vw, 1.45rem);
  letter-spacing: 0.02em;
}

.temporary {
  margin: 3px 0 0;
  color: var(--gold-soft);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.76rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.book-stage {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(340px, 0.98fr);
  gap: clamp(34px, 5vw, 72px);
  align-items: center;
  padding-block: clamp(24px, 4vh, 54px);
}

.covers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(10px, 1.6vw, 22px);
  align-items: center;
}

.covers figure {
  margin: 0;
  min-width: 0;
}

.covers img {
  aspect-ratio: 1414 / 2048;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: var(--shadow);
}

.book-copy {
  max-width: 560px;
}

.series {
  margin: 0 0 8px;
  color: var(--gold);
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 18px;
  color: var(--white);
  font-weight: 500;
  font-size: clamp(2.65rem, 5.4vw, 5.3rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.intro,
.source {
  margin: 0;
  color: rgba(246, 241, 232, 0.92);
  font-size: clamp(1rem, 1.55vw, 1.2rem);
  line-height: 1.55;
}

.source {
  margin-top: 13px;
  color: rgba(246, 241, 232, 0.74);
  font-size: clamp(0.92rem, 1.35vw, 1.05rem);
}

.order-row {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 20px;
}

.price-wrap {
  flex: 0 0 auto;
}

.price {
  display: block;
  color: var(--white);
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(1.65rem, 3vw, 2.25rem);
  font-weight: 800;
  line-height: 1;
}

.vat {
  display: block;
  margin-top: 4px;
  color: rgba(246, 241, 232, 0.64);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.72rem;
}

.shipping {
  display: block;
  margin-top: 5px;
  max-width: 220px;
  color: var(--gold-soft);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.72rem;
  line-height: 1.35;
}

.shipping-dialog {
  margin: -4px 0 14px;
  color: var(--gold-soft);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.86rem;
  line-height: 1.45;
}

.pickup {
  display: block;
  margin-top: 5px;
  max-width: 300px;
  color: rgba(246, 241, 232, 0.78);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.72rem;
  line-height: 1.35;
}

.pickup-dialog {
  margin: -5px 0 16px;
  color: rgba(246, 241, 232, 0.78);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.84rem;
  line-height: 1.45;
}

.order-button {
  flex: 1 1 auto;
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 22px;
  border: 1px solid var(--gold);
  border-radius: 4px;
  background: var(--gold);
  color: var(--book-bg);
  box-shadow: 0 10px 30px rgba(0,0,0,0.22);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.94rem;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.order-button:hover,
.order-button:focus-visible {
  transform: translateY(-2px);
  background: var(--gold-soft);
  box-shadow: 0 14px 34px rgba(0,0,0,0.30);
  outline: none;
}

.shop-note {
  margin: 13px 0 0;
  color: rgba(246, 241, 232, 0.61);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.76rem;
  line-height: 1.45;
}

footer {
  min-height: 42px;
  display: flex;
  align-items: flex-end;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: rgba(246, 241, 232, 0.52);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.72rem;
}

/* Tablet */
@media (max-width: 860px) {
  .landing {
    width: min(760px, calc(100% - 30px));
  }

  .book-stage {
    grid-template-columns: 1fr;
    gap: 24px;
    padding-block: 18px 22px;
  }

  .covers {
    width: min(100%, 640px);
    margin-inline: auto;
  }

  .book-copy {
    max-width: 680px;
    margin-inline: auto;
    text-align: center;
  }

  .order-row {
    justify-content: center;
  }

  .order-button {
    flex: 0 1 330px;
  }

  .magen-david {
    width: min(84vw, 600px);
    top: 63%;
  }
}

/* Mobile: keep the two covers next to each other and compress the landing page */
@media (max-width: 560px) {
  .landing {
    width: min(100% - 22px, 520px);
    padding-top: max(12px, env(safe-area-inset-top));
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }

  .bsd {
    top: max(13px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
    font-size: 1rem;
  }

  .brand-row {
    min-height: 50px;
    padding-right: 60px;
  }

  .brand {
    font-size: 1rem;
  }

  .temporary {
    margin-top: 1px;
    font-size: 0.58rem;
    letter-spacing: 0.055em;
  }

  .book-stage {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
    padding-block: 10px 12px;
  }

  .covers {
    width: 100%;
    gap: 7px;
  }

  .covers img {
    box-shadow: 0 9px 24px rgba(0,0,0,0.25);
  }

  .series {
    margin-bottom: 4px;
    font-size: 0.61rem;
    letter-spacing: 0.13em;
  }

  h1 {
    margin-bottom: 8px;
    font-size: clamp(2rem, 10vw, 3rem);
  }

  .intro {
    font-size: 0.92rem;
    line-height: 1.38;
  }

  .source {
    margin-top: 7px;
    font-size: 0.77rem;
    line-height: 1.35;
  }

  .order-row {
    margin-top: 12px;
    padding-top: 11px;
    gap: 12px;
    text-align: left;
  }

  .price {
    font-size: 1.48rem;
  }

  .vat {
    font-size: 0.61rem;
  }

  .order-button {
    min-height: 46px;
    padding: 11px 14px;
    font-size: 0.82rem;
  }

  .shop-note {
    margin-top: 8px;
    font-size: 0.65rem;
    line-height: 1.35;
  }

  footer {
    min-height: 30px;
    padding-top: 7px;
    justify-content: center;
    text-align: center;
    font-size: 0.58rem;
  }

  .magen-david {
    width: 100vw;
    top: 70%;
  }
}

@media (max-width: 360px) {
  .intro {
    font-size: 0.84rem;
  }

  .source {
    display: none;
  }

  .shop-note {
    font-size: 0.61rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .magen-david {
    animation: none;
  }

  .order-button {
    transition: none;
  }
}

/* Click-to-enlarge book covers */
.cover-button {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
}

.cover-button:focus-visible {
  outline: 2px solid var(--gold-soft);
  outline-offset: 4px;
}

.zoom-hint {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 5px 8px;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 999px;
  background: rgba(13, 39, 62, 0.82);
  color: var(--ivory);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.68rem;
  line-height: 1;
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

.cover-button:hover .zoom-hint,
.cover-button:focus-visible .zoom-hint {
  opacity: 1;
  transform: translateY(0);
}

/* Native dialogs: lightbox + order chooser */
dialog {
  border: 0;
}

dialog::backdrop {
  background: rgba(2, 12, 21, 0.86);
  backdrop-filter: blur(4px);
}

.cover-dialog {
  width: min(94vw, 880px);
  height: min(94svh, 1100px);
  margin: auto;
  padding: 18px;
  overflow: hidden;
  border: 1px solid rgba(217, 181, 74, 0.38);
  border-radius: 10px;
  background: var(--book-bg);
  box-shadow: 0 30px 90px rgba(0,0,0,0.58);
}

.cover-dialog[open] {
  display: grid;
  place-items: center;
}

.cover-dialog img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: calc(94svh - 36px);
  object-fit: contain;
}


.cover-nav {
  position: absolute;
  top: 50%;
  z-index: 4;
  width: 48px;
  height: 64px;
  transform: translateY(-50%);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 8px;
  background: rgba(13,39,62,0.88);
  color: var(--white);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 2.6rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.cover-nav:hover,
.cover-nav:focus-visible {
  background: rgba(217,181,74,0.94);
  border-color: var(--gold-soft);
  color: var(--book-bg);
  outline: none;
}

.cover-prev {
  left: 12px;
}

.cover-next {
  right: 12px;
}

.dialog-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 50%;
  background: rgba(13,39,62,0.90);
  color: var(--white);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.order-dialog {
  width: min(92vw, 480px);
  margin: auto;
  padding: 30px;
  border: 1px solid rgba(217,181,74,0.40);
  border-radius: 14px;
  background: var(--book-bg);
  color: var(--ivory);
  box-shadow: 0 30px 90px rgba(0,0,0,0.58);
}

.order-dialog h2 {
  margin: 4px 44px 8px 0;
  color: var(--white);
  font-size: clamp(1.65rem, 6vw, 2.15rem);
  font-weight: 500;
  line-height: 1.05;
}

.dialog-kicker {
  margin: 0;
  color: var(--gold);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dialog-copy {
  margin: 0 0 20px;
  color: rgba(246,241,232,0.76);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.9rem;
  line-height: 1.45;
}

.order-options {
  display: grid;
  gap: 10px;
}

.order-option {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 11px 16px;
  border: 1px solid rgba(217, 181, 74, 0.72);
  border-radius: 6px;
  color: var(--ivory);
  background: transparent;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.order-option:hover,
.order-option:focus-visible {
  border-color: var(--gold);
  background: var(--gold);
  color: var(--book-bg);
  transform: translateY(-1px);
  outline: none;
}


.order-address {
  margin: 18px 0 0;
  color: rgba(246,241,232,0.64);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.76rem;
  line-height: 1.4;
  text-align: center;
}

.order-button {
  border: 1px solid var(--gold);
  cursor: pointer;
}

@media (max-width: 560px) {
  .zoom-hint {
    opacity: 0.9;
    transform: none;
    right: 5px;
    bottom: 5px;
    padding: 4px 6px;
    font-size: 0.56rem;
  }

  .cover-dialog {
    width: 100vw;
    height: 100svh;
    max-width: none;
    max-height: none;
    padding: 10px;
    border-radius: 0;
  }

  .cover-dialog img {
    max-height: calc(100svh - 20px);
  }

  .cover-nav {
    width: 44px;
    height: 58px;
    font-size: 2.25rem;
    background: rgba(13,39,62,0.78);
  }

  .cover-prev {
    left: 6px;
  }

  .cover-next {
    right: 6px;
  }

  .order-dialog {
    width: min(94vw, 440px);
    padding: 24px 18px 20px;
  }
}

