/*
 * Šanko page. Base styles (tokens, top bar, buttons, footer) come from
 * ../styles.css; this file is the page around the book and the book itself.
 */

/* ------------------------------------------------------------ The page */

.sanko-page {
  background:
    radial-gradient(90% 50% at 15% 0%, rgba(0, 150, 255, 0.12), transparent 60%),
    radial-gradient(70% 40% at 90% 30%, rgba(201, 164, 92, 0.1), transparent 60%),
    var(--abyss);
}

.sanko-page main { padding-top: calc(var(--bar) + 22px); }

.sp-back {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 clamp(8px, 2.2vw, 36px);
}
.sp-back a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  color: var(--mute);
  transition: color 0.3s, gap 0.3s var(--ease);
}
.sp-back a i { font-style: normal; color: var(--yellow); }
.sp-back a:hover { color: var(--text); gap: 14px; }

.sanko-page .book { padding-top: 2vh; scroll-margin-top: calc(var(--bar, 72px) + 8px); }

/* The ad sits on top of the page; the QR code on the cards lands here. */
.sp-ad {
  max-width: 1360px;
  margin: 0 auto;
  padding: 2vh clamp(8px, 2.2vw, 36px) 7vh;
}
.sp-ad .ad { --fit: 170px; }

/* -------------------------------------------- Šanko, the whole story (book) */

/* One page of the bar book itself: ruled paper with a red margin, the
   app's own navy and brass, a stamp when the shift closes. It lies on the
   ocean like a sheet on the table. .bk-rv gets .in from sanko.js. */
.book {
  --paper: #f5f0e4;
  --paper-deep: #ebe2cf;
  --ink: #131a26;
  --ink-soft: #4f5868;
  --rule: rgba(36, 86, 150, 0.13);
  --margin: rgba(196, 55, 43, 0.5);
  --brass: #c9a45c;
  --brass-ink: #8c6a2b;
  --navy: #0f1b33;
  --navy-up: #1b2a4a;
  --red: #c4372b;
  --ruled: 34px;
  --hand: "Caveat", "Segoe Print", cursive;
  --slab: "Roboto Slab", Georgia, serif;
  position: relative;
  padding: 4vh clamp(8px, 2.2vw, 36px) 16vh;
  /* The stamp starts large before it lands; keep it from widening the page. */
  overflow-x: clip;
}

.book-page {
  position: relative;
  max-width: 1360px;
  margin: 0 auto;
  padding: 26px clamp(20px, 5vw, 84px) clamp(48px, 7vw, 100px) clamp(44px, 8.5vw, 140px);
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(120% 40% at 50% 0%, rgba(255, 253, 246, 0.9), transparent 70%),
    repeating-linear-gradient(to bottom, transparent 0 calc(var(--ruled) - 1px), var(--rule) calc(var(--ruled) - 1px) var(--ruled));
  box-shadow: 0 50px 120px -40px rgba(0, 0, 0, 0.85);
  /* Punched along the top, like a sheet torn out of the book. */
  -webkit-mask: radial-gradient(circle 6px at 13px 0, #0000 97%, #000) 0 0 / 26px 100% repeat-x;
  mask: radial-gradient(circle 6px at 13px 0, #0000 97%, #000) 0 0 / 26px 100% repeat-x;
}

/* The double red margin line. */
.book-page::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: clamp(26px, 5.6vw, 96px);
  width: 5px;
  border-left: 1.5px solid var(--margin);
  border-right: 1.5px solid var(--margin);
  pointer-events: none;
}

.book-run {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 0 14px;
  border-bottom: 2px solid var(--ink);
  color: var(--ink-soft);
  font-size: 10.5px;
}

.book .mono { letter-spacing: 0.08em; }

/* Reveal */
.bk-rv { transition: opacity 1.2s var(--ease), transform 1.2s var(--ease); }
.bk-rv:not(.in) { opacity: 0; transform: translateY(34px); }

.bk-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: var(--ink-soft);
}
.bk-label b {
  font-family: var(--slab);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
  color: var(--red);
}

