/* Mateur is a paid font: drop the licensed files into assets/fonts/ with these names and they're picked up automatically. */
@font-face {
  font-family: "Mateur";
  src: url("assets/fonts/Mateur.woff2") format("woff2"), url("assets/fonts/Mateur.woff") format("woff"), url("assets/fonts/Mateur.otf") format("opentype"), url("assets/fonts/Mateur.ttf") format("truetype");
  font-display: swap;
}

/* ───────── Tokens ───────── */
:root {
  --ink: #060a1f;
  --night: #0b1240;
  --indigo: #2b3cc4;
  --periwinkle: #9aa6ff;
  --frost: #e9ecff;
  --aurora: #5de0cf;
  --text: #f2f4ff;
  --text-dim: rgba(226, 231, 255, 0.72);
  --glass: rgba(18, 26, 80, 0.55);
  --glass-line: rgba(200, 210, 255, 0.22);

  /* titles: Mateur (licensed, self-hosted in assets/fonts) → Pangolin until the file is added; body: Montserrat */
  --title: "Mateur", "Pangolin", "Caveat", cursive;
  --display: var(--title);
  --sans: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;

}

*,
*::before,
*::after { box-sizing: border-box; }

html { color-scheme: dark; scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ───────── Header: floating glass pill ───────── */
.site-header {
  position: fixed;
  z-index: 10;
  top: max(16px, env(safe-area-inset-top, 0px));
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  pointer-events: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 36px;
  max-width: 100%;
  padding: 7px 7px 7px 22px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 10px 30px -12px rgba(4, 10, 50, 0.6);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  pointer-events: auto;
}

.site-logo { display: flex; flex: none; }
.site-logo img { display: block; height: 17px; width: auto; }

.site-links {
  display: flex;
  gap: 26px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
}

.site-links a { color: rgba(255, 255, 255, 0.82); transition: color 0.2s; white-space: nowrap; }
.site-links a:hover { color: #fff; }

.site-cta {
  flex: none;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.2s;
}

.site-cta:hover { background: rgba(255, 255, 255, 0.3); }

.site-logo:focus-visible,
.site-links a:focus-visible,
.site-cta:focus-visible { outline: 2px solid #fff; outline-offset: 3px; border-radius: 6px; }

@media (max-width: 720px) {
  .site-links { display: none; }
  .site-nav { gap: 10px; padding-left: 14px; }
  .site-logo img { height: 13px; }
  .site-cta { padding: 7px 12px; font-size: 13px; }
}

/* ───────── Hero ───────── */
.hero {
  position: relative;
  z-index: 1;
  height: 100vh;
  height: 100svh;
  min-height: 520px;
  overflow: hidden;
  isolation: isolate;
  background: #050b2a;

  /* The ground layers are laid out in the 2000×1306 composition frame.
     The frame is cover-sized to the screen and bottom-aligned, so the snow is never cut and only sky is cropped. */
  --frame-ratio: 1.5314;
  --gw: max(100vw, 100svh * var(--frame-ratio));
  --gx: calc((100vw - var(--gw)) / 2);

  /* drift boxes, in % of the frame (measured from the reference composition) */
  --dl-x: -16.6%;  --dl-y: 55.74%;  --dl-w: 85.9%;    /* left drift: drift-left.webp 1903×1196 */
  --dr-x: 36.6%;   --dr-y: 68.84%;  --dr-w: 74.95%;   /* right drift: drift-right.webp 1660×580 */

  /* robot, placed relative to the left drift so it always stays tucked behind it */
  --nrk-dx: 21%;  --nrk-dy: -13%;  --nrk-w: 24%;
}

/* The scene wrapper carries the heat-haze distortion. */
.scene { position: absolute; inset: 0; z-index: 0; }
.defs { position: absolute; }

.sky {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 62%;
  user-select: none;
}

.hero-sparkles { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0.5; }

.ground {
  position: absolute;
  left: var(--gx);
  bottom: 0;
  width: var(--gw);
  aspect-ratio: var(--frame-ratio);
  pointer-events: none;
}

.ground img { position: absolute; display: block; height: auto; user-select: none; -webkit-user-drag: none; }
.dunes { position: absolute; left: -10.47%; top: 17.15%; width: 131.5%; aspect-ratio: 2000 / 1121; }

/* ───────── Garland light on the snow ─────────
   White snow can't be brightened, so the warm light is laid on as a multiply tint (white → warm cream),
   clipped to each snow image and centred under the robot and the book. Positions follow the layout variables. */
.dunes-light,
.drift-left-light,
.drift-right-light {
  mix-blend-mode: multiply;
  pointer-events: none;
  animation: garland-flicker 2.6s ease-in-out infinite;
}

.dunes-light {
  -webkit-mask: url("assets/snow-dunes.webp") 0 0 / 100% 100% no-repeat;
  mask: url("assets/snow-dunes.webp") 0 0 / 100% 100% no-repeat;
  background:
    radial-gradient(16% 15% at calc((var(--dl-x) + var(--nrk-dx) + var(--nrk-w) / 2 + 10.47%) / 1.315) 47%, rgba(255, 196, 130, 0.9), rgba(255, 210, 160, 0.35) 55%, transparent 100%),
    radial-gradient(13% 13% at calc((var(--dr-x) + var(--dr-w) * 0.66 + 10.47%) / 1.315) 50%, rgba(255, 196, 130, 0.85), rgba(255, 210, 160, 0.3) 55%, transparent 100%);
}

.drift { position: absolute; }
/* snow is drawn as a coloured dot screen (snow-dots.js) on a canvas in the image's place;
   the image stays in the DOM, hidden, because other scripts measure it */
.snow-src { visibility: hidden; }
canvas.snow-dots { display: block; height: auto; image-rendering: pixelated; }
.drift-left { left: var(--dl-x); top: var(--dl-y); width: var(--dl-w); aspect-ratio: 1903 / 1196; }
.drift-right { left: var(--dr-x); top: var(--dr-y); width: var(--dr-w); aspect-ratio: 1660 / 580; }

/* the garland's warm light on the front drifts, clipped to each drift */
.drift-left-light {
  -webkit-mask: url("assets/drift-left.webp") 0 0 / 100% 100% no-repeat;
  mask: url("assets/drift-left.webp") 0 0 / 100% 100% no-repeat;
  background: radial-gradient(26% 22% at 38% 22%, rgba(255, 190, 120, 0.95), rgba(255, 210, 160, 0.35) 55%, transparent 100%);
}

.drift-right-light {
  -webkit-mask: url("assets/drift-right.webp") 0 0 / 100% 100% no-repeat;
  mask: url("assets/drift-right.webp") 0 0 / 100% 100% no-repeat;
  background: radial-gradient(24% 55% at 66% 22%, rgba(255, 190, 120, 0.95), rgba(255, 210, 160, 0.35) 55%, transparent 100%);
}

/* ───────── Patch ─────────
   Placed in the right drift's frame: centre over the drift's left slope, lower part hidden behind the drift. */
.patch {
  --size: calc(var(--dr-w) * 0.13);
  position: absolute;
  /* the drift's crest at 47% of its width is ~36.6% down the image (image height = 0.349 × width) */
  left: calc(var(--dr-x) + var(--dr-w) * var(--patch-fx, 0.34) - var(--size) / 2);
  top: calc(var(--dr-y) + var(--dr-w) * 0.128 - var(--size) * 0.6);
  width: var(--size);
  aspect-ratio: 1;
  perspective: 900px;
  pointer-events: auto;
  cursor: pointer;
  transition: translate 0.45s cubic-bezier(0.4, 0, 0.6, 1);
}
.patch.is-up {
  translate: 0 -62%;
  transition: translate 0.6s cubic-bezier(0.25, 1.6, 0.45, 1);
}
/* once up, it hangs in the air and floats like the book */
.patch-float { position: absolute; inset: 0; transform-style: preserve-3d; }
.patch.is-up .patch-float { animation: float-bob 2.6s ease-in-out 0.6s infinite; }
@keyframes float-bob { 50% { transform: translateY(-5%); } }

.patch-spin {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  rotate: x -8deg;
}
.patch.is-spinning .patch-spin { animation: patch-spin 1.1s cubic-bezier(0.45, 0.05, 0.25, 1); }
@keyframes patch-spin { from { transform: rotateY(0deg); } to { transform: rotateY(360deg); } }
.patch-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  filter: drop-shadow(0 6px 10px rgba(5, 10, 40, 0.5));
  user-select: none;
  -webkit-user-drag: none;
}
.patch-back { transform: rotateY(180deg); }

.boil { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.snow-spray { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.snowfall { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* ───────── Ground robot + lynx ───────── */
.nrk,
.nrk-spill {
  position: absolute;
  left: calc(var(--dl-x) + var(--nrk-dx));
  top: calc(var(--dl-y) + var(--nrk-dy));
  width: var(--nrk-w);
  aspect-ratio: 1274 / 1517;
  pointer-events: none;
  opacity: 0;
  animation: nrk-in 1.4s 0.2s ease forwards;
  /* hop: a springy rise out of the drift, a softer fall back */
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.6, 1);
}

.hero.nrk-up .nrk,
.hero.nrk-up .nrk-spill {
  transform: translateY(-16%);
  transition: transform 0.6s cubic-bezier(0.25, 1.6, 0.45, 1);
}

.hero.nrk-hover { cursor: pointer; }
.hero.nrk-up .nrk-body { animation: float-bob-small 2.6s ease-in-out 0.6s infinite; }
@keyframes float-bob-small { 50% { transform: translateY(-1.5%); } }

/* cards for the robot and the patch: same panel as the book card, title in a hand-drawn face */
.obj-card-title {
  margin: 0;
  font-family: var(--title);
  font-weight: 700;
  font-size: 34px;
  line-height: 1.05;
}
.obj-card .book-card-text + .book-card-text { margin-top: -8px; }

@keyframes nrk-in { to { opacity: 1; } }

/* garland spill: a big warm light map, screened over the dunes around the robot */
.nrk-spill { mix-blend-mode: screen; }
.nrk-spill canvas {
  position: absolute;
  left: -70%;
  top: -45%;
  width: 240%;
  height: 190%;
  animation: garland-flicker 2.6s ease-in-out infinite;
}

/* garland light on the robot itself, clipped to the painted robot */
.nrk-light {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  mix-blend-mode: screen;
  -webkit-mask: url("assets/nrk-base.webp") 0 0 / 100% 100%, url("assets/nrk-front.webp") 0 0 / 100% 100%;
  mask: url("assets/nrk-base.webp") 0 0 / 100% 100%, url("assets/nrk-front.webp") 0 0 / 100% 100%;
  animation: garland-flicker 2.6s ease-in-out infinite;
}

@keyframes garland-flicker {
  0%, 100% { opacity: 0.88; }
  18% { opacity: 1; }
  34% { opacity: 0.8; }
  52% { opacity: 0.97; }
  70% { opacity: 0.84; }
  86% { opacity: 1; }
}

.nrk-body {
  position: absolute;
  inset: 0;
  filter: drop-shadow(-4px -3px 10px rgba(150, 170, 255, 0.22));
}


.nrk-body img,
.nrk-lynx {
  position: absolute;
  user-select: none;
  -webkit-user-drag: none;
}

.nrk-body img { inset: 0; width: 100%; height: 100%; }

/* 9×4 sprite sheet (558×866 cells): columns = gaze left→right, rows = up→down */
.nrk-lynx {
  left: 29.66%;
  top: 17%; /* lynx-top */
  width: 38.36%;
  height: 50%;
  background: url("assets/nrk-lynx.webp") 50% 50% / 900% 400% no-repeat;
  transform-origin: 52% 97%;
  animation: lynx-breathe 3.2s ease-in-out infinite;
}

/* warm light from the garland falling on the lynx, clipped to its current frame */
.nrk-lynx::before {
  content: "";
  position: absolute;
  inset: 0;
  -webkit-mask: url("assets/nrk-lynx.webp") var(--frame, 50% 50%) / 900% 400% no-repeat;
  mask: url("assets/nrk-lynx.webp") var(--frame, 50% 50%) / 900% 400% no-repeat;
  background:
    radial-gradient(35% 40% at 6% 55%, rgba(255, 165, 60, 0.32), transparent 70%),
    radial-gradient(35% 40% at 96% 65%, rgba(255, 165, 60, 0.26), transparent 70%);
  mix-blend-mode: screen;
  animation: garland-flicker 2.6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes lynx-breathe { 50% { transform: scaleY(1.008) scaleX(0.997); } }

/* Christmas lights: strung over the robot, and laid along the right drift's crest (all built by nrk.js) */
.nrk-garland { position: absolute; inset: 0; width: 100%; height: 100%; }
.garland { overflow: visible; }
.garland .wire { fill: none; stroke: #141b3a; stroke-linecap: round; opacity: 0.9; }
.garland .cap { fill: #1d2540; }
.garland .bulb { fill: #fff0a8; stroke: #ffb300; stroke-width: 0.8; animation: twinkle 1.8s ease-in-out infinite; }
.garland .halo { fill: #ffb030; animation: twinkle 1.8s ease-in-out infinite; }
.garland .bloom { fill: #ff9a1f; opacity: 0.4; }
@keyframes twinkle { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }

/* Phones and tall screens: a narrower frame, with both drifts pulled towards the middle
   so the robot (left) and the book (right) are both on screen. */
@media (max-aspect-ratio: 4/5) {
  .hero {
    --gw: 230vw;
    --dl-x: 8%;
    --dr-x: 5%;
    --nrk-w: 20%;
    --nrk-dx: 23%;
  }
}

/* ───────── Book ───────── */
.book-scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.book-scene.is-ready { opacity: 1; }
.book-scene.is-hover { cursor: pointer; }

/* invisible focus target placed over the book by book.js */
.book-hit {
  position: absolute;
  z-index: 2;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: none;
  pointer-events: none;
}

.book-hit:focus-visible { outline: 2px solid var(--periwinkle); outline-offset: 6px; }

/* ───────── Info card ─────────
   Built from the Figma frame (990×626), scaled to 0.44: square corners,
   frosted white 20 % panel, hand-lettered title, outline + solid buttons. */
.book-card {
  --cta: #4640ed;
  position: absolute;
  z-index: 8;   /* above the hero headline (z 4), below the fixed header */
  left: 0;
  top: 0;
  width: min(440px, calc(100vw - 32px));
  padding: 25px 27px 20px;
  /* frosted like the design, with a night tint so text stays readable over the white snow */
  background: linear-gradient(rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.1)), rgba(10, 16, 52, 0.94);
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  color: #fff;
  opacity: 0;
  transform: translate(var(--from-x, -10px), 6px) scale(0.97);
  transform-origin: var(--origin, left center);
  transition: opacity 0.28s ease, transform 0.38s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
}

.book-card[hidden] { display: block; visibility: hidden; }

.book-card.is-open {
  visibility: visible;
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.book-card-title { margin: 0; line-height: 0; }
.book-card-title img { display: block; width: 78%; max-width: 100%; height: auto; }

.book-card-text {
  margin: 24px 0 31px;
  font-size: 15px;
  line-height: 1.53;
  color: rgba(255, 255, 255, 0.67);
}

.book-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.book-card-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 45px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.book-card-btn--ghost { border: 1px solid #fff; }
.book-card-btn--ghost:hover { background: rgba(255, 255, 255, 0.12); }
.book-card-btn--solid { background: var(--cta); }
.book-card-btn--solid:hover { background: #5a55ff; }
.book-card-btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* ───────── Below the hero: Roboneers' site language, softened ─────────
   Layout concept: alternating black / light-grey bands, square corners, one electric blue,
   Geist for text and Geist Mono for small lowercase labels. */
:root {
  --rb-black: #000;
  --rb-ink: #0d0d0d;
  --rb-light: #ededed;
  --rb-white: #fff;
  --rb-blue: #2b2bff;
  --rb-blue-2: #1f1fd6;
  --rb-grey: #8a8a8a;
  --rb-line: #e3e3e3;
  --rb-sans: var(--sans);
  --rb-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

body { background: var(--rb-black); }

/* snow melts into the black band below */
.hero::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 14svh;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0), #000);
  pointer-events: none;
}

.rb-wrap {
  max-width: 1360px;
  margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

.rb-section { padding-block: clamp(56px, 7vw, 96px); font-family: var(--rb-sans); }
.rb-dark { background: var(--rb-black); color: #fff; }

.rb-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 16px; margin-bottom: 28px; }
.rb-title { min-width: 0; }
.rb-title { margin: 0; font-family: var(--title); font-weight: 400; font-size: clamp(28px, 3.4vw, 44px); letter-spacing: -0.02em; line-height: 1.1; text-wrap: balance; }
.rb-label { font-family: var(--rb-mono); font-size: 12px; color: var(--rb-grey); letter-spacing: 0.02em; }
.rb-label { margin: 0 0 10px; }

/* placeholders: dashed underline / italic, easy to spot before launch */
.tbd { border-bottom: 1px dashed currentColor; }
.tbd-text { font-style: italic; opacity: 0.7; }

/* Tabs */
.rb-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; margin-bottom: 18px; }
.rb-tab {
  position: relative;
  display: flex; align-items: center; gap: 14px;
  height: 64px; padding: 0 18px;
  border: 0; background: #1c1c1c; color: #fff;
  font: 500 clamp(15px, 1.4vw, 20px) var(--rb-sans);
  text-align: left; cursor: pointer;
  transition: background-color 0.2s;
}
.rb-tab span { font-family: var(--rb-mono); font-size: 14px; color: #9a9aff; }
.rb-tab:hover { background: #262626; }
.rb-tab.is-active { background: var(--rb-blue); }
.rb-tab.is-active span { color: #c9c9ff; }
/* the striped strip under the active tab */
.rb-tab.is-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -12px; height: 8px;
  background: repeating-linear-gradient(135deg, #2a2a2a 0 6px, transparent 6px 12px);
}
.rb-tab:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Viewer frame */
.rb-viewer {
  position: relative;
  background: radial-gradient(70% 90% at 70% 60%, #101a3a 0%, #05070f 70%);
  min-height: clamp(380px, 42vw, 560px);
}
.rb-pane { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 32px; padding: clamp(32px, 5vw, 72px); }
.rb-pane[hidden] { display: none; }
.rb-pane.is-active { animation: rb-fade 0.45s ease both; }
@keyframes rb-fade { from { opacity: 0; transform: translateY(8px); } }
.rb-pane img { justify-self: center; max-height: clamp(260px, 32vw, 440px); width: auto; max-width: 100%; filter: drop-shadow(0 24px 40px rgba(43, 43, 255, 0.25)); }
.rb-pane-text { min-width: 0; }
.rb-kicker { margin: 0 0 14px; font-family: var(--rb-mono); font-size: 12px; color: #9a9aff; }
.rb-pane h3 { margin: 0 0 16px; font-weight: 500; font-size: clamp(24px, 2.6vw, 36px); line-height: 1.15; letter-spacing: -0.015em; text-wrap: balance; }
.rb-pane p { margin: 0; color: #c8c8c8; line-height: 1.6; max-width: 52ch; }
.rb-pane .rb-kicker { color: #9a9aff; }

/* Product cards */
.rb-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.rb-card { display: flex; flex-direction: column; background: var(--rb-white); color: var(--rb-ink); padding-top: 0; }
.rb-card-tab {
  align-self: flex-end;
  margin: -36px 0 0; padding: 10px 20px;
  background: var(--rb-white); font-weight: 500; font-size: clamp(22px, 2.2vw, 30px); letter-spacing: -0.01em;
}
.rb-cards { margin-top: 64px; row-gap: 72px; }
.rb-card-media { display: grid; place-items: center; height: clamp(240px, 24vw, 320px); padding: 24px; border-bottom: 1px solid var(--rb-line); }
.rb-card-media img { height: 100%; width: 100%; object-fit: contain; min-height: 0; }
.rb-card-media { overflow: hidden; }
.rb-rows { margin: 0; padding: 12px 24px 24px; flex: 1; }
.rb-rows div { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--rb-line); font-size: 14px; }
.rb-rows dt { color: var(--rb-grey); }
.rb-rows dd { margin: 0; }
.rb-order { display: flex; align-items: stretch; height: 52px; background: var(--rb-blue); color: #fff; font-weight: 600; font-size: 14px; text-transform: uppercase; letter-spacing: 0.04em; }
.rb-order:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* the two items are one set: one order bar under both cards */
.rb-cards { position: relative; }
.rb-set {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(220px, 300px); align-items: stretch;
  margin-top: 16px; background: var(--sens-cream, #fff); color: var(--rb-ink);
}
.rb-set-info { padding: 20px 24px; min-width: 0; }
.rb-set-info .rb-label { margin-bottom: 6px; }
.rb-set-name { margin: 0; font-weight: 600; font-size: 16px; line-height: 1.4; }
.rb-set-price { margin: 0; display: grid; place-items: center; padding: 0 28px; font-family: var(--title, sans-serif); font-size: 40px; white-space: nowrap; border-left: 1px solid var(--rb-line); }
.rb-set-order { height: auto; min-height: 64px; }
@media (max-width: 900px) {
  .rb-cards { row-gap: 64px; }
  .rb-set { grid-template-columns: 1fr auto; }
  .rb-set-order { grid-column: 1 / -1; }
}

/* two-column note panel */
.rb-note { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 56px; padding: 32px 40px; background: var(--rb-white); color: var(--rb-ink); }
.rb-note p { margin: 0; line-height: 1.6; font-size: 15px; }
.rb-note .rb-label { margin-bottom: 10px; }
.rb-note a { color: var(--rb-blue); }

/* Mini-games */
.rb-games { margin-top: 96px; }
.rb-game { position: relative; background: var(--rb-white); color: var(--rb-ink); margin-top: 52px; }
.rb-game .rb-card-tab { position: absolute; right: 0; top: -44px; margin: 0; }
.rb-game p { margin: 0; line-height: 1.55; font-size: 15px; color: #333; }
.rb-btn-line { height: 40px; padding: 0 16px; border: 1px solid var(--rb-ink); background: none; color: var(--rb-ink); font: 600 13px var(--rb-sans); text-transform: uppercase; letter-spacing: 0.04em; cursor: pointer; }
.rb-btn-line:hover { background: var(--rb-light); }
.rb-btn-line:focus-visible, .cg-swatch:focus-visible { outline: 2px solid var(--rb-blue); outline-offset: 2px; }

.cg-body { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 28px; padding: 24px; }
.cg-canvas { display: block; width: 100%; height: 100%; transform-origin: 0 0; border: 1px solid var(--rb-line); cursor: crosshair; touch-action: manipulation; }
.cg-side { display: grid; align-content: start; gap: 20px; }
.cg-swatches { display: grid; grid-template-columns: repeat(5, 44px); gap: 10px; }
.cg-swatch { width: 44px; height: 44px; border: 0; background: var(--c); cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.cg-swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--rb-white), 0 0 0 5px var(--rb-ink); }

.rg-track { position: relative; height: 120px; background: repeating-linear-gradient(90deg, #f3f3f3 0 24px, #ebebeb 24px 48px); overflow: hidden; cursor: pointer; touch-action: manipulation; }
.rg-target { position: absolute; left: 50%; top: 0; bottom: 0; width: 13%; translate: -50% 0; border-left: 2px dashed var(--rb-blue); border-right: 2px dashed var(--rb-blue); background: rgba(43, 43, 255, 0.07); }
.rg-patch { position: absolute; top: 50%; width: 88px; height: 88px; translate: -50% -50%; pointer-events: none; filter: drop-shadow(0 6px 8px rgba(0,0,0,.25)); }
.rg-track.is-hit .rg-target { background: rgba(43, 43, 255, 0.22); }
.rg-track.is-miss { animation: rg-shake 0.3s; }
@keyframes rg-shake { 25% { translate: -6px 0; } 75% { translate: 6px 0; } }
.rg-msg { min-height: 1.5em; font-weight: 600; font-size: 18px !important; color: var(--rb-ink) !important; }
.rg-btn { width: 200px; border: 0; cursor: pointer; font-family: var(--rb-sans); }


@media (max-width: 900px) {
  .cg-body { grid-template-columns: 1fr; }
}

/* Blue banner */
.rb-banner { background: var(--rb-blue); color: #fff; font-family: var(--rb-sans); overflow: hidden; }
.rb-banner-inner { display: grid; grid-template-columns: 1.2fr 1fr; align-items: center; gap: 32px; padding-block: clamp(40px, 5vw, 64px); }
.rb-banner-title { display: inline-flex; align-items: stretch; gap: 8px; margin: 0 0 24px; font-family: var(--title); font-weight: 400; font-size: clamp(24px, 3vw, 36px); text-transform: uppercase; }
.rb-banner-title i { width: 10px; background: rgba(255, 255, 255, 0.28); }
.rb-banner-title span { padding: 4px 14px; background: rgba(255, 255, 255, 0.16); }
.rb-banner p { margin: 0 0 24px; max-width: 46ch; font-size: clamp(16px, 1.4vw, 19px); line-height: 1.5; }
.rb-banner img { justify-self: center; max-height: 340px; width: auto; max-width: 100%; mix-blend-mode: luminosity; opacity: 0.85; filter: brightness(1.15) contrast(1.05); }
.rb-btn-ghost { display: inline-grid; place-items: center; height: 40px; padding: 0 18px; border: 1px solid rgba(255, 255, 255, 0.6); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; transition: background-color 0.2s; }
.rb-btn-ghost:hover { background: rgba(255, 255, 255, 0.14); }
.rb-btn-ghost:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* FAQ, news-list style */
.rb-list { display: grid; gap: 2px; }
.rb-list details { background: var(--rb-white); }
.rb-list summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; cursor: pointer; list-style: none; }
.rb-list summary::-webkit-details-marker { display: none; }
.rb-list summary span { display: grid; gap: 4px; font-weight: 500; font-size: clamp(16px, 1.4vw, 19px); }
.rb-list summary i { flex: none; display: grid; place-items: center; width: 28px; height: 28px; background: #eee; font-style: normal; transition: transform 0.2s, background-color 0.2s; }
.rb-list details[open] summary i { transform: rotate(90deg); background: var(--rb-blue); color: #fff; }
.rb-list summary:focus-visible { outline: 2px solid var(--rb-blue); outline-offset: -2px; }
.rb-list details p { margin: 0; padding: 0 20px 20px; max-width: 70ch; line-height: 1.6; color: #444; }

/* Footer */
.rb-footer { background: var(--rb-black); color: #fff; font-family: var(--rb-sans); padding-block: 56px 32px; }
.rb-footer-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 56px; }
.rb-footer-top img { height: 26px; width: auto; max-width: 100%; object-fit: contain; object-position: left; }
.rb-footer-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.rb-footer-cols > div { display: grid; align-content: start; gap: 10px; font-size: 14px; }
.rb-footer-cols a:hover { color: #9a9aff; }
.rb-copy { margin: 56px 0 0; font-size: 13px; color: #8a8a8a; }

@media (max-width: 900px) {
  .rb-pane, .rb-banner-inner, .rb-note { grid-template-columns: 1fr; }
  .rb-pane { position: relative; inset: auto; }
  .rb-pane img { max-height: 260px; order: -1; }
  .rb-viewer { min-height: 0; }
  .rb-cards { grid-template-columns: 1fr; }
  .rb-footer-cols { grid-template-columns: 1fr 1fr; }
  .rb-banner img { max-height: 220px; }
}

@media (max-width: 560px) {
  .rb-tab { height: 56px; padding: 0 12px; gap: 8px; font-size: 14px; }
  .rb-rows div { grid-template-columns: 1fr; gap: 2px; }
  .rb-note { padding: 24px 20px; }
}

/* ───────── Hero copy (over the sky) ───────── */
.hero-copy {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: clamp(96px, 15svh, 150px);
  translate: -50% 0;
  width: min(760px, calc(100% - 32px));
  text-align: center;
  pointer-events: none;
  color: #fff;
}
.hero-kicker {
  display: inline-block;
  margin: 0 0 14px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  font: 500 13px var(--rb-sans, "Inter", sans-serif);
  letter-spacing: 0.02em;
}
.hero-title {
  margin: 0;
  font-family: var(--sens-hand);
  font-weight: 400;
  font-size: clamp(48px, 7.4vw, 108px);
  line-height: 0.95;
  color: #fff;
  -webkit-text-stroke: 3px #111;
  paint-order: stroke fill;
  text-shadow: 5px 6px 0 #111;
  rotate: -2deg;
  text-wrap: balance;
}
.hero-title span { color: var(--sens-lime); }
.hero-lede {
  margin: 18px auto 24px;
  max-width: 46ch;
  font: 400 clamp(15px, 1.35vw, 18px) / 1.5 var(--rb-sans, "Inter", sans-serif);
  text-shadow: 0 1px 12px rgba(0, 0, 40, 0.8);
}
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.hero-btn {
  pointer-events: auto;
  display: inline-grid;
  place-items: center;
  height: 50px;
  padding: 0 24px;
  border-radius: 999px;
  border: 2px solid #111;
  font: 600 15px var(--rb-sans, "Inter", sans-serif);
  box-shadow: 3px 4px 0 #111;
  transition: translate 0.15s, box-shadow 0.15s;
}
.hero-btn:hover { translate: -1px -1px; box-shadow: 4px 5px 0 #111; }
.hero-btn:active { translate: 2px 3px; box-shadow: 1px 1px 0 #111; }
.hero-btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.hero-btn--buy { background: var(--sens-lime); color: #111; }
.hero-btn--try { background: #fff; color: #111; }
@media (max-aspect-ratio: 4/5) {
  .hero-copy { top: 88px; }
  .hero-lede { margin: 12px auto 18px; }
  .hero-btn { height: 44px; padding: 0 18px; font-size: 14px; }
}

/* ───────── Сенс layer: the bookstore's identity on top of the Roboneers bands ─────────
   Acid lime + deep green, Christmas red, white "sticker" labels with a thick outline,
   titles in --title (Mateur, Pangolin fallback) and scribbled stars. */
:root {
  --sens-lime: #c5f33a;
  --sens-green: #2f8a3c;
  --sens-red: #d0222e;
  --sens-cream: #fbf8ef;
  --sens-hand: var(--title);
  --sens-caps: var(--title);
  --doodle-star-y: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cg fill='none' stroke='%23f4d23a' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M20 3 L21 18 M20 37 L19 22 M3 20 L18 19 M37 20 L22 21 M8 8 L18 18 M32 32 L22 22 M32 8 L22 18 M8 32 L18 22'/%3E%3C/g%3E%3C/svg%3E");
  --doodle-star-r: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cg fill='none' stroke='%23d0222e' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M20 3 L21 18 M20 37 L19 22 M3 20 L18 19 M37 20 L22 21 M8 8 L18 18 M32 32 L22 22 M32 8 L22 18 M8 32 L18 22'/%3E%3C/g%3E%3C/svg%3E");
  --doodle-spark-b: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M20 2 C21 14 26 19 38 20 C26 21 21 26 20 38 C19 26 14 21 2 20 C14 19 19 14 20 2Z' fill='none' stroke='%233b48c4' stroke-width='2.2' stroke-linejoin='round'/%3E%3C/svg%3E");
  --doodle-spark-l: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M20 2 C21 14 26 19 38 20 C26 21 21 26 20 38 C19 26 14 21 2 20 C14 19 19 14 20 2Z' fill='none' stroke='%23c5f33a' stroke-width='2.2' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* section titles become tilted stickers */
.sens-sticker {
  position: relative;
  display: inline-block;
  padding: 6px 18px 10px;
  background: #fff;
  color: #111;
  font-family: var(--sens-caps);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
  line-height: 1;
  border-radius: 16px;
  box-shadow: 0 0 0 4px #111, 6px 7px 0 4px #111;
  rotate: -1.5deg;
}
.sens-lime { background: var(--sens-lime); rotate: 1.2deg; }
.sens-red { background: var(--sens-red); color: #fff; }
.sens-sticker::after {
  content: "";
  position: absolute;
  right: -46px; top: -30px;
  width: 44px; height: 44px;
  background: var(--doodle-star-y) center / contain no-repeat;
  rotate: 12deg;
}
.sens-lime::after { background-image: var(--doodle-spark-b); }
.sens-red::after { background-image: var(--doodle-star-y); }

/* hand-drawn marker headline, like «Сенс шукає талант!» */
.sens-hand {
  font-family: var(--sens-hand);
  font-weight: 400;
  font-size: clamp(48px, 6vw, 84px);
  color: var(--sens-lime);
  letter-spacing: -0.01em;
  -webkit-text-stroke: 2px #111;
  paint-order: stroke fill;
  text-shadow: 4px 5px 0 #fff;
  rotate: -2deg;
}

/* doodles may poke out of a heading; never let them widen the page */
.rb-section, .rb-banner { overflow-x: clip; }

/* scattered doodles in the dark bands */
.rb-dark { position: relative; }
.rb-dark::before, .rb-dark::after {
  content: "";
  position: absolute;
  width: 56px; height: 56px;
  pointer-events: none;
  background: var(--doodle-spark-l) center / contain no-repeat;
  opacity: 0.85;
}
.rb-dark::before { right: 6%; top: 40px; rotate: -10deg; }
.rb-dark::after { left: 3%; bottom: 36px; width: 38px; height: 38px; background-image: var(--doodle-star-r); }

/* product card tabs & game tabs as rounded stickers */
.rb-card-tab {
  font-family: var(--sens-hand);
  font-weight: 400;
  border-radius: 14px 14px 0 0;
}
.rb-card, .rb-game, .rb-note, .rb-list details { background: var(--sens-cream); }
.rb-card-tab { background: var(--sens-cream); }

/* lime banner instead of the blue one */
.sens-banner { background: var(--sens-green); position: relative; }
.sens-banner .rb-banner-title { font-family: var(--sens-hand); text-transform: none; font-size: clamp(34px, 4.4vw, 56px); }
.sens-banner .rb-banner-title span { background: var(--sens-lime); color: #111; border-radius: 14px; padding: 2px 18px 6px; box-shadow: 0 0 0 3px #111; rotate: -2deg; }
.sens-banner .rb-banner-title i { display: none; }
.sens-banner::before {
  content: ""; position: absolute; left: 46%; top: 24px; width: 64px; height: 64px;
  background: var(--doodle-star-y) center / contain no-repeat; rotate: 18deg;
}
.sens-banner .rb-btn-ghost { background: var(--sens-lime); color: #111; border-color: #111; border-radius: 999px; }
.sens-banner .rb-btn-ghost:hover { background: #fff; }
.sens-banner img { mix-blend-mode: normal; opacity: 1; filter: drop-shadow(0 10px 18px rgba(0,0,0,.35)); }

/* light band in Сенс cream, with a red frame like the Christmas card */
.rb-list details { background: #fff; border: 2px solid #111; border-radius: 12px; }
.rb-list { gap: 10px; }
.rb-list details[open] summary i { background: var(--sens-red); }

/* Roboneers blue stays on the actions; Сенс lime marks the active things */
.rb-tab.is-active { background: var(--sens-lime); color: #111; }
.rb-tab.is-active span { color: #111; }
.cg-swatch { border-radius: 50%; }

/* ───────── Boiling titles: the outline redrawn slightly differently ~8 times a second ───────── */
.hero-title, .rb-title, .sens-hand, .obj-card-title, .rb-banner-title, .rb-card-tab {
  animation: boil 0.375s steps(1) infinite;
}
@keyframes boil {
  0%      { filter: url(#boil0); }
  33.33%  { filter: url(#boil1); }
  66.66%  { filter: url(#boil2); }
}

/* ───────── Dotted snow trail behind the cursor (below the hero) ───────── */
/* behind the content: below-hero sections sit above it and their dark bands are transparent (body is black) */
.dot-trail { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; pointer-events: none; }
main > .rb-section, main > .rb-banner, .rb-footer { position: relative; z-index: 1; }
.rb-dark, .rb-footer { background: transparent; }

/* the pixel pencil cursor (supplied art, shortened; 56 px, tip at the bottom-left = hotspot 1 54) */
html { cursor: url("assets/cursor-pencil-yellow.png") 1 54, auto; }

/* ───────── Comment round: donate button, banner patch, 3D card models, story share ───────── */
.hero-btn--donate { background: var(--sens-red); color: #fff; }
.rb-banner .rb-banner-patch { mix-blend-mode: normal; opacity: 1; max-height: 300px; filter: drop-shadow(0 12px 20px rgba(0,0,0,.35)); rotate: 8deg; }

.rb-3d { position: relative; cursor: grab; touch-action: pan-y; }
.rb-3d:active { cursor: grabbing; }
.rb-3d canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.rb-3d .rb-3d-fallback { visibility: hidden; }
.rb-3d.no-webgl .rb-3d-fallback { visibility: visible; }
.rb-3d-toggle {
  position: absolute; left: 16px; bottom: 14px; z-index: 1;
  height: 34px; padding: 0 14px; border: 2px solid #111; border-radius: 999px;
  background: var(--sens-lime); color: #111; font: 600 13px var(--sans); cursor: pointer; box-shadow: 2px 3px 0 #111;
}
.rb-3d-toggle:focus-visible { outline: 2px solid var(--rb-blue); outline-offset: 2px; }
.rb-3d-hint { position: absolute; right: 16px; bottom: 18px; font: 12px var(--rb-mono); color: var(--rb-grey); pointer-events: none; }
.rb-card-media.rb-3d { height: clamp(300px, 30vw, 400px); }

.cg-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cg-share { background: var(--sens-lime); border-color: #111; }
.story-modal[hidden] { display: none; }
.story-modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(0,0,0,.7); }
.story-panel { display: grid; gap: 14px; justify-items: center; width: min(420px, 100%); max-height: 100%; overflow: auto; padding: 22px; background: var(--sens-cream); color: #111; border-radius: 16px; }
.story-title { margin: 0; font-family: var(--title); font-weight: 400; font-size: 30px; }
.story-panel img { width: min(260px, 70vw); height: auto; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.3); }
.story-note { margin: 0; font-size: 14px; line-height: 1.5; text-align: center; }

/* ───────── Comment round 2 ───────── */
.rb-gpane[hidden] { display: none; }
.rb-gpane > .rb-card-tab { display: none; }
.rb-game.rb-gpane, .rb-game.cg.rb-gpane { margin-top: 20px; }

.rb-where { margin-top: 96px; }
.rb-places { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.rb-places li { display: grid; gap: 6px; padding: 20px; background: var(--sens-cream); color: #111; border: 2px solid #111; border-radius: 14px; box-shadow: 4px 5px 0 #111; }
.rb-places b { font-family: var(--title); font-weight: 400; font-size: 22px; }
.rb-place-kind { font: 12px var(--rb-mono); color: var(--sens-green); text-transform: lowercase; }
.rb-place-addr { font-size: 14px; color: #444; }
@media (max-width: 900px) { .rb-places { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .rb-places { grid-template-columns: 1fr; } }

.pencil-pick { display: flex; gap: 6px; align-items: center; padding: 0 4px; }
.pencil-dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.55); background: var(--c); cursor: pointer; padding: 0; }
.pencil-dot[aria-pressed="true"] { outline: 2px solid #fff; outline-offset: 2px; }
.pencil-dot:focus-visible { outline: 2px solid var(--sens-lime); outline-offset: 2px; }
@media (max-width: 720px) { .pencil-pick { gap: 4px; } .pencil-dot { width: 14px; height: 14px; } }

/* while any card is open, the hero headline steps back so the card reads cleanly */
.hero-copy { transition: opacity 0.25s ease; }
.hero.card-open .hero-copy { opacity: 0; }
/* …and the whole scene (book, patch, robot, drifts) is lifted above the headline for as long as a card is open, so the
   headline can never show through or sit on top of a hovering object. Only the stacking order changes, not the layout. */
.hero.card-open .scene { z-index: 5; }
.hero.card-open .book-hit { z-index: 6; }

@media (prefers-reduced-motion: reduce) {
  .scene { filter: none; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ───────── Copy from the brief: hero price, intro, "what's inside", how to order ───────── */
.hero-actions { align-items: center; }
.hero-price {
  display: inline-grid; place-items: center; height: 50px; padding: 0 20px;
  border-radius: 999px; background: #fff; color: #111; border: 2px solid #111; box-shadow: 3px 4px 0 #111;
  font: 500 15px var(--rb-sans, sans-serif); rotate: 2deg;
}
.hero-price b { font-family: var(--title); font-weight: 400; font-size: 1.35em; }

.rb-intro { max-width: 760px; margin: -8px 0 32px; font-size: clamp(16px, 1.4vw, 19px); line-height: 1.55; }
.rb-intro p { margin: 0 0 12px; }

.rb-inside { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin: 0 0 32px; padding: 0; }
.rb-inside li { display: flex; flex-direction: column; gap: 8px; padding: 18px 18px 20px; background: #fff; color: var(--rb-ink); font-size: 14px; line-height: 1.4; border-radius: 14px; box-shadow: 0 0 0 3px #111, 5px 6px 0 3px #111; }
.rb-inside li:nth-child(odd) { rotate: -1deg; }
.rb-inside li:nth-child(even) { rotate: 1deg; }
.rb-inside b { font-family: var(--title); font-weight: 400; font-size: 34px; line-height: 1; color: var(--sens-green); }
@media (max-width: 900px) { .rb-inside { grid-template-columns: 1fr 1fr; } .rb-inside li:last-child { grid-column: 1 / -1; } }

.rb-order-wrap { display: grid; grid-template-columns: 1fr minmax(320px, 520px); gap: 48px; align-items: start; }
.rb-order-text p { font-size: 17px; line-height: 1.55; max-width: 46ch; margin: 22px 0 16px; }
.rb-steps { margin: 0 0 24px; padding-left: 1.3em; line-height: 1.6; color: #ddd; }
.rb-form { position: relative; background: #fff; color: var(--rb-ink); padding: 28px; border-radius: 18px; box-shadow: 0 0 0 4px #111, 8px 9px 0 4px var(--sens-lime); }
.rb-order-card-name { margin: 0 0 14px; font-weight: 600; font-size: 17px; line-height: 1.4; }
.rb-form-sum { margin: 0 0 20px; font-size: 15px; }
.rb-form-sum b { font-family: var(--title); font-weight: 400; font-size: 44px; }
@media (max-width: 860px) { .rb-order-wrap { grid-template-columns: 1fr; } }
.rb-banner .rb-label { opacity: 0.8; }
.rb-banner .rb-label { opacity: 1; color: #fff; }

/* phones: no per-frame SVG "boil" filter on titles (expensive repaints) */
.lowpower .hero-title, .lowpower .rb-title, .lowpower .sens-hand, .lowpower .obj-card-title, .lowpower .rb-banner-title, .lowpower .rb-card-tab { animation: none; filter: none; }

/* ───────── Header in the landing's sticker style; hides on scroll down, returns on scroll up ───────── */
.site-header { transition: transform 0.35s cubic-bezier(.2,.8,.2,1); }
.site-header.is-hidden { transform: translateY(calc(-100% - 40px)); }
.site-nav {
  gap: 28px;
  padding: 6px 6px 6px 20px;
  border-radius: 18px;
  background: var(--sens-cream);
  border: 3px solid #111;
  box-shadow: 5px 6px 0 #111;
  backdrop-filter: none; -webkit-backdrop-filter: none;
  rotate: -0.6deg;
}
.site-logo img { filter: brightness(0); }
.site-links { font-weight: 600; font-size: 14px; }
.site-links a { position: relative; color: #111; padding: 4px 0; }
.site-links a::after {
  content: ""; position: absolute; left: -4px; right: -4px; bottom: 0; height: 8px; z-index: -1;
  background: var(--sens-lime); border-radius: 4px; transform: scaleX(0); transform-origin: left; transition: transform 0.2s;
}
.site-links a:hover { color: #111; }
.site-links a:hover::after { transform: scaleX(1); }
.site-cta {
  padding: 9px 18px; border-radius: 12px;
  background: var(--sens-lime); border: 2px solid #111; box-shadow: 2px 3px 0 #111;
  color: #111; font-weight: 700; font-size: 14px; rotate: 1.5deg;
}
.site-cta:hover { background: #d4ff52; translate: -1px -1px; box-shadow: 3px 4px 0 #111; }
.site-logo:focus-visible, .site-links a:focus-visible, .site-cta:focus-visible { outline-color: #111; }
.pencil-dot { border-color: #111; }
.pencil-dot[aria-pressed="true"] { outline-color: #111; }
@media (max-width: 720px) {
  .site-nav { gap: 10px; padding: 5px 5px 5px 14px; border-radius: 14px; box-shadow: 3px 4px 0 #111; }
  .site-cta { padding: 7px 12px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) { .site-header { transition: none; } }

/* colouring page: one portrait page in a zoomable stage (+/− buttons, pinch, drag to pan when zoomed) */
.cg-stage { position: relative; justify-self: center; width: min(100%, calc(82vh * 0.7)); aspect-ratio: 1400 / 2000; overflow: hidden; border: 2px solid #111; border-radius: 6px; background: #fffdf8; touch-action: pan-y; }
.cg-stage.is-zoomed { touch-action: none; cursor: grab; }
.cg-stage .cg-canvas { border: 0; }
.cg-zoom { position: absolute; right: 10px; top: 10px; display: grid; gap: 6px; }
.cg-zoom button { width: 44px; height: 44px; border: 2px solid #111; border-radius: 12px; background: var(--sens-lime); color: #111; font: 700 22px var(--sans); box-shadow: 2px 3px 0 #111; cursor: pointer; }
.cg-zoom button:disabled { opacity: 0.4; }
@media (max-width: 900px) {
  .cg-body { padding: 12px; gap: 16px; }
  .cg-stage { width: 100%; }
  .cg-side { gap: 14px; }
  .cg-swatches { grid-template-columns: repeat(5, 1fr); gap: 8px; }
  .cg-swatch { width: 100%; height: auto; aspect-ratio: 1; }
}
/* ───────── Hero copy: lighter headline block; phones: hero objects are scenery only ───────── */
.hero-kicker { margin-bottom: 10px; font-size: 12px; }
.hero-title { font-size: clamp(40px, 5.6vw, 82px); -webkit-text-stroke-width: 2.5px; text-shadow: 4px 5px 0 #111; }
.hero-tagline {
  margin: 14px 0 0;
  font: 700 clamp(17px, 1.7vw, 24px) / 1.2 var(--rb-sans, "Inter", sans-serif);
  text-shadow: 0 1px 14px rgba(0, 0, 40, 0.85);
}
.hero-lede { margin: 8px auto 20px; max-width: 52ch; font-size: clamp(14px, 1.1vw, 16px); }
.hero-btn { height: 46px; padding: 0 20px; font-size: 14px; }
.hero-price { height: 46px; }
@media (max-aspect-ratio: 4/5) {
  .hero-copy { top: 84px; width: min(560px, calc(100% - 40px)); }
  .hero-kicker { font-size: 11px; padding: 4px 10px; margin-bottom: 8px; }
  .hero-title { font-size: clamp(32px, 9.4vw, 46px); -webkit-text-stroke-width: 2px; text-shadow: 3px 4px 0 #111; }
  .hero-tagline { margin-top: 10px; font-size: 16px; }
  .hero-lede { font-size: 13px; line-height: 1.45; margin: 6px auto 14px; max-width: 36ch; }
  .hero-btn { height: 40px; padding: 0 16px; font-size: 13px; }
  .hero-price { font-size: 12px; height: 40px; padding: 0 14px; }
  .hero { --patch-fx: 0.8; }
}
.lowpower .patch { pointer-events: none; cursor: default; }
.lowpower .book-scene.is-hover, .lowpower .hero.nrk-hover { cursor: default; }

/* ───────── Touch devices: touch wording, no mouse-only extras ───────── */
.touch .t-mouse, .mouse .t-touch { display: none; }
html:not(.touch):not(.mouse) .t-touch { display: none; }
.touch .pencil-pick { display: none; }          /* pencils only colour the cursor trail, which needs a mouse */
.touch, .touch * { cursor: auto !important; }
.touch .dot-trail { display: none; }
@media (hover: none) {
  /* taps shouldn't leave buttons stuck in their hover state */
  .hero-btn:hover, .site-cta:hover { translate: none; box-shadow: 3px 4px 0 #111; }
}
/* phones: the palette sits right above the picture in one sticky row, so you never scroll away to change colour */
@media (max-width: 640px) {
  .cg-body { display: flex; flex-direction: column; }
  .cg-side { display: contents; }
  .cg-swatches {
    order: -1; position: sticky; top: 8px; z-index: 3;
    display: flex; gap: 6px; padding: 8px; margin: 0 -4px;
    overflow-x: auto; scrollbar-width: none;
    background: #fffdf8; border: 2px solid #111; border-radius: 999px; box-shadow: 3px 4px 0 #111;
  }
  .cg-swatches::-webkit-scrollbar { display: none; }
  .cg-swatch { flex: 0 0 34px; width: 34px; height: 34px; }
  .cg-body > .cg-stage, .cg-stage { order: 0; }
  .cg-side > p { order: 1; margin: 0; font-size: 14px; }
    .cg-actions { order: 3; }
}

/* ───────── Order modal ─────────
   Native <dialog> (top layer, focus trap, Esc). Same language as the book card:
   square corners, frosted night glass, solid indigo CTA. */
html.has-dialog { overflow: hidden; }

.order {
  --cta: #4640ed;
  --field: rgba(6, 10, 40, 0.42);
  --field-line: rgba(255, 255, 255, 0.26);
  --error: #ffb3b3;
  --amber: #ffc24a;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 16px;
  border: 0;
  background: none;
  color: var(--text);
  font-family: var(--sans);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.order[open] { display: flex; }
.order::backdrop { background: rgba(4, 7, 28, 0.6); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }

.order-panel {
  position: relative;
  width: min(500px, 100%);
  margin: auto;            /* centred, and still scrollable when taller than the screen */
  --px: 32px;
  --pb: 24px;
  padding: 28px var(--px) var(--pb);
  background: rgba(22, 30, 92, 0.64);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 30px 80px -20px rgba(2, 4, 30, 0.75);
  animation: order-in 0.34s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes order-in { from { opacity: 0; transform: translateY(14px) scale(0.98); } }

.order-panel:focus { outline: none; }

.order-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}
.order-close:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }

.order-title {
  margin: 0 40px 10px 0;
  font-family: var(--display);
  font-size: 23px;
  font-weight: 600;
  line-height: 1.2;
}

.order-lead {
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-dim);
  white-space: pre-line;
}

.order-demo {
  margin: -6px 0 20px;
  padding: 8px 12px;
  border: 1px dashed rgba(255, 255, 255, 0.35);
  font-size: 12.5px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.75);
}

/* a flex column, not a grid: the sticky footer needs the whole form as its range */
.order-form { display: flex; flex-direction: column; gap: 14px; }

.order-field label,
.order-delivery legend {
  display: block;
  margin-bottom: 7px;
  font-size: 13.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
}
.order-optional { font-weight: 400; color: rgba(255, 255, 255, 0.55); }

.order-field input,
.order-select select,
.order-prefix {
  height: 46px;
  border: 1px solid var(--field-line);
  border-radius: 0;
  background: var(--field);
  color: #fff;
  font: 16px/1 var(--sans);   /* 16px keeps iOS from zooming in on focus */
}

.order-field input,
.order-select select {
  width: 100%;
  min-width: 0;
  padding: 0 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.order-field input::placeholder { color: rgba(255, 255, 255, 0.38); }
.order-field input:focus,
.order-select select:focus { border-color: var(--periwinkle); box-shadow: 0 0 0 3px rgba(154, 166, 255, 0.25); }
.order-field.is-invalid input,
.order-field.is-invalid select { border-color: var(--error); }

.order-phone { display: flex; }
.order-prefix {
  display: flex;
  flex: none;
  align-items: center;
  padding: 0 12px 0 14px;
  border-right: 0;
  background: rgba(255, 255, 255, 0.1);
  font-weight: 500;
}

.order-select select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  cursor: pointer;
}
.order-select option { background: #141c5c; color: #fff; }

.order-hint,
.order-error {
  margin: 7px 0 0;
  font-size: 12.5px;
  line-height: 1.45;
}
.order-hint { color: rgba(255, 255, 255, 0.6); }
.order-error { color: var(--error); }

.order-delivery {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin: 4px 0 0;
  padding: 16px 0 0;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}
.order-delivery legend { float: left; width: 100%; margin: 0; padding: 0; }
.order-delivery-hint { margin: -6px 0 0; }
.order-np-off { margin: -2px 0 0; color: var(--amber); }

.order-combo-box { position: relative; }
.order-options {
  position: absolute;
  z-index: 2;
  bottom: calc(100% + 4px);   /* upwards: never over the submit button, and clear of a phone's keyboard */
  left: 0;
  right: 0;
  max-height: 248px;
  margin: 0;
  padding: 4px 0;
  overflow-y: auto;
  list-style: none;
  background: #141c5c;
  border: 1px solid var(--field-line);
  box-shadow: 0 -14px 40px -12px rgba(2, 4, 30, 0.8);
}
.order-option {
  padding: 9px 14px;
  font-size: 14px;
  line-height: 1.35;
  cursor: pointer;
}
.order-option:hover,
.order-option[aria-selected="true"] { background: rgba(154, 166, 255, 0.22); }
.order-option-note { padding: 9px 14px; font-size: 13px; color: rgba(255, 255, 255, 0.6); }

/* honeypot: off-screen for people, still "fillable" for bots */
.order-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.order-form-error { margin: 0; font-size: 14px; line-height: 1.45; color: var(--error); }

/* The submit button (and an error above it) stays at the bottom of the window when the form is taller
   than the screen: the rest scrolls under it. The shelf is the panel's colour, fading in at the top. */
.order-footer {
  position: sticky;
  bottom: 0;
  z-index: 1;
  display: grid;
  gap: 10px;
  margin: 0 calc(-1 * var(--px)) calc(-1 * var(--pb));
  padding: 16px var(--px) var(--pb);
  background: linear-gradient(rgba(20, 27, 84, 0), rgb(20, 27, 84) 16px);
  box-shadow: 0 16px 0 rgb(20, 27, 84);   /* also covers the strip between the panel and the window's edge */
}
.order-footer .order-submit { margin-top: 0; }

.order-submit {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 52px;
  margin-top: 6px;
  border: 0;
  background: var(--cta);
  color: #fff;
  font: 600 16px/1 var(--sans);
  cursor: pointer;
  transition: background-color 0.2s, opacity 0.2s;
}
.order-submit:hover { background: #5a55ff; }
.order-submit:disabled { cursor: progress; opacity: 0.75; }
.order-submit.is-busy { color: transparent; }
.order-submit.is-busy::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: order-spin 0.8s linear infinite;
}
@keyframes order-spin { to { rotate: 360deg; } }

.order-close:focus-visible,
.order-submit:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* success + sold-out screens */
.order-view--success,
.order-view--soldout { padding-top: 6px; }

.order-check {
  position: relative;
  width: 54px;
  height: 54px;
  margin-bottom: 18px;
  border-radius: 50%;
  background: rgba(93, 224, 207, 0.16);
  border: 1px solid rgba(93, 224, 207, 0.6);
}
.order-check::after {
  content: "";
  position: absolute;
  left: 19px;
  top: 14px;
  width: 12px;
  height: 21px;
  border: solid var(--aurora);
  border-width: 0 2.5px 2.5px 0;
  rotate: 45deg;
}

.order-number {
  margin: -2px 0 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--aurora);
}

.order-badge {
  display: inline-block;
  margin: 0 0 16px;
  padding: 6px 12px;
  background: var(--amber);
  color: var(--night);
  font: 600 12px/1 var(--display);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  rotate: -3deg;
}

@media (max-width: 560px) {
  /* bottom sheet on phones */
  .order { padding: 0; }
  .order-panel {
    margin: auto 0 0;
    width: 100%;
    --px: 20px;
    --pb: calc(22px + env(safe-area-inset-bottom, 0px));
    padding: 26px var(--px) var(--pb);
    border-width: 1px 0 0;
    animation-name: order-up;
  }
  .order-title { font-size: 20px; }
  @keyframes order-up { from { transform: translateY(40px); opacity: 0; } }
}


html.is-sold-out .only-in-stock,
html:not(.is-sold-out) .only-sold-out { display: none !important; }

/* ───────── Rounded sticker look for every popup, and green pill buttons everywhere ─────────
   Popups (info cards, order modal, Stories modal) borrow the header's sticker: cream, 3 px black outline,
   offset black shadow, rounded corners. Buttons borrow the hero's: lime pill, black outline, offset shadow.
   This block comes last on purpose: it overrides the older square / blue / glass rules above. */
:root { --sticker-radius: 24px; }

/* buttons */
.site-cta, .hero-btn, .book-card-btn, .rb-order, .rb-btn-ghost, .rb-btn-line, .order-submit, .btn, .rb-3d-toggle, .rb-tab {
  border-radius: 999px;
}
.site-cta, .hero-btn, .book-card-btn, .rb-order, .rb-btn-ghost, .rb-btn-line, .order-submit, .btn {
  background: var(--sens-lime);
  color: #111;
  border: 2px solid #111;
  box-shadow: 3px 4px 0 #111;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  text-shadow: none;
  rotate: none;
  transition: translate 0.15s, box-shadow 0.15s, background-color 0.15s;
}
.site-cta:hover, .hero-btn:hover, .book-card-btn:hover, .rb-order:hover, .rb-btn-ghost:hover, .rb-btn-line:hover, .order-submit:hover, .btn:hover {
  background: #d4ff52;
  translate: -1px -1px;
  box-shadow: 4px 5px 0 #111;
  transform: none;
}
.site-cta:active, .hero-btn:active, .book-card-btn:active, .rb-order:active, .rb-btn-ghost:active, .rb-btn-line:active, .order-submit:active, .btn:active {
  translate: 2px 3px;
  box-shadow: 1px 1px 0 #111;
}
.site-cta:focus-visible, .hero-btn:focus-visible, .book-card-btn:focus-visible, .rb-order:focus-visible, .rb-btn-ghost:focus-visible,
.rb-btn-line:focus-visible, .order-submit:focus-visible, .btn:focus-visible { outline: 3px solid #111; outline-offset: 3px; border-radius: 999px; }
.hero-btn--try { background: var(--sens-lime); }
.site-cta { padding: 8px 20px; }
.rb-btn-line, .rb-btn-ghost { height: 42px; padding: 0 20px; font-size: 14px; }

/* the order bars */
.rb-order { align-items: center; justify-content: center; text-align: center; }

/* tabs: pills too (the striped strip under the active one doesn't fit a pill) */
.rb-tab.is-active::after { display: none; }

/* round controls */
.cg-zoom button { border-radius: 50%; }

/* info cards (book, robot, patch) */
.book-card {
  padding: 22px 24px 22px;
  background: var(--sens-cream);
  color: #111;
  border: 3px solid #111;
  border-radius: var(--sticker-radius);
  box-shadow: 5px 6px 0 #111;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.book-card-title img { filter: brightness(0); }
.book-card-text { margin: 16px 0 22px; color: rgba(17, 17, 17, 0.72); }
.book-card-actions { gap: 12px; }
.book-card-btn { height: 46px; padding: 0 12px; text-align: center; line-height: 1.15; }
.obj-card--single .book-card-actions { grid-template-columns: 1fr; }
.obj-card-title { color: #111; }

/* the monobank jar widget (a picture for now) */
.mono-widget { margin: 14px 0 20px; }
.mono-widget img { display: block; width: 100%; height: auto; border-radius: 18px; }

/* Stories modal */
.story-panel { padding: 24px; border: 3px solid #111; border-radius: var(--sticker-radius); box-shadow: 5px 6px 0 #111; }
.story-panel img { border-radius: 16px; }

/* order modal */
.order {
  --cta: var(--sens-lime);
  --field: #fff;
  --field-line: #111;
  --error: #c4161f;
  color: #111;
}
.order-panel {
  --panel: var(--sens-cream);
  background: var(--panel);
  border: 3px solid #111;
  border-radius: var(--sticker-radius);
  box-shadow: 5px 6px 0 #111;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.order-close { border: 2px solid #111; background: #fff; color: #111; }
.order-close:hover { background: var(--sens-lime); color: #111; }
.order-close:focus-visible { outline: 3px solid #111; outline-offset: 3px; }
.order-title { color: #111; font-weight: 400; font-size: 28px; }
.order-lead { color: rgba(17, 17, 17, 0.72); }
.order-demo { border-color: rgba(17, 17, 17, 0.4); color: rgba(17, 17, 17, 0.75); border-radius: 12px; }
.order-field label, .order-delivery legend { color: #111; }
.order-optional { color: rgba(17, 17, 17, 0.5); }
.order-field input, .order-select select, .order-prefix { border: 2px solid #111; color: #111; }
.order-field input, .order-select select { border-radius: 14px; }
.order-field input::placeholder { color: rgba(17, 17, 17, 0.38); }
.order-field input:focus, .order-select select:focus { border-color: #111; box-shadow: 0 0 0 3px var(--sens-lime); }
.order-prefix { border-right: 0; border-radius: 14px 0 0 14px; background: #efe9d8; }
.order-phone input { border-radius: 0 14px 14px 0; }
.order-select select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23111' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.order-select option { background: #fff; color: #111; }
.order-hint { color: rgba(17, 17, 17, 0.6); }
.order-delivery { border-top: 2px dashed rgba(17, 17, 17, 0.25); }
.order-np-off { color: #8a5a00; }
.order-options { background: #fff; border: 2px solid #111; border-radius: 14px; box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.45); }
.order-option:hover, .order-option[aria-selected="true"] { background: var(--sens-lime); }
.order-option-note { color: rgba(17, 17, 17, 0.6); }
.order-footer {
  background: linear-gradient(rgba(251, 248, 239, 0), var(--sens-cream) 16px);
  box-shadow: 0 16px 0 var(--sens-cream);
}
.order-submit.is-busy::after { border-color: rgba(17, 17, 17, 0.25); border-top-color: #111; }
.order-number { color: var(--sens-green); }
.order-badge { border: 2px solid #111; border-radius: 999px; padding: 6px 14px; }
@media (max-width: 560px) {
  .order-panel { border-width: 3px 3px 0; border-radius: var(--sticker-radius) var(--sticker-radius) 0 0; box-shadow: 0 -4px 0 #111; }
  .order-title { font-size: 24px; }
}
/* keep the sticky footer's colour shelf inside the rounded panel */
.order-panel { overflow: clip; }

/* secondary button: a quiet grey pill next to the green one (used for «Детальніше»).
   Add class="btn-secondary" to any button or link; [class] only raises its specificity above the green rules. */
.btn-secondary[class] {
  background: #e6e4dc;
  color: #111;
  border: 2px solid rgba(17, 17, 17, 0.2);
  box-shadow: none;
}
.btn-secondary[class]:hover { background: #d9d6cb; border-color: #111; box-shadow: none; translate: 0 -1px; }
.btn-secondary[class]:active { translate: 0 1px; }

/* one size for every button (the header's is the only exception): 52 px tall, 16 px text.
   Last in the file so it beats the per-button sizes and the phone overrides above. */
.hero-btn, .book-card-btn, .rb-order, .rb-btn-ghost, .rb-btn-line, .order-submit, .btn, .rb-3d-toggle {
  box-sizing: border-box;
  height: 52px;
  min-height: 52px;
  padding: 0 28px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
}
.book-card-btn { padding: 0 16px; }
.hero-price { height: 52px; font-size: 16px; padding: 0 22px; }

/* ───────── One corner system ─────────
   --r-lg  big blocks: popups, panels, product cards, the set bar, the colouring / maze frame
   --r-md  things inside them: list rows, small cards, pictures, inputs
   999px   buttons and tabs
   The header keeps its own 18 px. Cards that have a title tab keep their top-right corner square, so the
   tab and the card read as one folder. */
:root { --r-lg: 24px; --r-md: 16px; --sticker-radius: var(--r-lg); }

.rb-viewer, .rb-note, .rb-set { border-radius: var(--r-lg); }
.rb-card, .rb-game { border-radius: var(--r-lg) 0 var(--r-lg) var(--r-lg); }
.rb-card-tab { border-radius: var(--r-md) var(--r-md) 0 0; }
.rb-form { border-radius: var(--r-lg); }
.rb-inside li, .rb-list details, .rb-places li { border-radius: var(--r-md); }
.cg-stage, .rg-track { border-radius: var(--r-md); }
.mono-widget img, .story-panel img { border-radius: var(--r-md); }
.order-field input, .order-select select, .order-options { border-radius: var(--r-md); }
.order-prefix { border-radius: var(--r-md) 0 0 var(--r-md); }
.order-phone input { border-radius: 0 var(--r-md) var(--r-md) 0; }
.order-demo { border-radius: var(--r-md); }

/* «Комплект за донат»: text | price on one line | button the full height of the bar, following its corners */
.rb-set { overflow: hidden; align-items: stretch; grid-template-columns: minmax(0, 1fr) auto minmax(220px, 300px); }
.rb-set-price { display: flex; align-items: center; justify-content: center; gap: 0.25em; padding: 0 32px; white-space: nowrap; line-height: 1; }
.rb-set-price span { display: inline; }
.rb-set-order[class] {
  height: auto; min-height: 0;
  border: 0; border-left: 2px solid #111; border-radius: 0;
  box-shadow: none; translate: none;
  justify-content: center;
}
.rb-set-order[class]:hover { box-shadow: none; translate: none; background: #d4ff52; }
.rb-set-order[class]:active { translate: none; box-shadow: none; }
@media (max-width: 900px) {
  .rb-set { grid-template-columns: minmax(0, 1fr) auto; }
  .rb-set-price { padding: 0 24px; }
  .rb-set-order[class] { grid-column: 1 / -1; min-height: 56px; border-left: 0; border-top: 2px solid #111; }
}

/* the colouring side column is wide enough for «Поділитись в Instagram Stories» on one line at 16 px */
.cg-actions .rb-btn-line { white-space: nowrap; }
@media (max-width: 900px) { .cg-actions .rb-btn-line { white-space: normal; } }

/* the game panel has no title tab (it is hidden), so all four corners are round */
.rb-game.rb-gpane { border-radius: var(--r-lg); }

/* ───────── FAQ: electric-blue rounded block on the grid ───────── */
.rb-faq {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(0, 760px);
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
  padding: clamp(28px, 4vw, 56px);
  background: var(--rb-blue);
  border-radius: var(--r-lg);
  color: #fff;
}
.rb-faq .rb-head { margin: 0; }
.rb-faq .rb-list { gap: 12px; }
.rb-faq .rb-list details { background: var(--sens-cream); color: #111; box-shadow: 3px 4px 0 #111; }
.rb-faq .rb-list details[open] summary i { background: #111; }
@media (max-width: 860px) { .rb-faq { grid-template-columns: 1fr; } }

/* the arrow: a round chip; on hover the arrow runs out to the right while a second one slides in from the left;
   open = the chip turns to point down */
.rb-list summary i {
  position: relative;
  flex: none;
  display: block;
  width: 40px;
  height: 40px;
  overflow: hidden;
  border: 2px solid #111;
  border-radius: 50%;
  background: var(--sens-lime);
  color: #111;
  transition: rotate 0.35s cubic-bezier(0.3, 1.5, 0.5, 1), background-color 0.2s, color 0.2s;
}
.rb-list summary i svg {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: translate 0.4s cubic-bezier(0.6, 0, 0.2, 1);
}
.rb-list summary i svg:last-child { translate: -150% 0; }
.rb-list summary:hover i svg:first-child { translate: 150% 0; }
.rb-list summary:hover i svg:last-child { translate: 0 0; }
.rb-list details[open] summary i { rotate: 90deg; color: var(--sens-lime); transform: none; }
.rb-list summary:focus-visible { outline: 3px solid #111; outline-offset: 2px; border-radius: var(--r-md); }
@media (prefers-reduced-motion: reduce) { .rb-list summary i, .rb-list summary i svg { transition: none; } }

/* colouring block: the page sits at the left with the same 24 px gap as above and below it; the text / colours /
   buttons column is wide, and whatever width is left over stays on its right */
@media (min-width: 901px) {
  .cg-body { grid-template-columns: minmax(0, calc(82vh * 0.7)) minmax(0, 1fr); gap: clamp(32px, 4vw, 64px); }
  .cg-stage { justify-self: start; width: 100%; }
  .cg-side { width: min(100%, 520px); gap: 24px; }
  .cg-side > p { font-size: 16px; line-height: 1.6; }
}

/* «Свій колір» lives in the palette: a rainbow circle with a «+»; after picking it shows the colour */
.cg-custom {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: conic-gradient(#d0222e, #f08a24, #f4d23a, #c5f33a, #3f8a3a, #3b8ee0, #3b48c4, #b13bd0, #d0222e);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
  cursor: pointer;
}
.cg-custom::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 46%;
  height: 46%;
  border-radius: 50%;
  background: #fff;
  color: #111;
  font: 700 16px/1 var(--sans);
  pointer-events: none;
}
/* once a colour is picked the rainbow ring stays (it is still the «own colour» button) and the centre shows the colour */
.cg-custom.is-set::after { content: ""; width: 62%; height: 62%; background: var(--c); border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18); }
.cg-custom[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--rb-white), 0 0 0 5px var(--rb-ink); }
.cg-custom input { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.cg-custom:focus-within { outline: 2px solid var(--rb-blue); outline-offset: 3px; }
.cg-swatches { grid-template-columns: repeat(6, 44px); }
@media (max-width: 900px) { .cg-swatches { grid-template-columns: repeat(6, 1fr); } .cg-custom { width: 100%; height: auto; aspect-ratio: 1; } }
@media (max-width: 640px) { .cg-custom { flex: 0 0 34px; width: 34px; height: 34px; aspect-ratio: auto; } }

/* heading of the colouring block */
.cg-title {
  margin: 0 0 4px;
  font-family: var(--title);
  font-weight: 400;
  font-size: clamp(40px, 4.4vw, 64px);
  line-height: 1.02;
  color: #111;
}
.cg-title mark {
  display: inline-block;
  margin-top: 6px;
  padding: 0 16px 4px;
  border-radius: var(--r-md);
  background: var(--sens-lime);
  color: #111;
  rotate: -1.5deg;
}
@media (max-width: 640px) {
  .cg-title { order: -2; font-size: 34px; margin: 0 0 4px; }
  .cg-title mark { margin-top: 2px; }
}

/* the story viewer grows with its text (the panes used to be absolutely positioned at a fixed height) */
.rb-viewer { display: grid; min-height: 0; }
.rb-pane { position: relative; inset: auto; grid-area: 1 / 1; }
.rb-pane-text p + p { margin-top: 14px; }
.rb-pane p.rb-pane-punch { margin-top: 20px; color: var(--sens-lime); font-weight: 700; font-size: clamp(17px, 1.6vw, 22px); line-height: 1.3; }

/* Photo in the «Ульф» tab */
.rb-pane .rb-pane-photo { width: 100%; max-height: none; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--r-md); border: 1px solid rgba(255, 255, 255, 0.18); box-shadow: none; filter: none; }
@media (max-width: 900px) { .rb-pane .rb-pane-photo { max-height: none; } }

/* Viewer outline: thick blue line redrawn ~8×/s like the boiling titles (only the line wobbles, not the content) */
.rb-viewer::after { content: ""; position: absolute; inset: 0; border: 5px solid var(--rb-blue); border-radius: inherit; pointer-events: none; z-index: 2; animation: boil 0.375s steps(1) infinite; }
.lowpower .rb-viewer::after { animation: none; filter: none; }
@media (prefers-reduced-motion: reduce) { .rb-viewer::after { animation: none; } }
.rb-pane .rb-pane-spread { aspect-ratio: 2000 / 1428; background: #fff; border-color: #111; }

/* «Дитині — розмальовка. Військовим — НРК.» sits right under the set bar */
.rb-note { display: block; margin-top: 16px; padding: clamp(24px, 3vw, 40px) clamp(24px, 3.4vw, 48px); }
.rb-note-title { margin: 0 0 14px; font-family: var(--title); font-weight: 400; font-size: clamp(28px, 3.4vw, 44px); line-height: 1.1; letter-spacing: -0.02em; text-wrap: balance; }
.rb-note p { max-width: 70ch; font-size: 16px; }
.rb-place-kind { text-transform: none; }
@media (min-width: 1100px) { .rb-places { grid-template-columns: repeat(4, 1fr); } }

/* «Коментар» textarea: same look as the inputs */
.order-field textarea {
  display: block; width: 100%; min-width: 0; min-height: 92px; padding: 12px 14px; resize: vertical; outline: none;
  border: 2px solid #111; border-radius: var(--r-md); background: var(--field, #fff); color: #111;
  font: 16px/1.4 var(--sans); transition: border-color 0.2s, box-shadow 0.2s;
}
.order-field textarea::placeholder { color: rgba(17, 17, 17, 0.38); }
.order-field textarea:focus { border-color: #111; box-shadow: 0 0 0 3px var(--sens-lime); }
.order-field.is-invalid textarea { border-color: var(--error); }

/* ───────── Order form in two steps: contacts → delivery ───────── */
.order-step { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 14px; font-weight: 600; color: #111; }
.order-step span { padding: 4px 10px; border: 2px solid #111; border-radius: 999px; background: var(--sens-lime); font: 12px/1 var(--rb-mono); }

.order-group { min-width: 0; margin: 0; padding: 0; border: 0; }
.order-field legend { display: block; width: 100%; padding: 0; margin: 0 0 7px; font-size: 13.5px; font-weight: 500; color: #111; }

/* radio chips: messenger (3 across) and delivery (2 across) */
.order-chips { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.order-field .order-chip { position: relative; display: block; margin: 0; cursor: pointer; }
.order-chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; opacity: 0; cursor: pointer; }
.order-chip span {
  display: flex; align-items: center; justify-content: center; height: 46px; padding: 0 8px;
  border: 2px solid #111; border-radius: var(--r-md); background: #fff; color: #111;
  font: 600 15px/1.1 var(--sans); text-align: center; transition: background-color 0.15s, box-shadow 0.15s, translate 0.15s;
}
.order-chip:hover span { background: #f3f7dd; }
.order-chip input:checked + span { background: var(--sens-lime); box-shadow: 2px 3px 0 #111; }
.order-chip input:focus-visible + span { outline: 3px solid #111; outline-offset: 2px; }

/* quantity: − [ 1 ] + */
.order-qty { display: inline-grid; grid-template-columns: 48px 76px 48px; gap: 8px; }
.order-qty input { text-align: center; padding: 0 6px; font-weight: 600; }
.order-qty-btn {
  height: 46px; border: 2px solid #111; border-radius: var(--r-md); background: #fff; color: #111;
  font: 600 24px/1 var(--sans); cursor: pointer; transition: background-color 0.15s, translate 0.15s;
}
.order-qty-btn:hover { background: var(--sens-lime); }
.order-qty-btn:active { translate: 0 1px; }
.order-qty-btn:focus-visible { outline: 3px solid #111; outline-offset: 2px; }

/* Nova Poshta fields: no dashed divider any more, they are the step's content */
.order-delivery { margin: 0; padding: 0; border-top: 0; }

/* two buttons on the delivery step */
.order-actions { display: grid; grid-template-columns: 1fr; gap: 10px; }
.has-back .order-actions { grid-template-columns: minmax(96px, 0.45fr) 1fr; }

@media (max-width: 560px) {
  .order-form { gap: 12px; }
  .order-lead { margin-bottom: 12px; font-size: 14px; line-height: 1.45; }
  .order-title { margin-bottom: 6px; }
}

/* Story preview: the Instagram link is a real button (it is an <a>, so it has to be centred by hand) and the panel closes with a cross */
.story-panel { position: relative; }
.story-title { margin: 0; font-size: 26px; text-align: center; }   /* short enough on one line, clear of the cross */
.story-ig { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; text-align: center; }
.story-close {
  position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 38px; height: 38px; padding: 0;
  border: 2px solid #111; border-radius: 50%; background: #fff; color: #111; cursor: pointer; transition: background-color 0.15s, translate 0.15s;
}
.story-close:hover { background: var(--sens-lime); }
.story-close:active { translate: 0 1px; }
.story-close:focus-visible { outline: 3px solid #111; outline-offset: 3px; }
