/* Palette and type. */

@font-face {
  font-family: 'Afta Sans';
  src: url('/fonts/AftaSansThin-Regular.otf') format('opentype');
  font-weight: 300;
  font-display: swap;
}
@font-face {
  font-family: 'Trampolina';
  src: url('/fonts/FbTrampolina-Regular.otf') format('opentype');
  font-weight: 400;
  font-display: swap;
}

:root {
  --topbar: #eae3d9;
  --nav: #c1b2af;
  --cream: #f3f0e7;
  --sand: #dad4c4;
  --ink: #2b2724;
  --ink-soft: #6b625d;
  --ink-faint: #8d827c;
  --btn: #3c3c3a;
  --line: rgba(43, 39, 36, 0.14);
  --white: #fffdfa;
  --danger: #9c4f43;
  --ok: #4f7355;
  --warn: #a8792f;

  --shell: 1180px;
  --gutter: 20px;
  --radius: 10px;

  --sans: 'Assistant', 'Heebo', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --display: 'Afta Sans', 'Trampolina', var(--sans);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
}

/* `height: auto` is essential: the width/height attributes on an <img> are
   applied as presentational hints, so overriding only the width stretches the
   image vertically. */
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

.shell {
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------------------------------------------------------------- header */

.topbar {
  background: linear-gradient(105deg, #efe9e0 0%, #e7ded6 45%, #d9c9c6 100%);
  text-align: center;
  padding: 26px 16px 22px;
}
.topbar a {
  display: inline-flex;
  align-items: center;
  gap: clamp(10px, 1.6vw, 20px);
  max-width: 100%;
  font-family: var(--display);
  font-size: clamp(17px, 4.6vw, 40px);
  letter-spacing: clamp(0.08em, 1.1vw, 0.2em);
  text-decoration: none;
  color: var(--ink);
  font-weight: 300;
  white-space: nowrap;
}

.topbar-logo {
  width: clamp(34px, 6vw, 56px);
  height: auto;
  border-radius: 8px;
  flex: none;
}
/* The wordmark alone already fills a phone's width; the mark goes above it. */
@media (max-width: 600px) {
  .topbar a { flex-direction: column; gap: 8px; }
  .topbar-logo { width: 38px; }
}

.nav {
  background: var(--nav);
  position: sticky;
  top: 0;
  z-index: 40;
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 9px var(--gutter);
}
.nav a {
  text-decoration: none;
  color: var(--ink);
  padding: 7px 13px;
  font-size: 15px;
  border-radius: 3px;
  transition: background 0.18s, color 0.18s;
  white-space: nowrap;
}
.nav a:hover { background: rgba(43, 39, 36, 0.1); }
/*
 * "You are here" and "sign in" used to be the same dark pill, so the login
 * button read as just another tab. Only the account action is a solid button
 * now; the current page is marked but not dressed as something to press.
 */
.nav a[aria-current='page'] {
  background: rgba(43, 39, 36, 0.12);
  color: var(--ink);
  font-weight: 600;
}
.nav a.is-cta { background: var(--btn); color: #fff; }
.nav a.is-muted { color: rgba(43, 39, 36, 0.62); font-family: var(--display); letter-spacing: 0.12em; }
.nav a.is-muted:hover { background: none; cursor: default; }

/* Nav collapses into a disclosure on phones so it never wraps to 3 rows. */
.nav-toggle {
  display: none;
  background: none;
  border: 0;
  font: inherit;
  color: var(--ink);
  padding: 10px var(--gutter);
  width: 100%;
  text-align: start;
  cursor: pointer;
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; align-items: center; gap: 10px; }
  .nav-inner {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding-bottom: 14px;
  }
  .nav.is-open .nav-inner { display: flex; }
  .nav a { padding: 11px 13px; }

  /*
   * In the stacked menu the account action sits at the end of a list of pages,
   * so it needs a rule to say it is not one of them.
   */
  .nav-inner a.is-cta {
    position: relative;
    margin-top: 13px;
  }
  .nav-inner a.is-cta::before {
    content: '';
    position: absolute;
    inset-inline: 0;
    top: -7px;
    height: 1px;
    background: rgba(43, 39, 36, 0.25);
  }
}

/* ------------------------------------------------------------ book rows */

.book-row {
  padding: clamp(40px, 7vw, 86px) 0;
  background-color: var(--cream);
}
.book-row.is-sand { background-color: var(--sand); }

.book-row-inner {
  display: grid;
  /*
   * The pages are the reason anyone is on this page, so they get the larger
   * share of it. The copy column has a max-width of its own and was not using
   * the full half anyway - this hands the slack to the artwork rather than to
   * the gap.
   */
  grid-template-columns: 1.35fr 1fr;
  gap: clamp(20px, 4vw, 56px);
  align-items: center;
}

.book-copy {
  max-width: 460px;
  /* The copy column sits on the left in the mockup; push it there. */
  margin-inline-start: auto;
}

.book-title {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(34px, 6.4vw, 62px);
  line-height: 1.16;
  letter-spacing: 0.07em;
  margin: 0 0 18px;
  text-transform: uppercase;
  /* Latin title, set flush left like the mockup. */
  direction: ltr;
  text-align: left;
}

.book-desc {
  color: var(--ink-soft);
  margin: 0 0 22px;
  font-size: clamp(14px, 1.6vw, 16px);
}

.book-art { position: relative; }
.book-art img {
  width: 100%;
  height: auto;
  filter: drop-shadow(18px 22px 34px rgba(43, 39, 36, 0.26));
}

/*
 * The page mockup arrives as a <picture> and already has its shadow baked into
 * the alpha channel, so it must not take the cover's drop-shadow on top - two
 * shadows at different angles read as a mistake.
 */
/*
 * Uploaded previews can be any shape, so the box is reserved and the image is
 * contained inside it. Without a fixed ratio the hero would jump as each new
 * upload's own proportions arrive, and intrinsic width/height cannot be used
 * here - the file comes from the admin panel, not the bundle.
 */
.book-art picture img {
  filter: none;
  /*
   * 11 / 8, not 4 / 3: the uploaded preview is 890x648 and the squarer box was
   * letterboxing it, so the artwork was rendering smaller than the space it had.
   * A ratio is still pinned rather than left to the file, because this image
   * comes from the admin panel and the hero must not resize as it changes.
   */
  aspect-ratio: 11 / 8;
  object-fit: contain;
}

/* Stands in for a book whose cover art does not exist yet. Deliberately not
   another book's cover, which would read as the same product. The spine and
   page edge keep it reading as a book next to the real 3-D mockup. */
.book-placeholder {
  position: relative;
  aspect-ratio: 3 / 4;
  max-width: 76%;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 10% 12%;
  background: linear-gradient(150deg, #4a4643 0%, #35312e 55%, #2b2724 100%);
  color: #ded6cd;
  border-radius: 2px 5px 5px 2px;
  box-shadow: 16px 20px 32px rgba(43, 39, 36, 0.3);
}
/* The page block along the spine edge. */
.book-placeholder::before {
  content: '';
  position: absolute;
  inset-block: 6px;
  inset-inline-start: -7px;
  width: 7px;
  border-radius: 2px 0 0 2px;
  background: linear-gradient(90deg, #cfc7bd, #efe9e0 45%, #b9b0a6);
}
.book-placeholder-title {
  font-family: var(--display);
  font-size: clamp(20px, 3.4vw, 34px);
  letter-spacing: 0.12em;
  line-height: 1.35;
  text-transform: uppercase;
}
.book-placeholder-note {
  font-size: 13px;
  letter-spacing: 0.06em;
  color: rgba(222, 214, 205, 0.6);
}

.book-badge {
  display: inline-block;
  background: rgba(43, 39, 36, 0.08);
  border: 1px solid var(--line);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 14px;
}
.book-badge.is-owned { background: var(--ok); color: #fff; border-color: transparent; }

@media (max-width: 860px) {
  .book-row-inner { grid-template-columns: 1fr; }
  .book-copy { max-width: none; margin-inline-start: 0; text-align: center; }
  .book-art { max-width: 460px; margin-inline: auto; }
  .book-title { text-align: center; }
}

/* -------------------------------------------------------------- buttons */

.btn {
  display: inline-block;
  background: var(--btn);
  color: #fff;
  text-decoration: none;
  border: 0;
  padding: 13px 30px;
  font: inherit;
  font-size: 15px;
  border-radius: 2px;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s;
}
.btn:hover { opacity: 0.88; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn-ghost {
  background: none;
  color: var(--ink);
  border: 1px solid var(--ink);
}
.btn-block { display: block; width: 100%; text-align: center; }
.btn-sm { padding: 8px 16px; font-size: 14px; }

/* ---------------------------------------------------------------- cards */

.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(20px, 3vw, 30px);
}

.page-head {
  /*
   * padding-block, never the shorthand: .page-head is always used together with
   * .shell and is declared after it, so `padding: X 0 Y` silently reset the
   * side gutter to zero and every page heading sat flush against the screen
   * edge on phones.
   */
  padding-block: clamp(28px, 5vw, 52px) clamp(18px, 3vw, 28px);
}
.page-head h1 {
  font-family: var(--display);
  font-weight: 300;
  letter-spacing: 0.09em;
  font-size: clamp(28px, 5vw, 46px);
  margin: 0 0 8px;
  text-transform: uppercase;
}
.page-head p { margin: 0; color: var(--ink-soft); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
  gap: 18px;
}

/* Account and dashboard read better on a narrower measure than the 1180px
   marketing shell, and a lone book card does not get stranded on a wide row. */
.shell-narrow { max-width: 900px; }
.shell-narrow .grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
}

.stat {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.stat b { display: block; font-size: 26px; font-weight: 600; line-height: 1.3; }
.stat span { color: var(--ink-faint); font-size: 13px; }

/* ------------------------------------------------- marketing book page

   Deliberately NOT .stat/.panel. Those are dashboard furniture and earn their
   borders in /admin, where a card really is a discrete record. On the sales
   page the same chrome turned every block into an identical white rectangle,
   so the page read as a form rather than as a book. Here the structure is
   carried by type, rule and space instead: nothing is boxed.
*/

.eyebrow {
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 10px;
}

/* Four figures set as newspaper columns. The hairlines sit *between* the
   columns, never around them, and are re-cut at each breakpoint so a wrapped
   row never leaves a rule dangling at its start edge. */
.facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  padding-top: clamp(26px, 3.4vw, 40px);
}
.fact { padding-inline: clamp(14px, 2.2vw, 30px); }
.fact + .fact { border-inline-start: 1px solid var(--line); }
.fact:first-child { padding-inline-start: 0; }
.fact:last-child { padding-inline-end: 0; }

.fact b {
  display: block;
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(40px, 5.4vw, 60px);
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--ink);
  /* Afta Sans carries the digits; Hebrew has no glyphs there and falls through
     to Trampolina, which is why the label below looks different on purpose. */
  font-variant-numeric: lining-nums;
}
.fact strong {
  display: block;
  margin-top: 14px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}
.fact span {
  display: block;
  margin-top: 5px;
  color: var(--ink-faint);
  font-size: 13px;
  line-height: 1.55;
}

@media (max-width: 860px) {
  .facts { grid-template-columns: repeat(2, 1fr); row-gap: clamp(24px, 5vw, 34px); }
  .fact { padding-inline: clamp(14px, 3vw, 24px); }
  .fact:nth-child(odd) { border-inline-start: 0; padding-inline-start: 0; }
  .fact:nth-child(even) { padding-inline-end: 0; }
}
@media (max-width: 430px) {
  .facts { grid-template-columns: 1fr; row-gap: 26px; }
  .fact,
  .fact:nth-child(even) { border-inline-start: 0; padding-inline: 0; }
  .fact b { font-size: 38px; }
}

/* A contents list, because the product is a book. The heading holds its own
   column so the list is not competing with it for the reader's first look. */
.contents {
  display: grid;
  grid-template-columns: minmax(180px, 0.42fr) 1fr;
  gap: clamp(18px, 4vw, 56px);
  margin-top: clamp(48px, 7vw, 86px);
}
.contents h2 {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(26px, 3.4vw, 38px);
  letter-spacing: 0.06em;
  line-height: 1.2;
  margin: 0;
}
.contents-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.contents-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(14px, 2.4vw, 26px);
  align-items: baseline;
  padding: clamp(14px, 2vw, 19px) 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  line-height: 1.65;
}
.contents-list .n {
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
  /* Keeps 01-05 in one rhythm regardless of glyph widths. */
  font-variant-numeric: tabular-nums lining-nums;
}

@media (max-width: 700px) {
  .contents { grid-template-columns: 1fr; gap: 18px; }
}

/* Fine print is fine print. It had the same border and background as the
   contents above it, which gave a legal note the weight of a selling point. */
.fineprint {
  margin-top: clamp(26px, 3.6vw, 38px);
  padding-inline-start: 16px;
  border-inline-start: 2px solid var(--line);
  color: var(--ink-faint);
  font-size: 13.5px;
  line-height: 1.7;
  max-width: 70ch;
}
.fineprint strong { color: var(--ink-soft); font-weight: 600; }

/* Running prose. Body copy does not need a card around it - the measure and the
   leading do the containing. (The contact form keeps its .panel: grouping a set
   of inputs is what a panel is actually for.) */
.prose {
  max-width: 64ch;
  color: var(--ink-soft);
  font-size: clamp(15px, 1.7vw, 17px);
  line-height: 1.85;
}
.prose p { margin: 0 0 1.15em; }
.prose p:last-child { margin-bottom: 0; }
.prose .lede {
  color: var(--ink);
  font-size: clamp(17px, 2.1vw, 20px);
  line-height: 1.7;
}

/*
 * A single line that carries the turn of the story, set apart from the running
 * paragraphs on either side of it rather than buried between them.
 */
.prose-beat {
  margin: clamp(26px, 4vw, 38px) 0;
  font-family: var(--display);
  font-size: clamp(19px, 2.6vw, 27px);
  line-height: 1.45;
  letter-spacing: 0.04em;
  color: var(--ink);
}

/* Available to a screen reader and to a crawler, absent for a sighted visitor.
   The home page is a stack of book rows and so had no h1 of its own. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/*
 * The paper ground from the client's mockup. It is a near-flat cream with a
 * faint grain, so it is fixed and covered rather than tiled - a repeat would
 * make the seams visible on a long page. The cream token stays underneath as
 * the fallback, so nothing flashes white while the image loads or if it fails.
 */
body.has-paper {
  background-color: var(--cream);
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* iOS ignores background-attachment: fixed and blows the image up instead. */
@media (hover: none) {
  body.has-paper { background-attachment: scroll; }
}

/*
 * Listening platforms. Rules and space, like the rest of the site - the icons
 * carry the recognition, so the rows do not need boxes too. Marks are set in
 * currentColor rather than each brand's own colour: three saturated logos would
 * be the loudest thing on a cream page, and they still read instantly.
 */
.platforms {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 520px;
  border-top: 1px solid var(--line);
}
.platforms li { border-bottom: 1px solid var(--line); }

.platforms a {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: center;
  gap: clamp(14px, 2.5vw, 20px);
  padding: clamp(15px, 2.2vw, 20px) 4px;
  text-decoration: none;
  color: var(--ink);
  transition: color 0.18s, padding-inline-start 0.18s;
}
.platforms a:hover,
.platforms a:focus-visible { color: var(--ink-soft); }

.platform-icon {
  width: 26px;
  height: 26px;
  display: block;
}

.platform-name {
  font-size: clamp(16px, 2vw, 18px);
  /* Latin names inside an RTL row. */
  unicode-bidi: isolate;
}

/* Points the way the language runs, and nudges on hover. */
.platform-go {
  color: var(--ink-faint);
  font-size: 18px;
  transition: transform 0.18s var(--ease-out, ease);
}
.platforms a:hover .platform-go,
.platforms a:focus-visible .platform-go { transform: translateX(-4px); }

/*
 * Video preview dialog in the admin panel. The reader's own .video-modal lives
 * in reader.css, which admin pages do not load, so these styles cannot simply
 * be reused - and they are namespaced rather than duplicated under the same
 * name so the two can never collide on a page that loads both.
 */
.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(20, 18, 16, 0.78);
}
.admin-modal[hidden] { display: none; }

/*
 * Width is derived from the height cap, not guessed. The clips are portrait, so
 * on any normal screen it is the height that runs out first - a fixed 460px
 * box left the video floating in the middle of it with dark margins either side
 * and a header twice its width. 9/16 of the tallest we allow is exactly as wide
 * as the video will actually be.
 */
.admin-modal-inner {
  width: min(420px, 92vw, calc(72dvh * 9 / 16));
  background: #35302c;
  color: #f3f0e7;
  border-radius: 12px;
  overflow: hidden;
}
.admin-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 6px 11px 14px;
  font-size: 14.5px;
  font-weight: 600;
  /* Latin clip names inside an RTL panel. */
  unicode-bidi: isolate;
}
.admin-modal-head button {
  background: none;
  border: 0;
  color: #cfc7c0;
  font: inherit;
  line-height: 1;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background 0.16s, color 0.16s;
}
.admin-modal-head button:hover,
.admin-modal-head button:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.admin-modal .video-frame {
  position: relative;
  /* The demo clips are portrait phone video. The container is already sized
     from this ratio, so the frame simply fills it. */
  aspect-ratio: 9 / 16;
  background: #000;
}
.admin-modal .video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.admin-modal .video-message {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  padding: 20px;
  color: #ded6cd;
  font-size: 14px;
}

/* Play button in the admin video list. */
.video-play {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-inline-start: 8px;
  vertical-align: middle;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  padding: 0;
  transition: background 0.16s, border-color 0.16s, transform 0.16s;
}
.video-play:hover,
.video-play:focus-visible {
  background: var(--btn);
  border-color: var(--btn);
  color: #fff;
  transform: scale(1.06);
}
.video-play svg {
  width: 13px;
  height: 13px;
  /* The triangle points the way the video plays, not the way Hebrew reads. */
  margin-inline-start: 1px;
}

/* ------------------------------------------------- admin: book cards */

/*
 * One collapsible card per book. <details>/<summary> rather than scripted
 * panels: it opens with a click or the keyboard, survives with JS off, and the
 * browser handles the state.
 */
.book-card { padding: 0; }
.book-card + .book-card { margin-top: 0; }

.book-card-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: clamp(14px, 2vw, 18px) clamp(16px, 2.4vw, 24px);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
/* Safari draws its own triangle without this. */
.book-card-summary::-webkit-details-marker { display: none; }
.book-card-summary:hover { background: rgba(43, 39, 36, 0.035); }

.book-card-summary strong { font-size: 16px; }
.book-card-summary .muted { font-size: 13px; }

.book-card-chev {
  color: var(--ink-faint);
  font-size: 12px;
  transition: transform 0.2s var(--ease-out, ease);
}
.book-card[open] .book-card-chev { transform: rotate(180deg); }

/* Pushed to the far end so the titles stay aligned down the list. */
.book-card-meta {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* The body only exists when the card is open, so it carries its own padding. */
.book-card > form,
.book-card > hr {
  margin-inline: clamp(16px, 2.4vw, 24px);
}
.book-card > form:last-of-type { margin-bottom: clamp(16px, 2.4vw, 24px); }

/* ------------------------------------------------- admin: book upload */

.book-upload { display: grid; gap: 12px; }

.book-upload-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 15px;
}
.book-upload-note { margin: 0; font-size: 13px; max-width: 62ch; }

/*
 * The native file input is unstyleable and renders its own English
 * "Choose File" button, which sat left-aligned in an otherwise RTL panel. It is
 * hidden inside this label instead: clicking anywhere here opens the picker,
 * and the same element doubles as the drop target.
 */
.dropzone {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: clamp(20px, 3vw, 30px) 20px;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  background: #faf8f4;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
}
.dropzone:hover,
.dropzone:focus-within { border-color: var(--ink-faint); background: #f6f3ed; }
/* While a file is being dragged over it. */
.dropzone.is-over { border-color: var(--ink); background: #f1ece3; }

.dropzone svg { width: 26px; height: 26px; color: var(--ink-faint); }
.dropzone-main { font-size: 14px; color: var(--ink-soft); }

.dropzone-file {
  font-size: 13px;
  color: var(--ink);
  font-weight: 600;
  /* Filename then size, read left to right, with the name itself isolated
     in a <bdi> so a Hebrew name keeps its own direction inside the line. */
  direction: ltr;
  unicode-bidi: isolate;
}
.dropzone-file:empty { display: none; }

/*
 * Named for the book uploader specifically. `.upload-progress` and `#uploadBar`
 * already belong to the video uploader further down this file, and because its
 * rules come later they silently won - the bar rendered as a flex row with the
 * status beside it instead of a bar with the status underneath.
 */
.book-upload-progress { display: grid; gap: 8px; }
/*
 * width:100% is load-bearing. The track's only child starts at width:0, so an
 * auto-sized grid column collapses to nothing and the bar stays invisible for
 * the whole upload - which is exactly when it is needed.
 */
.book-upload-track {
  width: 100%;
  height: 5px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
}
.book-upload-track > div {
  height: 100%;
  width: 0;
  background: var(--btn);
  transition: width 0.25s ease;
}
.book-upload-status {
  font-size: 13px;
  color: var(--ink-soft);
  min-height: 1.3em;
  unicode-bidi: plaintext;
}

/* Contact details, set as rules rather than another boxed panel. */
.contact-lines {
  margin: 0 0 clamp(28px, 4vw, 40px);
  padding: 0;
  border-top: 1px solid var(--line);
  max-width: 560px;
}
.contact-lines > div {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: clamp(10px, 2vw, 20px);
  align-items: baseline;
  padding: clamp(13px, 1.8vw, 17px) 0;
  border-bottom: 1px solid var(--line);
}
.contact-lines dt {
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.contact-lines dd {
  margin: 0;
  font-size: 16px;
  /*
   * `isolate`, not `plaintext`. plaintext takes the direction from the first
   * strong character, and a phone number has none - so "050-000-0000" resolved
   * as LTR and sat against the opposite edge from every other value. isolate
   * keeps the run from reordering while still inheriting the page's RTL, so the
   * value lines up with its label.
   */
  unicode-bidi: isolate;
}
.contact-lines dd span {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  color: var(--ink-faint);
}
@media (max-width: 460px) {
  .contact-lines > div { grid-template-columns: 1fr; gap: 4px; }
}

.quiet-note {
  max-width: 44ch;
  margin-inline: auto;
  text-align: center;
  color: var(--ink-faint);
  line-height: 1.8;
}

/* --------------------------------------------------------------- forms */

label { display: block; font-size: 14px; color: var(--ink-soft); margin-bottom: 6px; }

input[type='text'],
input[type='email'],
input[type='tel'],
input[type='number'],
input[type='password'],
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  font: inherit;
  color: var(--ink);
}
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
.btn:focus-visible,
a:focus-visible {
  outline: 2px solid var(--btn);
  outline-offset: 2px;
}

.field { margin-bottom: 16px; }

.code-input {
  letter-spacing: 0.6em;
  text-align: center;
  font-size: 26px;
  padding-inline-start: 0.6em; /* balance the trailing letter-spacing */
}

.note {
  padding: 12px 15px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 18px;
  border: 1px solid transparent;
}
.note-error { background: #f7e9e6; color: var(--danger); border-color: #e5cdc7; }
.note-ok { background: #e8f0e9; color: var(--ok); border-color: #cfe0d2; }
.note-info { background: #f0ece3; color: var(--ink-soft); border-color: var(--line); }
.note-warn { background: #f7efdf; color: var(--warn); border-color: #ecdcbd; }

/* --------------------------------------------------------------- tables */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: start; padding: 11px 12px; border-bottom: 1px solid var(--line); }
th { color: var(--ink-faint); font-weight: 600; white-space: nowrap; }
tbody tr:hover { background: rgba(43, 39, 36, 0.03); }

.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  white-space: nowrap;
}
.pill-ok { background: #e8f0e9; color: var(--ok); }
.pill-warn { background: #f7efdf; color: var(--warn); }
.pill-crit { background: #f7e9e6; color: var(--danger); }
.pill-muted { background: rgba(43, 39, 36, 0.07); color: var(--ink-soft); }

/* -------------------------------------------------------------- footer */

.footer {
  background: var(--btn);
  color: #cfc7c0;
  padding: 34px var(--gutter);
  text-align: center;
  font-size: 13px;
  margin-top: 60px;
}
.footer a { color: #fff; }
.footer .strap { letter-spacing: 0.2em; margin-bottom: 8px; font-family: var(--display); }

/*
 * Build credit. Sits below a hairline and reads quieter than the site's own
 * details - it belongs to us, not to the client's brand. The logo is already
 * white on transparent, so it needs no treatment on this background.
 */
.built-by {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  text-decoration: none;
  opacity: 0.6;
  transition: opacity 0.2s;
  /*
   * RTL, so the Hebrew label leads on the right and the logo follows to its
   * left - the order the line is actually read in.
   */
  direction: rtl;
}
.built-by:hover,
.built-by:focus-visible { opacity: 1; }
.built-by span {
  font-size: 11px;
  letter-spacing: 0.02em;
  color: #cfc7c0;
}
.built-by img {
  width: 96px;
  height: auto;
  display: block;
}

.stack > * + * { margin-top: 16px; }
.muted { color: var(--ink-faint); }
.center { text-align: center; }
.narrow { max-width: 440px; margin-inline: auto; }

/* Email / phone on the login page: two words on a rule, the chosen one underlined. */
.login-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--line);
  margin: -4px 0 22px;
}
.login-tabs a {
  padding: 10px 0 12px;
  text-align: center;
  font-size: 15px;
  letter-spacing: .04em;
  color: var(--ink-faint);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.login-tabs a:hover { color: var(--ink-soft); }
.login-tabs a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--ink);
}
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }

@media print {
  /* The reader is not a printable document. */
  body { display: none !important; }
}

/* ------------------------------------------------------------- checkout */

.checkout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: clamp(20px, 3vw, 40px);
  align-items: start;
  padding-bottom: 70px;
}

.checkout-form {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(20px, 3vw, 32px);
}

.checkout-login-hint {
  font-size: 14px;
  margin: 0 0 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.form-section {
  border: 0;
  padding: 0;
  margin: 0 0 26px;
}
.form-section legend {
  font-family: var(--display);
  letter-spacing: 0.08em;
  font-size: 15px;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 0 0 12px;
  margin-bottom: 4px;
  width: 100%;
  border-bottom: 1px solid var(--line);
}

/* Country code and number, left to right like the number itself. */
.phone-input {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 9.5em) minmax(0, 1fr);
  gap: 8px;
}
.phone-input select { direction: ltr; }
.phone-input input { direction: ltr; text-align: left; }

/* phone-picker.js: the select stays in the form but out of sight. */
.phone-input[data-enhanced] { grid-template-columns: auto minmax(0, 1fr); }
.phone-input .pp-native {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.pp-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  min-height: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.pp-button::after {
  content: '';
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--ink-faint);
  border-bottom: 1.5px solid var(--ink-faint);
  transform: translateY(-2px) rotate(45deg);
  margin-left: 2px;
}
.pp-flag { font-size: 1.25em; line-height: 1; }
.pp-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  background: var(--paper, #fffdfa);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(43, 39, 36, 0.12);
  padding: 8px;
}
.pp-search { width: 100%; margin-bottom: 6px; }
.pp-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 260px;
  overflow-y: auto;
}
.pp-option {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.pp-option.is-active { background: rgba(43, 39, 36, 0.06); }
.pp-option[aria-selected="true"] .pp-name { font-weight: 600; }
.pp-dial { color: var(--ink-faint); font-size: 14px; }
.pp-empty { padding: 12px 10px; color: var(--ink-faint); text-align: center; }

/* City and postcode share a row on anything wider than a small phone. */
.field-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 14px;
}

.field-hint,
.field-error {
  display: block;
  font-size: 12.5px;
  margin-top: 5px;
  line-height: 1.5;
}
.field-hint { color: var(--ink-faint); }
.field-error { color: var(--danger); }

.field.has-error input,
.field.has-error select {
  border-color: var(--danger);
  background: #fdf7f6;
}

label.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 14px;
  cursor: pointer;
}
label.check input {
  width: auto;
  margin-top: 4px;
  flex: none;
  accent-color: var(--btn);
}
label.check.has-error span { color: var(--danger); }

.invoice-fields {
  margin-top: 14px;
  padding-inline-start: 26px;
  border-inline-start: 2px solid var(--line);
}

.checkout-submit { margin-top: 22px; font-size: 16px; padding: 15px 30px; }
.checkout-secure { font-size: 12.5px; margin: 12px 0 0; }

/* --------------------------------------------------------- order summary */

.checkout-summary-inner {
  background: var(--sand);
  border-radius: var(--radius);
  padding: 22px;
  position: sticky;
  top: 76px;
}
.checkout-summary h2 {
  margin: 0 0 16px;
  font-family: var(--display);
  letter-spacing: 0.08em;
  font-size: 17px;
  text-transform: uppercase;
}
.checkout-item {
  display: flex;
  gap: 14px;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(43, 39, 36, 0.16);
}
.checkout-item img {
  width: 62px;
  flex: none;
  filter: drop-shadow(4px 6px 10px rgba(43, 39, 36, 0.28));
}
.checkout-item strong { display: block; font-size: 15px; }
.checkout-item .muted { font-size: 12.5px; }

.checkout-lines { margin: 16px 0; font-size: 14px; }
.checkout-lines div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
}
.checkout-lines dt { color: var(--ink-soft); margin: 0; }
.checkout-lines dd { margin: 0; }
.checkout-lines .is-total {
  border-top: 1px solid rgba(43, 39, 36, 0.16);
  margin-top: 8px;
  padding-top: 12px;
  font-size: 17px;
  font-weight: 600;
}

.checkout-perks {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 13px;
  color: var(--ink-soft);
}
.checkout-perks li {
  padding-inline-start: 20px;
  position: relative;
  margin-bottom: 7px;
}
.checkout-perks li::before {
  content: '✓';
  position: absolute;
  inset-inline-start: 0;
  color: var(--ok);
  font-weight: 700;
}

.success-mark {
  width: 58px;
  height: 58px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--ok);
  color: #fff;
  font-size: 30px;
  line-height: 58px;
  text-align: center;
}

