/* ==========================================================================
   CardStitch landing page
   Isolated stylesheet for _layouts/cardstitch.html. Colours and pixel
   metrics are ported from the Android app (ui/theme/AppColors.kt, Pixel.kt).
   ========================================================================== */

:root {
  /* AppColors.kt */
  --bg: #4E779C;            /* Background: slate blue base */
  --surface: #395A78;       /* Surface: inset slate panel */
  --surface-2: #2E4A63;     /* SurfaceVariant: deeper inset */
  --border: #213547;        /* Border: hard shadow + outline */
  --bevel: #799BBF;         /* Bevel: top-left highlight */
  --accent: #E63946;        /* Accent: arcade red */
  --accent-fill: #C42B37;   /* Accent, deepened so button text passes AA */
  --amber: #FFCA3A;         /* GuideIdle */
  --green: #38B000;         /* GuideActive */
  --green-text: #7BE04A;    /* GuideActive, lifted for text on slate */
  --text: #F4EFE4;          /* TextPrimary */
  --text-2: #C7D6E3;        /* TextSecondary */
  --text-3: #8FA8BC;        /* TextTertiary (decorative only) */
  --ink: #18283A;           /* page edge, deeper than Border */

  /* Pixel.kt */
  --px-bevel: 3px;
  --px-outline: 2px;

  --font-display: "Jersey 10", "Silkscreen", ui-monospace, monospace;
  --font-pixel: "Silkscreen", ui-monospace, monospace;
  --font-body: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --wrap: 72rem;
  --gutter: clamp(1rem, 4vw, 2rem);
  --band-pad: clamp(4rem, 9vw, 7.5rem);

  --ease-out: cubic-bezier(0.4, 0, 0.2, 1); /* FastOutSlowInEasing */
}

/* pixelBevel(): highlight top/left, shadow bottom/right, hard outline */
.bevel,
.panel, .device, .lab, .feature, .pillar, .lane, .faq details, .final__panel, .vf, .pcard {
  --bv-hi: var(--bevel);
  --bv-lo: var(--border);
  box-shadow:
    inset var(--px-bevel) var(--px-bevel) 0 0 var(--bv-hi),
    inset calc(var(--px-bevel) * -1) calc(var(--px-bevel) * -1) 0 0 var(--bv-lo),
    0 0 0 var(--px-outline) var(--border);
}

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

html {
  background: var(--ink);
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  -webkit-text-size-adjust: 100%;
}

body.cs {
  margin: 0;
  background-color: var(--surface);
  /* 4px dither, the app's pixel grid */
  background-image:
    linear-gradient(45deg, rgba(33, 53, 71, 0.18) 25%, transparent 25%, transparent 75%, rgba(33, 53, 71, 0.18) 75%),
    linear-gradient(45deg, rgba(33, 53, 71, 0.18) 25%, transparent 25%, transparent 75%, rgba(33, 53, 71, 0.18) 75%);
  background-size: 8px 8px;
  background-position: 0 0, 4px 4px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
svg { display: block; }

a { color: var(--amber); text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
a:hover { color: var(--text); }

:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
}

code, output {
  font-family: var(--font-body);
  font-size: 0.92em;
  background: var(--border);
  color: var(--text);
  padding: 0.1em 0.45em;
  white-space: nowrap;
}

strong, b { font-weight: 600; color: var(--text); }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 0.95;
  margin: 0;
  letter-spacing: 0.015em;
  text-shadow: 3px 3px 0 var(--border); /* Type.kt PixelShadow */
}
h2 { font-size: clamp(2.7rem, 6vw, 4.4rem); }
h3 { font-size: 1.85rem; line-height: 1; text-shadow: 2px 2px 0 var(--border); }
p { margin: 0; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem; top: -4rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--amber);
  color: var(--border);
  font-family: var(--font-pixel);
  text-decoration: none;
}
.skip-link:focus { top: 1rem; }

#main-content:focus { outline: none; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.wrap--narrow { max-width: 52rem; }

/* ---------- Site nav (shared _includes/nav.html, restyled here) ---------- */
.site-header {
  background: var(--ink);
  border-bottom: var(--px-outline) solid var(--border);
}
.site-header .bottom-nav {
  display: flex;
  justify-content: center;
  gap: 0.25rem;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0.35rem var(--gutter);
  overflow-x: auto;
  scrollbar-width: none;
}
.site-header .bottom-nav::-webkit-scrollbar { display: none; }
.site-header .bottom-nav a {
  flex: none;
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0.25rem 0.75rem;
  color: var(--text-2);
  font-family: var(--font-pixel);
  font-size: 0.8rem;
  text-decoration: none;
  white-space: nowrap;
}
.site-header .bottom-nav a:hover { color: var(--text); background: var(--surface-2); }
.site-header .bottom-nav a[aria-current="page"] {
  color: var(--amber);
  box-shadow: inset 0 -3px 0 var(--amber);
}
@media (max-width: 40rem) {
  .site-header .bottom-nav { justify-content: flex-start; }
}

