/* The First 100 Days: the physical book (sheets, spine, edges, cover). */
@property --flip { syntax: "<number>"; inherits: false; initial-value: 0; }

.book {
  position: relative; z-index: 10;
  --gutter: 0px;
  width: calc(var(--page-w) * 2 + var(--gutter));
  height: var(--page-h);
  transform-style: preserve-3d;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  --edge-max: 16px;
}
.book.single { width: var(--page-w); }

/* a leaf: sits on the inline-end half, hinged at the spine */
.sheet {
  position: absolute; top: 0; inset-inline-start: 50%;
  width: var(--page-w); height: var(--page-h);
  transform-style: preserve-3d;
  transform-origin: left center;
  transform: rotateY(calc(var(--flip) * -180deg));
  will-change: transform;
}
.book[dir="rtl"] .sheet { transform-origin: right center; transform: rotateY(calc(var(--flip) * 180deg)); }
.book.single .sheet { inset-inline-start: 0; }
/* in single mode a flipped sheet leaves the stage entirely */
.book.single .sheet.flipped:not(.moving) { visibility: hidden; }

.face {
  position: absolute; inset: 0;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  overflow: hidden;
}
.face.back { transform: rotateY(180deg); }
.face .page { width: 100%; height: 100%; }

/* shading while the leaf moves: dark on the lifting face, a soft light fold on the other */
.face::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  opacity: calc(min(var(--flip), 1 - var(--flip)) * 2);
  transition: none;
}
.face.front::after { background: linear-gradient(to left, rgb(var(--shade) / var(--shade-a)), rgb(var(--shade) / .06) 45%, transparent 70%); }
.face.back::after { background: linear-gradient(to right, rgb(var(--shade) / var(--shade-a)), rgb(var(--shade) / .05) 45%, transparent 70%); }
.book[dir="rtl"] .face.front::after { background: linear-gradient(to right, rgb(var(--shade) / var(--shade-a)), rgb(var(--shade) / .06) 45%, transparent 70%); }
.book[dir="rtl"] .face.back::after { background: linear-gradient(to left, rgb(var(--shade) / var(--shade-a)), rgb(var(--shade) / .05) 45%, transparent 70%); }
.sheet { --flip: 0; }
.face::after { opacity: calc(min(var(--flip, 0), 1 - var(--flip, 0)) * 2); }
.sheet .face::after { --flip: inherit; }

/* gutter shadow at the spine side of every page */
.page::before {
  content: ""; position: absolute; top: 0; bottom: 0; width: 26px; pointer-events: none; z-index: 2;
}
.page.recto::before { inset-inline-start: 0; background: linear-gradient(to right, rgb(var(--shade) / calc(var(--shade-a) * .7)), rgb(var(--shade) / .05) 40%, transparent); }
.page.verso::before { inset-inline-end: 0; background: linear-gradient(to left, rgb(var(--shade) / calc(var(--shade-a) * .7)), rgb(var(--shade) / .05) 40%, transparent); }
[dir="rtl"] .page.recto::before { background: linear-gradient(to left, rgb(var(--shade) / calc(var(--shade-a) * .7)), rgb(var(--shade) / .05) 40%, transparent); }
[dir="rtl"] .page.verso::before { background: linear-gradient(to right, rgb(var(--shade) / calc(var(--shade-a) * .7)), rgb(var(--shade) / .05) 40%, transparent); }
.book.single .page::before { display: none; }

/* the block of pages: read stack at inline-start, unread at inline-end */
.book::before, .book::after {
  content: ""; position: absolute; top: 3px; bottom: 3px; width: var(--edge-max); pointer-events: none;
  background:
    repeating-linear-gradient(to right, rgb(var(--t-border-strong) / .55) 0 1px, rgb(var(--t-surface-sunken)) 1px 3px);
  box-shadow: 0 18px 40px rgb(var(--shade) / var(--shade-a));
}
.book::before { inset-inline-start: 0; transform: translateX(calc(-1 * var(--edge-max) * var(--read-frac, 0))) scaleX(var(--read-frac, 0)); transform-origin: left center; }
.book::after { inset-inline-end: 0; transform: translateX(calc(var(--edge-max) * var(--unread-frac, 1))) scaleX(var(--unread-frac, 1)); transform-origin: right center; }
.book[dir="rtl"]::before { transform: translateX(calc(var(--edge-max) * var(--read-frac, 0))) scaleX(var(--read-frac, 0)); transform-origin: right center; }
.book[dir="rtl"]::after { transform: translateX(calc(-1 * var(--edge-max) * var(--unread-frac, 1))) scaleX(var(--unread-frac, 1)); transform-origin: left center; }
.book.single::before, .book.single::after { display: none; }