.bk-h {
  max-width: 18em;
  font-family: var(--slab);
  font-size: clamp(30px, 3.6vw, 56px);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.02em;
  color: var(--navy);
}

.bk-sub {
  max-width: 38em;
  margin-top: 18px;
  color: var(--ink-soft);
  font-size: clamp(16px, 1.15vw, 18px);
  line-height: 1.6;
}

.bk-note {
  margin-top: 14px;
  color: var(--ink-soft);
  font-size: 13px;
  font-style: italic;
}

.bk-part {
  margin-top: clamp(56px, 9vw, 120px);
  padding-top: clamp(56px, 9vw, 120px);
  border-top: 1px solid rgba(19, 26, 38, 0.16);
}

/* Cover */

.bk-cover {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.8fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: end;
  padding-top: clamp(40px, 7vw, 96px);
}

.bk-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
  color: var(--brass-ink);
}
.bk-kicker img { width: 38px; height: 38px; border-radius: 50%; box-shadow: 0 0 0 3px var(--paper), 0 0 0 4px var(--brass); }

.bk-title {
  font-family: var(--slab);
  font-size: clamp(40px, 6vw, 96px);
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: -0.03em;
  color: var(--navy);
}
.bk-title em {
  font-style: normal;
  background: linear-gradient(transparent 60%, rgba(201, 164, 92, 0.55) 60% 90%, transparent 90%);
}

.bk-lede {
  max-width: 36em;
  margin-top: 28px;
  color: var(--ink-soft);
  font-size: clamp(17px, 1.3vw, 20px);
  line-height: 1.6;
}

.book .actions { display: flex; flex-wrap: wrap; gap: 18px 22px; margin-top: 34px; }
.book .btn { --blue: var(--navy); }
.book .btn.ghost.bk-ghost { --ink: var(--navy); box-shadow: inset 0 0 0 2px var(--navy); }
.book .btn.ghost.bk-ghost:hover,
.book .btn.ghost.bk-ghost:focus-visible { box-shadow: inset 0 0 0 2px var(--yellow), 4px 4px 0 var(--navy); }

.bk-facts {
  margin: 0;
  border-top: 2px solid var(--ink);
}
.bk-facts > div {
  display: grid;
  grid-template-columns: 112px 1fr;
  align-items: baseline;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(19, 26, 38, 0.18);
}
.bk-facts dt {
  font-family: var(--slab);
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  color: var(--navy);
}
.bk-facts dd { margin: 0; color: var(--ink-soft); font-size: 15px; line-height: 1.4; }

/* §1–2 The notebook and the sum */

.bk-problem {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.85fr);
  gap: clamp(36px, 6vw, 96px);
  align-items: start;
}

.bk-scribbles { margin-top: 30px; counter-reset: sc; }
.bk-scribbles li {
  position: relative;
  width: fit-content;
  max-width: 100%;
  padding: 2px 4px 2px 34px;
  font-family: var(--hand);
  font-size: clamp(23px, 2vw, 30px);
  font-weight: 600;
  line-height: var(--ruled);
  color: #2b3f63;
  transform: rotate(calc(var(--tilt, 0) * 1deg));
}
.bk-scribbles li + li { margin-top: 8px; }
.bk-scribbles li::before {
  counter-increment: sc;
  content: counter(sc) ".";
  position: absolute;
  left: 4px;
  color: #6b7a92;
}
.bk-scribbles li:nth-child(odd) { --tilt: -0.6; }
.bk-scribbles li:nth-child(even) { --tilt: 0.4; margin-left: 10px; }
/* A red pen strikes each line through when the part arrives. */
.bk-scribbles li::after {
  content: "";
  position: absolute;
  left: 28px;
  right: -6px;
  top: 52%;
  height: 3px;
  border-radius: 3px;
  background: var(--red);
  opacity: 0.8;
  transform: scaleX(0) rotate(-1.2deg);
  transform-origin: 0 50%;
  transition: transform 0.7s cubic-bezier(0.7, 0, 0.3, 1);
}
.in .bk-scribbles li::after { transform: scaleX(1) rotate(-1.2deg); }
.in .bk-scribbles li:nth-child(1)::after { transition-delay: 0.6s; }
.in .bk-scribbles li:nth-child(2)::after { transition-delay: 0.9s; }
.in .bk-scribbles li:nth-child(3)::after { transition-delay: 1.2s; }
.in .bk-scribbles li:nth-child(4)::after { transition-delay: 1.5s; }
.in .bk-scribbles li:nth-child(5)::after { transition-delay: 1.8s; }