/* ---------- On-page sub bar ---------- */
.subbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(46, 74, 99, 0.94);
  border-bottom: var(--px-outline) solid var(--border);
  box-shadow: 0 3px 0 rgba(24, 40, 58, 0.5);
}
@supports (backdrop-filter: blur(4px)) {
  .subbar { background: rgba(46, 74, 99, 0.86); backdrop-filter: blur(8px); }
}
.subbar__inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 4rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  text-decoration: none;
  margin-right: auto;
}
.brand__name {
  font-family: var(--font-display);
  font-size: 1.9rem;
  line-height: 1;
  text-shadow: 2px 2px 0 var(--border);
}
.brand__mark {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  outline: 2px solid var(--green);
  outline-offset: 0;
}
.brand__mark span {
  width: 11px; height: 15px;
  background: var(--amber);
  box-shadow: inset -2px -2px 0 #E09A1A;
}
.brand__mark span + span { background: var(--bevel); box-shadow: inset -2px -2px 0 var(--surface); }
.subbar__links {
  display: flex;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.subbar__links a {
  display: inline-block;
  padding: 0.4rem 0.6rem;
  font-family: var(--font-pixel);
  font-size: 0.78rem;
  color: var(--text-2);
  text-decoration: none;
}
.subbar__links a:hover { color: var(--amber); }
@media (max-width: 60rem) { .subbar__links { display: none; } }

/* ---------- Buttons (PixelButton) ---------- */
.btn {
  --fill: var(--surface);
  --drop: 5px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  min-height: 2.75rem;
  padding: 0.7rem 1.15rem;
  border: 0;
  background: var(--fill);
  color: var(--text);
  font-family: var(--font-pixel);
  font-size: 0.95rem;
  line-height: 1.1;
  text-decoration: none;
  text-shadow: 2px 2px 0 var(--border);
  cursor: pointer;
  box-shadow:
    inset var(--px-bevel) var(--px-bevel) 0 0 var(--bevel),
    inset calc(var(--px-bevel) * -1) calc(var(--px-bevel) * -1) 0 0 var(--border),
    0 0 0 var(--px-outline) var(--border),
    0 var(--drop) 0 var(--px-outline) var(--border);
  transition: transform 80ms steps(2), box-shadow 80ms steps(2), background-color 120ms;
}
.btn .px-icon { width: auto; height: 1.1em; flex: none; filter: drop-shadow(2px 2px 0 var(--border)); }
.btn:hover {
  color: var(--text);
  transform: translateY(-2px);
  --drop: 7px;
}
.btn:active {
  /* pressed: bevel inverts, button sinks by the bevel height */
  transform: translateY(var(--px-bevel));
  --drop: 1px;
  box-shadow:
    inset var(--px-bevel) var(--px-bevel) 0 0 var(--border),
    inset calc(var(--px-bevel) * -1) calc(var(--px-bevel) * -1) 0 0 var(--bevel),
    0 0 0 var(--px-outline) var(--border),
    0 var(--drop) 0 var(--px-outline) var(--border);
}
.btn--primary { --fill: var(--accent-fill); }
.btn--primary:hover { --fill: #D3303D; }
.btn--ghost { --fill: var(--surface-2); }
.btn--ghost:hover { --fill: var(--surface); }
.btn--lg { min-height: 3.5rem; padding: 1rem 1.5rem; font-size: 1.05rem; }
.btn--sm { min-height: 2.5rem; padding: 0.5rem 0.9rem; font-size: 0.8rem; --drop: 3px; }
.btn--sm:hover { --drop: 5px; }

.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 1rem;
  align-items: center;
}

/* ---------- Status + marching blocks (PixelMarchingProgressBar) ---------- */
.status {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.6rem 1rem;
  align-items: center;
  margin-top: 1.75rem;
  max-width: 34rem;
}
.status__label {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-pixel);
  font-size: 0.8rem;
  color: var(--amber);
  white-space: nowrap;
}
.status__dot {
  width: 10px; height: 10px;
  background: var(--amber);
  box-shadow: 0 0 0 2px var(--border);
  animation: blink 1.1s steps(1) infinite;
}
.status__text {
  grid-column: 1 / -1;
  font-size: 0.82rem;
  color: var(--text-2);
}

.marching {
  position: relative;
  display: block;
  height: 16px;
  min-width: 6rem;
  overflow: hidden;
  background: var(--surface-2);
  box-shadow:
    inset 3px 3px 0 var(--bevel),
    inset -3px -3px 0 var(--border),
    0 0 0 2px var(--border);
}
.marching span {
  position: absolute;
  top: 3px; bottom: 3px;
  width: 10px;
  left: 0;
  background: var(--green);
  animation: march 1.1s steps(40) -0.45s infinite;
}
.marching span:nth-child(2) { margin-left: 14px; }
.marching span:nth-child(3) { margin-left: 28px; }
@keyframes march {
  from { left: -38px; }
  to { left: 100%; }
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Eyebrow / section heads ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.1rem;
  font-family: var(--font-pixel);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--amber);
}
.eyebrow::before {
  content: "";
  width: 10px; height: 10px;
  background: currentColor;
  box-shadow: 2px 2px 0 var(--border);
}

.section-head { max-width: 52rem; margin-bottom: clamp(2.5rem, 5vw, 3.75rem); }
.section-head--center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head h2 + .section-head__lead { margin-top: 1.25rem; }
.section-head__lead {
  font-size: 1.08rem;
  color: var(--text-2);
  max-width: 42rem;
}
.section-head--center .section-head__lead { margin-left: auto; margin-right: auto; }

.band {
  position: relative;
  padding: var(--band-pad) 0;
}
.band--deep {
  background-color: var(--surface-2);
  border-top: var(--px-outline) solid var(--border);
  border-bottom: var(--px-outline) solid var(--border);
}

.chip {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  font-family: var(--font-pixel);
  font-size: 0.7rem;
  line-height: 1.3;
  background: var(--surface-2);
  color: var(--text-2);
  box-shadow: 0 0 0 2px var(--border);
}
.chip--ok { background: var(--green); color: var(--ink); text-shadow: none; }

.px-icon { width: auto; height: 22px; }
.px-icon__accent { fill: var(--accent); }

/* ==========================================================================
   Illustrated pixel card ("Sparkbit") — scales with its own width
   ========================================================================== */
