/* Kaper design system. Dark theme = the thief's blueprint. */
:root {
  --bg: #eef1f5;
  --paper: #ffffff;
  --ink: #142033;
  --muted: #566478;
  --line: #c4cdd9;
  --grid: rgba(20, 32, 51, 0.045);
  --accent: #1c4f91;
  --accent-soft: rgba(28, 79, 145, 0.1);
  --laser: #cc2a36;
  --laser-soft: rgba(204, 42, 54, 0.1);
  --pillar: #142033;
  --pillar-ink: #ffffff;
  --ok: #1d7a4a;
  --ok-soft: rgba(29, 122, 74, 0.1);
  --busy: #9a6700;
  --solved-bg: #e5e8ec;
  --solved-line: #cdd2d9;
  --font-display: "Saira Stencil One", "Arial Black", Impact, sans-serif;
  --font-body: "Libre Franklin", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1f3a; --paper: #102a4c; --ink: #e6eefa; --muted: #9db2cf; --line: #355a88;
    --grid: rgba(140, 200, 255, 0.07); --accent: #8cc8ff; --accent-soft: rgba(140, 200, 255, 0.14);
    --laser: #ff6b76; --laser-soft: rgba(255, 107, 118, 0.14); --pillar: #e6eefa; --pillar-ink: #0b1f3a;
    --ok: #6fdca0; --ok-soft: rgba(111, 220, 160, 0.14);
    --solved-bg: #1b2636; --solved-line: #2f3d50;
    --busy: #ffd166;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1f3a; --paper: #102a4c; --ink: #e6eefa; --muted: #9db2cf; --line: #355a88;
  --grid: rgba(140, 200, 255, 0.07); --accent: #8cc8ff; --accent-soft: rgba(140, 200, 255, 0.14);
  --laser: #ff6b76; --laser-soft: rgba(255, 107, 118, 0.14); --pillar: #e6eefa; --pillar-ink: #0b1f3a;
  --ok: #6fdca0; --ok-soft: rgba(111, 220, 160, 0.14);
  --solved-bg: #1b2636; --solved-line: #2f3d50;
  --busy: #ffd166;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
}
h1, h2, h3 { margin: 0; text-wrap: balance; font-weight: 400; }
p { margin: 0; }
a { color: var(--accent); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.section-title { font-family: var(--font-display); font-size: clamp(26px, 4vw, 34px); line-height: 1.1; }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* Wordmark: the laser cuts through the letters */
.logo {
  position: relative;
  display: inline-block;
  font-family: var(--font-display);
  color: var(--ink);
  text-decoration: none;
  line-height: 1;
  letter-spacing: 0.03em;
  isolation: isolate;
}
.logo::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: -7%;
  right: -7%;
  top: 54%;
  height: max(1.5px, 0.024em);
  background: var(--laser);
  box-shadow:
    0 0 0.03em 0.006em var(--laser),
    0 0 0.09em 0.012em var(--laser),
    0 0 0.22em 0.02em var(--laser),
    0 0 0.5em 0.03em var(--laser);
  transform: rotate(-4deg);
  border-radius: 99px;
}
@media (prefers-reduced-motion: no-preference) {
  .logo.big::after { animation: neon 7s linear infinite; }
  @keyframes neon {
    0%, 100% { opacity: 1; }
    2% { opacity: 0.35; }
    3.5% { opacity: 1; }
    5% { opacity: 0.55; }
    6.5%, 46% { opacity: 1; }
    54% { opacity: 0.8; }
    62% { opacity: 1; }
  }
}
.logo.big { font-size: clamp(76px, 15vw, 132px); }
.logo.small { font-size: 28px; }

/* Top bar */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 16px; }
.topbar.home { justify-content: flex-end; padding-bottom: 0; }
.topbar nav { display: flex; flex-wrap: wrap; gap: 4px 18px; align-items: center; }
.topbar nav a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px; }
.topbar nav a:hover, .topbar nav a[aria-current="page"] { color: var(--accent); }
.theme-btn {
  font: 500 12px/1 var(--font-mono);
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  padding: 7px 10px;
  cursor: pointer;
}
.theme-btn:hover { border-color: var(--accent); }

