@font-face {
  font-family: Inter;
  src: url("../assets/Inter.ttf") format("truetype");
  font-display: swap;
}

/* Motion tokens, the same three durations and two springs as the app. */
:root {
  --motion-fast: 120ms;
  --motion-base: 200ms;
  --motion-slow: 320ms;
  --ease-crisp: cubic-bezier(0.2, 0.9, 0.25, 1);
  --ease-soft: cubic-bezier(0.34, 1.3, 0.5, 1);
  /* Every scene repeats on one beat: fifteen slow steps. */
  --loop: calc(var(--motion-slow) * 15);

  color-scheme: light dark;
  --paper: #f7f3ec;
  --ink: #302c27;
  --muted: #6d655c;
  --line: #ded6ca;
  --accent: #a34f35;
  --card: #fffdf9;
  --green: #2cc283;
  --window: #ffffff;
  --window-bar: #efe9df;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --shadow: 0 1px 2px rgb(48 44 39 / 10%), 0 8px 24px rgb(48 44 39 / 8%);
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #211e1b;
    --ink: #f4ece2;
    --muted: #c4b9ac;
    --line: #4a4239;
    --accent: #e8a183;
    --card: #2b2621;
    --window: #17140f;
    --window-bar: #302a24;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 8px 24px rgb(0 0 0 / 30%);
  }
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font:
    16px/1.6 Inter,
    system-ui,
    sans-serif;
}
header,
main,
footer {
  width: min(960px, calc(100% - 48px));
  margin-inline: auto;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}
nav {
  display: flex;
  gap: 24px;
}
a {
  color: var(--accent);
  text-underline-offset: 4px;
}
a:focus-visible,
button:focus-visible,
.options input:focus-visible + span {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}
nav a {
  color: var(--muted);
}
nav {
  flex-wrap: wrap;
  align-items: center;
}
.language {
  display: none;
}
.js .language {
  display: block;
}
.language select {
  padding: 6px 28px 6px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--card);
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
  cursor: pointer;
}
.language select:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
main {
  padding: 40px 0 24px;
}
h1 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 16px;
  margin: 0 0 8px;
  font-weight: 500;
  line-height: 1;
}
h1 .wordmark {
  display: block;
  max-width: 100%;
  height: auto;
}
h1 span {
  font-size: clamp(28px, 5vw, 40px);
  letter-spacing: -0.03em;
  color: var(--muted);
}
h3 {
  margin: 0 0 12px;
  font-size: 18px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.lead {
  max-width: 560px;
  margin: 8px 0 32px;
  color: var(--muted);
  font-size: 18px;
}

/* Choosing the computer */
.chooser {
  margin: 0 0 32px;
  padding: 0;
  border: 0;
}
.chooser legend {
  padding: 0;
  margin-bottom: 12px;
  font-weight: 600;
}
.options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.options label {
  position: relative;
  cursor: pointer;
}
.options input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}
.options span {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 132px;
  min-height: 56px;
  padding: 8px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  font-weight: 600;
  transition: transform var(--motion-fast) var(--ease-crisp);
}
.options span::before {
  content: "";
  position: absolute;
  inset: -1px;
  border: 2px solid var(--accent);
  border-radius: 12px;
  opacity: 0;
  transition: opacity var(--motion-base) var(--ease-crisp);
}
.options label:hover span {
  transform: translateY(-1px);
}
.options input:checked + span::before {
  opacity: 1;
}
.options small {
  color: var(--muted);
  font-weight: 400;
}
.hint {
  min-height: 1.6em;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.hint [data-detected]:not([hidden]) + [data-for]::before {
  content: " ";
}
.choose {
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
}

/* Panels: only the chosen computer's steps are in the page */
.panels {
  position: relative;
  /* Hidden panels sit below the shown one; keep them out of the page height */
  overflow: clip;
  overflow-clip-margin: 24px;
}
.js .panel {
  position: absolute;
  inset: 0 0 auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition:
    opacity var(--motion-base) var(--ease-crisp),
    transform var(--motion-base) var(--ease-crisp),
    visibility 0s linear var(--motion-base);
}
.js .panel.active {
  position: relative;
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}
.steps {
  display: grid;
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.step,
.fallback {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 24px;
  align-items: center;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
}
.fallback {
  margin-top: 40px;
}
.fallback h3 {
  grid-column: 1 / -1;
  margin: 0;
}
.step-text p {
  margin: 0 0 12px;
  font-size: 17px;
}
.num {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--card);
  font-size: 14px;
  font-weight: 700;
}
.command {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--window);
  overflow: hidden;
}
.command code {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  font: 13px/1.5 var(--mono);
  overflow-wrap: anywhere;
}
.copy {
  position: relative;
  flex: none;
  min-width: 72px;
  padding: 0 14px;
  border: 0;
  border-left: 1px solid var(--line);
  background: var(--window-bar);
  color: var(--ink);
  font:
    600 13px Inter,
    system-ui,
    sans-serif;
  cursor: pointer;
  transition: transform var(--motion-fast) var(--ease-crisp);
}
.copy:active {
  transform: scale(0.96);
}
.copy.done {
  color: var(--accent);
}
.note {
  margin: 24px 0 0;
  color: var(--muted);
}
footer {
  padding: 24px 0 56px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}
