/* ==========================================================================
   Cerdek Base + Components  ·  v1.0
   Reusable across every page. Requires tokens.css.
   Sections: 1 Reset · 2 Type · 3 Layout · 4 Buttons & chips · 5 Header
             6 Cards & grounds · 7 Product-UI kit · 8 Reveal motion
             9 Doodle motion · 10 Footer · 11 Utilities
   ========================================================================== */

/* 1 ── Reset ─────────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 0 solid var(--gray-200);
  -webkit-tap-highlight-color: transparent; /* no grey/blue flash on tap (mobile WebKit), site-wide */
}
html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-padding-top: calc(var(--site-header) + 24px);
}
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
body {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
}
img,
svg,
video {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  font: inherit;
  color: inherit;
  background: none;
  cursor: pointer;
}
ul,
ol {
  list-style: none;
}
h1,
h2,
h3,
h4 {
  font-size: inherit;
  font-weight: inherit;
}
b,
strong {
  font-weight: 700;
}
:focus-visible {
  outline: 2px solid var(--orange-300);
  outline-offset: 2px;
}
::selection {
  background: color-mix(in srgb, var(--orange-300) 14%, transparent);
}
:is(.type-hero-title, .type-section-title, .type-subsection-title, .type-card-title)::selection,
:is(.type-hero-title, .type-section-title, .type-subsection-title, .type-card-title) ::selection {
  background: var(--orange-300);
  color: var(--white);
}

/* 2 ── Type ──────────────────────────────────────────────────────────────── */
.type-hero-title {
  font-size: 28px;
  font-weight: 600;
  line-height: 1.25;
  text-wrap: balance;
}
.type-hero-desc {
  font-size: 15px;
  line-height: 1.5;
}
.type-section-title {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.25;
}
.type-section-desc {
  max-width: var(--desc-measure, 640px);
  font-size: 15px;
  line-height: 1.5;
}
.type-subsection-title {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
}
.type-card-title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.375;
}
.type-eyebrow {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--orange-400);
}
.type-body {
  font-size: 15px;
  line-height: 1.5;
  color: var(--color-text-body);
}
.type-small {
  font-size: 14px;
  line-height: 1.43;
}
.type-caption {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.33;
}
@media (min-width: 640px) {
  .type-hero-title {
    font-size: 36px;
  }
  .type-section-title {
    font-size: 28px;
  }
  .type-subsection-title {
    font-size: 22px;
  }
}
@media (min-width: 1280px) {
  .type-hero-title {
    font-size: 40px;
  }
  .type-subsection-title {
    font-size: 24px;
  }
}
:lang(zh) .type-hero-title,
:lang(zh) .type-section-title {
  font-weight: 700;
  letter-spacing: 0.01em;
}

/* 3 ── Layout ────────────────────────────────────────────────────────────── */
/* .page-x centres content in a --page-content column with a minimum gutter. */
.page-x {
  --rail-gutter: max(var(--page-gutter-min), calc((100% - var(--page-content)) / 2));
  padding-inline: var(--rail-gutter);
}
.page-x--wide {
  --page-content: var(--page-content-wide);
}
.section {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}
.section--gap {
  padding-block: var(--section-gap);
}
.section--gap-b {
  padding-bottom: var(--section-gap);
}
.section--gap-half {
  padding-block: var(--section-gap-half);
}
.section-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  width: 100%;
}
.section-head .type-section-title {
  color: var(--gray-900);
  text-wrap: balance;
}
.section-head .type-section-desc {
  color: var(--gray-700);
}
/* vertical stack: heading block + content, 28px apart */
.stack {
  display: flex;
  flex-direction: column;
  gap: 28px;
  width: 100%;
}
.content {
  width: 100%;
  max-width: var(--page-content);
  margin-inline: auto;
}

