:root {
  color-scheme: light;
  --bg: #FFFFFF;
  --ink: #37352F;
  --muted: #6B6A66;
  --line: #E9E9E7;
  --soft: #F7F7F5;
  --accent: #2383E2;
  --accent-soft: #E7F1FD;
  --accent-ink: #0B6BCB;
  --rec: #EF3B3B;
  --blue: #2383E2;     --blue-bg: #DCEBFD;   --blue-ink: #1A63B3;
  --green: #0F9B6E;    --green-bg: #D6F5E7;  --green-ink: #0B6E4E;
  --orange: #F07A17;   --orange-bg: #FFE3C7; --orange-ink: #A34E08;
  --yellow: #F2B100;   --yellow-bg: #FFF0BD; --yellow-ink: #7A5500;
  --pink: #E8478A;     --pink-bg: #FFDCEA;   --pink-ink: #A81B5F;
  --purple: #7B4FE0;   --purple-bg: #E9E0FD; --purple-ink: #5A2DB5;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--yellow-bg); color: var(--ink); }

a { color: var(--accent); text-underline-offset: 3px; }

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding-inline: 24px;
}

h1, h2, .name {
  font-family: Montserrat, Inter, -apple-system, sans-serif;
  font-weight: 700;
  text-wrap: balance;
}

kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0.05em 0.42em;
  border: 1px solid rgba(35, 131, 226, 0.3);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: #fff;
  color: var(--blue-ink);
  font: 600 0.88em/1.4 Inter, -apple-system, sans-serif;
  text-align: center;
  white-space: nowrap;
}

/* Hero */

.hero {
  position: relative;
  isolation: isolate;
  text-align: center;
  padding-top: clamp(40px, 8vh, 88px);
  padding-bottom: clamp(56px, 8vw, 88px);
}

/* Soft colour wash behind the hero, so the page does not start grey. */
.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  top: -40px;
  width: min(1100px, 150vw);
  height: 620px;
  transform: translateX(-50%);
  background:
    radial-gradient(closest-side at 35% 45%, rgba(35, 131, 226, 0.22), transparent),
    radial-gradient(closest-side at 65% 40%, rgba(232, 71, 138, 0.18), transparent),
    radial-gradient(closest-side at 50% 80%, rgba(242, 177, 0, 0.2), transparent);
  pointer-events: none;
}

.lockup {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: clamp(24px, 4vh, 48px);
}

.lockup svg { width: 44px; height: 44px; display: block; }

.lockup .name {
  font-size: 24px;
  letter-spacing: -0.02em;
}

h1 {
  margin: 0 auto;
  max-width: 820px;
  font-size: clamp(40px, 7vw, 72px);
  line-height: 1.04;
  letter-spacing: -0.035em;
}