/* The button says "Copied"; this line tells screen readers the same */
.status {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  overflow: hidden;
  clip-path: inset(50%);
}

/* Scenes: faithful little drawings, looping, moving only by transform and opacity */
.scene {
  position: relative;
  container-type: inline-size;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
}
.scene-body {
  position: absolute;
  inset: 0;
  animation: loop-fade var(--loop) linear infinite;
}
.window {
  position: absolute;
  left: 6cqw;
  top: 8cqw;
  width: 88cqw;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 2cqw;
  background: var(--window);
  box-shadow: var(--shadow);
  font-size: 2.8cqw;
}
.bar {
  display: flex;
  align-items: center;
  gap: 1.2cqw;
  height: 6cqw;
  padding: 0 2.4cqw;
  background: var(--window-bar);
}
.bar i {
  width: 1.8cqw;
  height: 1.8cqw;
  border-radius: 50%;
  background: var(--muted);
  opacity: 0.45;
}
.bar b {
  margin-left: 1.6cqw;
  font-size: 2.4cqw;
  font-weight: 600;
  color: var(--muted);
}
.screen {
  padding: 2.6cqw 3cqw;
}
.line {
  position: relative;
  margin: 0;
  overflow: hidden;
  white-space: nowrap;
  font: 2.6cqw/1.9 var(--mono);
  text-overflow: ellipsis;
}
.prompt {
  color: var(--green);
}
.cover {
  position: absolute;
  inset: 0;
  background: var(--window);
  border-left: 0.5cqw solid var(--accent);
  transform: translateX(101%);
}
.out {
  color: var(--muted);
}
.scene[data-key]::after {
  content: attr(data-key);
  position: absolute;
  left: 50%;
  bottom: 4cqw;
  margin-left: -7cqw;
  width: 14cqw;
  padding: 1cqw 0;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 1.6cqw;
  background: var(--card);
  font:
    600 2.8cqw/1 Inter,
    system-ui,
    sans-serif;
  box-shadow: var(--shadow);
  opacity: 0;
  animation: key-cue var(--loop) linear infinite;
}
.blink {
  position: absolute;
  right: 9cqw;
  bottom: 5cqw;
  width: 15cqw;
  height: auto;
  transform-origin: 50% 90%;
  animation: blink-hello var(--loop) linear infinite;
}
.toggle {
  position: relative;
  margin-left: auto;
  width: 9cqw;
  height: 5cqw;
}
.toggle i {
  position: absolute;
  inset: 0;
  border-radius: 2.5cqw;
}
.track-off {
  background: var(--line);
}
.track-on {
  background: var(--green);
  animation: toggle-on var(--loop) linear infinite;
}
.toggle .knob {
  inset: 0.5cqw auto auto 0.5cqw;
  width: 4cqw;
  height: 4cqw;
  background: #fff;
  box-shadow: 0 0.2cqw 0.6cqw rgb(0 0 0 / 30%);
  transform: translateX(4cqw);
  animation: knob-slide var(--loop) linear infinite;
}
.row {
  display: flex;
  align-items: center;
  gap: 2cqw;
  font-size: 3cqw;
}
.row img {
  width: 5cqw;
  height: 5cqw;
}
.dialog {
  left: 20cqw;
  top: 8cqw;
  width: 60cqw;
}
.dialog .title,
.settings-window .small {
  margin: 0 0 1cqw;
  font-weight: 600;
}
.dialog .title {
  font-size: 3cqw;
}
.small {
  margin: 0 0 2cqw;
  color: var(--muted);
  font-size: 2.4cqw;
  line-height: 1.4;
}
.btn {
  position: relative;
  display: inline-block;
  padding: 1.2cqw 3cqw;
  border-radius: 1.4cqw;
  background: var(--window-bar);
  font-size: 2.6cqw;
  font-weight: 600;
}
.btn.primary {
  background: var(--accent);
  color: var(--card);
}
.link {
  position: relative;
  display: inline-block;
  color: var(--accent);
  font-size: 2.6cqw;
  text-decoration: underline;
}
.blue {
  --window: #1d4f8f;
  --window-bar: #1d4f8f;
  --muted: #cfe0f5;
  --line: #3a68a8;
  --accent: #ffffff;
  --card: #1d4f8f;
  color: #fff;
}
.blue .btn.primary {
  display: block;
  width: max-content;
  margin-top: 2cqw;
}
.settings-window {
  left: 6cqw;
  top: 12cqw;
  opacity: 1;
  animation: second-window var(--loop) linear infinite;
}
.scene-gatekeeper .dialog {
  animation: first-window var(--loop) linear infinite;
  opacity: 0;
}
.cursor {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4cqw;
  height: 4cqw;
  fill: var(--ink);
  stroke: var(--paper);
  stroke-width: 1.2;
  opacity: 0;
  pointer-events: none;
}
.toggle .cursor,
.btn .cursor,
.link .cursor {
  animation: cursor-in var(--loop) linear infinite;
}
/* The click ring is the target's own ::after so it needs no extra element. */
.toggle::after,
.btn.primary::after,
.link::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6cqw;
  height: 6cqw;
  margin: -3cqw 0 0 -3cqw;
  border: 0.5cqw solid var(--accent);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  animation: click-ring var(--loop) linear infinite;
}
.scene-smartscreen .link .cursor {
  animation-name: cursor-first;
}
.scene-smartscreen .link::after {
  animation-name: ring-first;
}
.scene-smartscreen .run {
  animation: run-in var(--loop) linear infinite;
}
.scene-smartscreen .run .cursor {
  animation-name: cursor-second;
}
.scene-smartscreen .run::after {
  animation-name: ring-second;
}
.scene-gatekeeper .btn.primary .cursor {
  animation-name: cursor-late;
}
.scene-gatekeeper .btn.primary::after {
  animation-name: ring-late;
}