/* 4 ── Buttons & chips ───────────────────────────────────────────────────── */
.pressable {
  transition: transform var(--dur-press) var(--ease-out-strong),
    opacity var(--dur-press) var(--ease-out-strong),
    background-color var(--dur-press) var(--ease-out-strong),
    color var(--dur-press) var(--ease-out-strong),
    filter var(--dur-press) var(--ease-out-strong);
}
.pressable:active {
  transform: scale(0.97);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 90px;
  height: 36px;
  padding-inline: 12px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  white-space: nowrap;
  text-align: center;
}
.btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}
.btn--lg {
  height: 40px;
  padding-inline: 16px;
}
.btn--primary {
  background: var(--orange-300);
  border-color: var(--orange-300);
  color: var(--white);
}
.btn--primary:hover {
  opacity: 0.9;
}
.btn--soft {
  background: var(--gray-100);
  color: var(--gray-950);
}
.btn--soft:hover {
  filter: brightness(0.95);
}
.btn--outline {
  background: var(--white);
  border-color: var(--gray-200);
  color: var(--gray-600);
}
.btn--outline:hover {
  opacity: 0.9;
}
.btn--ink {
  background: var(--orange-900);
  border-color: var(--orange-900);
  color: var(--white);
}
.btn--ink:hover {
  opacity: 0.9;
}

/* round icon button (banner arrows, back-to-top) */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-pill);
  background: var(--white);
  color: var(--gray-900);
}
.icon-btn:hover {
  background: rgb(255 255 255 / 0.8);
}
.icon-btn svg {
  width: 28px;
  height: 28px;
}

/* solid label pill that titles a feature */
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding-inline: 12px;
  border-radius: var(--radius-pill);
  background: var(--orange-400);
  color: var(--white);
  font-size: 15px;
  font-weight: 600;
}
@media (min-width: 640px) {
  .pill {
    height: 40px;
    font-size: 16px;
  }
}

/* small toggle chip (language pickers, filters) */
.chip {
  border-radius: var(--radius-pill);
  border: 1px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-700);
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  line-height: 20px;
  transition: background-color 0.3s, border-color 0.3s, color 0.3s,
    transform var(--dur-press) var(--ease-out-strong);
}
.chip:hover {
  border-color: var(--gray-300);
  background: var(--gray-50);
}
.chip[aria-pressed="true"] {
  border-color: var(--orange-400);
  background: var(--orange-400);
  color: var(--white);
}
@media (min-width: 640px) {
  .chip {
    padding-inline: 16px;
    font-size: 14px;
  }
}

/* big statement badge (scatter fields) */
.badge {
  border-radius: var(--radius-pill);
  padding: 16px 28px;
  color: var(--white);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
}
.badge--orange { background: var(--orange-300); }
.badge--blue { background: var(--blue); }
.badge--green { background: var(--green); }
.badge--deep { background: var(--orange-400); }
.badge--ink { background: var(--orange-900); }
@media (max-width: 639.98px) {
  .badge {
    padding: 10px 20px;
    font-size: 14px;
  }
}

/* number marker used in step lists */
.num {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  background: var(--orange-400);
  color: var(--white);
  font-size: 16px;
  font-weight: 600;
}

