/* Riglet design system.
   Signature: marigold "sun". Accent: "sky", taken from Falcon's eyes. Ink: deep indigo.
   Display: Fredoka (rounded, widened). Body: Figtree. Code only: JetBrains Mono. */

:root {
  color-scheme: light dark;

  --sun: #FFC530;
  --sun-edge: #E0A100;
  --sun-halo: #FFD666;
  --sun-tint: #FFF4D2;
  --sky: #1AA8F0;
  --sky-text: #0A6FAE;
  --ink: #1F1B4D;
  --ink-edge: #0E0B30;

  --text: #1F1B4D;
  --text-2: #57557C;
  --paper: #FFFFFF;
  --mist: #F3F3FA;
  --mist-2: #E9E9F4;
  --line: #E2E2EF;
  --line-strong: #CBCBE0;

  --strong-bg: #1F1B4D;
  --strong-text: #FFFFFF;
  --strong-edge: #0E0B30;

  --code-bg: #1F1B4D;
  --code-line: #2E2968;
  --code-text: #ECEAFF;
  --code-dim: #9C98CC;
  --code-key: #FFC530;
  --code-str: #7FD8FF;
  --code-num: #FF9DC4;

  --ok: #1E9E62;
  --danger: #C8323C;
  --danger-tint: #FDECEE;
  --focus: #1090D9;

  --shadow-ground: rgba(31, 27, 77, 0.16);

  --font-display: "Fredoka", ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-code: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --r-s: 12px;
  --r: 18px;
  --r-l: 28px;
  --r-xl: 44px;

  --gutter: 20px;
  --max: 1180px;
  --section: clamp(72px, 11vw, 136px);

  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
}