.bk-calc {
  position: relative;
  padding: clamp(24px, 3vw, 38px);
  color: #e9edf4;
  background:
    radial-gradient(130% 90% at 100% 0%, rgba(201, 164, 92, 0.2), transparent 55%),
    var(--navy);
  box-shadow: 10px 10px 0 var(--brass);
}
.bk-calc .bk-label { color: #a8b3c7; }
.bk-calc .bk-label b { color: var(--brass); }

.bk-calc-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  font-size: clamp(18px, 1.5vw, 22px);
  line-height: 1.4;
}

.bk-step {
  display: inline-flex;
  align-items: stretch;
  height: 46px;
  border: 1px solid rgba(201, 164, 92, 0.55);
  background: var(--navy-up);
}
.bk-step button {
  width: 40px;
  color: var(--brass);
  font-size: 22px;
  font-weight: 600;
  transition: background 0.2s, color 0.2s;
}
.bk-step button:hover { background: var(--brass); color: var(--navy); }
.bk-step button:disabled { opacity: 0.3; pointer-events: none; }
.bk-step output {
  display: grid;
  place-items: center;
  min-width: 64px;
  padding: 0 6px;
  border-inline: 1px solid rgba(201, 164, 92, 0.3);
  font-family: var(--slab);
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.bk-calc-sum {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin-top: 28px;
  background: rgba(201, 164, 92, 0.35);
  border: 1px solid rgba(201, 164, 92, 0.35);
}
.bk-calc-sum p {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  background: var(--navy);
  color: #a8b3c7;
  font-size: 14px;
}
.bk-calc-sum b {
  font-family: var(--slab);
  font-size: clamp(26px, 2.6vw, 40px);
  font-weight: 900;
  line-height: 1;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.bk-calc-sum .year b { color: #ff9d8a; }
.bk-calc .bk-note { color: #a8b3c7; }

/* §3 The ledger */

.bk-shift > header { margin-bottom: 40px; }

.bk-ledger {
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
}

.bk-row {
  position: relative;
  display: grid;
  grid-template-columns: 56px minmax(120px, 0.6fr) minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 0 24px;
  align-items: baseline;
  padding: 20px 0;
  border-bottom: 1px solid rgba(19, 26, 38, 0.16);
  font-size: 16px;
  line-height: 1.5;
  transition: background 0.3s;
}
.bk-row:last-child { border-bottom: 0; }
.bk-row:not(.head):hover { background: rgba(201, 164, 92, 0.12); }
.bk-row > .mono { color: var(--red); }
.bk-row > b {
  font-family: var(--slab);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--navy);
  text-transform: uppercase;
}
.bk-row > span:last-of-type { color: var(--ink-soft); }
.bk-row.head {
  padding: 12px 0;
  border-bottom: 2px solid var(--ink);
  color: var(--ink-soft);
  font-family: "Martian Mono", ui-monospace, monospace;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.bk-row.closed { padding: 26px 0 30px; }

/* Pressed onto the page just under the last line of the shift. */
.bk-ledger { margin-bottom: 96px; }
.bk-stamp {
  position: absolute;
  right: clamp(0px, 3vw, 48px);
  top: calc(100% + 22px);
  padding: 8px 18px 6px;
  border: 4px solid var(--red);
  border-radius: 8px;
  color: var(--red);
  font-family: var(--slab);
  font-size: clamp(20px, 2.2vw, 32px);
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  mix-blend-mode: multiply;
  opacity: 0;
  transform: rotate(-7deg) scale(2.4);
  pointer-events: none;
}
.in .bk-stamp { animation: stamp 0.55s cubic-bezier(0.3, 1.6, 0.5, 1) 0.9s forwards; }
@keyframes stamp {
  0% { opacity: 0; transform: rotate(-7deg) scale(2.4); }
  60% { opacity: 0.9; transform: rotate(-7deg) scale(0.94); }
  100% { opacity: 0.82; transform: rotate(-7deg) scale(1); }
}

/* §4 Roles: tabs like the dividers of a binder */

.bk-roles > header { margin-bottom: 40px; }

.bk-tablist { display: flex; gap: 6px; padding-left: 18px; }
.bk-tablist button {
  display: grid;
  gap: 4px;
  padding: 14px 22px 12px;
  border: 1.5px solid var(--ink);
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  background: var(--paper-deep);
  color: var(--ink-soft);
  text-align: left;
  transform: translateY(6px);
  transition: transform 0.3s var(--ease), background 0.3s, color 0.3s;
}
.bk-tablist button span { font-family: var(--slab); font-size: 20px; font-weight: 800; }
.bk-tablist button small { font-size: 9.5px; opacity: 0.8; }
.bk-tablist button:hover { transform: translateY(2px); color: var(--ink); }
.bk-tablist button[aria-selected="true"] {
  position: relative;
  z-index: 1;
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
  transform: none;
}
.bk-tablist button[aria-selected="true"] small { color: var(--brass); opacity: 1; }

.bk-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(28px, 5vw, 80px);
  align-items: center;
  padding: clamp(28px, 4vw, 56px);
  border: 1.5px solid var(--navy);
  border-top-width: 6px;
  background: rgba(255, 255, 255, 0.55);
  animation: panel-in 0.5s var(--ease);
}
.bk-panel[hidden] { display: none; }
@keyframes panel-in { from { opacity: 0; transform: translateY(10px); } }

.bk-shot { margin: 0; justify-self: center; width: 100%; }
.bk-shot img { width: 100%; }
.bk-shot.is-phone {
  max-width: 270px;
  padding: 10px;
  border-radius: 38px;
  background: #05080c;
  box-shadow: 0 0 0 2px #2a3540, 0 40px 70px -30px rgba(15, 27, 51, 0.7);
  transform: rotate(-3deg);
}
.bk-shot.is-phone img { border-radius: 30px; }
.bk-shot.is-desk {
  padding: 26px 8px 8px;
  border-radius: 10px;
  background:
    radial-gradient(circle 4px at 16px 13px, #ff6a5a 98%, #0000),
    radial-gradient(circle 4px at 30px 13px, #ffbf3a 98%, #0000),
    radial-gradient(circle 4px at 44px 13px, #36c763 98%, #0000),
    #e3e6eb;
  box-shadow: 0 0 0 1px rgba(19, 26, 38, 0.2), 0 40px 70px -30px rgba(15, 27, 51, 0.7);
  transform: rotate(-1.5deg);
}
.bk-shot.is-desk img { border-radius: 3px; }

.bk-shot.is-tickets { display: grid; gap: 14px; max-width: 340px; }
.bk-ticket {
  padding: 14px 18px;
  border-left: 6px solid var(--brass);
  background: #fff;
  box-shadow: 0 16px 30px -18px rgba(15, 27, 51, 0.55);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
}
.bk-ticket:nth-child(1) { transform: rotate(-1.5deg); }
.bk-ticket:nth-child(2) { transform: rotate(1deg) translateX(18px); }
.bk-ticket:nth-child(3) { transform: rotate(-0.5deg) translateX(6px); }
.bk-ticket p:first-child { display: flex; justify-content: space-between; margin-bottom: 4px; }
.bk-ticket p:first-child b { font-family: var(--slab); font-weight: 800; color: var(--navy); }
.bk-ticket p:first-child span { font-family: "Martian Mono", monospace; font-size: 12px; color: var(--ink-soft); }
.bk-ticket.late { border-left-color: var(--red); }
.bk-ticket.late p:first-child span { color: var(--red); font-weight: 500; }
.bk-ticket.done { opacity: 0.55; border-left-color: #3a9d6a; }
.bk-ticket.done p:not(:first-child) { text-decoration: line-through; }
.bk-ticket.done p:first-child span { color: #2f8a5a; }

.bk-list { border-top: 1px solid rgba(19, 26, 38, 0.18); }
.bk-list li {
  position: relative;
  padding: 16px 0 16px 34px;
  border-bottom: 1px solid rgba(19, 26, 38, 0.18);
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.55;
}
.bk-list li::before {
  content: "✓";
  position: absolute;
  left: 4px;
  top: 15px;
  color: var(--brass-ink);
  font-weight: 800;
}
.bk-list b { color: var(--navy); font-weight: 700; }

/* §5 The message */

.bk-alert {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
  gap: clamp(36px, 6vw, 96px);
  align-items: center;
}

.bk-chat {
  margin: 0;
  padding: 0 0 18px;
  border-radius: 26px;
  background:
    radial-gradient(circle at 20% 30%, rgba(76, 120, 160, 0.25), transparent 45%),
    radial-gradient(circle at 80% 80%, rgba(201, 164, 92, 0.16), transparent 45%),
    #0e1621;
  box-shadow: 0 50px 90px -40px rgba(15, 27, 51, 0.9), 0 0 0 1px rgba(15, 27, 51, 0.4);
  color: #e9eef4;
  overflow: hidden;
}
.bk-chat.in { transform: rotate(1.5deg); }
.bk-chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: #17212b;
  font-size: 15px;
}
.bk-chat-head img { width: 34px; height: 34px; border-radius: 50%; }
.bk-chat-head .mono { margin-left: auto; color: #7d8b99; font-size: 10px; }

.bk-bubble {
  position: relative;
  margin: 20px 16px 0;
  padding: 14px 16px 26px;
  border-radius: 16px 16px 16px 4px;
  background: #182533;
  font-size: 14.5px;
  line-height: 1.5;
}
.bk-bubble p { display: flex; justify-content: space-between; gap: 14px; }
.bk-bubble p b { font-weight: 600; color: #fff; font-variant-numeric: tabular-nums; }
.bk-bubble p.dim { display: block; color: #8fa0b2; font-size: 13px; margin-bottom: 8px; }
.bk-bubble p.dim:last-of-type { margin: 10px 0 0; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.bk-bubble p.warn { margin-top: 6px; color: #ff9d8a; }
.bk-bubble p.warn b { color: #ff9d8a; }
.bk-bubble time { position: absolute; right: 12px; bottom: 7px; color: #6fb8ef; font-size: 9.5px; }
.bk-chat .bk-note { margin: 14px 18px 0; color: #7d8b99; }

.in.bk-chat .bk-bubble { animation: bubble 0.7s cubic-bezier(0.3, 1.4, 0.5, 1) 0.5s both; }
@keyframes bubble { from { opacity: 0; transform: translateY(24px) scale(0.9); } }

/* §6 Index cards */

.bk-tools > header { margin-bottom: 44px; }

.bk-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 2.6vw, 36px);
}

.bk-card {
  position: relative;
  padding: 16px 18px 22px;
  border-top: 3px solid var(--red);
  background-color: #fffdf8;
  background-image: repeating-linear-gradient(to bottom, transparent 0 25px, rgba(36, 86, 150, 0.1) 25px 26px);
  box-shadow: 0 1px 0 rgba(19, 26, 38, 0.1), 0 24px 40px -28px rgba(15, 27, 51, 0.55);
}
.bk-card.in:nth-child(3n + 1) { transform: rotate(-0.7deg); }
.bk-card.in:nth-child(3n + 2) { transform: rotate(0.5deg) translateY(8px); }
.bk-card.in:nth-child(3n) { transform: rotate(-0.3deg); }
.bk-card.in:hover { transform: rotate(0) translateY(-4px); transition-duration: 0.4s; }
.bk-card:nth-child(3n + 2) { transition-delay: 0.08s; }
.bk-card:nth-child(3n) { transition-delay: 0.16s; }

/* The screenshot is a button: hover lifts it off the card, a click (or a
   tap on a phone) opens it full size in #shotDialog. */
.bk-card-shot {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  margin-bottom: 18px;
  cursor: zoom-in;
}
.bk-card-shot img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: top left;
  border: 1px solid rgba(19, 26, 38, 0.15);
  background: #fff;
  transform-origin: var(--zoom-from, 50% 0);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease), aspect-ratio 0.5s var(--ease);
}
.bk-zoom {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  background: rgba(15, 27, 51, 0.86);
  color: #fff;
  font-size: 9.5px;
  transition: opacity 0.3s;
}
.bk-zoom i { font-style: normal; font-size: 13px; color: var(--brass); }

.bk-card:nth-child(3n + 1) { --zoom-from: 0 0; }
.bk-card:nth-child(3n + 2) { --zoom-from: 50% 0; }
.bk-card:nth-child(3n) { --zoom-from: 100% 0; }

@media (hover: hover) and (min-width: 961px) {
  .bk-card:has(.bk-card-shot:hover),
  .bk-card:has(.bk-card-shot:focus-visible) { z-index: 4; }
  .bk-card-shot:hover img,
  .bk-card-shot:focus-visible img {
    aspect-ratio: 16 / 10;
    transform: scale(1.85);
    box-shadow: 0 0 0 1px rgba(15, 27, 51, 0.25), 0 40px 80px -24px rgba(15, 27, 51, 0.65);
  }
  .bk-card-shot:hover .bk-zoom,
  .bk-card-shot:focus-visible .bk-zoom { opacity: 0; }
  .bk-card-shot:focus-visible { outline: none; }
}

/* Full size */
.bk-lightbox {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: clamp(16px, 4vw, 56px);
  border: 0;
  background: transparent;
  color: #fff;
}
.bk-lightbox[open] { display: grid; place-items: center; }
.bk-lightbox::backdrop { background: rgba(6, 14, 24, 0.9); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.bk-lightbox figure {
  display: grid;
  gap: 14px;
  margin: 0;
  width: fit-content;
  max-width: min(1440px, 100%);
  animation: lb-in 0.4s var(--ease);
}
.bk-lightbox img {
  width: auto;
  max-width: 100%;
  max-height: calc(100dvh - 150px);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.9);
}
.bk-lightbox figcaption { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; }
.bk-lightbox figcaption b { font-family: "Roboto Slab", Georgia, serif; font-size: 22px; font-weight: 800; }
.bk-lightbox figcaption .mono { color: var(--mute); }
@keyframes lb-in { from { opacity: 0; transform: scale(0.94); } }

.bk-lb-close,
.bk-lb-nav {
  position: fixed;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  transition: background 0.25s, color 0.25s;
}
.bk-lb-close:hover,
.bk-lb-nav:hover { background: var(--yellow); color: #0b1520; }
.bk-lb-close { top: 16px; right: 16px; }
.bk-lb-nav { top: 50%; transform: translateY(-50%); }
.bk-lb-nav.prev { left: 16px; }
.bk-lb-nav.next { right: 16px; }

/* Phones: the picture gets the whole width; arrows sit under it (or swipe). */
@media (max-width: 700px) {
  .bk-lightbox { padding: 64px 12px 96px; }
  .bk-lightbox img { max-height: calc(100dvh - 210px); border-radius: 4px; }
  .bk-lightbox figcaption b { font-size: 19px; }
  .bk-lb-nav { top: auto; bottom: 24px; transform: none; }
  .bk-lb-nav.prev { left: calc(50% - 60px); }
  .bk-lb-nav.next { right: calc(50% - 60px); }
}

.bk-cards-dots { display: none; }
.bk-card h4 {
  margin: 0 0 8px;
  font-family: var(--slab);
  font-size: 22px;
  font-weight: 800;
  color: var(--navy);
}
.bk-card p { color: var(--ink-soft); font-size: 15px; line-height: 1.55; }

.bk-card p.bk-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  aspect-ratio: 16 / 9;
  margin-bottom: 18px;
  border: 1px dashed rgba(19, 26, 38, 0.3);
  color: var(--brass-ink);
  font-size: 13px;
  background: repeating-linear-gradient(-45deg, rgba(201, 164, 92, 0.1) 0 10px, transparent 10px 20px);
}

/* §7 Reasons */

.bk-why > header { margin-bottom: 40px; }

.bk-reasons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 clamp(28px, 5vw, 80px);
  counter-reset: why;
}
.bk-reasons li {
  position: relative;
  padding: 20px 0 20px 64px;
  border-top: 1px solid rgba(19, 26, 38, 0.18);
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.55;
}
.bk-reasons li::before {
  counter-increment: why;
  content: counter(why, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 16px;
  font-family: var(--slab);
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
  color: var(--brass);
}
.bk-reasons b { color: var(--navy); font-weight: 700; }

/* §8 Steps */

.bk-start > header { margin-bottom: 44px; }

.bk-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 20px;
}
.bk-steps li { position: relative; padding-top: 70px; }
.bk-steps li > span {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 2px solid var(--navy);
  border-radius: 50%;
  background: var(--paper);
  font-family: var(--slab);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0;
  color: var(--navy);
}
.bk-steps li:first-child > span { background: var(--navy); color: #fff; }
.bk-steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 23px;
  left: 58px;
  right: -12px;
  border-top: 2px dashed rgba(15, 27, 51, 0.35);
}
.bk-steps p { color: var(--ink-soft); font-size: 15.5px; line-height: 1.55; }
.bk-steps b { display: block; margin-bottom: 4px; color: var(--navy); font-size: 17px; }

/* §9 Questions */

.bk-faq { scroll-margin-top: 90px; }
.bk-faq > header { margin-bottom: 36px; }

.bk-qa {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 clamp(28px, 5vw, 80px);
  align-items: start;
}
.bk-qa details { border-top: 1px solid rgba(19, 26, 38, 0.2); }
.bk-qa details:nth-last-child(-n + 2) { border-bottom: 1px solid rgba(19, 26, 38, 0.2); }
.bk-qa summary {
  position: relative;
  padding: 20px 48px 20px 0;
  font-family: var(--slab);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--navy);
  cursor: pointer;
  list-style: none;
}
.bk-qa summary::-webkit-details-marker { display: none; }
.bk-qa summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 17px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1.5px solid var(--navy);
  border-radius: 50%;
  font-family: "Archivo", sans-serif;
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  transition: transform 0.35s var(--ease), background 0.3s, color 0.3s;
}
.bk-qa details[open] summary::after { transform: rotate(45deg); background: var(--navy); color: #fff; }
.bk-qa summary:hover { color: var(--brass-ink); }
.bk-qa details p {
  padding: 0 48px 22px 0;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.6;
}

/* §10 Sign here */

.bk-end {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 36px clamp(28px, 6vw, 96px);
  align-items: end;
  margin-top: clamp(56px, 9vw, 120px);
  padding-top: clamp(56px, 8vw, 110px);
  border-top: 2px solid var(--ink);
}
.bk-end-title {
  max-width: 16em;
  font-family: var(--slab);
  font-size: clamp(28px, 3vw, 46px);
  font-weight: 800;
  line-height: 1.08;
  color: var(--navy);
}
.bk-sign { display: grid; gap: 34px; justify-items: start; }
.bk-sign-line {
  position: relative;
  width: min(100%, 380px);
  height: 64px;
  border-bottom: 2px dotted rgba(19, 26, 38, 0.5);
}
.bk-sign-line span {
  position: absolute;
  left: 0;
  bottom: -26px;
  font-family: "Martian Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.bk-sign-line::before {
  content: "Šanko";
  position: absolute;
  left: 18px;
  bottom: 2px;
  font-family: var(--hand);
  font-size: 50px;
  font-weight: 700;
  line-height: 1;
  color: #23407a;
  transform: rotate(-6deg);
  clip-path: inset(0 100% 0 0);
  transition: clip-path 1.4s cubic-bezier(0.6, 0, 0.3, 1) 0.6s;
}
.in .bk-sign-line::before { clip-path: inset(-20px -20px -20px -20px); }

@media (max-width: 1100px) {
  .bk-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bk-card.in:nth-child(odd) { transform: rotate(-0.6deg); }
  .bk-card.in:nth-child(even) { transform: rotate(0.5deg) translateY(8px); }
  .bk-card:nth-child(odd) { --zoom-from: 0 0; }
  .bk-card:nth-child(even) { --zoom-from: 100% 0; }
  .bk-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 36px; }
  .bk-steps li:nth-child(3)::after { display: none; }
}

@media (max-width: 960px) {
  .book-page { padding-left: clamp(36px, 9vw, 64px); }
  .book-page::before { left: clamp(16px, 4.2vw, 30px); }
  .bk-cover,
  .bk-problem,
  .bk-alert,
  .bk-panel,
  .bk-end { grid-template-columns: 1fr; }
  .bk-cover { align-items: start; }
  .bk-row { grid-template-columns: 36px 1fr; gap: 4px 12px; }
  .bk-row > span:not(.mono) { grid-column: 2; }
  .bk-row.head { display: none; }
  .bk-row > span:last-of-type { font-size: 15px; }
  .bk-stamp { right: auto; left: 48px; }
  .bk-tablist { padding-left: 0; gap: 4px; }
  .bk-tablist button { flex: 1; padding: 12px 12px 10px; }
  .bk-tablist button span { font-size: 17px; }
  .bk-tablist button small { display: none; }
  .bk-panel { padding: 26px 20px; }
  .bk-shot.is-phone { max-width: 220px; }
  .bk-alert .bk-chat { max-width: 420px; }
  .bk-reasons,
  .bk-qa { grid-template-columns: 1fr; }
  .bk-qa details:nth-last-child(2) { border-bottom: 0; }
}

@media (max-width: 560px) {
  .book { padding-inline: 6px; }
  .book-page { padding: 18px 16px 48px 34px; }
  .book-page::before { left: 13px; }
  .book-run > span:last-child { display: none; }
  .bk-facts > div { grid-template-columns: 84px 1fr; }
  .bk-facts dt { font-size: 23px; }
  /* The cards become one swipe row: one card and the edge of the next. */
  .bk-cards {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 84%;
    gap: 14px;
    margin-right: -16px;
    padding: 6px 16px 14px 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .bk-cards::-webkit-scrollbar { display: none; }
  .bk-card,
  .bk-card.in:nth-child(n) { transform: none; scroll-snap-align: start; transition-delay: 0s; }
  .bk-card h4 { font-size: 20px; }
  .bk-card p { font-size: 14.5px; }
  .bk-cards-dots { display: flex; justify-content: center; gap: 8px; margin-top: 14px; }
  .bk-cards-dots i {
    width: 7px;
    height: 7px;
    border-radius: 99px;
    background: rgba(15, 27, 51, 0.22);
    transition: width 0.3s var(--ease), background 0.3s;
  }
  .bk-cards-dots i.on { width: 22px; background: var(--navy); }
  .bk-steps { grid-template-columns: 1fr; row-gap: 22px; }
  .bk-steps li { padding: 6px 0 0 64px; min-height: 48px; }
  .bk-steps li::after { display: none; }
  .bk-calc { box-shadow: 6px 6px 0 var(--brass); }
  .bk-calc-sum { grid-template-columns: 1fr; }
  .bk-step output { min-width: 54px; }
  .bk-chat.in { transform: none; }
  .bk-ticket:nth-child(2) { transform: rotate(1deg) translateX(8px); }
}

@media (prefers-reduced-motion: reduce) {
  .bk-rv:not(.in) { opacity: 1; transform: none; }
  .bk-scribbles li::after { transition: none; transform: scaleX(1) rotate(-1.2deg); }
  .bk-stamp { animation: none !important; opacity: 0.82; transform: rotate(-7deg); }
  .bk-sign-line::before { transition: none; clip-path: none; }
  .bk-panel, .in.bk-chat .bk-bubble { animation: none; }
}