.pcard {
  --bv-hi: rgba(255, 255, 255, 0.45);
  --bv-lo: rgba(33, 53, 71, 0.55);
  --px-bevel: 3px;
  position: relative;
  display: block;
  aspect-ratio: 84 / 118;
  container-type: inline-size;
  overflow: hidden;
}
.pcard--front { background: var(--amber); }
.pcard__face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 4cqw;
  padding: 7cqw;
}
.pcard__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1cqw;
}
.pcard__name {
  font-family: var(--font-pixel);
  font-size: 10.5cqw;
  line-height: 1;
  color: var(--border);
}
.pcard__gem {
  width: 9cqw; height: 9cqw;
  background: var(--accent);
  box-shadow: inset -2cqw -2cqw 0 #A51F2B, 0 0 0 1.5cqw var(--border);
}
.pcard__art {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  aspect-ratio: 10 / 7.4;
  background:
    linear-gradient(var(--bevel) 0 0) bottom / 100% 26% no-repeat,
    #A9C3DC;
  box-shadow: 0 0 0 1.5cqw var(--border);
}
.pcard__art .sprite { width: 52%; height: auto; image-rendering: pixelated; }
.pcard__text {
  display: grid;
  gap: 3.4cqw;
  padding: 3cqw 2cqw 0;
}
.pcard__text span {
  height: 3.4cqw;
  background: rgba(33, 53, 71, 0.55);
}
.pcard__text span:nth-child(2) { width: 82%; }
.pcard__text span:nth-child(3) { width: 58%; }
.pcard__num {
  margin-top: auto;
  align-self: flex-end;
  font-family: var(--font-pixel);
  font-size: 7cqw;
  line-height: 1;
  color: var(--border);
}