@media (min-width: 720px) {
  :root { --gutter: 32px; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --sun-edge: #B88400;
    --sun-tint: #3A3150;
    --sky-text: #6FD0FF;
    --text: #F2F1FF;
    --text-2: #B6B3DB;
    --paper: #15123A;
    --mist: #1D1948;
    --mist-2: #252156;
    --line: #2E2A63;
    --line-strong: #403B80;
    --strong-bg: #F2F1FF;
    --strong-text: #1F1B4D;
    --strong-edge: #9E9AD6;
    --code-bg: #0F0C2D;
    --code-line: #26225A;
    --danger: #FF7A83;
    --danger-tint: #3B1830;
    --focus: #5CC8FF;
    --ok: #4FD597;
    --shadow-ground: rgba(31, 27, 77, 0.22);
  }
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

img, svg, canvas { display: block; max-width: 100%; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-variation-settings: "wdth" 112;
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.015em;
  margin: 0;
  text-wrap: balance;
}

h1 { font-size: clamp(2.75rem, 7.4vw, 5.6rem); line-height: 0.96; letter-spacing: -0.025em; }
h2 { font-size: clamp(2.1rem, 4.6vw, 3.5rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); line-height: 1.15; letter-spacing: -0.005em; }

p { margin: 0; text-wrap: pretty; }

a { color: var(--sky-text); text-underline-offset: 0.18em; text-decoration-thickness: 2px; }
a:hover { text-decoration-color: currentColor; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 8px;
}

::selection { background: var(--sun); color: #1F1B4D; }

.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: 12px; top: -60px;
  z-index: 100;
  background: var(--strong-bg);
  color: var(--strong-text);
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

.wrap {
  width: 100%;
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section); }
.section + .section { padding-top: 0; }

.lede {
  font-size: clamp(1.125rem, 1.6vw, 1.3rem);
  line-height: 1.5;
  color: var(--text-2);
  max-width: 34em;
}

.section-head { max-width: 760px; margin-bottom: clamp(36px, 5vw, 56px); }
.section-head .lede { margin-top: 16px; }

/* ---------- buttons: chunky, pressable ---------- */

.btn {
  --bg: var(--sun);
  --fg: #1F1B4D;
  --edge: var(--sun-edge);
  --lift: 5px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 12px 26px;
  border: 0;
  border-radius: var(--r);
  background: var(--bg);
  color: var(--fg);
  box-shadow: 0 var(--lift) 0 var(--edge);
  font-family: var(--font-display);
  font-variation-settings: "wdth" 108;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0.005em;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform .09s ease, box-shadow .09s ease, filter .15s ease;
  margin-bottom: var(--lift);
}
.btn:hover { filter: brightness(1.04); }
.btn:active, .btn[data-pressing] {
  transform: translateY(var(--lift));
  box-shadow: 0 0 0 var(--edge);
}
.btn:disabled, .btn[aria-disabled="true"] {
  --bg: var(--mist-2);
  --fg: var(--text-2);
  --edge: var(--line-strong);
  cursor: not-allowed;
  filter: none;
}
.btn:disabled:active { transform: none; box-shadow: 0 var(--lift) 0 var(--edge); }

.btn-strong { --bg: var(--strong-bg); --fg: var(--strong-text); --edge: var(--strong-edge); }
.btn-ghost {
  --bg: var(--paper);
  --fg: var(--text);
  --edge: var(--line-strong);
  border: 2px solid var(--line-strong);
}
.btn-small {
  --lift: 4px;
  min-height: 42px;
  padding: 8px 18px;
  font-size: 1rem;
  border-radius: 14px;
}
.btn svg { width: 20px; height: 20px; flex: none; }

/* ---------- chips ---------- */

.chip {
  --chip-bg: var(--paper);
  --chip-border: var(--line-strong);
  --chip-fg: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 15px;
  border: 2px solid var(--chip-border);
  border-radius: 14px;
  background: var(--chip-bg);
  color: var(--chip-fg);
  box-shadow: 0 3px 0 var(--chip-border);
  font-family: var(--font-body);
  font-size: 0.975rem;
  font-weight: 650;
  line-height: 1.1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .08s ease, box-shadow .08s ease, background-color .15s ease, border-color .15s ease;
  margin-bottom: 3px;
}
.chip:hover { --chip-border: var(--text-2); }
.chip:active { transform: translateY(3px); box-shadow: 0 0 0 var(--chip-border); }
.chip[aria-pressed="true"] {
  --chip-bg: var(--sun);
  --chip-border: var(--sun-edge);
  --chip-fg: #1F1B4D;
}
.chip:disabled { opacity: .45; cursor: not-allowed; }
.chip .chip-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: currentColor; opacity: .35;
}
.chip[aria-pressed="true"] .chip-dot { opacity: 1; background: #1F1B4D; }
.chip-add::before {
  content: "+";
  font-family: var(--font-display);
  font-size: 1.15rem;
  line-height: 0;
  margin-right: -2px;
  color: var(--text-2);
}
.chip-add[aria-pressed="true"]::before { content: "\2713"; font-size: .95rem; color: #1F1B4D; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px 10px; }

/* ---------- switch ---------- */

.switch {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 6px 4px;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.switch-track {
  position: relative;
  width: 58px; height: 34px;
  border-radius: 999px;
  background: var(--mist-2);
  border: 2px solid var(--line-strong);
  box-shadow: inset 0 3px 0 rgba(31,27,77,.08);
  transition: background-color .2s ease, border-color .2s ease;
  flex: none;
}
.switch-track::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 2px 0 rgba(31,27,77,.25);
  transition: transform .22s var(--ease-spring);
}
.switch[aria-checked="true"] .switch-track { background: var(--sky); border-color: #0B86C8; }
.switch[aria-checked="true"] .switch-track::after { transform: translateX(24px); }

/* ---------- forms ---------- */

.field { display: grid; gap: 8px; }
.field + .field { margin-top: 22px; }
.label {
  font-family: var(--font-display);
  font-variation-settings: "wdth" 108;
  font-weight: 600;
  font-size: 1.125rem;
  line-height: 1.2;
}
.hint { color: var(--text-2); font-size: 0.95rem; line-height: 1.45; }

.input, .textarea {
  width: 100%;
  min-height: 54px;
  padding: 14px 16px;
  border: 2px solid var(--line-strong);
  border-radius: 16px;
  background: var(--paper);
  color: var(--text);
  font: inherit;
  font-size: 1.0625rem;
  line-height: 1.45;
  box-shadow: inset 0 3px 0 rgba(31,27,77,.04);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.textarea { min-height: 120px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--text-2); opacity: .75; }
.input:focus, .textarea:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus) 22%, transparent);
}
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: .95rem; font-weight: 600; }
.field-error:empty { display: none; }

/* ---------- site header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 2px solid transparent;
  transition: border-color .2s ease;
}
.site-header[data-scrolled] { border-bottom-color: var(--line); }
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  margin-right: auto;
  border-radius: 12px;
}
.brand svg { width: 38px; height: 38px; }
.brand-word {
  font-family: var(--font-display);
  font-variation-settings: "wdth" 115;
  font-weight: 600;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
  line-height: 1;
}
.nav { display: flex; align-items: center; gap: 2px; }
.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 12px;
  color: var(--text);
  font-weight: 650;
  text-decoration: none;
}
.nav a:hover { background: var(--mist); }
.nav a[aria-current="page"] { background: var(--mist); }
.header-cta { margin-left: 6px; }
@media (max-width: 559px) {
  .header-cta { display: none; }
  .brand-word { font-size: 1.4rem; }
  .brand svg { width: 34px; height: 34px; }
  .nav a { padding: 8px 10px; }
}

/* ---------- stage: where characters live ---------- */