/* spread: the open book casts a shadow on the stage; a thin spine line */
.book.spread { filter: drop-shadow(0 24px 50px rgb(var(--shade) / calc(var(--shade-a) * 1.2))); }
.book.spread .spine { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; background: rgb(var(--shade) / calc(var(--shade-a) + .15)); z-index: 600; pointer-events: none; }

/* the blank verso of a single-mode sheet (what you glimpse while it turns) */
.page.blank { background: var(--paper); }

/* ===================== fixed pages: endpapers, half title, title, colophon ===================== */
.page.endpaper, .page.cover-back { background: var(--cloth); }
.page.endpaper::before { opacity: .6; }
.page.blank { background: var(--paper); }
.page.kind-fixed .page-body { display: flex; flex-direction: column; }

.page.half-title .page-body { justify-content: center; align-items: center; }
.ht { font-family: var(--f-head); font-size: 1.05em; letter-spacing: .02em; color: var(--ink-soft); margin: 0; text-align: center; }
html[lang="en"] .ht { font-weight: 600; letter-spacing: .14em; text-transform: uppercase; font-size: .78em; }

.page.title-page .page-body { justify-content: flex-start; }
.tp { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; width: 100%; height: 100%; text-align: start; }
.tp-top { padding-top: 14%; }
.tp-title { font-family: var(--f-head); font-weight: 600; font-size: 2.1em; line-height: 1.12; margin: 0 0 .5em; letter-spacing: -.01em; }
html[lang="he"] .tp-title { font-weight: 400; }
.tp-sub { font-size: 1em; color: var(--ink-soft); margin: 0; max-width: 26ch; padding-top: .9em; border-top: 1px solid var(--rule-strong); }
.tp-credit { font-size: .78em; color: var(--ink-muted); margin: 0; max-width: 34ch; }
/* the Latin lockup always reads left to right, even on a Hebrew page */
.tp-foot, .cover-foot, .cb-foot { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; direction: ltr; text-align: left; align-self: flex-start; }
[dir="rtl"] .tp-foot, [dir="rtl"] .cb-foot { align-self: flex-end; }
[dir="rtl"] .cover-foot { justify-self: end; }
/* ---- the brand cloud (app treatment: multiply + radial fade; a white disc in dark) ---- */
.cloud { position: relative; display: inline-block; width: 40px; height: 40px; flex: 0 0 auto; }
.cloud-body, .cloud-art { position: absolute; inset: 0; display: block; transform-origin: 50% 60%; }
.cloud-art { transform: scale(1.42); }
.cloud img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply;
  -webkit-mask-image: radial-gradient(closest-side, #000 58%, transparent 80%); mask-image: radial-gradient(closest-side, #000 58%, transparent 80%); }
html[data-appearance="dark"] .cloud img { mix-blend-mode: normal; -webkit-mask-image: radial-gradient(closest-side, #000 46%, transparent 74%); mask-image: radial-gradient(closest-side, #000 46%, transparent 74%); }
/* every small cloud breathes like the app's brand symbol, and bounces once when tapped */
.cloud.sym .cloud-body { animation: brand-breathe 7s ease-in-out infinite; }
.cloud.bounce .cloud-body { animation: hero-bounce 520ms ease-in-out; }
@keyframes brand-breathe { 0%, 100% { transform: translateY(0) rotate(-.6deg); } 50% { transform: translateY(-1.5px) rotate(.6deg); } }
.lockup { display: inline-flex; align-items: center; gap: 10px; direction: ltr; text-align: left; cursor: pointer; text-decoration: none; color: inherit; -webkit-tap-highlight-color: transparent; }
.lockup:hover .wordmark, .lockup:focus-visible .wordmark { color: var(--rose); }
.lockup:focus-visible { outline: 2px solid var(--rose); outline-offset: 4px; border-radius: 12px; }
.lockup .tile { display: flex; align-items: flex-end; justify-content: center; width: 44px; height: 44px; border-radius: 15px; overflow: hidden; flex: 0 0 auto;
  background: linear-gradient(160deg, #FFF0F5 0%, #FEDBE8 100%); transform-origin: 50% 60%; animation: brand-breathe 7s ease-in-out infinite; }
.lockup .tile img { display: block; height: 50px; width: auto; transform: translateY(3px); }
.lockup.bounce .tile { animation: hero-bounce 520ms ease-in-out; }
.lk-text { display: flex; flex-direction: column; gap: 3px; }
.wordmark { font-family: var(--f-serif-brand); font-weight: 600; font-size: 21px; letter-spacing: -.01em; color: var(--ink); line-height: 1; }
.publisher { font-family: var(--f-num); font-weight: 500; font-size: 9px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-muted); line-height: 1; }

.page.colophon .page-body { justify-content: flex-start; font-size: .82em; color: var(--ink-muted); line-height: 1.6; }
.col-h { font-family: var(--f-head); font-size: 1.1em; color: var(--ink-soft); margin: 0 0 1.2em; padding-bottom: .6em; border-bottom: 1px solid var(--rule); }
.col p { margin: 0 0 .5em; text-align: start; }
.col-edition { font-family: var(--f-num); font-weight: 500; letter-spacing: .04em; color: var(--ink-soft); }
.col-disclaimer { margin-top: 1em; padding-top: .8em; border-top: 1px solid var(--rule); }
.col-disclaimer p { text-align: start; }
.col-disclaimer strong { color: var(--ink-soft); font-weight: 500; }

/* ===================== contents ===================== */
.toc-h { font-family: var(--f-head); font-weight: 600; font-size: 1.3em; margin: 0 0 .9em; color: var(--ink); }
html[lang="he"] .toc-h { font-weight: 400; }
.toc-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--rule); }
.toc-left { display: flex; gap: 12px; align-items: baseline; min-width: 0; }
.toc-n { font-family: var(--f-num); font-weight: 500; font-size: .85em; color: var(--rose); min-width: 1.6em; }
.toc-dot { color: var(--ink-muted); text-align: center; }
.toc-t { display: flex; flex-direction: column; min-width: 0; }
.toc-code { font-family: var(--f-head); font-size: .98em; color: var(--ink); }
.toc-sub { font-size: .78em; color: var(--ink-muted); line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toc-p { font-family: var(--f-num); font-size: .85em; color: var(--ink-soft); flex: 0 0 auto; }
.toc-flow .toc-row { break-inside: avoid; }

/* ===================== gate opener ===================== */
.page.opener .page-body { justify-content: center; }
.op { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.op-kicker { font-family: var(--f-label); font-weight: 600; font-size: .72em; letter-spacing: .16em; text-transform: uppercase; color: var(--rose); }
html[lang="he"] .op-kicker { letter-spacing: .02em; font-size: .85em; font-weight: 400; }
.op-num { font-family: var(--f-num); font-weight: 600; font-size: 6.2em; line-height: .9; color: var(--ink); margin: 2px 0 10px; letter-spacing: -.03em; }
.op-title { font-family: var(--f-head); font-weight: 600; font-size: 1.75em; line-height: 1.15; margin: 0; color: var(--ink); }
html[lang="he"] .op-title { font-weight: 400; }
.op-sub { font-size: 1em; color: var(--ink-soft); margin: 4px 0 0; line-height: 1.45; }
.op-meta { margin-top: 26px; padding-top: 14px; border-top: 1px solid var(--rule-strong); width: 100%; display: flex; flex-direction: column; gap: 8px; }
.om { display: grid; grid-template-columns: 7em 1fr; gap: 10px; font-size: .86em; line-height: 1.45; }
.om-k { font-family: var(--f-label); color: var(--ink-muted); }
html[lang="en"] .om-k { font-weight: 600; font-size: .78em; letter-spacing: .1em; text-transform: uppercase; padding-top: .25em; }
.om-v { color: var(--ink-soft); }
.om-v strong { font-weight: 500; color: var(--ink); }
.page.opener.appendix .op-title { font-size: 1.45em; }

/* ===================== back cover ===================== */
.page.cover-back .page-body { justify-content: space-between; }
.cb { display: flex; flex-direction: column; justify-content: space-between; height: 100%; }
.cb-text { font-size: .95em; line-height: 1.7; color: var(--ink-soft); margin: 14% 0 0; max-width: 32ch; text-align: start; }

/* ===================== the closed cover ===================== */
#cover {
  position: absolute; width: var(--page-w); height: var(--page-h);
  transform-style: preserve-3d; transform-origin: left center;
  transform: rotateY(0deg);
  transition: transform 900ms cubic-bezier(.3,.7,.2,1);
  z-index: 2000; cursor: pointer;
}
#cover.open { transform: rotateY(-180deg); }
[dir="rtl"] #cover.open { transform: rotateY(180deg); }
#cover.settled { z-index: 1; pointer-events: none; }
#cover.open .cover-lang { visibility: hidden; }
.cover-board { box-shadow: 0 24px 50px rgb(var(--shade) / calc(var(--shade-a) * 1.1)); }
[dir="rtl"] #cover { transform-origin: right center; }
.cover-board {
  position: absolute; inset: 0; overflow: hidden;
  background: linear-gradient(180deg, rgb(var(--t-home-sky) / .55), rgb(var(--sky)) 55%, rgb(var(--sky)));
  color: var(--ink);
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  display: grid; grid-template-rows: 1fr auto auto 1fr auto; align-items: start; justify-items: start;
  padding: 6% 9% 40px; row-gap: clamp(10px, 3.2%, 24px);
  text-align: start;
}
/* soft white clouds, drifting */
.sky { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.puff { position: absolute; display: block; border-radius: 50%; background: rgb(var(--cloud));
  box-shadow: 0 10px 30px rgb(var(--cloud-shade) / .22), inset 0 -8px 14px rgb(var(--cloud-shade) / .08); }
.puff::before, .puff::after { content: ""; position: absolute; border-radius: 50%; background: inherit; box-shadow: inherit; }
.puff::before { width: 62%; height: 62%; left: -22%; top: 26%; }
.puff::after { width: 74%; height: 74%; right: -24%; top: 18%; }
.puff.a { width: 26%; aspect-ratio: 1.55; left: 4%; top: 9%; animation: drift 34s ease-in-out infinite; }
.puff.b { width: 18%; aspect-ratio: 1.5; right: 8%; top: 19%; animation: drift 42s ease-in-out -12s infinite reverse; }
.puff.c { width: 32%; aspect-ratio: 1.6; left: 54%; top: 46%; animation: drift 50s ease-in-out -20s infinite; opacity: .9; }
.puff.d { width: 16%; aspect-ratio: 1.5; left: 10%; top: 58%; animation: drift 38s ease-in-out -30s infinite reverse; opacity: .85; }
.puff.e { width: 22%; aspect-ratio: 1.55; right: -4%; top: 70%; animation: drift 46s ease-in-out -8s infinite; opacity: .8; }
.puff.f { width: 14%; aspect-ratio: 1.5; left: 40%; top: 4%; animation: drift 30s ease-in-out -16s infinite reverse; opacity: .7; }
@keyframes drift { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(6%); } }
/* the hero cloud: floats, breathes, blinks, and every few seconds does a little excited wiggle; a tap makes it hop */
.cover-hero { grid-row: 2; position: relative; z-index: 1; justify-self: center; align-self: end; width: min(52%, 220px, calc(var(--page-h) * .27)); aspect-ratio: 1; cursor: pointer; }
.cover-hero .cloud { width: 100%; height: 100%; }
.cover-hero .cloud::before { content: ""; position: absolute; inset: 8%; border-radius: 50%;
  background: radial-gradient(circle, rgb(var(--t-pink) / .9), rgb(var(--t-pink) / 0) 70%); filter: blur(14px); opacity: .8; }
.cover-hero .cloud-body { animation: hero-float 6s ease-in-out infinite; }
.cover-hero .cloud-art { animation: hero-excited 7s ease-in-out infinite; }
.cover-hero .cloud-art::before, .cover-hero .cloud-art::after {
  content: ""; position: absolute; z-index: 1; top: 37.35%; width: 11.68%; height: 14.92%; border-radius: 50%; clip-path: inset(0 0 100% 0);
  animation: blink 5.6s ease-in-out infinite;
}
.cover-hero .cloud-art::before { left: 36.43%; background: radial-gradient(ellipse at 72% 10%, #95e1ef, #6ac8e8 48%, #43addc); }
.cover-hero .cloud-art::after { left: 53.3%; background: radial-gradient(ellipse at 72% 10%, #afe4f3, #88cbe9 48%, #6aaee0); animation-delay: .02s; }
#cover.bounce .cover-hero .cloud { animation: hero-bounce 520ms ease-in-out; }
@keyframes hero-float { 0%, 100% { transform: translate(0, 0) rotate(-.6deg); } 50% { transform: translate(1.5px, -6px) rotate(.6deg); } }
@keyframes hero-excited {
  0%, 78%, 100% { transform: scale(1.42) rotate(0); }
  82% { transform: scale(1.46) rotate(-6deg); } 86% { transform: scale(1.46) rotate(6deg); }
  90% { transform: scale(1.45) rotate(-4deg); } 94% { transform: scale(1.44) rotate(3deg); }
}
@keyframes blink { 0%, 93%, 100% { clip-path: inset(0 0 100% 0); } 95.5%, 97% { clip-path: inset(0); } }
@keyframes hero-bounce { 0% { transform: translateY(0) scale(1); } 46% { transform: translateY(-10px) scale(1.03); } 80% { transform: translateY(1px) scale(1, .995); } 100% { transform: none; } }
html[data-appearance="dark"] .cover-hero .cloud::before { opacity: .25; }
@media (prefers-reduced-motion: reduce) { .puff, .cloud-body, .cloud-art, .cloud-art::before, .cloud-art::after { animation: none !important; } }
.cover-top { grid-row: 3; position: relative; z-index: 1; width: 100%; align-self: start; }
.cover-foot { position: relative; z-index: 1; grid-row: 5; align-self: end; }
.cover-title { font-family: var(--f-head); font-weight: 600; font-size: clamp(24px, min(8.4cqw, calc(var(--page-h) * .06)), 42px); line-height: 1.1; margin: 0 0 .5em; letter-spacing: -.015em; color: var(--ink); }
.cover-sub { font-size: clamp(14px, 3.9cqw, 17px); color: var(--ink-soft); margin: 0; max-width: 24ch; padding-top: .9em; border-top: 1px solid var(--rule-strong); line-height: 1.5; }
#cover { container-type: inline-size; }
.cover-spine {
  position: absolute; top: 0; bottom: 0; inset-inline-start: 0; width: 22px;
  background: linear-gradient(to right, rgb(var(--cloud-shade) / .28), rgb(var(--cloud-shade) / .06) 50%, rgb(255 255 255 / .35));
  border-inline-end: 1px solid rgb(var(--cloud-shade) / .25);
}
[dir="rtl"] .cover-spine { background: linear-gradient(to left, rgb(var(--cloud-shade) / .28), rgb(var(--cloud-shade) / .06) 50%, rgb(255 255 255 / .35)); }
.cover-spine span { display: none; }
/* inside of the cover (seen as it opens): cloth, like the endpaper */
#cover::after {
  content: ""; position: absolute; inset: 0; transform: rotateY(180deg); backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background: rgb(var(--sky));
  box-shadow: inset 0 0 0 1px rgb(var(--shade) / .08);
}
/* stage: closed book sits centred; the spread sits centred too */
#stage > #cover { position: absolute; left: 50%; top: 50%; margin-left: calc(-.5 * var(--page-w)); margin-top: calc(-.5 * var(--page-h)); }
#stage.opened > #cover { left: 50%; margin-left: 0; }
[dir="rtl"] #stage.opened > #cover { margin-left: calc(-1 * var(--page-w)); }
#stage.single-mode > #cover { left: 0; top: 0; margin: 0; }

/* choose-language buttons on the cover */
.cover-lang { position: absolute; bottom: 40px; inset-inline-start: 9%; display: flex; justify-content: flex-start; gap: 8px; z-index: 3; }
[dir="ltr"] .cover-lang { inset-inline-start: auto; inset-inline-end: 9%; }
.cover-lang button {
  font-family: var(--f-num); font-weight: 500; font-size: 12px; letter-spacing: .06em;
  color: var(--ink); background: rgb(var(--t-surface) / .7); border: 1px solid var(--rule-strong); border-radius: 3px;
  padding: 9px 18px; cursor: pointer;
}
.cover-lang button:hover { border-color: var(--ink); }
.cover-lang button[lang="he"] { font-family: var(--f-label); letter-spacing: 0; font-size: 13px; }

/* ===================== quiet bar ===================== */
#bar {
  position: fixed; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 6px; padding: 6px 8px;
  background: rgb(var(--t-surface-raised) / .92); border: 1px solid var(--rule); border-radius: 999px;
  box-shadow: 0 12px 40px rgb(var(--shade) / var(--shade-a)); backdrop-filter: blur(10px); z-index: 3000;
  font-family: var(--f-label); font-size: 13px; color: var(--ink-soft);
}
#bar[hidden] { display: none; }
#bar button, #bar a {
  font: inherit; color: inherit; background: none; border: 0; padding: 8px 10px; border-radius: 999px; cursor: pointer; text-decoration: none;
  min-height: 36px; display: inline-flex; align-items: center; white-space: nowrap;
}
#bar button:hover, #bar a:hover { background: rgb(var(--t-text) / .06); color: var(--ink); }
#bar #progress { font-family: var(--f-num); font-weight: 500; font-size: 12px; letter-spacing: .04em; color: var(--ink-muted); padding: 0 8px; border-inline: 1px solid var(--rule); white-space: nowrap; }
#bar [lang="en"] { font-family: var(--f-num); }

/* ===================== contents overlay ===================== */
#toc { position: fixed; inset: 0; background: rgb(var(--shade) / .45); z-index: 3500; display: flex; align-items: center; justify-content: center; padding: 16px; }
#toc[hidden] { display: none; }
.toc-panel {
  position: relative; width: min(520px, 100%); max-height: min(78vh, 760px); overflow: auto; overscroll-behavior: contain;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 4px;
  padding: 26px 26px 18px; box-shadow: 0 30px 80px rgb(var(--shade) / calc(var(--shade-a) * 1.3));
}
.toc-panel h2 { font-family: var(--f-head); font-weight: 600; font-size: 1.15em; margin: 0 0 14px; color: var(--ink); }
html[lang="he"] .toc-panel h2 { font-weight: 400; }
.toc-close { position: absolute; top: 10px; inset-inline-end: 10px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: none; color: var(--ink-muted); font-size: 22px; cursor: pointer; }
.toc-item {
  display: grid; grid-template-columns: 2em 1fr auto; align-items: baseline; gap: 10px; width: 100%;
  text-align: start; font: inherit; color: var(--ink); background: none; border: 0; border-bottom: 1px solid var(--rule);
  padding: 10px 2px; cursor: pointer; font-size: .95em;
}
.toc-item:hover { background: rgb(var(--t-text) / .04); }
.toc-item.front { grid-template-columns: 1fr auto; color: var(--ink-soft); }
.toc-item .n { font-family: var(--f-num); font-weight: 500; color: var(--rose); font-size: .85em; }
.toc-item .t { font-family: var(--f-head); display: flex; flex-direction: column; min-width: 0; }
.toc-item .t small { font-family: var(--f-body); font-size: .78em; color: var(--ink-muted); line-height: 1.3; }
.toc-item .p { font-family: var(--f-num); font-size: .85em; color: var(--ink-muted); }

/* cover buttons: primary + ghost */
.cover-lang { flex-wrap: wrap; }
.cover-lang button.ghost { border-color: transparent; background: none; color: var(--ink-muted); }

#bar [hidden], #toc[hidden], #code[hidden] { display: none !important; }

/* visible page-turn arrows (hover on desktop, always faint) */
.nav-arrow { position: fixed; top: 50%; translate: 0 -50%; z-index: 30; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgb(var(--t-brand-pink) / .35);
  background: rgb(var(--t-surface) / .72); color: var(--ink); display: none; place-items: center; cursor: pointer; opacity: .55; transition: opacity .2s; backdrop-filter: blur(6px); }
.nav-arrow:hover, .nav-arrow:focus-visible { opacity: 1; }
.nav-arrow svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#stage.opened ~ .nav-arrow { display: grid; }
#nav-left { left: max(10px, env(safe-area-inset-left)); }
#nav-right { right: max(10px, env(safe-area-inset-right)); }
#nav-right svg { transform: scaleX(-1); }
@media (max-width: 899px) { .nav-arrow { width: 38px; height: 38px; opacity: .35; } }

@media (max-width: 899px), (pointer: coarse) { .nav-arrow { display: none !important; } }

/* the companion on the bar: breathes, hops when a page turns, opens the contents when tapped */
#bar .cloud.sym { width: 30px; height: 30px; margin-inline-start: 2px; }
#bar .cloud.sym.hop .cloud-body { animation: hero-bounce 420ms ease-in-out; }

/* the imprint on the back cover */
.page.cover-back .col { font-size: .82em; color: var(--ink-muted); line-height: 1.6; }
.page.cover-back .page-body { justify-content: flex-start; }
.page.cover-back .cb { height: 100%; }

/* short screens (a phone on its side): the cover keeps its order, just smaller */
@media (max-height: 520px) {
  .cover-board { padding-bottom: 20px; }
  .cover-lang { bottom: 20px; }
  .cover-sub { padding-top: .5em; }
}

/* ===================== access code sheet ===================== */
#code { position: fixed; inset: 0; z-index: 4000; display: grid; place-items: center; padding: 16px; background: rgb(var(--shade) / .4); backdrop-filter: blur(4px); }
.code-panel { position: relative; width: min(420px, 100%); background: var(--paper); color: var(--ink); border: 1px solid var(--rule); border-radius: 18px;
  padding: 26px 22px 22px; box-shadow: 0 30px 80px rgb(var(--shade) / calc(var(--shade-a) * 1.3)); text-align: start; }
.code-panel h2 { font-family: var(--f-head); font-weight: 600; font-size: 1.25em; margin: 0 0 .3em; }
html[lang="he"] .code-panel h2 { font-weight: 400; }
.code-hint { margin: 0 0 1em; color: var(--ink-soft); font-size: .92em; }
.code-panel input { width: 100%; font: 600 17px/1.2 var(--f-num); letter-spacing: .06em; text-align: center; text-transform: uppercase; color: var(--ink);
  background: rgb(var(--t-bg)); border: 1px solid var(--rule-strong); border-radius: 12px; padding: 14px 12px; }
.code-panel input:focus { outline: 2px solid var(--rose); outline-offset: 2px; }
.code-err { min-height: 1.3em; margin: .6em 0; font-size: .88em; color: var(--danger); }
.code-go { width: 100%; min-height: 48px; border: 0; border-radius: 999px; font: 500 1em var(--f-label); color: #fff; background: var(--rose-fill); cursor: pointer; }
.code-go[disabled] { opacity: .6; cursor: progress; }
.code-close { position: absolute; top: 10px; inset-inline-end: 10px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: none; color: var(--ink-muted); font-size: 22px; cursor: pointer; }

/* ===================== the end of the sample ===================== */
.sale-gates { list-style: none; padding: 0; margin: .4em 0 1.2em; }
.sale-gates li { display: flex; gap: 12px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--rule); break-inside: avoid; }
.sale-gates .n { color: var(--rose); min-width: 1.6em; font-size: .85em; }
.sale-gates .s { color: var(--ink-muted); font-size: .88em; }
.sale-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 1.2em 0 .6em; break-inside: avoid; }
.btn-buy, .btn-code { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 22px; border-radius: 999px; font: 500 .95em var(--f-label); text-decoration: none; cursor: pointer; }
.btn-buy { background: var(--rose-fill); color: #fff; border: 0; }
.btn-buy.off { background: rgb(var(--t-text) / .08); color: var(--ink-muted); cursor: default; }
.btn-code { background: none; color: var(--ink); border: 1px solid var(--rule-strong); }
.sale-note { font-size: .85em; color: var(--ink-muted); }

/* narrow covers (phones): the buttons sit in their own row above the publisher's mark, never on top of it */
@container (max-width: 540px) {
  .cover-lang { bottom: 104px; inset-inline-end: 9%; }
  .cover-board { padding-bottom: 36px; }
}

/* the cover's way to buy: the first and only filled button among the cover's choices */
.cover-lang a.buy { display: inline-flex; align-items: center; font-family: var(--f-label); font-weight: 500; font-size: 13px; letter-spacing: .02em;
  color: #fff; background: var(--rose-fill); border: 1px solid var(--rose-fill); border-radius: 3px; padding: 9px 18px; text-decoration: none; cursor: pointer; }
.cover-lang a.buy:hover { background: #e50076; border-color: #e50076; }