.spinner {
  width: 34px;
  height: 34px;
  margin: 0 auto 18px;
  border: 3px solid var(--line);
  border-top-color: var(--btn);
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2.4s; }
}

@media (max-width: 880px) {
  .checkout { grid-template-columns: 1fr; }
  /* The summary leads on a phone, so the price is seen before the form. */
  .checkout-summary { order: -1; }
  .checkout-summary-inner { position: static; }
}

@media (max-width: 480px) {
  .field-row { grid-template-columns: 1fr; }
}

.cta-pair {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
@media (max-width: 860px) {
  .cta-pair { justify-content: center; }
}

.form-consents {
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-top: 26px;
}

/* -------------------------------------------------------- video uploader */

.video-upload {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(20, 18, 16, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.video-upload[hidden] { display: none; }

.video-upload-inner {
  background: var(--white);
  border-radius: var(--radius);
  padding: clamp(20px, 3vw, 28px);
  width: 100%;
  max-width: 460px;
  max-height: 90dvh;
  overflow-y: auto;
}
.video-upload-inner h2 {
  margin: 0 0 18px;
  font-size: 18px;
  font-family: var(--display);
  letter-spacing: 0.06em;
}
.video-upload-inner input[type='file'] {
  width: 100%;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: var(--cream);
  font: inherit;
}

.upload-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}
.upload-bar {
  flex: 1;
  height: 7px;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden;
}
.upload-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--ok);
  border-radius: 99px;
  transition: width 200ms linear;
}
.upload-progress .muted {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  min-width: 40px;
}