/* check list */
.checks {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.checks li {
  display: flex;
  gap: 8px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--gray-700);
}
.checks li::before {
  content: "";
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 3px;
  background: var(--gray-600);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8.5l3.2 3.2L13 4.8'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8.5l3.2 3.2L13 4.8'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* 5 ── Header ────────────────────────────────────────────────────────────── */
.site-header {
  --page-content: var(--page-content-wide);
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: var(--site-header);
}
/* solid bar */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--white);
}
.site-header[data-sheet="true"]::before {
  background: var(--white);
  box-shadow: none;
}
.site-header__menu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-left: -12px;
  border-radius: var(--radius-pill);
}
.site-header__menu svg {
  width: 20px;
  height: 20px;
}
.site-header__logo {
  flex: none;
}
.site-header__logo img {
  height: 28px;
  width: auto;
}
.site-header__nav {
  display: none;
  align-items: center;
  gap: 40px;
  height: 40px;
  min-width: 0;
  flex: 1;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 16px;
  font-weight: 500;
  color: var(--gray-600);
  white-space: nowrap;
  transition: opacity var(--dur-press);
}
.nav-link:hover {
  opacity: 0.8;
}
.nav-link[aria-current="page"],
.nav-link.is-active {
  color: var(--gray-950);
}
.nav-link svg,
.chev {
  width: 20px;
  height: 20px;
  transition: transform var(--dur-menu);
}
[aria-expanded="true"] > .chev {
  transform: rotate(180deg);
}
.site-header__actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
  flex: none;
}
.site-header__actions .btn .chev {
  width: 18px;
  height: 18px;
}
.site-header .hide-sm {
  display: none;
}
@media (min-width: 640px) {
  .site-header .hide-sm {
    display: inline-flex;
  }
}
@media (min-width: 1024px) {
  .site-header {
    gap: 40px;
  }
  .site-header__menu {
    display: none;
  }
  .site-header__nav {
    display: flex;
  }
}
/* 6 nav items: tighten spacing on small desktops so BM labels stay on one line */
@media (min-width: 1024px) and (max-width: 1199.98px) {
  .site-header {
    gap: 24px;
  }
  .site-header__nav {
    gap: 22px;
  }
  .nav-link {
    font-size: 15px;
  }
}
.nav-pop {
  position: relative;
}
.nav-menu {
  position: absolute;
  top: calc(100% + 12px);
  left: -16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 120px;
  padding: 16px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-card);
  background: var(--white);
  box-shadow: var(--shadow-menu);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity var(--dur-menu) var(--ease-out-strong),
    transform var(--dur-menu) var(--ease-out-strong), visibility var(--dur-menu);
}
.nav-menu--right {
  left: auto;
  right: 0;
}
.nav-menu[data-open="true"] {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.nav-menu a,
.nav-menu button {
  white-space: nowrap;
  text-align: left;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--gray-950);
  transition: opacity var(--dur-press);
}
.nav-menu a:hover,
.nav-menu button:hover {
  opacity: 0.7;
}
.nav-menu [aria-pressed="false"] {
  color: var(--gray-600);
}
/* mobile sheet */
.nav-sheet {
  position: absolute;
  inset-inline: 0;
  top: 100%;
  display: flex;
  flex-direction: column;
  height: calc(100dvh - var(--site-header));
  padding-bottom: 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--white);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity var(--dur-menu) var(--ease-out-strong),
    transform var(--dur-menu) var(--ease-out-strong), visibility var(--dur-menu);
}
.nav-sheet[data-open="true"] {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.nav-sheet a,
.nav-sheet button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--gray-600);
  text-align: left;
  transition: opacity var(--dur-press);
}
.nav-sheet a:hover,
.nav-sheet button:hover {
  opacity: 0.7;
}
.nav-sheet .is-active {
  color: var(--gray-950);
}
.nav-sheet__spacer {
  flex: 1;
}
/* page-enter overlay (assets/js/enter-fx.js) — white cover + Cerdek's face */
.enter-fx {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.enter-fx__logo {
  width: min(36vw, 148px);
  height: auto;
  opacity: 0;
  transform: scale(0.3);
}
.enter-fx.is-on {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}
.enter-fx.is-enter {
  animation: enter-fx-in 200ms ease both;
}
.enter-fx.is-enter .enter-fx__logo {
  animation: enter-fx-pop 420ms cubic-bezier(0.34, 1.56, 0.64, 1) 80ms both;
}
.enter-fx.is-intro {
  transition: none;
}
.enter-fx.is-intro .enter-fx__logo {
  animation: enter-fx-pop 460ms cubic-bezier(0.34, 1.56, 0.64, 1) 60ms both;
}
.enter-fx.is-held .enter-fx__logo {
  opacity: 1;
  transform: none;
}
.enter-fx.is-leave .enter-fx__logo {
  animation: enter-fx-out 300ms cubic-bezier(0.36, 0, 0.66, -0.56) both;
}
.enter-fx.is-fade {
  animation: enter-fx-fade 280ms ease both;
}
@keyframes enter-fx-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes enter-fx-pop {
  0% { opacity: 0; transform: scale(0.3); }
  55% { opacity: 1; }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes enter-fx-out {
  0% { opacity: 1; transform: scale(1); }
  35% { opacity: 1; transform: scale(1.12); }
  100% { opacity: 0; transform: scale(0); }
}
@keyframes enter-fx-fade {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* language: segmented EN | BM | 中文 — every option visible, one tap to switch */
.lang-seg {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: var(--radius-pill);
  background: var(--gray-100);
}
.site-header .lang-seg.hide-sm {
  display: none;
}
@media (min-width: 640px) {
  .site-header .lang-seg.hide-sm {
    display: inline-flex;
  }
}
.lang-seg button {
  min-width: 40px;
  height: 30px;
  padding: 0 11px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  color: var(--gray-600);
  transition: background-color var(--dur-press), color var(--dur-press), box-shadow var(--dur-press);
}
.lang-seg button:hover {
  color: var(--gray-900);
}
.lang-seg button[aria-pressed="true"] {
  background: var(--white);
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.1);
  color: var(--gray-900);
}
.lang-seg button:focus-visible {
  outline: 2px solid var(--orange-300);
  outline-offset: 1px;
}
.nav-sheet .lang-seg--sheet {
  display: flex;
  margin: 0 20px 8px;
}
.nav-sheet .lang-seg--sheet button {
  flex: 1;
  justify-content: center;
  height: 40px;
  padding: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-600);
}
.nav-sheet .lang-seg--sheet button[aria-pressed="true"] {
  color: var(--gray-900);
}
.nav-sheet svg {
  width: 20px;
  height: 20px;
  flex: none;
}
@media (min-width: 1024px) {
  .nav-sheet {
    display: none;
  }
}

/* language on phones: globe chip → bottom sheet (≥640px keeps the EN | BM | 中文 segment) */
.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 36px;
  padding: 0 10px 0 8px;
  border-radius: var(--radius-pill);
  background: var(--gray-100);
  color: var(--gray-900);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  transition: transform 160ms var(--ease-out), background-color 160ms;
}
.lang-btn:active {
  transform: scale(0.94);
  background: var(--gray-150);
}
.lang-btn svg {
  width: 18px;
  height: 18px;
  transition: transform 520ms var(--ease-out-strong);
}
.lang-btn[aria-expanded="true"] svg {
  transform: rotate(-180deg);
}
.lang-btn__code {
  min-width: 2ch;
  text-align: center;
}
.lang-btn__code.is-swap {
  animation: lang-code-swap 360ms var(--ease-pop) both;
}
@keyframes lang-code-swap {
  0% { opacity: 0; transform: translateY(6px) scale(0.8); }
  100% { opacity: 1; transform: none; }
}
@media (min-width: 640px) {
  .lang-btn {
    display: none;
  }
}
/* small phones: menu + logo + language + CTA must share one row */
@media (max-width: 419.98px) {
  .site-header__actions {
    gap: 8px;
  }
  .site-header__logo img {
    height: 24px;
  }
  .lang-btn {
    width: 36px;
    padding: 0;
    justify-content: center;
  }
  .lang-btn__code {
    display: none;
  }
  .site-header__actions .btn {
    min-width: 0;
    padding-inline: 11px;
  }
}
@media (max-width: 359.98px) {
  .site-header__actions .btn {
    display: none; /* "Start learning" stays in the menu sheet */
  }
}
.site-header__menu {
  flex: none;
}
.lang-sheet {
  position: fixed;
  inset: 0;
  z-index: 1000;
}
.lang-sheet[hidden] {
  display: none;
}
.lang-sheet__scrim {
  position: absolute;
  inset: 0;
  background: rgb(13 13 13 / 0.42);
  opacity: 0;
  transition: opacity 260ms var(--ease-out);
}
.lang-sheet__panel {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  padding: 10px 16px calc(18px + env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0;
  background: var(--white);
  box-shadow: 0 -8px 30px rgb(0 0 0 / 0.12);
  transform: translateY(105%);
  transition: transform 380ms var(--ease-out-strong);
  touch-action: none;
  will-change: transform;
}
.lang-sheet[data-open="true"] .lang-sheet__scrim {
  opacity: 1;
}
.lang-sheet[data-open="true"] .lang-sheet__panel {
  transform: translateY(var(--drag, 0px));
}
.lang-sheet__panel:focus {
  outline: none;
}
.lang-sheet.is-dragging .lang-sheet__panel {
  transition: none;
}
.lang-sheet__grip {
  display: block;
  width: 40px;
  height: 5px;
  margin: 0 auto 16px;
  border-radius: var(--radius-pill);
  background: var(--gray-200);
}
.lang-sheet__title {
  margin: 0 6px 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-500);
}
.lang-sheet__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.lang-sheet__list button {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  height: 58px;
  padding: 0 16px 0 10px;
  border-radius: 16px;
  background: var(--gray-50);
  font-size: 17px;
  font-weight: 500;
  color: var(--gray-900);
  text-align: left;
  opacity: 0;
  transform: translateY(14px);
  transition: background-color 200ms, color 200ms, box-shadow 200ms, transform 160ms var(--ease-out);
}
.lang-sheet[data-open="true"] .lang-sheet__list button {
  animation: lang-item-in 420ms var(--ease-out-strong) both;
}
.lang-sheet[data-open="true"] .lang-sheet__list button:nth-child(2) { animation-delay: 50ms; }
.lang-sheet[data-open="true"] .lang-sheet__list button:nth-child(3) { animation-delay: 100ms; }
@keyframes lang-item-in {
  0% { opacity: 0; transform: translateY(14px); }
  100% { opacity: 1; transform: none; }
}
.lang-sheet__list button:active {
  transform: scale(0.97);
}
.lang-sheet__flag {
  position: relative;
  display: block;
  width: 34px;
  height: 24px;
  flex: none;
  margin-left: 4px;
  overflow: hidden;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.14);
  transition: transform 260ms var(--ease-pop);
}
.lang-sheet__flag::after { /* hairline so white stripes don't melt into the row */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.08);
}
.lang-sheet__flag svg {
  display: block;
  width: 100%;
  height: 100%;
}
.lang-sheet__name {
  flex: 1;
}
.lang-sheet__list button[aria-pressed="true"] {
  background: var(--orange-50);
  color: var(--orange-400);
  box-shadow: inset 0 0 0 1.5px var(--orange-200);
}
.lang-sheet__list button[aria-pressed="true"] .lang-sheet__flag {
  transform: scale(1.08) rotate(-4deg);
}
.lang-sheet__tick {
  width: 22px;
  height: 22px;
  flex: none;
  fill: none;
  stroke: var(--orange-300);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 22;
  stroke-dashoffset: 22;
  transition: stroke-dashoffset 360ms var(--ease-out-strong) 80ms;
}
.lang-sheet__list button[aria-pressed="true"] .lang-sheet__tick {
  stroke-dashoffset: 0;
}
.lang-sheet__list button:focus-visible {
  outline: 2px solid var(--orange-300);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .lang-sheet__scrim,
  .lang-sheet__panel,
  .lang-btn svg,
  .lang-sheet__tick {
    transition: none;
  }
  .lang-sheet[data-open="true"] .lang-sheet__list button,
  .lang-btn__code.is-swap {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* 6 ── Cards & grounds ───────────────────────────────────────────────────── */
.rounded-card {
  border-radius: var(--radius-card);
}
.card {
  border-radius: var(--radius-card);
  border: 1px solid var(--gray-150);
  background: var(--white);
}
.ground {
  border-radius: var(--radius-card);
  background: var(--peach);
}
.ground--gray {
  background: var(--gray-50);
}
.ground--soft {
  background: color-mix(in srgb, var(--orange-100) 70%, transparent);
}
.ground--ink {
  background: var(--orange-900);
  color: var(--white);
}
/* media frame: fixed 556×420 art slot used by feature rows */
.art {
  position: relative;
  width: 100%;
  aspect-ratio: 556 / 420;
  overflow: hidden;
  border-radius: var(--radius-card);
  background: var(--orange-300);
  container-type: inline-size;
  --u: calc(100cqw / 556);
}
@media (min-width: 1024px) {
  .art {
    flex: none;
    width: 556px;
    height: 420px;
  }
}

/* 7 ── Product-UI kit (the little white "app" pieces inside demos) ───────── */
.ui-card {
  border-radius: 16px;
  background: var(--white);
  border-bottom: 4px solid var(--ui-edge);
}
.ui-bubble {
  border-radius: 18px;
  background: var(--white);
  padding: 9px 14px;
  font-size: 13px;
  line-height: 18px;
  color: var(--gray-900);
  box-shadow: var(--shadow-bubble);
}
.ui-key {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 15px;
  border: 1.5px solid var(--ui-edge);
  border-bottom-width: 4.5px;
  background: var(--white);
  font-weight: 600;
  color: var(--ui-ink);
}
.ui-answer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 16px;
  border: 1.5px solid var(--success);
  background: var(--success-bg);
  box-shadow: 0 4px 0 var(--success-deep);
}
.ui-tick {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 9999px;
  background: var(--success);
}
.ui-tick svg {
  width: 16px;
  height: 16px;
  color: #fff;
  stroke: #fff;
  fill: none;
}
.frac {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  vertical-align: middle;
  margin-inline: 0.12em;
  font-size: 0.8em;
  line-height: 1.08;
}
.frac > span:first-child {
  border-bottom: 1px solid currentColor;
  padding-inline: 0.15em;
}
/* typing dots */
.ui-dots {
  display: flex;
  gap: 5px;
  border-radius: 18px;
  background: var(--white);
  padding: 12px 14px;
}
.ui-dots > span {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 9999px;
  background: var(--gray-900);
  animation: ui-dots 1.35s ease-in-out infinite;
}
.ui-dots > span:nth-child(2) {
  animation-delay: 0.15s;
}
.ui-dots > span:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes ui-dots {
  0%, 60%, 100% {
    opacity: 0.3;
    transform: none;
  }
  30% {
    opacity: 1;
    transform: translateY(-3px);
  }
}
.spinner {
  width: 16px;
  height: 16px;
  flex: none;
  border-radius: 9999px;
  border: 2px solid var(--orange-200);
  border-top-color: var(--orange-300);
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.shimmer-text {
  background: linear-gradient(90deg, var(--gray-500) 0%, var(--orange-300) 45%, var(--gray-500) 90%) 0 0 / 220% 100%;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  animation: shimmer 1.6s linear infinite;
}
.shimmer-bar {
  background: linear-gradient(90deg, var(--gray-100) 0%, var(--orange-100) 45%, var(--gray-100) 90%) 0 0 / 220% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer {
  0% {
    background-position: 110% 0;
  }
  to {
    background-position: -110% 0;
  }
}

/* 8 ── Reveal motion ─────────────────────────────────────────────────────── */
/* Wrap a block in [data-reveal]; site.js sets data-arrive="pending" → "in". */
[data-arrive="pending"] .card-arrive {
  opacity: 0;
  filter: blur(6px);
  transform: translateY(16px);
}
[data-arrive="in"] .card-arrive {
  opacity: 1;
  filter: blur(0);
  transform: none;
  transition: opacity var(--dur-arrive) var(--ease-out-gentle),
    transform var(--dur-arrive) var(--ease-out-gentle),
    filter var(--dur-arrive) var(--ease-out-gentle);
}
[data-arrive="in"] .card-arrive:nth-child(2) { transition-delay: calc(1 * var(--stagger-card)); }
[data-arrive="in"] .card-arrive:nth-child(3) { transition-delay: calc(2 * var(--stagger-card)); }
[data-arrive="in"] .card-arrive:nth-child(4) { transition-delay: calc(3 * var(--stagger-card)); }
[data-arrive="in"] .card-arrive:nth-child(n + 5) { transition-delay: calc(4 * var(--stagger-card)); }

/* hand-drawn underline that wipes in under a marked word */
.marked {
  position: relative;
  display: inline-block;
}
.marked > svg {
  position: absolute;
  left: 0;
  top: 0.99em;
  width: 100%;
  height: auto;
  overflow: visible;
  color: var(--orange-300);
}
[data-arrive="pending"] .underline-draw {
  clip-path: inset(0 100% 0 0);
}
[data-arrive="in"] .underline-draw {
  clip-path: inset(0);
  transition: clip-path 0.52s var(--ease-out-gentle) 0.2s;
}

/* badges that fall into place */
.badge-drop {
  transform: translateY(0) translate(var(--cx, 0px), var(--cy, 0px)) rotate(var(--rot, 0deg)) scale(1);
}
[data-arrive="pending"] .badge-drop {
  opacity: 0;
  transform: translateY(calc(-1 * min(var(--fall, var(--travel-badge)), var(--fall-max))))
    translate(var(--cx, 0px), var(--cy, 0px)) rotate(var(--rot, 0deg)) scale(0.92);
}
[data-arrive="in"] .badge-drop {
  opacity: 1;
  transform: translateY(0) translate(var(--cx, 0px), var(--cy, 0px)) rotate(var(--rot, 0deg)) scale(1);
  transition: opacity var(--dur-badge) var(--ease-settle), transform var(--dur-badge) var(--ease-settle);
  transition-delay: calc(var(--delay-index, 0) * var(--stagger-badge));
}

/* 9 ── Doodle motion ─────────────────────────────────────────────────────── */
.twinkle {
  animation: twinkle 3s ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% {
    opacity: 1;
    scale: 1;
  }
  50% {
    opacity: 0.35;
    scale: 0.8;
  }
}
.heartbeat {
  animation: heartbeat 1.8s ease-in-out infinite;
}
@keyframes heartbeat {
  0%, 28%, 70%, 100% {
    transform: scale(1);
  }
  14% {
    transform: scale(1.14);
  }
  42% {
    transform: scale(1.09);
  }
}
.sparkle {
  transform-origin: 0 100%;
  animation: sparkle 2.6s ease-in-out 0.6s infinite;
}
@keyframes sparkle {
  0%, 60%, 100% {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
  75% {
    opacity: 0.85;
    transform: scale(1.14) rotate(-7deg);
  }
}
.float-bob {
  animation: float-bob var(--bob-dur, 5.6s) ease-in-out infinite;
}
@keyframes float-bob {
  0%, 100% {
    transform: translate(0, 0) rotate(0);
  }
  25% {
    transform: translate3d(calc(var(--bob-x, 10px) * var(--bob-scale, 1)), calc(-0.6 * var(--bob-rise, 18px) * var(--bob-scale, 1)), 0)
      rotate(calc(var(--bob-rot, 2deg) * var(--bob-scale, 1)));
  }
  50% {
    transform: translate3d(0, calc(-1 * var(--bob-rise, 18px) * var(--bob-scale, 1)), 0) rotate(0deg);
  }
  75% {
    transform: translate3d(calc(-1 * var(--bob-x, 10px) * var(--bob-scale, 1)), calc(-0.45 * var(--bob-rise, 18px) * var(--bob-scale, 1)), 0)
      rotate(calc(-1 * var(--bob-rot, 2deg) * var(--bob-scale, 1)));
  }
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
}
@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.92);
  }
}

/* 10 ── Footer ───────────────────────────────────────────────────────────── */
.site-footer {
  --page-content: var(--page-content-wide);
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  width: 100%;
  padding-top: 40px;
  padding-bottom: 24px;
  background: var(--color-footer);
}
.site-footer__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 40px 24px;
  width: 100%;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--gray-850);
}
.site-footer__logo {
  grid-column: span 2;
}
.site-footer__logo img {
  height: 31px;
  width: auto;
}
.site-footer__col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  font-size: 14px;
  line-height: 20px;
}
.site-footer__col h3,
.site-footer__label {
  color: var(--gray-500);
  font-size: 14px;
  font-weight: 400;
}
.site-footer__col a {
  display: flex;
  align-items: center;
  min-height: 24px;
  color: var(--gray-400);
  transition: color var(--dur-press);
}
.site-footer__col a:hover {
  color: var(--white);
}
.site-footer__social {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 24px;
}
.site-footer__social a {
  min-height: 0;
  color: var(--white);
}
.site-footer__social a:hover {
  opacity: 0.8;
}
.site-footer__social svg {
  width: 20px;
  height: 20px;
}
.store-badges {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-top: 4px;
}
.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: 168px;
  height: 46px;
  padding: 0 14px 0 12px;
  border: 1px solid var(--gray-600);
  border-radius: 10px;
  background: #000;
  color: var(--white);
  transition: border-color var(--dur-press), background-color var(--dur-press), transform var(--dur-press) var(--ease-out-strong);
}
.store-badge:hover {
  background: var(--gray-850); /* simple: fill lightens, border stays */
}
.site-footer__col .store-badge {
  min-height: 0;
  color: var(--white);
}
.store-badge svg {
  flex: none;
  width: 24px;
  height: 24px;
}
.store-badge span {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  white-space: nowrap;
}
.store-badge small {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--gray-300);
}
.store-badge b {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
/* footer link groups: plain headings on desktop, tap-to-open rows on phones */
.site-footer__fold {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: default;
  pointer-events: none;
}
.site-footer__fold .chev {
  display: none;
}
@media (max-width: 639.98px) {
  .site-footer__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }
  .site-footer__col--fold {
    gap: 0;
    border-bottom: 1px solid var(--gray-850);
  }
  .site-footer__col--fold h3 {
    width: 100%;
  }
  .site-footer__fold {
    min-height: 48px;
    font-size: 15px;
    color: var(--gray-300);
    cursor: pointer;
    pointer-events: auto;
  }
  .site-footer__fold .chev {
    display: block;
    width: 18px;
    height: 18px;
    color: var(--gray-500);
  }
  .site-footer__col--fold > a {
    display: none;
  }
  .site-footer__col--fold.is-open {
    padding-bottom: 12px;
  }
  .site-footer__col--fold.is-open > a {
    display: flex;
    min-height: 36px;
  }
  /* the three fold rows sit together, then contact / social / badges */
  .site-footer__col--fold + .site-footer__col--fold {
    margin-top: -28px;
  }
  .store-badges {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }
  .store-badge {
    width: 100%;
  }
}
/* Start Today badges sit under Follow us in the same column */
.site-footer__label--start {
  margin-top: 20px;
}
@media (min-width: 1280px) {
  .site-footer__col.site-footer__col--badges {
    width: auto;
  }
}
/* contact column: icon + text rows; the address wraps in a narrow column */
.site-footer__col--contact a,
.site-footer__addr {
  gap: 8px;
}
.site-footer__col--contact svg {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--gray-500);
}
.site-footer__addr {
  display: flex;
  align-items: flex-start;
  max-width: 230px;
  font-size: 14px;
  line-height: 21px;
  color: var(--gray-400);
}
.site-footer__addr svg {
  margin-top: 2px;
}
@media (max-width: 639.98px) {
  /* phones: one column; the address lives on the Contact page, not in the footer */
  .site-footer__col--contact {
    grid-column: auto;
  }
  .site-footer__addr {
    display: none;
  }
}
.site-footer__legal {
  width: 100%;
  text-align: center;
  font-size: 14px;
  line-height: 20px;
  color: var(--gray-500);
}
.site-footer__legal small {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  line-height: 18px;
  color: var(--gray-600);
}
@media (min-width: 640px) {
  .site-footer__grid {
    grid-template-columns: repeat(4, auto);
    justify-content: space-between;
  }
  .site-footer__logo {
    grid-column: span 4;
  }
}
@media (min-width: 1280px) {
  .site-footer__grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 40px 32px;
    padding-inline: 48px;
  }
  .site-footer__logo {
    grid-column: auto;
  }
  .site-footer__col {
    width: 140px;
  }
  .site-footer__col--wide {
    width: 200px;
  }
  .site-footer__col.site-footer__col--contact {
    width: 230px;
  }
}