/* Buttons */
.btn {
  display: inline-block;
  font: 600 14px/1 var(--font-body);
  color: var(--ink);
  background: transparent;
  border: 1.5px solid var(--ink);
  padding: 11px 15px;
  cursor: pointer;
  text-decoration: none;
}
.btn.primary { background: var(--ink); color: var(--paper); }
.btn:hover { border-color: var(--accent); }
.btn.primary:hover { background: var(--accent); }
.btn:disabled { opacity: 0.45; cursor: default; }
.controls { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  padding: 2px 8px;
  color: var(--muted);
}
.chip.d-easy { color: var(--ok); border-color: var(--ok); }
.chip.d-medium, .chip.d-tricky { color: var(--accent); border-color: var(--accent); }
.chip.d-hard, .chip.d-big-job { color: var(--laser); border-color: var(--laser); }

/* The board */
.board-wrap { overflow-x: auto; }
.board {
  --n: 6;
  --cs: var(--cell, min(50px, calc((100vw - 40px) / var(--n))));
  display: grid;
  grid-template-columns: repeat(var(--n), var(--cs));
  border: 2.5px solid var(--ink);
  background: var(--paper);
  width: max-content;
}
.cell {
  position: relative;
  display: block;
  width: var(--cs);
  height: var(--cs);
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 0;
  color: var(--ink);
  font-family: var(--font-mono);
  text-align: center;
  line-height: var(--cs);
}
button.cell { cursor: pointer; touch-action: manipulation; }
button.cell:hover { background: var(--accent-soft); }
.cell.last-col { border-right: 0; }
.cell.last-row { border-bottom: 0; }
.cell.pillar { background: var(--pillar); color: var(--pillar-ink); font-size: calc(var(--cs) * 0.42); font-weight: 600; }
.cell.pillar .ring {
  position: absolute; inset: 14%;
  border: max(1px, calc(var(--cs) * 0.04)) solid var(--pillar-ink);
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: calc(var(--cs) * 0.36);
  line-height: 1;
}
.cell .lbl {
  position: absolute; left: 50%; bottom: 2px; transform: translateX(-50%);
  font-size: max(8px, calc(var(--cs) * 0.18)); line-height: 1; letter-spacing: 0.03em; font-weight: 600;
  padding: 0 2px; background: var(--paper);
  color: var(--accent); z-index: 2;
}
.seg { position: absolute; background: var(--accent); z-index: 1; --t: max(2px, calc(var(--cs) * 0.08)); }
.seg.n { left: 50%; top: 0; width: var(--t); height: 50%; transform: translateX(-50%); }
.seg.s { left: 50%; bottom: 0; width: var(--t); height: 50%; transform: translateX(-50%); }
.seg.w { top: 50%; left: 0; height: var(--t); width: 50%; transform: translateY(-50%); }
.seg.e { top: 50%; right: 0; height: var(--t); width: 50%; transform: translateY(-50%); }
.seg.door.n { top: -3px; height: calc(50% + 3px); }
.seg.door.s { bottom: -3px; height: calc(50% + 3px); }
.seg.door.w { left: -3px; width: calc(50% + 3px); }
.seg.door.e { right: -3px; width: calc(50% + 3px); }
.dot {
  position: absolute; left: 50%; top: 50%;
  width: max(4px, calc(var(--cs) * 0.2)); height: max(4px, calc(var(--cs) * 0.2));
  border-radius: 50%; background: var(--accent);
  transform: translate(-50%, -50%); z-index: 1;
}
.vault-dial {
  position: absolute; left: 50%; top: 44%; width: 58%; height: 58%;
  transform: translate(-50%, -50%); border-radius: 50%;
  border: max(1.5px, calc(var(--cs) * 0.05)) solid var(--accent); background: var(--paper); z-index: 2;
}
.vault-dial::after { content: ""; position: absolute; left: 50%; top: 12%; width: 2px; height: 38%; background: var(--accent); transform: translateX(-50%); }
.gem {
  position: absolute; left: 50%; top: 50%; width: 36%; height: 36%;
  transform: translate(-50%, -50%) rotate(45deg);
  background: var(--paper); border: max(1.5px, calc(var(--cs) * 0.05)) solid var(--accent); z-index: 2;
}
.laser { position: absolute; inset: 22%; z-index: 1; }
.laser::before, .laser::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 130%; height: max(1.5px, calc(var(--cs) * 0.06));
  background: var(--laser); box-shadow: 0 0 calc(var(--cs) * 0.12) var(--laser);
  transform: translate(-50%, -50%) rotate(45deg); border-radius: 2px;
}
.laser::after { transform: translate(-50%, -50%) rotate(-45deg); }
.cell.sol .laser, .cell.sol .seg, .cell.sol .dot { opacity: 0.6; }
.mini .lbl { display: none; }

