/* Jigsaw Rally marketing site.
   Layout: one fixed stage. Every section is a giant jigsaw piece placed on a
   grid; scrolling drives a camera over that grid while the next piece slides
   in and locks to the one before it. Light mode only, on the app's palette. */

:root {
  color-scheme: light;

  /* App palette (see the UI direction canvas) */
  --haze: #E9EBFF;
  --table: #C3CAF8;
  --surface: #FFFFFF;
  --raised: #DCE0FF;
  --ink: #15133A;
  --ink-2: #4A4780;
  --ink-3: #5F5C99;
  --midnight: #100F2E;
  --dusk: #25245A;
  --on-dark: #F7F5FF;
  --on-dark-2: #B9B6E3;
  --coral: #FF5E57;
  --coral-ink: #B8312B;
  --peri: #7C8CFF;
  --peri-ink: #4A55C8;
  --jade: #2FD39B;
  --jade-ink: #08744F;

  --font-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-ui: "Figtree", "Avenir Next", "Segoe UI", system-ui, sans-serif;

  --radius: 22px;
  --shadow-ink: 21, 19, 58;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--table);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--peri-ink); outline-offset: 3px; border-radius: 6px; }
.tnum { font-variant-numeric: tabular-nums; }

.skip-link {
  position: fixed; left: 16px; top: -60px; z-index: 50;
  background: var(--ink); color: var(--on-dark); padding: 10px 16px; border-radius: 12px; text-decoration: none;
}
.skip-link:focus { top: calc(12px + env(safe-area-inset-top, 0px)); }

/* ---------- Floating nav ---------- */
.site-nav {
  position: fixed; z-index: 30;
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: 50%; transform: translateX(-50%);
  width: min(1180px, calc(100% - 32px));
  display: flex; align-items: center; gap: 12px;
  padding: 8px 8px 8px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .74);
  border: 1px solid rgba(var(--shadow-ink), .08);
  box-shadow: 0 10px 30px rgba(var(--shadow-ink), .08);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
}
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; margin-right: auto; }
.logo { width: 34px; height: 30px; }
.logo-a { fill: var(--coral); stroke: #fff; stroke-width: 1.2; }
.logo-b { fill: var(--peri); stroke: #fff; stroke-width: 1.2; }
.logo-jig {
  width: 40px; height: 40px; flex: none; border-radius: 11px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 4px 10px rgba(var(--shadow-ink), .18);
  transition: transform .3s cubic-bezier(.2, .9, .3, 1.4);
}
.brand:hover .logo-jig { transform: rotate(-6deg) scale(1.06); }
.wordmark { font-family: var(--font-display); font-weight: 800; font-size: 21px; letter-spacing: -.03em; white-space: nowrap; }
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  text-decoration: none; font-weight: 600; font-size: 15px; color: var(--ink-2);
  padding: 10px 14px; border-radius: 999px;
}
.nav-links a:hover { background: var(--haze); color: var(--ink); }
.nav-links a[aria-current="true"] { color: var(--ink); background: var(--haze); }
@media (max-width: 760px) { .nav-links { display: none; } }

/* ---------- Buttons, chips, badges ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border-radius: 999px;
  font: 700 16px/1 var(--font-ui); text-decoration: none; white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--coral); color: var(--ink); box-shadow: 0 6px 18px rgba(255, 94, 87, .35); }
.btn-ghost { color: var(--p-ink, var(--ink)); border: 1.5px solid currentColor; opacity: .9; }
.btn-jade { background: var(--jade); color: var(--ink); }

/* Apple's official badge, unaltered. Keep it at least 40px tall. */
.store-badge { display: inline-flex; align-items: center; border-radius: 9px; }
.store-badge img { display: block; width: auto; height: 52px; }

.chip {
  display: inline-flex; align-items: center; gap: 10px; align-self: flex-start;
  margin: 0; padding: 8px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, .8); color: var(--ink-2); font-size: 14px; font-weight: 600;
  border: 1px solid rgba(var(--shadow-ink), .08);
}
.chip b { color: var(--ink); }
.chip.on-dark { background: rgba(255, 255, 255, .08); color: var(--on-dark-2); border-color: rgba(255, 255, 255, .12); }
.chip.on-dark b { color: var(--on-dark); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 4px rgba(255, 94, 87, .2); }