/* --------------------------------------------------------- legal documents */

/*
 * The terms run to several thousand words. Set as a document - one measure,
 * clear section breaks, numbers that stay attached to their clause - rather
 * than inside a panel, which at this length reads as a widget and not as
 * something to be read.
 */
.legal-doc {
  /*
   * A px measure, not `ch`: the ch unit is the width of "0", which in a Hebrew
   * face is far narrower than the letters actually set in it - 68ch came out at
   * barely 500px and a third of the line length the text wants. The column is
   * aligned to the start of the shell so it sits under the heading rather than
   * floating in the middle of it.
   */
  max-width: 760px;
  margin-inline-end: auto;
  padding-bottom: 72px;
  color: var(--ink);
  font-size: 15.5px;
  line-height: 1.85;
}

.legal-updated {
  color: var(--ink-soft);
  font-size: 14px;
  letter-spacing: 0.04em;
}

.legal-doc .legal-lede {
  margin: 0 0 34px;
  padding-inline-start: 14px;
  border-inline-start: 2px solid var(--line);
  color: var(--ink-soft);
}

.legal-doc section + section {
  margin-top: 38px;
  padding-top: 34px;
  border-top: 1px solid var(--line);
}

.legal-doc h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(18px, 2.4vw, 22px);
  letter-spacing: 0.05em;
  margin: 0 0 16px;
}