/* ---- Home ---- */
.home-main { display: flex; flex-direction: column; align-items: center; text-align: center; padding-bottom: 48px; }
.brand { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.byline { font-family: var(--font-mono); font-size: 14px; letter-spacing: 0.08em; color: var(--laser); }
.home-main h1 { font-family: var(--font-body); font-weight: 700; font-size: clamp(30px, 5.4vw, 46px); line-height: 1.12; letter-spacing: -0.015em; margin-top: 18px; }
.lead { margin-top: 12px; font-size: clamp(16px, 2.2vw, 18px); max-width: 62ch; display: flex; flex-direction: column; gap: 2px; }
.hero-board { margin-top: 28px; --cell: min(58px, calc((100vw - 42px) / 8)); }
.hero-board .board { box-shadow: 0 18px 50px rgba(5, 14, 30, 0.28); }
@media (prefers-reduced-motion: no-preference) {
  .hero-board .route-part { animation: trace 0.32s calc(var(--i) * 75ms + 300ms) both; }
  @keyframes trace { from { opacity: 0; } to { opacity: 1; } }
  .hero-board .vault-dial::after { transform-origin: 50% 100%; animation: spin 0.9s calc(var(--last) * 75ms + 300ms) both; }
  @keyframes spin { from { transform: translateX(-50%) rotate(0); } to { transform: translateX(-50%) rotate(360deg); } }
}

.paths {
  width: 100%;
  max-width: 640px;
  margin-top: 36px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.path {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 20px 20px 24px;
  color: inherit;
  text-decoration: none;
  border-left: 1px solid var(--line);
  position: relative;
}
.path:first-child { border-left: 0; }
.path:nth-child(1) { --c: var(--accent); }
.path:nth-child(2) { --c: var(--laser); }
/* The line above the column lights up like a laser beam on hover */
.path::before {
  content: "";
  position: absolute;
  top: -2px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--c);
  box-shadow: 0 0 10px var(--c);
  transform: scaleX(0);
  transform-origin: left;
}
.path:is(:hover, :focus-visible)::before { transform: scaleX(1); }
.path .tag {
  font-weight: 700; font-size: 15px; line-height: 1;
  padding: 11px 15px; color: var(--paper);
}
.path .tag { background: var(--c); }
.path:is(:hover, :focus-visible) .tag { filter: brightness(1.12); }
@media (prefers-reduced-motion: no-preference) {
  .path::before { transition: transform 0.35s ease-out; }
  .path .tag, .phone, .cover { transition: transform 0.35s cubic-bezier(0.34, 1.5, 0.64, 1), box-shadow 0.35s, filter 0.2s; }
  .path:is(:hover, :focus-visible) .tag { transform: translateY(-3px); }
  .path:is(:hover, :focus-visible) .phone:nth-child(1) { transform: rotate(-13deg) translate(-9px, 3px); }
  .path:is(:hover, :focus-visible) .phone:nth-child(2) { transform: translateY(-13px) scale(1.07); }
  .path:is(:hover, :focus-visible) .phone:nth-child(3) { transform: rotate(13deg) translate(9px, 3px); }
  .path:is(:hover, :focus-visible) .cover { transform: rotate(3deg) translateY(-9px) scale(1.08); box-shadow: 12px 16px 26px rgba(5, 14, 30, 0.45); }
}
.visual { height: 124px; display: flex; align-items: center; justify-content: center; }
.path p { font-size: 15px; }
.path .note { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }

.phones { gap: 4px; align-items: center; }
.phone {
  background: var(--paper); border: 2px solid var(--ink); border-radius: 8px;
  padding: 16px 4px; --cell: 9px;
}
.phone:nth-child(1) { transform: rotate(-6deg) translateY(4px); }
.phone:nth-child(2) { transform: translateY(-5px); z-index: 1; }
.phone:nth-child(3) { transform: rotate(6deg) translateY(4px); }
.phone .board { border-width: 1px; }

.cover {
  --paper: #102a4c; --ink: #e6eefa; --line: #355a88; --accent: #8cc8ff; --laser: #ff6b76; --pillar: #e6eefa; --pillar-ink: #0b1f3a;
  width: 88px; height: 122px; background: #0b1f3a; color: #e6eefa;
  border-left: 6px solid #06152a;
  box-shadow: 6px 8px 18px rgba(5, 14, 30, 0.35);
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: 12px;
  transform: rotate(-3deg);
  --cell: 8.5px;
}
.cover .logo { font-size: 21px; color: #e6eefa; }
.cover .board { border-width: 1px; }

.how { width: 100%; max-width: 880px; margin-top: 12px; text-align: left; gap: 24px; }
.how-head { display: flex; flex-direction: column; gap: 6px; }
.how-rules { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 32px; }
.how-rules .legend { grid-template-columns: minmax(0, 1fr); align-content: start; }
.how-example { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 32px; align-items: start; border-top: 1px solid var(--line); padding-top: 24px; }
.how-board { --cell: min(44px, calc((100vw - 76px) / 6)); }
.how-steps { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.how-steps h3 { font-family: var(--font-display); font-size: 24px; line-height: 1.1; }

.pullquote { max-width: 720px; margin-top: 44px; font-style: italic; font-size: clamp(20px, 3vw, 25px); line-height: 1.5; }
.pullquote em { font-style: inherit; color: var(--laser); }

.community { width: 100%; max-width: 880px; margin-top: 44px; padding-top: 32px; border-top: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.community h2 { font-family: var(--font-display); font-size: 28px; }
.signup { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 10px; }
.signup .row { display: flex; gap: 8px; }
.signup input[type="email"] {
  flex: 1; min-width: 0;
  font: 400 16px var(--font-body); color: var(--ink);
  background: var(--paper); border: 1.5px solid var(--line); padding: 10px 12px;
}
.signup .consent { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--muted); text-align: left; }
.signup .consent input { margin-top: 3px; }
.signup .msg { font-size: 14px; color: var(--muted); min-height: 1.4em; }
.socials { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

/* Footer */
.foot { border-top: 1px solid var(--line); margin-top: 16px; padding-block: 28px 40px; }
.foot .wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.foot nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 20px; }
.foot nav a { color: var(--muted); font-size: 14px; text-decoration: none; }
.foot nav a:hover { color: var(--accent); }
.foot small { color: var(--muted); font-size: 12px; max-width: 70ch; }

/* ---- Puzzle list ---- */
.list-page { padding-block: 16px 56px; display: flex; flex-direction: column; gap: 24px; }
.list-head { display: flex; flex-direction: column; gap: 6px; text-align: center; align-items: center; }
.list-head h1 { font-family: var(--font-display); font-size: clamp(36px, 6vw, 56px); line-height: 1.05; }
.list-group { display: flex; flex-direction: column; gap: 14px; }
.list-group-head { display: flex; flex-direction: column; gap: 4px; text-align: center; align-items: center; }
.daily { display: grid; grid-template-columns: minmax(0, 1fr); width: 100%; max-width: 560px; margin-inline: auto; }
.daily-card { border-color: var(--accent); padding: 20px; gap: 20px; }
.daily-card .job-body h2 { font-size: 24px; }
.jobs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.job {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 16px;
  color: inherit;
  text-decoration: none;
}
.job:hover { border-color: var(--accent); }
@media (prefers-reduced-motion: no-preference) {
  .job { transition: transform 0.25s cubic-bezier(0.34, 1.5, 0.64, 1), border-color 0.2s; }
  .job:hover { transform: translateY(-4px); }
}
.job-thumb { position: relative; }
.job-thumb .board { border-width: 1.5px; }
/* Solved jobs: grey card, faded plan, "Solved" stamped across it. */
.job.solved { background: var(--solved-bg); border-color: var(--solved-line); }
.job.solved .job-thumb .board { filter: grayscale(1); opacity: 0.55; }
.job-body h2 span { display: block; }
.job.solved .job-body h2 { color: var(--muted); }
.stamp {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%) rotate(-28deg);
  font-family: var(--font-display); font-size: 19px; line-height: 1; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--ok); border: 2px solid var(--ok); padding: 3px 6px 2px;
  opacity: 0.8; pointer-events: none; white-space: nowrap;
}
.daily-card .stamp { font-size: 25px; border-width: 3px; }
.game .board-wrap { position: relative; }
.board-wrap.solved .board { filter: grayscale(1); opacity: 0.55; }
.board-wrap .stamp { font-size: clamp(40px, 13vw, 68px); border-width: 4px; padding: 6px 14px 3px; }
@media (prefers-reduced-motion: no-preference) {
  .board-wrap.solved .board { transition: filter 0.5s, opacity 0.5s; }
  .board-wrap .stamp.pop { animation: stamp-in 0.45s cubic-bezier(0.34, 1.5, 0.64, 1) both; }
  @keyframes stamp-in {
    from { opacity: 0; transform: translate(-50%, -50%) rotate(-28deg) scale(2.2); }
    to { opacity: 0.8; transform: translate(-50%, -50%) rotate(-28deg) scale(1); }
  }
}
.job-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.job-body .eyebrow { font-size: 11px; }
.job-body h2 { font-family: var(--font-display); font-size: 19px; line-height: 1.15; overflow-wrap: break-word; }
.job-state { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.job-state.done { color: var(--ok); }
.job-state.busy { color: var(--busy); }

/* ---- Puzzle ---- */
.game {
  --board: min(calc(100vw - 40px), max(320px, min(500px, calc(100vh - 360px))));
  padding-block: 8px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.game .board { --cs: calc(var(--board) / var(--n)); }
.game .board-wrap { overflow: visible; }
.back { font-size: 14px; font-weight: 600; text-decoration: none; }
.back:hover { text-decoration: underline; }
.play { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.game-top, .play-side { width: calc(var(--board) + 5px); max-width: 100%; }
.game-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.play-side { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.play-head { display: flex; flex-direction: column; gap: 4px; align-items: center; text-align: center; }
.play-head h1 { font-family: var(--font-display); font-size: clamp(28px, 4.4vw, 38px); line-height: 1.08; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.timer { font-family: var(--font-mono); font-size: 34px; line-height: 1; font-weight: 600; font-variant-numeric: tabular-nums; }
.actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.actions .btn { padding-block: 13px; text-align: center; }
.play-side .again { width: 100%; padding-block: 14px; text-align: center; }
.status { min-height: 48px; font-size: 15px; padding: 12px 14px; border: 1px dashed var(--line); color: var(--muted); }
.status.good { border: 1px solid var(--ok); background: var(--ok-soft); color: var(--ink); }
.status.bad { border: 1px solid var(--laser); background: var(--laser-soft); color: var(--ink); }
.howto-line { font-size: 14px; color: var(--muted); }


.panel { background: var(--paper); border: 1px solid var(--line); padding: 24px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.rules { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 9px; }
.rules li::marker { font-family: var(--font-mono); color: var(--accent); }
.legend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; }
.legend li { display: grid; grid-template-columns: 36px 1fr; gap: 10px; align-items: center; font-size: 14px; }
.legend .cell { --cs: 36px; border: 1px solid var(--line); }
.game-rules { margin-top: 24px; }
.how-controls { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line); padding-top: 20px; }
.how-controls h3 { font-family: var(--font-display); font-size: 24px; line-height: 1.1; }
.how-controls ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 7px; }

/* ---- Inner pages ---- */
.page { max-width: 760px; padding-block: 16px 56px; display: flex; flex-direction: column; gap: 22px; }
.page h1 { font-family: var(--font-display); font-size: clamp(36px, 6vw, 56px); line-height: 1.05; }
.page h2 { font-family: var(--font-display); font-size: 25px; }
.page ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.lede { font-size: 18px; color: var(--muted); }
.book-hero { display: flex; gap: 32px; align-items: center; flex-wrap: wrap; }
.book-hero .cover { transform: rotate(-3deg) scale(1.5); transform-origin: left center; margin-right: 56px; margin-block: 34px; }
.book-hero > div:last-child { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 12px; }


@media (max-width: 820px) {
  .how-rules, .how-example { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .how { padding: 20px; }
  .paths { grid-template-columns: minmax(0, 1fr); }
  .path { border-left: 0; border-top: 1px solid var(--line); }
  .path:first-child { border-top: 0; }
  .legend { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 960px) {
  .jobs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* "How to play": a plain title on wide screens, a fold-out box on phones. */
.how-toggle { all: unset; display: inline-flex; align-items: center; justify-content: space-between; gap: 12px; }
.how-toggle:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }

@media (max-width: 620px) {
  .jobs { grid-template-columns: minmax(0, 1fr); }
  .actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .daily-card .job-body h2 { font-size: 20px; }

  .how:not(.open) { gap: 0; }
  .how:not(.open) > :not(.how-head),
  .how:not(.open) .how-head > :not(h2) { display: none; }
  .how-toggle { display: flex; width: 100%; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .how-toggle::after {
    content: ""; flex: none; width: 10px; height: 10px; margin-right: 4px;
    border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
    transform: translateY(-3px) rotate(45deg);
  }
  .how.open .how-toggle::after { transform: translateY(3px) rotate(-135deg); }
}

/* Where the cards are narrowest, a smaller title keeps the building on one line. */
@media (max-width: 360px), (min-width: 621px) and (max-width: 720px), (min-width: 961px) and (max-width: 1060px) {
  .jobs .job-body h2 { font-size: 16px; }
}
@media (max-width: 360px) {
  .daily-card .job-body h2 { font-size: 16px; }
}