.stage {
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
  border-radius: var(--r-xl);
  background: var(--sun);
  overflow: hidden;
  isolation: isolate;
  touch-action: manipulation;
}
.stage::before {
  /* the halo behind the character */
  content: "";
  position: absolute;
  left: 50%; top: 47%;
  width: 74%; aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--sun-halo);
  z-index: -1;
}
.stage::after {
  /* ground shadow */
  content: "";
  position: absolute;
  left: 50%; bottom: 9%;
  width: 46%; height: 6%;
  transform: translateX(-50%);
  border-radius: 50%;
  background: var(--shadow-ground);
  z-index: -1;
}
.stage-art, .stage canvas {
  position: absolute;
  inset: 6% 8% 8%;
  width: 84%;
  height: 86%;
}
.stage canvas {
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity .5s var(--ease-out);
}
.stage-art {
  transition: opacity .4s ease, transform .5s var(--ease-out);
}
.stage-art svg { width: 100%; height: 100%; overflow: visible; }
.stage[data-live] canvas { opacity: 1; }
.stage[data-live] .stage-art { opacity: 0; transform: scale(.97); pointer-events: none; }
.stage[data-loading] .stage-art { animation: art-breathe 2.4s ease-in-out infinite; }
@keyframes art-breathe { 50% { transform: translateY(-1.5%) scale(1.01); } }
.stage-art.is-hop { animation: art-hop .6s var(--ease-spring); }
@keyframes art-hop {
  0% { transform: translateY(0) scale(1, 1); }
  25% { transform: translateY(2%) scale(1.06, .92); }
  55% { transform: translateY(-9%) scale(.96, 1.05); }
  100% { transform: translateY(0) scale(1, 1); }
}

.stage-hit {
  position: absolute;
  inset: 0;
  z-index: 2;
  border: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  border-radius: inherit;
  -webkit-tap-highlight-color: transparent;
}
.stage-hit:focus-visible { outline-offset: -6px; outline-color: #1F1B4D; }

.stage-badge {
  position: absolute;
  z-index: 3;
  left: 16px; bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 14px 6px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.92);
  color: #1F1B4D;
  font-weight: 700;
  font-size: .9rem;
  line-height: 1;
  pointer-events: none;
  box-shadow: 0 2px 0 rgba(31,27,77,.12);
}
.stage-badge .live-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--sky);
  box-shadow: 0 0 0 0 rgba(26,168,240,.5);
}
.stage[data-live] .live-dot { animation: live-pulse 2s ease-out infinite; }
@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(26,168,240,.55); }
  70%, 100% { box-shadow: 0 0 0 9px rgba(26,168,240,0); }
}
.stage:not([data-live]) .live-dot { background: #8E8BB5; }
.stage-tip {
  position: absolute;
  z-index: 3;
  right: 16px; bottom: 16px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  background: #1F1B4D;
  color: #FFFFFF;
  font-weight: 700;
  font-size: .9rem;
  line-height: 1;
  pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
}
.stage-tip[data-gone] { opacity: 0; transform: translateY(6px); }
@media (min-width: 720px) {
  .stage-badge { left: 22px; bottom: 22px; }
  .stage-tip { right: 22px; bottom: 22px; }
}

/* ---------- hero ---------- */

.hero { padding-block: clamp(16px, 4vw, 56px) 0; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "title" "stage" "actions";
  gap: 28px;
  align-items: center;
}
.hero-title { grid-area: title; }
.hero-stage { grid-area: stage; }
.hero-actions { grid-area: actions; }
.hero-title .lede { margin-top: 20px; }
.hero h1 { max-width: 9.5em; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px 14px; align-items: center; }
.runtimes-line {
  margin-top: 22px;
  color: var(--text-2);
  font-size: .975rem;
}
.runtimes-line strong { color: var(--text); font-weight: 650; }

@media (min-width: 960px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
    grid-template-areas: "title stage" "actions stage";
    column-gap: clamp(40px, 5vw, 80px);
    row-gap: 32px;
  }
  .hero-title { align-self: end; }
  .hero-actions { align-self: start; }
}
@media (max-width: 959px) {
  .hero-stage { max-width: 560px; width: 100%; justify-self: center; }
}