@keyframes loop-fade {
  0% {
    opacity: 0;
  }
  6%,
  92% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
@keyframes key-cue {
  0%,
  2% {
    opacity: 0;
    transform: translateY(1cqw);
  }
  6%,
  14% {
    opacity: 1;
    transform: none;
  }
  18%,
  100% {
    opacity: 0;
  }
}
.typed .cover {
  animation: type-out var(--loop) linear infinite;
}
.scene-claude .typed .cover {
  animation-name: type-out-early;
}
@keyframes type-out {
  0%,
  16% {
    transform: translateX(0);
  }
  40%,
  100% {
    transform: translateX(101%);
  }
}
@keyframes type-out-early {
  0%,
  10% {
    transform: translateX(0);
  }
  32%,
  100% {
    transform: translateX(101%);
  }
}
.out-1 {
  animation: line-in-1 var(--loop) linear infinite;
}
.out-2 {
  animation: line-in-2 var(--loop) linear infinite;
}
@keyframes line-in-1 {
  0%,
  46% {
    opacity: 0;
    transform: translateY(0.8cqw);
  }
  52%,
  100% {
    opacity: 1;
    transform: none;
  }
}
@keyframes line-in-2 {
  0%,
  58% {
    opacity: 0;
    transform: translateY(0.8cqw);
  }
  64%,
  100% {
    opacity: 1;
    transform: none;
  }
}
@keyframes blink-hello {
  0%,
  40% {
    opacity: 0;
    transform: scale(0.6);
  }
  48% {
    opacity: 1;
    transform: scale(1);
  }
  54% {
    transform: rotate(-10deg);
  }
  60% {
    transform: rotate(10deg);
  }
  66% {
    transform: rotate(-8deg);
  }
  72%,
  100% {
    opacity: 1;
    transform: none;
  }
}
@keyframes toggle-on {
  0%,
  44% {
    opacity: 0;
  }
  50%,
  100% {
    opacity: 1;
  }
}
@keyframes knob-slide {
  0%,
  44% {
    transform: translateX(0);
  }
  52%,
  100% {
    transform: translateX(4cqw);
  }
}
@keyframes cursor-in {
  0%,
  18% {
    opacity: 0;
    transform: translate(10cqw, 12cqw);
  }
  22% {
    opacity: 1;
  }
  38%,
  70% {
    opacity: 1;
    transform: translate(0, 0);
  }
  76%,
  100% {
    opacity: 0;
    transform: translate(0, 0);
  }
}
@keyframes click-ring {
  0%,
  40% {
    opacity: 0;
    transform: scale(0.4);
  }
  42% {
    opacity: 0.8;
    transform: scale(0.4);
  }
  56%,
  100% {
    opacity: 0;
    transform: scale(1.4);
  }
}
@keyframes first-window {
  0%,
  6% {
    opacity: 0;
    transform: translateY(1cqw);
  }
  12%,
  36% {
    opacity: 1;
    transform: none;
  }
  42%,
  100% {
    opacity: 0;
    transform: none;
  }
}
@keyframes second-window {
  0%,
  42% {
    opacity: 0;
    transform: translateY(1cqw);
  }
  50%,
  100% {
    opacity: 1;
    transform: none;
  }
}
@keyframes cursor-late {
  0%,
  54% {
    opacity: 0;
    transform: translate(10cqw, 12cqw);
  }
  58% {
    opacity: 1;
  }
  70%,
  88% {
    opacity: 1;
    transform: translate(0, 0);
  }
  92%,
  100% {
    opacity: 0;
    transform: translate(0, 0);
  }
}
@keyframes ring-late {
  0%,
  72% {
    opacity: 0;
    transform: scale(0.4);
  }
  74% {
    opacity: 0.8;
    transform: scale(0.4);
  }
  88%,
  100% {
    opacity: 0;
    transform: scale(1.4);
  }
}
@keyframes cursor-first {
  0%,
  8% {
    opacity: 0;
    transform: translate(10cqw, 12cqw);
  }
  12% {
    opacity: 1;
  }
  24%,
  40% {
    opacity: 1;
    transform: translate(0, 0);
  }
  44%,
  100% {
    opacity: 0;
    transform: translate(0, 0);
  }
}
@keyframes ring-first {
  0%,
  26% {
    opacity: 0;
    transform: scale(0.4);
  }
  28% {
    opacity: 0.8;
    transform: scale(0.4);
  }
  40%,
  100% {
    opacity: 0;
    transform: scale(1.4);
  }
}
@keyframes run-in {
  0%,
  34% {
    opacity: 0;
    transform: translateY(1cqw);
  }
  42%,
  100% {
    opacity: 1;
    transform: none;
  }
}
@keyframes cursor-second {
  0%,
  44% {
    opacity: 0;
    transform: translate(10cqw, 12cqw);
  }
  48% {
    opacity: 1;
  }
  62%,
  84% {
    opacity: 1;
    transform: translate(0, 0);
  }
  88%,
  100% {
    opacity: 0;
    transform: translate(0, 0);
  }
}
@keyframes ring-second {
  0%,
  64% {
    opacity: 0;
    transform: scale(0.4);
  }
  66% {
    opacity: 0.8;
    transform: scale(0.4);
  }
  80%,
  100% {
    opacity: 0;
    transform: scale(1.4);
  }
}

@media (max-width: 720px) {
  header,
  main,
  footer {
    width: calc(100% - 32px);
  }
  .step,
  .fallback {
    grid-template-columns: 1fr;
    padding: 16px;
  }
  .options span {
    min-width: 0;
  }
  .options label {
    flex: 1 1 calc(50% - 6px);
  }
}

/* Reduced motion: every scene rests on its last frame, nothing loops. */
@media (prefers-reduced-motion: reduce) {
  .scene *,
  .scene *::before,
  .scene *::after,
  .scene,
  .scene::after {
    animation: none !important;
  }
  .scene[data-key]::after {
    opacity: 0;
  }
  .scene-gatekeeper .dialog {
    opacity: 0;
  }
  .js .panel,
  .options span,
  .options span::before,
  .copy {
    transition-duration: 0s !important;
  }
}