/* Apple's own ⇧⌘ glyphs; Montserrat draws them as clip-art. */
h1 .keys {
  color: var(--accent);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Inter, sans-serif;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.lede {
  max-width: 520px;
  margin: 20px auto 36px;
  color: var(--muted);
  font-size: 20px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: filter 160ms ease, transform 160ms var(--ease-out), background-color 160ms ease;
}

.btn svg { width: 18px; height: 18px; display: block; }

.btn.primary { background: var(--blue); color: #fff; box-shadow: 0 10px 22px -10px rgba(35, 131, 226, 0.7); }
.btn.secondary { background: var(--yellow-bg); color: var(--yellow-ink); }

@media (hover: hover) and (pointer: fine) {
  .btn.primary:hover { filter: brightness(1.06); }
  .btn.secondary:hover { background-color: #FFE68A; }
}

.btn:active { transform: scale(0.97); }

.btn:focus-visible, .foot a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.meta {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 14px;
}

/* The stage: a quiet screen where a region gets recorded and saved */

.stage {
  position: relative;
  max-width: 820px;
  aspect-ratio: 16 / 9;
  margin: clamp(48px, 8vw, 72px) auto 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    radial-gradient(circle at 1px 1px, rgba(35, 131, 226, 0.22) 1px, transparent 0) 0 0 / 22px 22px,
    linear-gradient(135deg, #E2EFFF 0%, #F7E6F5 52%, #FFF0CC 100%);
  overflow: hidden;
  text-align: left;
}

.bar {
  position: absolute;
  inset: 0 0 auto;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.bar .timer { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; opacity: 0; }
.bar .timer::before { content: ""; width: 8px; height: 8px; border-radius: 1.5px; background: var(--rec); }

.doc {
  position: absolute;
  left: 7%;
  top: 17%;
  width: 56%;
  display: grid;
  gap: 10px;
  padding: 4% 4% 5%;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 20px -10px rgba(38, 32, 78, 0.25);
}

.doc i {
  display: block;
  height: 9px;
  border-radius: 5px;
  background: var(--purple-bg);
}

.doc i:first-child { width: 56%; height: 14px; background: var(--blue); margin-bottom: 6px; }
.doc i:nth-child(2) { background: var(--pink-bg); }
.doc i:nth-child(3) { width: 88%; background: var(--green-bg); }
.doc i:nth-child(4) { width: 74%; background: var(--yellow-bg); }
.doc i:nth-child(5) { background: var(--blue-bg); }
.doc i:nth-child(6) { width: 64%; background: var(--orange-bg); }

.chart {
  position: absolute;
  left: 9%;
  top: 56%;
  width: 52%;
  height: 26%;
  display: flex;
  align-items: flex-end;
  gap: 6%;
  padding: 0 4%;
}

.chart b {
  flex: 1;
  border-radius: 4px 4px 0 0;
  background: var(--pink);
}

.chart b:nth-child(2) { background: var(--green); }
.chart b:nth-child(3) { background: var(--yellow); }
.chart b:nth-child(4) { background: var(--blue); }
.chart b:nth-child(5) { background: var(--purple); }

/* The region keeps its final size; only its opacity, scale and colour change. */
.region {
  position: absolute;
  left: 6%;
  top: 50%;
  width: 58%;
  height: 38%;
  border: 1px solid var(--blue);
  background: rgba(35, 131, 226, 0.1);
  box-shadow: 0 0 0 9999px rgba(38, 32, 78, 0.2);
}

.size {
  position: absolute;
  right: 0;
  bottom: -30px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* The result card, drawn in HTML so its thumbnail is the region that was just recorded. */
.card {
  position: absolute;
  right: 3.5%;
  bottom: 6%;
  width: 30%;
  padding: 5px 5px 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  box-shadow: 0 18px 40px -12px rgba(15, 15, 15, 0.28), 0 0 0 0.5px rgba(15, 15, 15, 0.14);
}

.thumb {
  position: relative;
  aspect-ratio: 58 / 38;
  display: flex;
  align-items: flex-end;
  gap: 7%;
  padding: 10% 9% 0;
  border-radius: 7px;
  background:
    radial-gradient(circle at 1px 1px, rgba(35, 131, 226, 0.22) 1px, transparent 0) 0 0 / 9px 9px,
    #FFFFFF;
  overflow: hidden;
}

.thumb b { flex: 1; border-radius: 2px 2px 0 0; background: var(--pink); }
.thumb b:nth-child(2) { background: var(--green); }
.thumb b:nth-child(3) { background: var(--yellow); }
.thumb b:nth-child(4) { background: var(--blue); }
.thumb b:nth-child(5) { background: var(--purple); }

.thumb .dur {
  position: absolute;
  left: 5px;
  bottom: 5px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--purple);
  color: #fff;
  font-size: 9px;
  font-weight: 600;
  line-height: 15px;
  font-variant-numeric: tabular-nums;
}

.formats {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 7px 0 8px;
  color: var(--muted);
  font-size: 10.5px;
}

.formats .on { padding: 0 6px; border-radius: 999px; background: var(--blue); color: #fff; font-weight: 600; line-height: 16px; }
.formats .dot { color: #C7C6C2; }

.formats svg {
  position: absolute;
  right: 6px;
  top: 50%;
  width: 11px;
  height: 11px;
  transform: translateY(-50%);
  color: var(--muted);
}

/* One 8-second loop, four beats: a pointer drags out a region, the region turns red and records,
   it stops, and the result card springs in while its thumbnail plays. Transform and opacity only. */
.pointer { position: absolute; inset: 0; opacity: 0; pointer-events: none; z-index: 2; }
.pointer svg { position: absolute; left: 0; top: 0; width: 22px; height: 22px; filter: drop-shadow(0 2px 3px rgba(15, 15, 15, 0.28)); }

.region { transform-origin: 0 0; }

.thumb::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--accent);
  transform-origin: 0 50%;
  transform: scaleX(0);
}

@media (prefers-reduced-motion: no-preference) {
  .pointer { animation: pointer 8s linear infinite; }
  .region { animation: region 8s linear infinite; }
  .region .size { animation: size 8s linear infinite; }
  .bar .timer { animation: timer 8s linear infinite; }
  .bar .timer::before { animation: rec 1s ease-in-out infinite; }
  .chart b { transform-origin: 50% 100%; animation: eq 1.1s ease-in-out infinite alternate; }
  .chart b:nth-child(2) { animation-delay: -0.3s; }
  .chart b:nth-child(3) { animation-delay: -0.6s; }
  .chart b:nth-child(4) { animation-delay: -0.2s; }
  .chart b:nth-child(5) { animation-delay: -0.8s; }
  .card { animation: card 8s linear infinite; }
  .thumb b { transform-origin: 50% 100%; animation: bar-rise 8s linear infinite; }
  .thumb::after { animation: play 8s linear infinite; }
}

@keyframes pointer {
  0%, 5% { transform: translate(92%, 100%); opacity: 0; }
  8% { transform: translate(92%, 100%); opacity: 1; }
  16% { transform: translate(6%, 50%); opacity: 1; }
  40%, 44% { transform: translate(64%, 88%); opacity: 1; }
  50%, 100% { transform: translate(70%, 96%); opacity: 0; }
}

@keyframes region {
  /* colours below match the .region base rule above */
  0%, 15% { opacity: 0; transform: scale(0.02, 0.02); border-color: var(--accent); background-color: rgba(35, 131, 226, 0.06); box-shadow: 0 0 0 9999px rgba(55, 53, 47, 0); }
  16%, 39% { opacity: 1; transform: scale(0.02, 0.02); border-color: var(--accent); background-color: rgba(35, 131, 226, 0.06); box-shadow: 0 0 0 9999px rgba(55, 53, 47, 0); }
  40%, 45% { opacity: 1; transform: none; border-color: var(--accent); background-color: rgba(35, 131, 226, 0.06); box-shadow: 0 0 0 9999px rgba(55, 53, 47, 0.12); }
  46%, 66% { opacity: 1; transform: none; border-color: var(--rec); background-color: transparent; box-shadow: 0 0 0 9999px rgba(55, 53, 47, 0.12); }
  70%, 100% { opacity: 0; transform: scale(0.98, 0.98); border-color: var(--rec); background-color: transparent; box-shadow: 0 0 0 9999px rgba(55, 53, 47, 0); }
}

@keyframes size {
  0%, 42% { opacity: 0; }
  46%, 66% { opacity: 1; }
  70%, 100% { opacity: 0; }
}

@keyframes timer {
  0%, 45% { opacity: 0; }
  47%, 66% { opacity: 1; }
  68%, 100% { opacity: 0; }
}

@keyframes rec {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

@keyframes eq {
  from { transform: scaleY(0.82); }
  to { transform: scaleY(1); }
}

@keyframes card {
  0%, 66% { opacity: 0; transform: translateX(130%); animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1); }
  74% { opacity: 1; transform: translateX(-4%); animation-timing-function: ease-in-out; }
  78%, 90% { opacity: 1; transform: none; }
  96%, 100% { opacity: 0; transform: translateX(130%); }
}

@keyframes bar-rise {
  0%, 70% { transform: scaleY(0); }
  78% { transform: scaleY(1.08); }
  84%, 100% { transform: scaleY(1); }
}

@keyframes play {
  0%, 75% { transform: scaleX(0); }
  92%, 100% { transform: scaleX(1); }
}

@media (prefers-reduced-motion: reduce) {
  .region { border-color: var(--rec); background: transparent; box-shadow: none; }
}

@media (max-width: 560px) {
  .card { width: 44%; }
  .doc { width: 70%; }
}

/* Sections */

.how {
  padding-top: clamp(72px, 10vw, 112px);
  padding-bottom: clamp(48px, 6vw, 72px);
  border-top: 1px solid var(--line);
}

.how h2, .block h2, .close h2 {
  margin: 0;
  font-size: clamp(30px, 4.2vw, 46px);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.how h2 { text-align: center; }

.steps {
  display: grid;
  gap: 16px;
  margin: 48px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

@media (min-width: 820px) {
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.steps li {
  --tone: var(--blue);
  --tint: var(--blue-bg);
  padding: 22px 22px 24px;
  border-radius: 14px;
  background: var(--tint);
  counter-increment: step;
}

.steps li:nth-child(2) { --tone: var(--green); --tint: var(--green-bg); }
.steps li:nth-child(3) { --tone: var(--orange); --tint: var(--orange-bg); }

.steps li::before {
  content: counter(step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin-bottom: 14px;
  border-radius: 7px;
  background: #fff;
  color: var(--tone);
  box-shadow: 0 1px 2px rgba(38, 32, 78, 0.12);
  font: 700 13px/1 Montserrat, sans-serif;
}

.steps h3 {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 600;
}

.steps p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.block {
  display: grid;
  gap: 40px;
  align-items: center;
  padding-top: 88px;
  padding-bottom: 88px;
  border-top: 1px solid var(--line);
}

@media (min-width: 880px) {
  .block { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
}

.block p {
  max-width: 440px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.shot {
  justify-self: center;
  width: min(420px, 100%);
  margin: 0;
  border-radius: 14px;
  box-shadow: 0 28px 60px -20px rgba(232, 71, 138, 0.38), 0 14px 32px -14px rgba(35, 131, 226, 0.4), 0 0 0 0.5px rgba(15, 15, 15, 0.1);
}

.shot img { display: block; width: 100%; height: auto; border-radius: 14px; }

.options {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.options li {
  display: grid;
  grid-template-columns: 9em minmax(0, 1fr);
  gap: 4px 20px;
  padding: 16px 4px;
  border-bottom: 1px solid var(--line);
}

.options li:last-child { border-bottom: 0; }

.options li { --tone-bg: var(--blue-bg); --tone-ink: var(--blue-ink); }
.options li:nth-child(2) { --tone-bg: var(--purple-bg); --tone-ink: var(--purple-ink); }
.options li:nth-child(3) { --tone-bg: var(--pink-bg); --tone-ink: var(--pink-ink); }

.options b {
  justify-self: start;
  align-self: start;
  line-height: 1.5;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--tone-bg);
  color: var(--tone-ink);
  font-weight: 600;
}

.options span { color: var(--muted); font-size: 15px; }

@media (max-width: 479px) {
  .options li { grid-template-columns: minmax(0, 1fr); }
}

/* Quiet numbers */

.weights {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.weights caption {
  caption-side: bottom;
  padding-top: 14px;
  color: var(--muted);
  font-size: 13px;
  text-align: left;
}

.weights td {
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  vertical-align: middle;
}

.weights tr:last-child td { border-bottom: 0; }

.weights td:first-child { width: 7.5em; font-weight: 600; }
.weights td:last-child { width: 5.5em; text-align: right; color: var(--muted); }

.meter {
  display: block;
  height: 10px;
  border-radius: 5px;
  background: var(--blue);
}

.meter.base { background: var(--pink); }
.weights tr:nth-child(3) .meter { background: var(--green); }

.close {
  display: grid;
  justify-items: center;
  gap: 28px;
  margin-top: 96px;
  padding: 88px 28px;
  border-radius: 28px;
  background: linear-gradient(135deg, var(--yellow-bg) 0%, var(--pink-bg) 50%, var(--blue-bg) 100%);
  text-align: center;
}

.note {
  max-width: 520px;
  margin: 0;
  padding: 14px 18px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: inset 0 0 0 1px rgba(122, 85, 0, 0.18);
  color: var(--ink);
  font-size: 14px;
  text-align: left;
}

.note b { color: var(--accent-ink); font-weight: 600; }

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 22px;
  margin-top: 56px;
  padding-top: 20px;
  padding-bottom: 52px;
  color: var(--muted);
  font-size: 14px;
}

.foot a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
  text-decoration: none;
  border-radius: 6px;
}

.foot a:hover { color: var(--blue); text-decoration: underline; }

/* Entrances: short stagger (60 ms), ease-out, transform and opacity only. Runs only when JS does. */
@media (prefers-reduced-motion: no-preference) {
  .hero > * { animation: rise 500ms var(--ease-out) both; }
  .hero > :nth-child(2) { animation-delay: 60ms; }
  .hero > :nth-child(3) { animation-delay: 120ms; }
  .hero > :nth-child(4) { animation-delay: 180ms; }
  .hero > :nth-child(5) { animation-delay: 240ms; }
  .hero > :nth-child(6) { animation-delay: 300ms; }
}

@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.js .reveal > * { opacity: 0; transform: translateY(10px); transition: opacity 440ms var(--ease-out), transform 440ms var(--ease-out); }
.js .reveal.in > * { opacity: 1; transform: none; }
.js .reveal > :nth-child(2) { transition-delay: 60ms; }
.js .reveal > :nth-child(3) { transition-delay: 120ms; }

@media (prefers-reduced-motion: reduce) {
  .js .reveal > * { transform: none; transition: opacity 200ms ease; }
}

/* Small motion for the rest of the page: the mark, the meters, the option rows and the steps. */
@media (prefers-reduced-motion: no-preference) {
  .lockup rect[stroke-dasharray] { animation: march 1.2s linear infinite; }
  .lockup circle { transform-box: fill-box; transform-origin: center; animation: pulse 2.4s ease-in-out infinite; }

  .js .weights .meter { transform: scaleX(0); transform-origin: 0 50%; transition: transform 900ms var(--ease-out) 200ms; }
  .js .reveal.in .weights .meter { transform: none; }
  .js .weights tr:nth-child(3) .meter { transition-delay: 320ms; }

  .js .reveal .options li { opacity: 0; transform: translateX(-8px); transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out); }
  .js .reveal.in .options li { opacity: 1; transform: none; }
  .js .reveal.in .options li:nth-child(2) { transition-delay: 90ms; }
  .js .reveal.in .options li:nth-child(3) { transition-delay: 180ms; }

  .js .reveal .steps li { opacity: 0; transform: translateY(12px); transition: opacity 520ms var(--ease-out), transform 520ms var(--ease-out); }
  .js .reveal.in .steps li { opacity: 1; transform: none; }
  .js .reveal.in .steps li:nth-child(2) { transition-delay: 120ms; }
  .js .reveal.in .steps li:nth-child(3) { transition-delay: 240ms; }
}

@keyframes march { to { stroke-dashoffset: -8; } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.14); } }

/* Stars on the code button: shown by script only once the count is worth showing. */
.stars {
  margin-left: 2px;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ⇧⌘5 against Toma */

.compare {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.compare caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.compare th, .compare td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.compare tbody tr:last-child > * { border-bottom: 0; }
.compare thead th { font-size: 13px; font-weight: 600; color: var(--muted); }
.compare thead th:last-child { color: var(--accent); }
.compare tbody th { width: 8.5em; padding-left: 0; font-weight: 600; }
.compare tbody td { color: var(--muted); }
.compare tbody td:last-child { color: var(--ink); font-weight: 500; }

@media (max-width: 479px) {
  .compare tbody th { width: auto; }
  .compare th, .compare td { padding-inline: 6px; }
}

/* Questions */

.faq {
  padding-top: 88px;
  padding-bottom: 24px;
  border-top: 1px solid var(--line);
}

.faq h2 {
  margin: 0;
  font-size: clamp(30px, 4.2vw, 46px);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.qa { margin-top: 32px; max-width: 720px; }

.qa details { border-bottom: 1px solid var(--line); }
.qa details:last-child { border-bottom: 0; }

.qa summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 44px;
  padding: 14px 0;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.qa summary::-webkit-details-marker { display: none; }

.qa summary::after {
  content: "+";
  flex: none;
  color: var(--accent);
  font-size: 22px;
  font-weight: 500;
  line-height: 1;
  transition: transform 200ms var(--ease-out);
}

.qa details[open] summary::after { transform: rotate(45deg); }

.qa summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.qa p { margin: 0 0 18px; max-width: 600px; color: var(--muted); font-size: 16px; }

/* Dark: the same palette, tints become deep and inks become light. A script in <head> sets
   data-theme from the visitor's choice or, failing that, the system setting. */
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #191919;
  --ink: #E6E5E1;
  --muted: #9B9A97;
  --line: #2F2F2D;
  --soft: #202020;
  --accent: #4A9DF0;
  --accent-soft: #1C2F45;
  --accent-ink: #8CC2F7;
  --blue-bg: #1B2E44;   --blue-ink: #8CC2F7;
  --green-bg: #15332A;  --green-ink: #7FD8B5;
  --orange-bg: #3A2614; --orange-ink: #F7B47A;
  --yellow-bg: #362C10; --yellow-ink: #F2CF6B;
  --pink-bg: #3A1D2B;   --pink-ink: #F59CC2;
  --purple-bg: #2A2142; --purple-ink: #BBA4F5;
  --frame: #333331;
  --frame-ink: #C9C8C4;
}

[data-theme="dark"] ::selection { background: #5C4A10; }

[data-theme="dark"] .hero::before { opacity: 0.55; }
[data-theme="dark"] kbd { background: var(--soft); border-color: rgba(74, 157, 240, 0.4); }
[data-theme="dark"] .btn.primary { color: #fff; box-shadow: 0 10px 22px -10px rgba(35, 131, 226, 0.5); }
[data-theme="dark"] .stars { background: rgba(0, 0, 0, 0.25); }

[data-theme="dark"] .stage {
  background:
    radial-gradient(circle at 1px 1px, rgba(74, 157, 240, 0.2) 1px, transparent 0) 0 0 / 22px 22px,
    linear-gradient(135deg, #17243A 0%, #2A1B2E 52%, #2E2715 100%);
}
[data-theme="dark"] .bar { background: rgba(25, 25, 25, 0.85); }
[data-theme="dark"] .doc { background: #262626; box-shadow: 0 8px 20px -10px rgba(0, 0, 0, 0.6); }
[data-theme="dark"] .card { background: rgba(38, 38, 38, 0.96); box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.6), 0 0 0 0.5px rgba(255, 255, 255, 0.12); }
[data-theme="dark"] .thumb { background: radial-gradient(circle at 1px 1px, rgba(74, 157, 240, 0.22) 1px, transparent 0) 0 0 / 9px 9px, #1E1E1E; }
[data-theme="dark"] .formats .dot { color: #55534F; }

[data-theme="dark"] .steps li::before { background: var(--bg); box-shadow: none; }
[data-theme="dark"] .clip { box-shadow: 0 28px 60px -24px rgba(0, 0, 0, 0.7), 0 0 0 0.5px rgba(255, 255, 255, 0.1); }
[data-theme="dark"] .note { background: rgba(0, 0, 0, 0.3); box-shadow: inset 0 0 0 1px rgba(242, 207, 107, 0.2); }

@media (hover: hover) and (pointer: fine) {
  [data-theme="dark"] .btn.secondary:hover { background-color: #4A3C14; }
}

/* Theme switch, top right of the hero */

.theme {
  position: absolute;
  top: 16px;
  right: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  color: var(--ink);
  cursor: pointer;
  transition: transform 160ms var(--ease-out), border-color 160ms ease;
}

.theme svg { width: 18px; height: 18px; }
.theme .moon, [data-theme="dark"] .theme .sun { display: none; }
[data-theme="dark"] .theme .moon { display: block; }
.theme:active { transform: scale(0.94); }
.theme:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

@media (hover: hover) and (pointer: fine) {
  .theme:hover { border-color: var(--accent); }
}

/* The result card, live: pick a format, copy it. Drawn in HTML so it follows the theme. */

.clip {
  --frame: #DADAD8;
  --frame-ink: #4A4945;
  justify-self: center;
  width: min(460px, 100%);
  margin: 0;
  padding: 12px 12px 0;
  border-radius: 22px;
  background: var(--frame);
  box-shadow: 0 28px 60px -20px rgba(232, 71, 138, 0.38), 0 14px 32px -14px rgba(35, 131, 226, 0.4), 0 0 0 0.5px rgba(15, 15, 15, 0.1);
}

[data-theme="dark"] .clip { --frame: #333331; --frame-ink: #C9C8C4; }

.editor {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: #1E1E20;
  color: #E4E4E6;
}

.editor .title {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px;
  border-bottom: 1px solid #2C2C2F;
  background: #28282B;
  color: #8E8E93;
  font-size: 12px;
  font-weight: 600;
}

.editor .title i { width: 10px; height: 10px; border-radius: 50%; background: #FF5F57; }
.editor .title i:nth-child(2) { background: #FEBC2E; }
.editor .title i:nth-child(3) { background: #28C840; margin-right: 12px; }

.editor pre {
  margin: 0;
  padding: 12px 14px 40px;
  overflow: hidden;
  font: 12px/1.6 ui-monospace, "SF Mono", Menlo, monospace;
  counter-reset: line 37;
}

.editor pre span.l { display: block; white-space: pre; counter-increment: line; }
.editor pre span.l::before { content: counter(line); display: inline-block; width: 2.4em; color: #5E5E63; }
.editor .c { color: #7F8C98; }
.editor .k { color: #FF7AB2; }
.editor .f { color: #6BDFFF; }
.editor .t { color: #5DD8FF; }
.editor .b { color: #D9A6FF; }

.editor .dur {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 1px 8px;
  border-radius: 999px;
  background: #000;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.editor .dur::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -10px;
  width: 400px;
  height: 2px;
  background: var(--accent);
  transform-origin: 0 50%;
}

@media (prefers-reduced-motion: no-preference) {
  .editor .dur::after { animation: progress 7s linear infinite; }
}

@keyframes progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.pick {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  height: 46px;
}

.pick .dot { color: color-mix(in srgb, var(--frame-ink) 40%, transparent); }

.pick button {
  min-width: 44px;
  min-height: 34px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: color-mix(in srgb, var(--frame-ink) 75%, transparent);
  font: 600 15px/1 Inter, -apple-system, sans-serif;
  cursor: pointer;
  transition: color 140ms ease, background-color 140ms ease, transform 140ms var(--ease-out);
}

.pick button[aria-pressed="true"] { color: var(--ink); font-weight: 800; }
[data-theme="dark"] .pick button[aria-pressed="true"] { color: #fff; }
.pick button:active { transform: scale(0.94); }
.pick button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

@media (hover: hover) and (pointer: fine) {
  .pick button:hover { background: color-mix(in srgb, var(--frame-ink) 12%, transparent); }
}

.pick .copy {
  position: absolute;
  right: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
}

.pick .copy svg { width: 17px; height: 17px; }

.pick .copied {
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 160ms ease, transform 160ms var(--ease-out);
  pointer-events: none;
}

.pick .copied.on { opacity: 1; transform: none; }

.clip figcaption {
  margin: 0 -12px;
  padding: 10px 16px 12px;
  border-top: 1px solid color-mix(in srgb, var(--frame-ink) 18%, transparent);
  color: var(--frame-ink);
  font-size: 13px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.clip figcaption b { font-weight: 600; }