/* ---------- how it works: joints on a bone ---------- */

.steps {
  position: relative;
  display: grid;
  gap: 40px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.step {
  position: relative;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  column-gap: 20px;
  align-items: start;
  align-content: start;
}
.step-joint {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--strong-bg);
  color: var(--strong-text);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.6rem;
  box-shadow: 0 0 0 8px var(--paper);
}
.step-joint::after {
  content: "";
  position: absolute;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--sun);
  right: -2px; top: -2px;
  box-shadow: 0 0 0 4px var(--paper);
}
.step h3 { margin-top: 14px; }
.step p { margin-top: 8px; color: var(--text-2); max-width: 30em; }
.step-art { grid-column: 2; margin-top: 18px; }

/* the bone */
.steps::before {
  content: "";
  position: absolute;
  left: 29px; top: 32px; bottom: 32px;
  width: 6px;
  border-radius: 3px;
  background: var(--line-strong);
}
@media (min-width: 900px) {
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
  .step { grid-template-columns: minmax(0, 1fr); }
  .step-art { grid-column: 1; }
  .step h3 { margin-top: 26px; }
  .steps::before { left: 32px; right: calc((100% - 64px) / 3 + 32px); top: 29px; bottom: auto; width: auto; height: 6px; }
}

.vignette {
  border: 2px solid var(--line);
  border-radius: var(--r-l);
  background: var(--mist);
  padding: 18px;
  min-height: 168px;
  display: grid;
  align-content: center;
  gap: 12px;
}
.vignette-photo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}
.vignette-photo > * { min-width: 0; }
.vignette-photo .thumb {
  width: 104px; height: 104px;
  border-radius: 20px;
  background: var(--sun);
  padding: 10px;
  flex: none;
  transform: rotate(-4deg);
  box-shadow: 0 4px 0 var(--sun-edge);
}
.vignette-photo .thumb svg { width: 100%; height: 100%; }
.file-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--paper);
  border: 2px solid var(--line);
  font-weight: 650;
  font-size: .95rem;
  line-height: 1.2;
}
.file-pill svg { width: 18px; height: 18px; flex: none; }
.or-line { color: var(--text-2); font-size: .9rem; }
.bubble {
  position: relative;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 20px 20px 20px 6px;
  padding: 12px 14px;
  font-weight: 600;
  line-height: 1.4;
}
.bubble-caret {
  display: inline-block;
  width: 2px; height: 1.1em;
  background: var(--sky);
  vertical-align: -0.18em;
  margin-left: 2px;
  animation: caret 1s steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }
.mini-code {
  font-family: var(--font-code);
  font-size: .8rem;
  line-height: 1.6;
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: 14px;
  padding: 12px 14px;
  overflow: hidden;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.mini-code .k { color: var(--code-key); }
.mini-code .s { color: var(--code-str); }

/* ---------- action gallery ---------- */

.gallery {
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1fr);
}
.gallery-stage { max-width: 560px; width: 100%; justify-self: center; }
@media (max-width: 959px) {
  /* keep Falcon in view while the chips below are tapped */
  .gallery-stage {
    position: sticky;
    top: 72px;
    z-index: 5;
    max-width: none;
    width: auto;
    justify-self: stretch;
    margin-inline: calc(var(--gutter) * -1);
    padding: 6px var(--gutter) 14px;
    background: var(--mist);
    box-shadow: 0 12px 14px -14px rgba(31, 27, 77, .35);
  }
  .gallery-stage .stage { width: min(100%, 38vh, 420px); margin-inline: auto; border-radius: 32px; }
}
@media (min-width: 960px) {
  .gallery { grid-template-columns: minmax(0, 0.92fr) minmax(0, 1fr); gap: clamp(40px, 5vw, 72px); align-items: start; }
  .gallery-stage { position: sticky; top: 96px; max-width: none; }
}
.gallery-panel { display: grid; gap: 28px; }
.action-groups { display: grid; gap: 22px; }
.action-group h3 {
  font-size: 1.05rem;
  font-variation-settings: "wdth" 105;
  margin-bottom: 12px;
  color: var(--text);
}
.action-group h3 span { color: var(--text-2); font-family: var(--font-body); font-weight: 600; font-size: .9rem; margin-left: 6px; }
.layer-controls {
  display: grid;
  gap: 14px;
  padding: 18px 20px;
  border-radius: var(--r-l);
  background: var(--mist);
}
.layer-controls p { color: var(--text-2); font-size: .95rem; line-height: 1.45; }
.layer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.gallery-note { color: var(--text-2); font-size: .95rem; }
.gallery-note[hidden] { display: none; }