/*
 * Clause numbers are part of the text ("4.3. ..."), so the hanging indent has
 * to come from the paragraph rather than from a list marker. text-indent with a
 * matching negative start keeps the number in the margin and the wrapped lines
 * aligned under the first word.
 */
.legal-doc p {
  margin: 0 0 13px;
  padding-inline-start: 2.6em;
  text-indent: -2.6em;
}

.legal-doc .legal-lede,
.legal-doc .legal-note {
  text-indent: 0;
  padding-inline-start: 0;
}
.legal-doc .legal-lede { padding-inline-start: 14px; }

.legal-contact {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  color: var(--ink-soft);
}
.legal-contact li + li { margin-top: 6px; }

@media (max-width: 560px) {
  .legal-doc { font-size: 15px; line-height: 1.8; }
  .legal-doc p { padding-inline-start: 2.2em; text-indent: -2.2em; }
}

/*
 * A form that stands on the page without a card around it. Aligned to the start
 * of the shell so it sits under its own heading; .narrow centres, which leaves
 * the heading on one side of the page and the fields on the other.
 */
.form-column {
  max-width: 480px;
  margin-inline-end: auto;
}

/* ------------------------------------------------------------- coupon box */

.coupon-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

/*
 * The code is Latin in an RTL form, so the input is dir="ltr" and its
 * placeholder has to be pushed back to the right to read as Hebrew.
 */