/* FAQ accordion: <div class="faq"><details class="card faq__item"><summary>Q</summary><p>A</p></details></div> */
.faq {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.faq__item {
  padding: 0;
  overflow: hidden;
}
.faq__item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  cursor: pointer;
  list-style: none;
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-900);
}
.faq__item summary::-webkit-details-marker {
  display: none;
}
.faq__item summary::after {
  content: "";
  flex: none;
  width: 20px;
  height: 20px;
  background: var(--gray-600);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5.5 8 4.5 4.5L14.5 8'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5.5 8 4.5 4.5L14.5 8'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: rotate var(--dur-menu) var(--ease-out-strong);
}
.faq__item[open] summary::after {
  rotate: 180deg;
}
.faq__item p {
  padding: 0 22px 20px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--gray-700);
}
/* back to top */
.to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;
  opacity: 0;
  visibility: hidden;
  translate: 0 8px;
  transition: opacity 0.2s, translate 0.2s, visibility 0.2s;
}
.to-top[data-show="true"] {
  opacity: 1;
  visibility: visible;
  translate: 0 0;
}
.to-top button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  border: 1px solid var(--gray-150);
  background: var(--white);
  box-shadow: var(--shadow-float);
}
.to-top svg {
  width: 20px;
  height: 20px;
}

/* 11 ── Utilities ────────────────────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
.nowrap {
  white-space: nowrap;
}
.hidden {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .pressable:active {
    transform: none;
  }
  [data-arrive] .card-arrive,
  [data-arrive] .badge-drop {
    transform: none !important;
    filter: none !important;
  }
  .twinkle,
  .heartbeat,
  .sparkle,
  .float-bob,
  .ui-dots > span,
  .shimmer-text,
  .shimmer-bar {
    animation: none;
  }
  .shimmer-text {
    color: var(--gray-500);
    background: none;
  }
  [data-arrive="pending"] .underline-draw {
    clip-path: none;
  }
}