/* ---------- code / snippets ---------- */

.code-card {
  border-radius: var(--r-l);
  background: var(--code-bg);
  color: var(--code-text);
  overflow: hidden;
  border: 2px solid var(--code-line);
}
.tabs {
  display: flex;
  gap: 4px;
  padding: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 2px solid var(--code-line);
  -webkit-overflow-scrolling: touch;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none;
  min-height: 42px;
  padding: 8px 14px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--code-dim);
  font: inherit;
  font-weight: 650;
  font-size: .95rem;
  cursor: pointer;
  white-space: nowrap;
}
.tab:hover { color: var(--code-text); background: var(--code-line); }
.tab[aria-selected="true"] {
  background: var(--sun);
  color: #1F1B4D;
  box-shadow: 0 3px 0 var(--sun-edge);
}
.tab:focus-visible { outline-color: var(--sun); outline-offset: 1px; }
.code-panel { position: relative; }
.code-panel pre {
  margin: 0;
  padding: 22px 22px 26px;
  overflow: auto;
  max-height: 520px;
  font-family: var(--font-code);
  font-size: .875rem;
  line-height: 1.7;
  tab-size: 2;
  -webkit-overflow-scrolling: touch;
}
.code-panel pre:focus-visible { outline-offset: -4px; outline-color: var(--sun); }
.code-panel code { font-family: inherit; }
.tok-c { color: var(--code-dim); font-style: italic; }
.tok-s { color: var(--code-str); }
.tok-k { color: var(--code-key); }
.tok-n { color: var(--code-num); }
.code-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 12px 14px 14px 22px;
  border-top: 2px solid var(--code-line);
  color: var(--code-dim);
  font-size: .9rem;
}
.code-foot .btn { --bg: var(--code-line); --fg: var(--code-text); --edge: #0A0826; }
@media (prefers-color-scheme: dark) {
  .code-foot .btn { --edge: #05041A; }
}

/* ---------- CTA band ---------- */

.cta-band {
  border-radius: var(--r-xl);
  background: var(--sun);
  color: #1F1B4D;
  padding: clamp(36px, 6vw, 72px);
  display: grid;
  gap: 24px;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.cta-band h2 { max-width: 12em; }
.cta-band p { max-width: 32em; margin-top: 14px; font-size: 1.15rem; color: #3D3970; }
.cta-band .btn-strong { --bg: #1F1B4D; --fg: #FFFFFF; --edge: #0E0B30; }
.cta-band-art {
  width: clamp(200px, 24vw, 300px);
  justify-self: end;
  align-self: end;
  transform: rotate(-6deg);
}
@media (min-width: 820px) {
  .cta-band { grid-template-columns: minmax(0, 1fr) auto; padding-bottom: 0; }
  .cta-band > div { padding-bottom: clamp(36px, 6vw, 72px); }
  .cta-band-art { margin: 0 2% -14% 0; }
}
@media (max-width: 819px) {
  .cta-band-art { display: none; }
}

/* ---------- footer ---------- */

.site-footer {
  padding-block: 48px 56px;
  border-top: 2px solid var(--line);
  color: var(--text-2);
  font-size: .95rem;
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 32px;
  align-items: center;
  justify-content: space-between;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.footer-links a { color: var(--text); font-weight: 650; text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.footer-note { flex-basis: 100%; font-size: .875rem; }

/* ---------- panels & notices ---------- */

.panel {
  border: 2px solid var(--line);
  border-radius: var(--r-l);
  background: var(--paper);
  padding: clamp(20px, 3vw, 32px);
}
.notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--sun-tint);
  color: var(--text);
  font-size: .975rem;
  line-height: 1.45;
}
.notice svg { width: 22px; height: 22px; flex: none; margin-top: 1px; }
.notice-error { background: var(--danger-tint); }
.notice-error svg { color: var(--danger); }
.notice[hidden] { display: none; }

.waitlist { display: grid; gap: 10px; }
.waitlist-row { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-start; }
.waitlist-row .input { flex: 1 1 240px; }
.waitlist-row .btn { flex: 0 0 auto; }
.waitlist-status { font-weight: 650; font-size: .975rem; }
.waitlist-status[data-tone="ok"] { color: var(--ok); }
.waitlist-status[data-tone="error"] { color: var(--danger); }
.waitlist-status:empty { display: none; }
.waitlist[data-done] .waitlist-row { display: none; }

/* ---------- motion safety ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