.pcard--back {
  background-color: var(--surface-2);
  display: grid;
  place-items: center;
}
.pcard__pattern {
  position: absolute;
  inset: 7cqw;
  background-color: #2A5A8A;
  background-image:
    linear-gradient(45deg, #23507D 25%, transparent 25%, transparent 75%, #23507D 75%),
    linear-gradient(45deg, #23507D 25%, transparent 25%, transparent 75%, #23507D 75%);
  background-size: 16cqw 16cqw;
  background-position: 0 0, 8cqw 8cqw;
  box-shadow: 0 0 0 1.5cqw var(--border);
}
.pcard__emblem {
  --step: polygon(37.5% 0, 62.5% 0, 62.5% 12.5%, 75% 12.5%, 75% 25%, 87.5% 25%, 87.5% 37.5%, 100% 37.5%, 100% 62.5%, 87.5% 62.5%, 87.5% 75%, 75% 75%, 75% 87.5%, 62.5% 87.5%, 62.5% 100%, 37.5% 100%, 37.5% 87.5%, 25% 87.5%, 25% 75%, 12.5% 75%, 12.5% 62.5%, 0 62.5%, 0 37.5%, 12.5% 37.5%, 12.5% 25%, 25% 25%, 25% 12.5%, 37.5% 12.5%);
  position: relative;
  width: 46cqw; height: 46cqw;
  background: var(--border);
  clip-path: var(--step);
}
.pcard__emblem::before, .pcard__emblem::after {
  content: "";
  position: absolute;
  clip-path: var(--step);
}
.pcard__emblem::before { inset: 9%; background: linear-gradient(135deg, var(--amber) 50%, #E09A1A 50%); }
.pcard__emblem::after { inset: 34%; background: var(--border); }
.pcard__label {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  padding: 4cqw 6cqw 5cqw;
  font-family: var(--font-pixel);
  font-size: 15cqw;
  line-height: 1;
  color: var(--text);
  background: rgba(33, 53, 71, 0.92);
  box-shadow: 0 0 0 1.5cqw var(--border);
  text-shadow: 1cqw 1cqw 0 var(--border);
  white-space: nowrap;
}

/* ---------- Corner brackets (drawPixelCornerBrackets) ---------- */
.brackets { position: relative; }
.brackets::after {
  --c: var(--amber);
  --s: 4px;
  --l: 18px;
  content: "";
  position: absolute;
  inset: -10px;
  pointer-events: none;
  background:
    linear-gradient(var(--c) 0 0) top left / var(--l) var(--s),
    linear-gradient(var(--c) 0 0) top left / var(--s) var(--l),
    linear-gradient(var(--c) 0 0) top right / var(--l) var(--s),
    linear-gradient(var(--c) 0 0) top right / var(--s) var(--l),
    linear-gradient(var(--c) 0 0) bottom left / var(--l) var(--s),
    linear-gradient(var(--c) 0 0) bottom left / var(--s) var(--l),
    linear-gradient(var(--c) 0 0) bottom right / var(--l) var(--s),
    linear-gradient(var(--c) 0 0) bottom right / var(--s) var(--l);
  background-repeat: no-repeat;
  filter: drop-shadow(2px 2px 0 var(--border));
}
.brackets--green::after { --c: var(--green); --l: 26px; --s: 5px; inset: -14px; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  padding: clamp(3rem, 7vw, 6rem) 0 clamp(4rem, 8vw, 7rem);
  background:
    radial-gradient(60rem 30rem at 85% 40%, rgba(121, 155, 191, 0.25), transparent 70%);
  overflow: hidden;
}
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(2.5rem, 5vw, 4.5rem);
  align-items: center;
}
.hero__title {
  font-size: clamp(4rem, 10.5vw, 8.2rem);
  line-height: 0.88;
  text-shadow: 4px 4px 0 var(--border);
}
.hero__title .hl { color: var(--amber); }
.hero__title span { white-space: nowrap; }
.hero__lead {
  margin-top: 1.6rem;
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  color: var(--text);
  max-width: 34rem;
}
.hero__for {
  margin: 0.9rem 0 2rem;
  color: var(--text-2);
}
.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin: 1.75rem 0 0;
  padding: 0;
  list-style: none;
  font-family: var(--font-pixel);
  font-size: 0.78rem;
  color: var(--text-2);
}
.facts li { display: inline-flex; align-items: center; gap: 0.5rem; }
.facts li::before {
  content: "";
  width: 8px; height: 8px;
  background: var(--green);
  box-shadow: 0 0 0 2px var(--border);
}

/* The "device": a pixel panel styled like the app's onboarding screen */
.device {
  margin: 0;
  background: var(--bg);
  padding: 0;
  position: relative;
  box-shadow:
    inset var(--px-bevel) var(--px-bevel) 0 0 var(--bevel),
    inset calc(var(--px-bevel) * -1) calc(var(--px-bevel) * -1) 0 0 var(--border),
    0 0 0 var(--px-outline) var(--border),
    12px 12px 0 var(--px-outline) var(--ink);
}
.device__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem 0.85rem 1.25rem;
  background: var(--surface);
  box-shadow: inset 0 -2px 0 var(--border), inset 3px 3px 0 var(--bevel);
}
.device__title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  line-height: 1;
  text-shadow: 2px 2px 0 var(--border);
}
.device__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.25rem;
  padding: 0.35rem 0.7rem;
  border: 0;
  background: var(--surface-2);
  color: var(--text-2);
  font-family: var(--font-pixel);
  font-size: 0.7rem;
  cursor: pointer;
  box-shadow: inset 2px 2px 0 var(--bevel), inset -2px -2px 0 var(--border), 0 0 0 2px var(--border);
}
.device__toggle:hover { color: var(--text); }
.device__toggle-icon {
  width: 10px; height: 10px;
  background:
    linear-gradient(currentColor 0 0) left / 3px 100% no-repeat,
    linear-gradient(currentColor 0 0) right / 3px 100% no-repeat;
}
.device__toggle[aria-pressed="true"] .device__toggle-icon {
  background: currentColor;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.device__screen {
  padding: clamp(1.5rem, 4vw, 2.5rem) clamp(0.75rem, 3vw, 2rem) 0;
}

.stage {
  --perspective: 1700px;
  position: relative;
  width: 100%;
  max-width: 34rem;
  margin: 0 auto;
  aspect-ratio: 232 / 140;
  container-type: inline-size;
}
.stage__card {
  /* 84×118 card centred in a 232×140 box, like OnboardingDialog */
  --tx: 0;
  --ry: 0;
  --o: 1;
  position: absolute;
  left: calc((232 - 84) / 2 / 232 * 100%);
  top: calc((140 - 118) / 2 / 140 * 100%);
  width: calc(84 / 232 * 100%);
  height: calc(118 / 140 * 100%);
  transform: perspective(var(--perspective)) translateX(calc(var(--tx) * 100cqw / 232)) rotateY(calc(var(--ry) * 1deg));
  opacity: var(--o);
  will-change: transform;
}
.stage__card .pcard { width: 100%; height: 100%; }
/* No-JS / reduced-motion default: the stitched end state */
.stage__card--front { --tx: -50; }
.stage__card--back { --tx: 50; }
.stage__fx {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.no-js .stage::after {
  /* static green "stitched" frame when JS is off */
  content: "";
  position: absolute;
  left: calc(16 / 232 * 100%);
  right: calc(16 / 232 * 100%);
  top: calc(3 / 140 * 100%);
  bottom: calc(3 / 140 * 100%);
  border: 3px solid var(--green);
}

.device__caption {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.5rem;
  margin: clamp(1.25rem, 3vw, 2rem) calc(clamp(0.75rem, 3vw, 2rem) * -1) 0;
  padding: 0.75rem 1rem;
  background: var(--border);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: clamp(0.95rem, 2.2vw, 1.15rem);
  letter-spacing: 0.01em;
  white-space: pre;
}
.caret {
  display: inline-block;
  width: 0.6em;
  height: 1.1em;
  margin-left: 2px;
  background: var(--amber);
  animation: blink 1s steps(1) infinite;
}
.device__file {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 0 calc(clamp(0.75rem, 3vw, 2rem) * -1);
  padding: 0.75rem 1rem 1rem;
  background: var(--border);
  border-top: 2px dashed var(--surface);
  font-size: 0.9rem;
}
.device__file code { background: var(--ink); }
.device__file > * { opacity: var(--file-o, 1); }

/* ==========================================================================
   Problem: before vs after
   ========================================================================== */
.versus {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 1.5rem;
  align-items: stretch;
}
.panel {
  background: var(--surface);
  padding: clamp(1.25rem, 3vw, 2rem);
  display: flex;
  flex-direction: column;
}
.panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
  border-bottom: 2px dashed var(--bevel);
}
.counter {
  font-family: var(--font-pixel);
  font-size: 0.85rem;
  color: var(--text-2);
}
.counter__n {
  font-family: var(--font-display);
  font-size: 3.6rem;
  line-height: 1;
  color: #FF8A93;
  text-shadow: 3px 3px 0 var(--border);
}
.counter--good .counter__n { color: var(--green-text); }
.counter__per { display: block; font-size: 0.7rem; color: var(--text-2); text-align: right; }

.steps-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: s;
  display: grid;
  gap: 0.55rem;
}
.steps-list li {
  counter-increment: s;
  display: grid;
  grid-template-columns: 2rem 6.8rem 1fr;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.6rem;
  background: var(--surface-2);
  box-shadow: 0 0 0 2px var(--border);
  font-size: 0.92rem;
}
.steps-list li::before {
  content: counter(s);
  grid-column: 1;
  grid-row: 1;
  font-family: var(--font-pixel);
  color: var(--text-2);
  text-align: center;
}
.steps-list .tool {
  grid-column: 2;
  grid-row: 1;
  justify-self: start;
  padding: 0.12rem 0.4rem;
  font-family: var(--font-pixel);
  font-size: 0.66rem;
  background: var(--border);
  color: var(--text-2);
}
.steps-list li > :not(.tool) { grid-column: 3; }
.steps-list li:last-child { color: #FFB3B9; }

.versus__vs {
  display: grid;
  place-items: center;
}
.versus__vs span {
  display: grid;
  place-items: center;
  width: 3.5rem; height: 3.5rem;
  font-family: var(--font-pixel);
  font-size: 1rem;
  background: var(--accent-fill);
  color: var(--text);
  text-shadow: 2px 2px 0 var(--border);
  box-shadow: inset 3px 3px 0 var(--bevel), inset -3px -3px 0 var(--border), 0 0 0 2px var(--border);
}

.panel--after { background: var(--surface); outline: 3px solid var(--green); outline-offset: 5px; }
.panel--after .panel__head { border-bottom-color: var(--text-2); }
.taps {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.tap {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.9rem;
  background: var(--surface-2);
  box-shadow: 0 0 0 2px var(--border);
  font-size: 0.95rem;
}
.tap b { font-family: var(--font-pixel); font-weight: 400; color: var(--amber); margin-right: 0.3rem; }
.tap__btn {
  flex: none;
  width: 2.4rem; height: 2.4rem;
  border-radius: 50%;
  background: var(--text);
  box-shadow: 0 0 0 4px var(--surface-2), 0 0 0 6px var(--text), 0 0 0 8px var(--border);
  margin: 8px;
}
.result {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.25rem;
  align-items: center;
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--surface-2);
  box-shadow: 0 0 0 2px var(--border);
}
.result__img {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: #fff;
  outline: 3px solid var(--green);
  outline-offset: 3px;
}
.result__img .pcard { width: 3.6rem; }
.ticks {
  margin: 0; padding: 0; list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem 0.8rem;
  font-family: var(--font-pixel);
  font-size: 0.8rem;
}
.ticks li { display: inline-flex; align-items: center; gap: 0.45rem; }
.ticks .px-icon, .dodont__list .px-icon, .lane .px-icon { height: 14px; color: var(--green-text); flex: none; }
.panel__foot { margin-top: auto; padding-top: 1.25rem; text-align: center; }
.panel__foot code { background: var(--border); }

.math {
  margin: clamp(2rem, 4vw, 3rem) auto 0;
  max-width: 60rem;
  text-align: center;
  font-size: 1.1rem;
  color: var(--text-2);
}
.math s { color: var(--text-2); text-decoration-color: var(--accent); text-decoration-thickness: 3px; }
.math strong { color: var(--amber); }

/* staged reveal for the step lists */
.js .steps-list li,
.js .taps .tap,
.js .result {
  opacity: 0;
  transform: translateX(-12px);
  transition: opacity 240ms steps(3), transform 240ms steps(3);
}
.js .is-in .steps-list li,
.js .is-in .taps .tap,
.js .is-in .result { opacity: 1; transform: none; }
.steps-list li:nth-child(1) { transition-delay: 150ms; }
.steps-list li:nth-child(2) { transition-delay: 300ms; }
.steps-list li:nth-child(3) { transition-delay: 450ms; }
.steps-list li:nth-child(4) { transition-delay: 600ms; }
.steps-list li:nth-child(5) { transition-delay: 750ms; }
.steps-list li:nth-child(6) { transition-delay: 900ms; }
.steps-list li:nth-child(7) { transition-delay: 1050ms; }
.taps .tap:nth-child(1) { transition-delay: 350ms; }
.taps .tap:nth-child(2) { transition-delay: 600ms; }
.result { transition-delay: 900ms; }

/* ==========================================================================
   How it works
   ========================================================================== */
.how {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
  margin: 0;
  padding: 0;
  list-style: none;
}
.how__step h3 { margin: 0.35rem 0 0.6rem; }
.how__step p:not(.how__num) { color: var(--text-2); }
.how__num {
  margin-top: 1.6rem;
  font-family: var(--font-pixel);
  font-size: 0.85rem;
  color: var(--amber);
}
.vf {
  --bv-hi: #3A4F63;
  --bv-lo: #0F1A24;
  position: relative;
  aspect-ratio: 4 / 4.4;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 30% 20%, rgba(121, 155, 191, 0.18), transparent 60%),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.12) 0 2px, transparent 2px 4px),
    #1B2A38;
  overflow: hidden;
}
.vf__slots {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
}
.vf__slots span {
  display: grid;
  place-items: center;
  width: 2.25rem; height: 1.6rem;
  font-family: var(--font-pixel);
  font-size: 0.7rem;
  color: var(--text-2);
  background: var(--surface-2);
  box-shadow: inset 2px 2px 0 var(--bevel), inset -2px -2px 0 var(--border), 0 0 0 2px var(--border);
}
.vf__slots .is-next { color: var(--amber); box-shadow: inset 0 0 0 2px var(--amber), 0 0 0 2px var(--border); }
.vf__slots .is-filled { background: var(--amber); color: var(--border); }
.vf__frame { width: 38%; margin-top: -4%; }
.vf__frame .pcard { width: 100%; }
.vf__shutter {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--text);
  box-shadow: 0 0 0 3px #1B2A38, 0 0 0 6px var(--text), 0 0 0 8px var(--border);
}
.vf--done { align-content: center; gap: 1.1rem; padding: 1rem; }
.vf__out {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: #fff;
  outline: 3px solid var(--green);
  outline-offset: 4px;
}
.vf__out .pcard { width: clamp(3.5rem, 9vw, 5.5rem); }
.vf .marching { width: 72%; }
.vf__name code { font-size: 0.78rem; background: var(--border); }