.pro-badge {
  display: inline-block; padding: 3px 9px; border-radius: 999px; margin-right: 10px;
  background: var(--jade); color: var(--ink); font-size: 12px; letter-spacing: .1em;
}

/* ---------- World, table and pieces ---------- */
.stage { position: fixed; inset: 0; overflow: hidden; }
.world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.world.moving:not(.zooming) { will-change: transform; }
.js:not(.ready) .world { opacity: 0; }
.ready .world { transition: opacity .3s ease; }
.spacer { width: 1px; }

.ghosts, .seams { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.ghosts path { fill: rgba(255, 255, 255, .2); stroke: rgba(74, 85, 200, .2); stroke-width: 1.5; }
.seams { z-index: 5; }
.seams path {
  fill: none; stroke: var(--coral); stroke-width: 4; stroke-linecap: round;
  opacity: 0;
}
.seams path.flash { animation: seam 1.1s ease-out; }
@keyframes seam {
  0% { opacity: 1; stroke-dashoffset: var(--len); }
  45% { opacity: 1; stroke-dashoffset: 0; }
  100% { opacity: 0; stroke-dashoffset: 0; }
}

.piece {
  position: absolute; left: 0; top: 0;
  transform-origin: 50% 50%;
  --p-fill: var(--surface); --p-ink: var(--ink); --p-muted: var(--ink-2); --p-accent: var(--coral);
  --p-accent-ink: var(--coral-ink); --p-card: var(--haze); --p-line: rgba(var(--shadow-ink), .1);
  --ph-a: rgba(124, 140, 255, .12); --ph-b: rgba(124, 140, 255, .05); --ph-line: rgba(74, 85, 200, .35);
  --p-side: #CDD2F4; --bevel-hi: #fff; --bevel-lo: rgba(21, 19, 58, .1); --sheen-top: 0; --sheen-bottom: .04;
  color: var(--p-ink);
}
.piece.pending, .piece.off { visibility: hidden; }

/* Zoomed out, the pieces are small: one light shadow instead of three, and no
   lift shadow, keeps the pull-back to the overview smooth. */
.zooming .piece-lift { display: none; }
/* In the finished overview, every piece is a button back to its section. */
.overview-pick .piece { cursor: pointer; transition: transform .3s cubic-bezier(.2, .9, .3, 1.4); }
.overview-pick .piece-body { pointer-events: none; }
.overview-pick .piece:hover { transform: translateY(calc(-10px / var(--z, 1))) scale(1.02); z-index: 6; }
.overview-pick .piece:hover .piece-shape .rim { stroke: var(--coral); stroke-width: calc(3px / var(--z, 1)); }
.overview-tip {
  position: fixed; left: 0; top: 0; z-index: 40; pointer-events: none;
  padding: 7px 12px; border-radius: 999px; background: var(--ink); color: var(--on-dark);
  font-size: 13px; font-weight: 700; white-space: nowrap;
  box-shadow: 0 8px 20px rgba(var(--shadow-ink), .3);
  opacity: 0; transition: opacity .15s ease;
}
.overview-tip.on { opacity: 1; }
.overview-tip::before { content: "Go to "; font-weight: 500; color: var(--on-dark-2); }
.piece.active { will-change: transform; z-index: 4; }
.piece.snap .piece-body { animation: settle .45s cubic-bezier(.2, .9, .3, 1.4); }
@keyframes settle { 0% { transform: scale(1.012); } 100% { transform: none; } }

.piece-shape, .piece-lift { position: absolute; overflow: visible; pointer-events: none; }
.piece-shape .fill { fill: var(--p-fill); }
.piece-shape .side { fill: var(--p-side); }
.piece-shape .rim { fill: none; stroke: rgba(var(--shadow-ink), .12); stroke-width: 1; }
.piece-shape .bevel-hi { stroke: var(--bevel-hi); }
.piece-shape .bevel-lo { stroke: var(--bevel-lo); }
/* Contact shadow under the cut edge, then a soft ambient one. Two layers, not
   more, and never swapped mid-zoom: every extra drop-shadow is re-rasterised
   on every piece each frame the camera scales, which is what made the finale
   zoom stutter and flicker. */
.piece-shape {
  filter:
    drop-shadow(0 2px 1.5px rgba(var(--shadow-ink), .2))
    drop-shadow(0 16px 24px rgba(var(--shadow-ink), .17));
}
.piece-lift { opacity: var(--lift, 0); filter: blur(26px); }
.piece-lift path { fill: rgba(var(--shadow-ink), .45); }
.piece.active .piece-lift { will-change: opacity; }

.piece-body {
  position: relative;
  height: 100%;
  padding: var(--pad-t, 80px) var(--pad-x, 48px) var(--pad-b, 80px);
  display: flex; flex-direction: column; justify-content: center;
}
.measuring .piece-body { height: auto !important; }

/* Tones */
.piece[data-tone="haze"] { --p-fill: var(--haze); --p-card: var(--surface); --p-side: #B7BEF0; --bevel-hi: rgba(255, 255, 255, .75); --sheen-top: .3; }
.piece[data-tone="white"] { --p-fill: var(--surface); --p-card: var(--haze); }
.piece[data-tone="peri"] {
  --p-side: #5664E0; --bevel-hi: rgba(255, 255, 255, .45); --bevel-lo: rgba(21, 19, 58, .22); --sheen-top: .18; --sheen-bottom: .08;
  --p-fill: var(--peri); --p-muted: #1D1B4C; --p-card: #F4F5FF; --p-accent: var(--ink); --p-accent-ink: var(--ink);
  --ph-a: rgba(255, 255, 255, .26); --ph-b: rgba(255, 255, 255, .12); --ph-line: rgba(21, 19, 58, .4);
}
.piece[data-tone="coral"] {
  --p-side: #D63F39; --bevel-hi: rgba(255, 255, 255, .42); --bevel-lo: rgba(80, 10, 10, .22); --sheen-top: .15; --sheen-bottom: .06;
  --p-fill: var(--coral); --p-muted: #3D1210; --p-card: var(--surface); --p-accent: var(--ink); --p-accent-ink: var(--ink);
}
.piece[data-tone="ink"], .piece[data-tone="dusk"], .piece[data-tone="midnight"] {
  --p-side: #050418; --bevel-hi: rgba(255, 255, 255, .13); --bevel-lo: rgba(0, 0, 0, .32); --sheen-top: .06; --sheen-bottom: .1;
  --p-fill: var(--ink); --p-ink: var(--on-dark); --p-muted: var(--on-dark-2); --p-accent: var(--jade);
  --p-accent-ink: var(--jade); --p-card: var(--dusk); --p-line: rgba(255, 255, 255, .12);
  --ph-a: rgba(255, 255, 255, .07); --ph-b: rgba(255, 255, 255, .02); --ph-line: rgba(185, 182, 227, .4);
}
.piece[data-tone="dusk"] { --p-fill: var(--dusk); --p-card: var(--ink); --p-side: #121036; }
.piece[data-tone="midnight"] { --p-side: #030212; --p-fill: var(--midnight); --p-accent: var(--coral); --p-card: var(--dusk); }

/* ---------- Content inside a piece ---------- */
.content { width: 100%; max-width: 1180px; margin-inline: auto; display: grid; gap: clamp(28px, 4vw, 56px); }
.split { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); align-items: center; gap: clamp(28px, 5vw, 80px); }
.split.reverse > .stack { order: 2; }
.stack { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.stack.narrow { max-width: 760px; }

.display {
  margin: 0; font-family: var(--font-display); font-weight: 800;
  font-size: clamp(42px, 6.6vw, 104px); line-height: .95; letter-spacing: -.035em;
  text-wrap: balance;
}
.headline {
  margin: 0; font-family: var(--font-display); font-weight: 750;
  font-size: clamp(32px, 4.4vw, 68px); line-height: 1; letter-spacing: -.03em;
  text-wrap: balance;
}
.lede { margin: 0; font-size: clamp(17px, 1.45vw, 21px); line-height: 1.55; color: var(--p-muted); max-width: 54ch; }
.eyebrow {
  margin: 0; display: flex; align-items: center;
  font-size: 13px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--p-accent-ink);
}
/* Jig, the mascot, stands beside every eyebrow in a different pose. */
.eyebrow::before {
  content: ""; width: 26px; height: 27px; margin: -6px 10px -6px 0; flex: none;
  background: var(--jig, url(brand/jig.svg)) center / contain no-repeat;
  filter: drop-shadow(0 2px 2px rgba(21, 19, 58, .18));
}
.eyebrow.bare::before { display: none; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }

.facts, .steps { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 12px; }
.facts li, .steps li {
  display: grid; gap: 2px; padding: 14px 18px; border-radius: 16px;
  background: var(--p-card); border: 1px solid var(--p-line);
}
.facts b, .steps b { font-size: 16px; }
.facts span, .steps span { font-size: 15px; color: var(--p-muted); }
.steps { counter-reset: step; }
.steps li { grid-template-columns: auto 1fr; column-gap: 14px; }
.steps li::before {
  counter-increment: step; content: counter(step);
  grid-row: span 2; align-self: center;
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--jade); color: var(--ink); font-weight: 800; font-size: 14px;
}

.sizes { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; max-width: 520px; }
.sizes li {
  display: grid; padding: 12px 16px; border-radius: 16px; min-width: 0;
  background: var(--p-card); border: 1px solid var(--p-line); font-size: 14px; color: var(--p-muted);
}
.sizes b { font-family: var(--font-display); font-size: clamp(20px, 1.9vw, 26px); white-space: nowrap; letter-spacing: -.02em; color: var(--p-ink); }

.peek-strip { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; max-width: 460px; }
.peek-strip li {
  text-align: center; padding: 12px 0; border-radius: 12px; font-weight: 700; font-size: 13px;
  background: rgba(255, 255, 255, .28); color: var(--ink);
}
.peek-strip li.seen { background: rgba(21, 19, 58, .16); }
.peek-strip li.today { background: var(--ink); color: var(--on-dark); }
.next-hint { margin: 0; display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--ink); }
.next-hint svg, .scroll-cue svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.next-hint svg { animation: nudge-x 1.6s ease-in-out infinite; }
@keyframes nudge-x { 50% { transform: translateX(5px); } }

/* Placeholders */
.ph {
  position: relative; display: grid; place-items: center; min-height: 120px;
  border-radius: var(--radius); border: 1.5px dashed var(--ph-line);
  background: repeating-linear-gradient(135deg, var(--ph-a) 0 14px, var(--ph-b) 14px 28px);
  color: var(--p-ink);
}
.ph.tall { aspect-ratio: 3 / 4; max-height: 62vh; width: 100%; max-width: 100%; justify-self: center; }
.ph.short { aspect-ratio: 16 / 7; }
.weekly-puzzle { position: relative; justify-self: center; width: min(100%, 400px, calc(62vh * .75)); aspect-ratio: 3 / 4; cursor: pointer; border-radius: 6px; -webkit-tap-highlight-color: transparent; }
.weekly-still { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 6px; box-shadow: 0 24px 48px rgba(var(--shadow-ink), .22); }
.weekly-puzzle.ready .weekly-still { visibility: hidden; }
.weekly-puzzle canvas { position: absolute; left: -20%; top: -15%; width: 140%; height: 130%; pointer-events: none; }
.weekly-hint {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 1; pointer-events: none; white-space: nowrap;
  padding: 7px 13px; border-radius: 999px; background: rgba(21, 19, 58, .74); color: #fff; font-size: 13px; font-weight: 700;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: opacity .25s;
}
.weekly-puzzle.busy .weekly-hint { opacity: 0; }
.weekly-puzzle.spent { cursor: default; }
.weekly-puzzle:focus-visible { outline: 3px solid var(--coral); outline-offset: 6px; }
.weekly-caption { text-align: center; font-size: 14px; font-weight: 700; color: var(--p-muted); }
.ph-label {
  display: grid; gap: 2px; text-align: center; padding: 8px 14px; margin: 12px; border-radius: 12px;
  background: var(--p-fill); font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
}
.ph-label em { font-style: normal; font-weight: 500; letter-spacing: 0; text-transform: none; font-size: 13px; color: var(--p-muted); }

.visual { margin: 0; display: grid; gap: 16px; min-width: 0; }
.device.phone {
  width: min(300px, 70%); aspect-ratio: 9 / 19.5; justify-self: center;
  padding: 10px; border-radius: 46px; background: #0E0D24;
  box-shadow: 0 30px 60px rgba(var(--shadow-ink), .25), inset 0 0 0 2px rgba(255, 255, 255, .08);
  --ph-a: rgba(124, 140, 255, .22); --ph-b: rgba(124, 140, 255, .1); --ph-line: rgba(185, 182, 227, .45);
  --p-fill: var(--dusk); --p-ink: var(--on-dark); --p-muted: var(--on-dark-2);
}
.device.phone > .ph { height: 100%; border-radius: 37px; }
.shot { display: block; width: 100%; height: 100%; object-fit: cover; background: #E9EBFF; }
.device.phone > .shot { border-radius: 37px; }
.invite-shot { display: block; width: min(440px, 100%); height: auto; justify-self: center; filter: drop-shadow(0 22px 40px rgba(var(--shadow-ink), .22)); }
.device.phone.small { width: min(200px, 100%); }
.device.phone.cover-screen { width: min(250px, 100%); aspect-ratio: auto; padding: 9px; border-radius: 20px 44px 44px 20px; }
.device.phone.cover-screen > .shot { height: auto; aspect-ratio: 600 / 845; border-radius: 12px 36px 36px 12px; }
.split .visual > .device.phone { width: min(260px, 64%); }
.stat-row { display: flex; justify-content: center; gap: 28px; color: var(--p-muted); font-size: 14px; }
.stat-row span { display: grid; text-align: center; }
.stat-row b { font-family: var(--font-display); font-size: 26px; color: var(--p-ink); }

.hero-visual { margin: 0; position: relative; display: grid; place-items: center; min-height: 0; }
.hero-visual .phone { grid-area: 1 / 1; z-index: 1; transform: rotate(4deg) translateX(10%); width: min(290px, 64%); }
.hero-visual .phone-back { grid-area: 1 / 1; z-index: 0; transform: rotate(-7deg) translateX(-34%) scale(.86); opacity: .9; }
.scroll-cue {
  position: absolute; left: 50%; bottom: calc(var(--pad-b) - 56px); transform: translateX(-50%);
  margin: 0; display: flex; align-items: center; gap: 8px; white-space: nowrap;
  font-size: 14px; font-weight: 700; color: var(--ink-2);
  opacity: calc(1 - var(--intro, 0) * 3);
}
.scroll-cue svg { animation: nudge-y 1.6s ease-in-out infinite; }
@keyframes nudge-y { 50% { transform: translateY(4px); } }

.board-card {
  margin: 0; padding: 22px; border-radius: var(--radius);
  background: var(--p-card); border: 1px solid var(--p-line);
}
.board-title { margin: 0 0 14px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; font-weight: 800; font-size: 18px; }
.board-title span { font-weight: 500; font-size: 14px; color: var(--p-muted); }
.board-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.board-rows li {
  display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, .05); font-size: 15px;
}
.board-rows .rank { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: rgba(255, 255, 255, .1); }
.board-rows li:first-child .rank { background: var(--jade); color: var(--ink); }
.board-rows .time { font-weight: 700; }
.board-rows .pending { opacity: .6; }
.avatar { width: 30px; height: 30px; border-radius: 50%; border: 1.5px dashed var(--ph-line); background: var(--ph-a); }
.avatar:has(img) { border: 0; background: linear-gradient(160deg, #A9B4FF, #7C8CFF); display: grid; place-items: center; overflow: hidden; }
.avatar img { width: 78%; height: 78%; object-fit: contain; }

.sizes small { font-family: var(--font-ui); font-size: 13px; font-weight: 600; letter-spacing: 0; color: var(--p-muted); }
.sizes li { white-space: nowrap; }
.stages-title { margin: 0 auto 12px; width: min(460px, 100%); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-family: var(--font-display); font-weight: 750; font-size: 20px; letter-spacing: -.02em; }
.stages-title span { font-family: var(--font-ui); font-size: 14px; font-weight: 700; color: var(--coral-ink); align-self: center; }
.stages {
  list-style: none; margin: 0 auto; padding: 0; width: min(460px, 100%);
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px;
}
.stages li {
  display: grid; gap: 2px; padding: 12px 12px 10px; border-radius: 14px; min-width: 0;
  background: var(--haze); color: var(--ink-3); font-size: 12px; font-weight: 600;
}
.stages b { font-family: var(--font-display); font-size: 26px; line-height: 1; letter-spacing: -.02em; color: var(--ink-2); }
.stages span:last-child { min-height: 1.5em; font-weight: 700; }
.stages li.done { background: #D8F7EB; color: var(--jade-ink); }
.stages li.done b { color: var(--jade-ink); }
.stages li.now { background: var(--coral); color: var(--ink); box-shadow: 0 10px 22px rgba(255, 94, 87, .35); }
.stages li.now b { color: var(--ink); }

.packs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.ph.cover { aspect-ratio: 3 / 4; min-height: 0; }
.packs .cover { display: grid; gap: 2px; align-content: start; }
.packs .cover img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--radius); margin-bottom: 8px; box-shadow: 0 16px 32px rgba(var(--shadow-ink), .16); }
.packs .cover b { font-family: var(--font-display); font-size: 18px; font-weight: 750; letter-spacing: -.02em; line-height: 1.15; }
.packs .cover span { font-size: 14px; color: var(--p-muted); }

.occasions { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.occasions li {
  display: grid; align-content: start; gap: 8px; padding: 10px 10px 18px; border-radius: var(--radius);
  background: var(--p-card); border: 1px solid var(--p-line);
}
.occasions .ph { aspect-ratio: 4 / 3; min-height: 0; border-radius: 16px; margin-bottom: 6px; }
.occasions .photo { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; object-position: 50% 35%; border-radius: 16px; margin-bottom: 6px; }
.occasions h3 { margin: 0 8px; font-family: var(--font-display); font-size: 20px; font-weight: 750; letter-spacing: -.02em; line-height: 1.15; }
.occasions p { margin: 0 8px; font-size: 15px; color: var(--p-muted); }

.share-card {
  margin: 0 auto; width: min(380px, 100%); padding: 22px; border-radius: 26px;
  background: var(--surface); color: var(--ink);
  box-shadow: 0 30px 60px rgba(61, 18, 16, .25);
  transform: rotate(-2deg);
}
.share-line { margin: 0 0 16px; font-weight: 700; font-size: 15px; }
.mosaic { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; aspect-ratio: 6 / 8; }
.mosaic i { border-radius: 5px; background: var(--raised); }
/* The app's mosaic colours: coral for the first quarter placed, through orchid and violet, to indigo for the last. */
.mosaic .q1, .mosaic-key .q1 { background: var(--coral); }
.mosaic .q2, .mosaic-key .q2 { background: #C2477F; }
.mosaic .q3, .mosaic-key .q3 { background: #6D4BC9; }
.mosaic .q4, .mosaic-key .q4 { background: #3A3480; }
.mosaic i { transform: scale(var(--s, 1)); transition: transform .4s cubic-bezier(.2, .9, .3, 1.3); }
.mosaic-key { margin: 14px 0 0; display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ink-3); }
.mosaic-key i { width: 18px; height: 12px; border-radius: 3px; }
.mosaic-key span:first-child { margin-right: 4px; }
.mosaic-key span:last-child { margin-left: 4px; }

.device-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: clamp(24px, 4vw, 56px); }
.device-row figcaption { text-align: center; font-size: 13px; font-weight: 700; color: var(--ink-3); margin-top: 18px; }
.device-row .phone figcaption { position: absolute; left: 0; right: 0; top: 100%; margin-top: 18px; }
.device-row .phone { position: relative; margin-bottom: 40px; }
.device.duo {
  margin: 0 0 40px; flex: 1 1 520px; max-width: 760px; position: relative;
  display: grid; grid-template-columns: 1fr 14px 1fr; grid-template-rows: minmax(0, 1fr);
  padding: 12px; border-radius: 30px; background: #0E0D24; aspect-ratio: 1180 / 840;
  box-shadow: 0 30px 60px rgba(var(--shadow-ink), .25);
  --ph-a: rgba(124, 140, 255, .22); --ph-b: rgba(124, 140, 255, .1); --ph-line: rgba(185, 182, 227, .45);
  --p-fill: var(--dusk); --p-ink: var(--on-dark); --p-muted: var(--on-dark-2);
}
.duo-pane { border-radius: 20px; min-height: 0; }
.duo-pane.shot { width: 100%; height: 100%; }
.duo-hinge { background: linear-gradient(90deg, #07061a, #2a2960 50%, #07061a); border-radius: 4px; margin: 6px 3px; }
.device.duo figcaption { grid-column: 1 / -1; position: absolute; left: 0; right: 0; top: 100%; }

.footer { gap: clamp(32px, 5vw, 64px); }
.footer-cta { display: grid; gap: 20px; justify-items: start; }
.footer .headline { font-size: clamp(40px, 6vw, 92px); }
.footer-links { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 24px; padding-top: 32px; border-top: 1px solid var(--p-line); }
.footer-links div { display: grid; gap: 8px; align-content: start; }
.footer-links p { margin: 0 0 4px; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--p-muted); }
.footer-links a { text-decoration: none; color: var(--p-ink); font-weight: 600; padding: 4px 0; overflow-wrap: anywhere; }
.footer-links a:hover { color: var(--coral); }
.legal { margin: 0; font-size: 13px; color: var(--p-muted); }

/* ---------- Minimap and finale ---------- */
.minimap {
  position: fixed; z-index: 25; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  padding: 8px; border-radius: 14px; background: rgba(255, 255, 255, .7);
  border: 1px solid rgba(var(--shadow-ink), .08);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.minimap-grid { position: relative; }
.minimap button {
  position: absolute; padding: 0; border: 0; border-radius: 3px; cursor: pointer;
  background: rgba(74, 85, 200, .14); box-shadow: inset 0 0 0 1px rgba(74, 85, 200, .3);
  transition: background .25s ease;
}
.minimap button.placed { background: var(--peri); box-shadow: none; }
.minimap button.current { background: var(--coral); }
.no-js .minimap, .no-js .finale { display: none; }
@media (max-width: 640px) { .minimap { display: none; } }

.finale {
  position: fixed; z-index: 26; left: 50%; bottom: calc(40px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, calc((1 - var(--f, 0)) * 24px));
  width: min(520px, calc(100% - 32px));
  display: grid; justify-items: center; gap: 10px; text-align: center;
  padding: 22px 24px; border-radius: 26px;
  background: rgba(255, 255, 255, .96); border: 1px solid rgba(var(--shadow-ink), .08);
  box-shadow: 0 24px 60px rgba(var(--shadow-ink), .2);
  opacity: var(--f, 0); visibility: hidden;
}
.finale.on { visibility: visible; }
.finale { padding-top: 52px; }
.finale-jig { position: absolute; left: 50%; top: -62px; width: 96px; height: auto; transform: translateX(-50%); filter: drop-shadow(0 10px 12px rgba(21, 19, 58, .25)); }
.footer-jig { width: 84px; height: auto; margin-bottom: -8px; filter: drop-shadow(0 10px 16px rgba(0, 0, 0, .35)); }
.finale p { margin: 0; color: var(--ink-2); }
.finale .finale-hint { font-size: 13px; font-weight: 600; color: var(--ink-3); }
.finale .finale-title { font-family: var(--font-display); font-weight: 800; font-size: 30px; letter-spacing: -.02em; color: var(--ink); }
.finale .btn-ghost { --p-ink: var(--ink); }

/* ---------- Content slot outlines (add #slots or ?slots to the URL) ---------- */
.show-slots [data-slot] { outline: 2px dashed var(--coral); outline-offset: 3px; position: relative; }
.show-slots [data-slot]::after {
  content: attr(data-slot); position: absolute; left: 0; top: -22px; z-index: 3;
  font: 700 11px/1 var(--font-ui); letter-spacing: .04em; color: var(--ink); text-transform: none;
  background: var(--coral); padding: 4px 6px; border-radius: 6px; white-space: nowrap;
}

/* ---------- Narrow pieces ---------- */
@media (max-width: 900px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .split.reverse > .stack { order: 0; }
  .packs, .occasions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-visual { max-height: 46vh; }
  .hero-visual .phone { width: min(220px, 52%); }
  .ph.tall { max-height: 40vh; }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .facts li, .steps li { padding: 12px 14px; }
  .sizes li { min-width: 0; flex: 1; padding: 10px 12px; }
  .sizes b { font-size: 20px; }
  .occasions { grid-template-columns: minmax(0, 1fr); }
  .occasions .ph, .occasions .photo { aspect-ratio: 16 / 9; }
  .stages { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stages li { padding: 10px 10px 8px; font-size: 12px; }
  .sizes li { white-space: normal; }
  .sizes small { display: block; }
  .stages b { font-size: 22px; }
  .board-card { padding: 16px; }
  .device.duo { flex-basis: 100%; }
  .hero-visual { display: none; }
  .wordmark { font-size: clamp(15px, 4.9vw, 19px); }
  .nav-cta { min-height: 42px; padding: 0 16px; font-size: 15px; }
  .scroll-cue { font-size: 13px; }
}

/* ---------- Without JavaScript: a plain stacked page ---------- */
.no-js .stage, .no-js .world { position: static; }
.no-js .world { display: grid; gap: 28px; padding: 96px 16px 40px; }
.no-js .piece { position: relative; border-radius: 40px; background: var(--p-fill); }
.no-js .piece-body { padding: 56px clamp(20px, 5vw, 64px); }
.no-js .ghosts, .no-js .seams, .no-js .spacer, .no-js .scroll-cue { display: none; }

/* ---------- Phones and tablets (html.lite, set in main.js) ----------
   Blurred SVG shadows and bevels are repainted on every piece each frame the
   camera moves, which is what made scrolling judder on phones. The lite build
   keeps one small contact shadow, a sharp bevel and no lift shadow, and keeps
   the world on its own layer while zooming too. */
.lite .piece-shape { filter: drop-shadow(0 2px 1.5px rgba(var(--shadow-ink), .2)); }
.lite .piece-shape g { filter: none; }
.lite .piece-lift { display: none; }
.lite .world.moving { will-change: transform; }
.lite.mapped .world { visibility: hidden; }

/* The overview map that replaces the zoomed-out board on phones. */
.map {
  position: fixed; inset: 0; z-index: 2; width: 100%; height: 100%;
  opacity: var(--m, 0); visibility: hidden; pointer-events: none;
  transform: scale(calc(1.08 - .08 * var(--m, 0))); transform-origin: 50% 40%;
}
.map.on { visibility: visible; }
.overview-pick .map { pointer-events: auto; }
.map-ghosts path { fill: rgba(255, 255, 255, .2); stroke: rgba(74, 85, 200, .2); stroke-width: 1; }
.map-piece { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.map-piece .map-face { stroke: rgba(var(--shadow-ink), .14); stroke-width: 1; }
.map-piece:active .map-face { stroke: var(--coral); stroke-width: 2.5; }
.map-piece text {
  font-family: var(--font-ui); font-weight: 800; letter-spacing: -.01em;
  text-anchor: middle; dominant-baseline: central; pointer-events: none;
}
/* A shorter finale card on phones leaves room for the map above it. */
@media (max-width: 640px) {
  .lite .finale { gap: 6px; padding: 18px 18px 18px; }
  .lite .finale-jig { display: none; }
  .lite .finale .finale-title { font-size: 24px; }
  .lite .finale p:not(.finale-title):not(.finale-hint) { display: none; }
}