.coupon-row input {
  flex: 1;
  min-width: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.coupon-row input::placeholder {
  direction: rtl;
  text-align: right;
  text-transform: none;
  letter-spacing: normal;
}
.coupon-row .btn { flex: 0 0 auto; white-space: nowrap; }

.coupon-msg { margin: 9px 0 0; font-size: 13.5px; }
.coupon-ok { color: #3f6b4f; }
.coupon-bad { color: var(--danger, #9d3b34); }

/* The one credit on an otherwise debit list; it reads as a mistake in the
 * same colour as the rest. */
.checkout-lines .is-discount dd { color: #3f6b4f; }
.checkout-lines .is-discount dt { color: var(--ink-soft); }

/* ------------------------------------------- book page: bands and spacing */

/*
 * The book page is a stack of alternating bands, so vertical rhythm is set on
 * each band rather than on one wrapper. The numbers and the contents list used
 * to share a single padded box; splitting them let the spread sit full-width
 * between the two, and let the gap under the list close up.
 */
.facts-band { padding-block: clamp(44px, 7vw, 86px) clamp(36px, 5vw, 60px); }

.spread-band { padding-block: clamp(34px, 5vw, 64px); }

.spread-inner {
  display: grid;
  justify-items: center;
  gap: clamp(22px, 3.5vw, 34px);
  text-align: center;
}

/*
 * The artwork carries its own shadow in the alpha channel, so it takes none
 * here. Capped rather than full-bleed: past about 760px the three pages start
 * to read as wallpaper instead of as a book.
 */
.spread-inner picture { display: block; width: 100%; max-width: 760px; }
.spread-inner img { width: 100%; height: auto; }

.contents-band { padding-block: clamp(40px, 6vw, 72px) clamp(36px, 5vw, 60px); }

/* Tighter than the band above it: the list and this button are one thought. */
.contents-cta {
  margin-top: clamp(20px, 3vw, 30px);
  text-align: center;
}

@media (max-width: 700px) {
  .spread-inner { gap: 20px; }
  .contents-cta { margin-top: 18px; }
}

/* ------------------------------------------------------ zoomable mockups */

.is-zoomable { cursor: zoom-in; }
.is-zoomable:focus-visible { outline: 2px solid var(--ink); outline-offset: 6px; }

.lightbox {
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  background: #17150f;
  color: #f3f0e7;
  overflow: hidden;
}
.lightbox::backdrop { background: rgba(17, 15, 11, 0.92); }

.lightbox-bar {
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: max(12px, env(safe-area-inset-top)) 14px 12px;
}
.lightbox-zoom { display: flex; gap: 8px; }

.lightbox-btn {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(243, 240, 231, 0.28);
  background: rgba(243, 240, 231, 0.1);
  color: #f3f0e7;
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
  /* Backdrop-blur is decoration; the border carries the affordance without it. */
  backdrop-filter: blur(6px);
}
.lightbox-btn:hover { background: rgba(243, 240, 231, 0.2); }
.lightbox-btn:disabled { opacity: 0.35; cursor: default; }

.lightbox-stage {
  position: absolute;
  inset: 0;
  /*
   * Flex, not grid. In a grid whose row is auto-sized, the row takes its height
   * from the image and the image's own `max-height: 100%` then resolves against
   * that - so it constrains nothing and a 2070px page rendered at full height
   * with the stage clipping it. A flex container has a definite height here
   * (inset: 0), which is what the percentage needs to mean anything.
   */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 12px 52px;
  overflow: hidden;
  /* Two-finger pinch is handled in script; this stops the browser fighting it. */
  touch-action: none;
}
.lightbox-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform-origin: center center;
  transition: transform 0.12s ease-out;
  will-change: transform;
}
.lightbox-stage.is-zoomed { cursor: grab; }
.lightbox-stage.is-zoomed:active { cursor: grabbing; }

.lightbox-hint {
  position: absolute;
  inset-block-end: max(12px, env(safe-area-inset-bottom));
  inset-inline: 0;
  margin: 0;
  text-align: center;
  font-size: 12.5px;
  color: rgba(243, 240, 231, 0.62);
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .lightbox-stage img { transition: none; }
}

/* Narrower chrome where the screen is small. */
@media (max-width: 560px) {
  .lightbox-stage { padding: 58px 8px 46px; }
}
}

/* Turnstile: invisible unless a visitor looks suspicious, then centred. */
.cf-turnstile { display: flex; justify-content: center; }
.cf-turnstile:empty { display: none; }