/* ==========================================================================
   Sellers: output lab + features
   ========================================================================== */
.lab {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  background: var(--surface);
  margin-bottom: clamp(3rem, 6vw, 4.5rem);
}
.lab__preview {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  background: var(--bg);
  box-shadow: inset -2px 0 0 var(--border);
}
.lab__label, .lab__file-label {
  justify-self: start;
  align-self: flex-start;
  padding: 0.15rem 0.45rem;
  background: var(--border);
}
.lab__label, .ctl legend, .ctl__legend, .lab__file-label {
  font-family: var(--font-pixel);
  font-size: 0.75rem;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.lab__canvas {
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 15rem;
  padding: clamp(1rem, 3vw, 1.75rem);
  background:
    linear-gradient(45deg, #34536F 25%, transparent 25%, transparent 75%, #34536F 75%),
    linear-gradient(45deg, #34536F 25%, transparent 25%, transparent 75%, #34536F 75%),
    #2B4560;
  background-size: 16px 16px;
  background-position: 0 0, 8px 8px;
  box-shadow: 0 0 0 2px var(--border);
  container-type: inline-size;
}
.lab__file {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.lab__file output {
  font-size: 1rem;
  padding: 0.35rem 0.65rem;
  background: var(--border);
  color: var(--amber);
  white-space: normal;
  word-break: break-all;
}

/* StitchLayout: border = 3% of card height, same width between the cards;
   watermark strip below = text height + border; text 4% of card height. */
.stitched {
  --cw: 47.03cqw;
  --b: calc(var(--cw) * 118 / 84 * 0.03);
  --bc: #fff;
  --wm: #424242;
  display: inline-flex;
  flex-direction: column;
  width: auto;
  max-width: 100%;
  background: var(--bc);
  padding: var(--b) var(--b) 0;
  box-shadow: 8px 8px 0 var(--ink);
  transition: background-color 200ms steps(2), padding 200ms steps(2);
}
.stitched__cards { display: flex; gap: var(--b); }
.stitched__cards .pcard {
  width: var(--cw);
  --px-bevel: 0px;
  box-shadow: none;
}
.stitched__strip {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  height: var(--b);
  overflow: hidden;
}
.stitched__wm {
  display: none;
  font-family: Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: calc(var(--cw) * 118 / 84 * 0.04);
  line-height: 1.17;
  color: var(--wm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.stitched.has-wm .stitched__strip { height: calc(var(--cw) * 118 / 84 * (0.04 * 1.17 + 0.03)); }
.stitched.has-wm .stitched__wm { display: block; }
.stitched[data-border="black"] { --bc: #000; --wm: #BDBDBD; }
.stitched[data-border="grey"] { --bc: #9E9E9E; --wm: #424242; }
.stitched[data-border="none"] { --cw: 50cqw; --b: 0px; }
.stitched[data-border="none"] .stitched__strip { display: none; }

.lab__controls {
  display: grid;
  gap: 1.35rem;
  align-content: start;
  padding: clamp(1.25rem, 3vw, 2rem);
}
.ctl { margin: 0; padding: 0; border: 0; min-width: 0; }
.ctl legend, .ctl__legend { display: block; padding: 0; margin-bottom: 0.6rem; }
.ctl__hint { margin-top: 0.5rem; font-size: 0.8rem; color: var(--text-2); }
.seg { display: flex; gap: 8px; }
.seg--wrap { flex-wrap: wrap; }
.toggle { position: relative; display: inline-flex; }
.toggle input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}
.toggle span {
  display: inline-grid;
  place-items: center;
  min-width: 2.75rem;
  min-height: 2.5rem;
  padding: 0.35rem 0.75rem;
  font-family: var(--font-pixel);
  font-size: 0.8rem;
  color: var(--text-2);
  background: var(--surface-2);
  box-shadow: inset 2px 2px 0 var(--bevel), inset -2px -2px 0 var(--border), 0 0 0 2px var(--border);
  transition: transform 60ms steps(2);
  user-select: none;
}
.toggle:hover span { color: var(--text); }
.toggle input:checked + span {
  color: var(--ink);
  background: var(--amber);
  text-shadow: none;
  box-shadow: inset 2px 2px 0 var(--border), inset -2px -2px 0 #FFE08A, 0 0 0 2px var(--border);
  transform: translateY(2px);
}
.toggle input:focus-visible + span { outline: 3px solid var(--text); outline-offset: 3px; }
.seg--cond .toggle span { min-width: 2.6rem; padding: 0.35rem 0.5rem; }
.field {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.55rem 0.75rem;
  border: 0;
  background: var(--border);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  box-shadow: inset 2px 2px 0 var(--ink), 0 0 0 2px var(--border);
}
.field::placeholder { color: var(--text-3); }
.field:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.field:disabled { opacity: 0.5; }

.features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.feature {
  background: var(--surface);
  padding: 1.5rem;
  transition: transform 120ms steps(2);
}
.feature:hover { transform: translate(-3px, -3px); box-shadow:
    inset var(--px-bevel) var(--px-bevel) 0 0 var(--bevel),
    inset calc(var(--px-bevel) * -1) calc(var(--px-bevel) * -1) 0 0 var(--border),
    0 0 0 var(--px-outline) var(--border),
    6px 6px 0 var(--px-outline) var(--ink); }
.feature__icon, .pillar__icon {
  display: inline-grid;
  place-items: center;
  width: 3.25rem; height: 3.25rem;
  margin-bottom: 1.1rem;
  color: var(--amber);
  background: var(--surface-2);
  box-shadow: inset 2px 2px 0 var(--bevel), inset -2px -2px 0 var(--border), 0 0 0 2px var(--border);
}
.pillar__icon { width: 4.25rem; height: 4.25rem; }
.pillar__icon .px-icon { height: 36px !important; }
.feature__icon .px-icon, .pillar__icon .px-icon { height: 26px; filter: drop-shadow(2px 2px 0 var(--border)); }
.feature h3 { margin-bottom: 0.6rem; }
.feature p { font-size: 0.93rem; color: var(--text-2); }

/* ==========================================================================
   Honest photos
   ========================================================================== */
.band--honest {
  background:
    repeating-linear-gradient(90deg, rgba(56, 176, 0, 0.06) 0 2px, transparent 2px 48px),
    var(--surface);
}
.honest {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
}
.honest h2 { margin-bottom: 1.25rem; }
.dodont {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 2rem 0 1.75rem;
}
.dodont__title {
  margin-bottom: 0.75rem;
  font-family: var(--font-pixel);
  font-weight: 400;
  font-size: 0.85rem;
  text-shadow: none;
}
.dodont__title--do { color: var(--green-text); }
.dodont__title--dont { color: #FF8A93; }
.dodont__list { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.5rem; }
.dodont__list li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.7rem;
  background: var(--surface-2);
  box-shadow: 0 0 0 2px var(--border);
  font-size: 0.92rem;
}
.dodont__list--dont .px-icon { color: #FF8A93; }
.honest__why {
  font-family: var(--font-display);
  font-size: 1.9rem;
  line-height: 1.05;
  color: var(--amber);
  text-shadow: 2px 2px 0 var(--border);
}
.honest__proof { margin: 0; }
.proof {
  display: block;
  padding: 0;
  background: var(--ink);
  box-shadow: 0 0 0 2px var(--border), 10px 10px 0 var(--ink);
  container-type: inline-size;
}
.proof img { width: 100%; height: auto; }
.proof--illustrated { display: grid; place-items: center; padding: 1.5rem; background: #2B4560; }
.honest__proof figcaption {
  margin-top: 1.75rem;
  font-size: 0.85rem;
  color: var(--text-2);
  text-align: center;
}

/* ==========================================================================
   Privacy
   ========================================================================== */
.pillars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.pillar {
  background: var(--surface);
  padding: 1.75rem 1.5rem;
  text-align: center;
}
.pillar__icon { margin-left: auto; margin-right: auto; }
.pillar h3 { margin-bottom: 0.5rem; }
.pillar p { font-size: 0.93rem; color: var(--text-2); }
.center-link { margin-top: 2.25rem; text-align: center; font-family: var(--font-pixel); font-size: 0.85rem; }

/* ==========================================================================
   Roadmap
   ========================================================================== */
.roadmap {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}
.lane {
  background: var(--surface-2);
  padding: 1.5rem;
}
.lane__title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.1rem;
  font-family: var(--font-pixel);
  font-weight: 400;
  font-size: 0.9rem;
  text-shadow: 2px 2px 0 var(--border);
}
.lane__dot { width: 12px; height: 12px; box-shadow: 0 0 0 2px var(--border); background: var(--green); }
.lane--next .lane__dot { background: var(--amber); animation: blink 1.1s steps(1) infinite; }
.lane--ideas .lane__dot { background: var(--bevel); }
.lane ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.6rem; }
.lane li { display: flex; gap: 0.65rem; align-items: baseline; font-size: 0.92rem; }
.lane li .px-icon { position: relative; top: 2px; }
.lane__bullet { flex: none; width: 8px; height: 8px; position: relative; top: -1px; background: var(--amber); }
.lane--ideas .lane__bullet { background: var(--bevel); }
.lane--ideas li { color: var(--text-2); }
.lane__note { margin: -0.5rem 0 1rem; font-size: 0.8rem; color: var(--text-2); }
.lane--next { background: var(--surface); }
.lane--next .marching { margin-top: 1.5rem; }
.lane--ideas { background: transparent; box-shadow: 0 0 0 2px var(--bevel); }
.lane--ideas { border: 0; outline: 2px dashed var(--border); outline-offset: -8px; }

/* ==========================================================================
   FAQ
   ========================================================================== */
.faq { display: grid; gap: 1rem; }
.faq details { background: var(--surface); }
.faq summary {
  position: relative;
  display: block;
  padding: 1.15rem 3.5rem 1.15rem 1.35rem;
  font-family: var(--font-display);
  font-size: 1.6rem;
  line-height: 1.1;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  position: absolute;
  right: 1.25rem;
  top: 50%;
  width: 14px; height: 14px;
  margin-top: -7px;
  background:
    linear-gradient(var(--amber) 0 0) center / 100% 4px no-repeat,
    linear-gradient(var(--amber) 0 0) center / 4px 100% no-repeat;
  filter: drop-shadow(2px 2px 0 var(--border));
}
.faq details[open] summary::after {
  background: linear-gradient(var(--amber) 0 0) center / 100% 4px no-repeat;
}
.faq summary:hover { color: var(--amber); }
.faq summary:focus-visible { outline-offset: -4px; }
.faq__a {
  padding: 0 1.35rem 1.35rem;
  color: var(--text-2);
}
.faq__a p { max-width: 44rem; }

/* ==========================================================================
   Final CTA
   ========================================================================== */
.final__panel {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 1.25rem;
  padding: clamp(2.5rem, 6vw, 4.5rem) clamp(1.25rem, 4vw, 3rem);
  text-align: center;
  background: var(--surface);
}
.final__panel .section-head__lead { color: var(--text); }
.final__panel .cta { justify-content: center; margin-top: 0.75rem; }
.final__panel .status { margin-left: auto; margin-right: auto; text-align: left; }
.final__cards {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 0.5rem;
  background: #fff;
  outline: 3px solid var(--green);
  outline-offset: 4px;
}
.final__cards .pcard { width: 4.5rem; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: var(--ink);
  border-top: var(--px-outline) solid var(--border);
  padding: 3rem 0 2.5rem;
  color: var(--text-2);
  font-size: 0.85rem;
}
.site-footer__inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem 2rem;
}
.site-footer__name {
  font-family: var(--font-display);
  font-size: 1.9rem;
  line-height: 1;
  color: var(--text);
}
.site-footer__links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; align-items: center; }
.site-footer__links a { color: var(--text); font-family: var(--font-pixel); font-size: 0.75rem; }
.site-footer__links a:hover { color: var(--amber); }
.site-footer__legal, .site-footer__copy { grid-column: 1 / -1; max-width: 60rem; color: var(--text-2); font-size: 0.78rem; }

/* ==========================================================================
   Legal pages (_layouts/cardstitch-legal.html)
   Same band, section head, panel and list styles as the landing page;
   only the long-text rhythm is specific here.
   ========================================================================== */
.legal__title { font-size: clamp(2.7rem, 6vw, 4.4rem); } /* = section h2 */
.legal__head .facts { margin-top: 1.25rem; }

.legal__body { display: block; overflow-wrap: break-word; color: var(--text-2); }
.legal__body > * + * { margin-top: 1.1rem; }
.legal__body p, .legal__body li { max-width: 68ch; }
.legal__body h2 {
  margin-top: 2.5rem;
  padding-top: 1.75rem;
  border-top: 2px dashed var(--bevel); /* = .panel__head divider */
  font-size: 1.85rem;                  /* = h3 on the landing page */
  line-height: 1;
  color: var(--text);
  text-shadow: 2px 2px 0 var(--border);
}
.legal__body h3 {                      /* = .lane__title */
  margin-top: 1.75rem;
  font-family: var(--font-pixel);
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--text);
  text-shadow: 2px 2px 0 var(--border);
}
.legal__body h2 + *, .legal__body h3 + * { margin-top: 0.75rem; }
.legal__body ul { margin-left: 0; padding-left: 0; list-style: none; }
.legal__body li { position: relative; padding-left: 1.4rem; }
.legal__body li + li { margin-top: 0.5rem; }
.legal__body li::before {              /* = .lane__bullet */
  content: "";
  position: absolute;
  left: 0.15rem; top: 0.66em;
  width: 8px; height: 8px;
  background: var(--amber);
}
.legal__body code { white-space: normal; }
.legal__note {                         /* inset well, like .vf / .lab__canvas */
  padding: 1rem 1.15rem;
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.92rem;
  box-shadow:
    inset var(--px-bevel) var(--px-bevel) 0 0 var(--border),
    inset calc(var(--px-bevel) * -1) calc(var(--px-bevel) * -1) 0 0 var(--bevel);
}
.legal .center-link { margin-top: 2.5rem; }

/* ==========================================================================
   Scroll reveal (stepped, like the app's pixel motion)
   ========================================================================== */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 420ms steps(4), transform 420ms steps(4);
}
.js .reveal.is-in { opacity: 1; transform: none; }
.features .feature:nth-child(3n + 2), .pillars .pillar:nth-child(2), .how__step:nth-child(2), .lane:nth-child(2) { transition-delay: 90ms; }
.features .feature:nth-child(3n), .pillars .pillar:nth-child(3), .how__step:nth-child(3), .lane:nth-child(3) { transition-delay: 180ms; }
.features .feature:hover { transition-delay: 0ms; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 64rem) {
  .hero__grid { grid-template-columns: 1fr; }
  .device { max-width: 36rem; width: 100%; margin: 0 auto; }
  .versus { grid-template-columns: 1fr; }
  .versus__vs { margin: -0.25rem 0; }
  .lab { grid-template-columns: 1fr; }
  .lab__preview { box-shadow: inset 0 -2px 0 var(--border); }
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .honest { grid-template-columns: 1fr; }
  .roadmap { grid-template-columns: 1fr 1fr; }
  .lane--done { grid-column: 1 / -1; }
  .lane--done ul { grid-template-columns: 1fr 1fr; column-gap: 1.5rem; }
}
@media (max-width: 48rem) {
  .how { grid-template-columns: 1fr; max-width: 26rem; margin: 0 auto; }
  .vf { aspect-ratio: 16 / 12; }
  .vf__frame { width: 30%; }
  .pillars { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr; }
  .roadmap { grid-template-columns: 1fr; }
  .lane--done ul { grid-template-columns: 1fr; }
  .dodont { grid-template-columns: 1fr; }
  .site-footer__inner { grid-template-columns: 1fr; }
}
@media (max-width: 30rem) {
  body.cs { font-size: 0.95rem; }
  .btn--lg { width: 100%; }
  .cta { gap: 1.1rem; }
  .steps-list li { grid-template-columns: 1.4rem 1fr; }
  .steps-list .tool { grid-column: 2; }
  .steps-list li > :not(.tool) { grid-column: 2; }
  .steps-list li { grid-auto-flow: row; row-gap: 0.25rem; }
  .steps-list li::before { grid-row: 1 / span 2; }
  .tap { padding: 0.6rem; gap: 0.5rem; font-size: 0.85rem; }
  .tap__btn { width: 1.8rem; height: 1.8rem; margin: 6px; }
  .device { box-shadow:
    inset var(--px-bevel) var(--px-bevel) 0 0 var(--bevel),
    inset calc(var(--px-bevel) * -1) calc(var(--px-bevel) * -1) 0 0 var(--border),
    0 0 0 var(--px-outline) var(--border),
    6px 6px 0 var(--px-outline) var(--ink); }
  .result { grid-template-columns: 1fr; justify-items: center; }
  .status { grid-template-columns: 1fr; }
  .subbar .btn--sm { padding: 0.45rem 0.7rem; font-size: 0.72rem; }
  .brand__name { font-size: 1.1rem; }
}

/* ==========================================================================
   Reduced motion: final states, no loops
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0ms !important;
  }
  .marching span { animation: none; left: 12%; }
  .marching span:nth-child(2) { left: 12%; }
  .marching span:nth-child(3) { left: 12%; }
  .status__dot, .caret, .lane--next .lane__dot { animation: none; }
  .js .reveal, .js .steps-list li, .js .taps .tap, .js .result { opacity: 1; transform: none; }
}

.final { background: var(--bg); }

/* ==========================================================================
   Embedded demo (cardstitch/demo.html shown in an iframe on the home page).
   Scoped to .cs-embed so none of this touches the normal landing page: the
   iframe is transparent, the device fills its width and there is no chrome.
   ========================================================================== */
body.cs-embed {
  margin: 0;
  background: transparent;      /* beats body.cs so the console shows through */
}
/* The home-page cell is wide and short (same height as the game), so the
   embed drops the device chrome and lays the demo out to fill the frame:
   the stage takes all spare height, caption and filename sit in compact
   strips below it. */
html:has(body.cs-embed), body.cs-embed { height: 100%; overflow: hidden; }
.cs-embed .device {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: transparent;
  box-shadow: none;
}
.cs-embed .device__bar { display: none; }
.cs-embed .device__screen {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: minmax(0, 1fr) auto;
  padding: 10px 0 0;
}
.cs-embed .stage {
  grid-column: 1 / -1;
  height: 100%;
  width: auto;
  max-width: 100%;
  margin: 0 auto;
}
/* Caption and filename share one strip: caption left, file right. */
.cs-embed .device__caption,
.cs-embed .device__file {
  min-height: 0;
  margin: 8px 0 0;
  padding: 6px 10px;
  border-top: 0;
  font-size: 13px;
}
.cs-embed .device__caption { justify-content: flex-start; }
.cs-embed .device__file { gap: 6px; flex-wrap: nowrap; font-size: 11px; }
.cs-embed .device__file .chip { display: none; }
@media (max-width: 380px) { .cs-embed .device__file { display: none; } }
