/* Karatasi landing page. Colours are Omarchy theme palettes, set on :root by main.js; the
   defaults below are Tokyo Night so the page renders before the script runs. */

:root {
  --bg: #1a1b26;
  --bg-dark: #13141c;
  --bg-light: #24283b;
  --fg: #a9b1d6;
  --fg-bright: #c0caf5;
  --fg-dim: #b4bee6;
  --fg-faint: #565f89;
  --accent: #7aa2f7;
  --selection: #292e42;
  --muted: #414868;
  --red: #f7768e;
  --green: #9ece6a;
  --yellow: #e0af68;
  --blue: #7aa2f7;
  --magenta: #ad8ee6;
  --cyan: #449dab;

  --mono: "JetBrains Mono", "JetBrainsMono Nerd Font", ui-monospace, SFMono-Regular, Menlo, monospace;
  --max: 1280px;
  --pad: clamp(1rem, 3vw, 2.5rem);
  --nav-h: 56px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --t: 0.45s;
  color-scheme: dark;
}
:root[data-mode="light"] {
  color-scheme: light;
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background var(--t), color var(--t);
}
::selection {
  background: var(--accent);
  color: var(--bg);
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
h1, h2, h3 {
  color: var(--fg-bright);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0;
}
h1 {
  font-size: clamp(2.2rem, 4.6vw, 3.6rem);
}
h2 {
  font-size: clamp(1.6rem, 2.8vw, 2.3rem);
}
h3 {
  font-size: 1.25rem;
}
p {
  margin: 0;
}
p + p {
  margin-top: 0.9em;
}
code, kbd, pre {
  font-family: var(--mono);
}
code {
  background: var(--bg-light);
  border-radius: 4px;
  padding: 0.1em 0.4em;
  font-size: 0.92em;
  color: var(--fg-bright);
}
pre {
  margin: 0;
  background: var(--bg-dark);
  border: 1px solid var(--bg-light);
  border-radius: 8px;
  padding: 1rem 1.2rem;
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--fg-bright);
}
pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}
pre .c {
  color: var(--fg-faint);
}
pre .s {
  color: var(--green);
}
pre .k {
  color: var(--magenta);
}
pre .p {
  color: var(--accent);
}
kbd {
  display: inline-block;
  color: var(--fg-bright);
  background: var(--bg-light);
  border: 1px solid var(--muted);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 0 0.45em;
  font-size: 0.85em;
  line-height: 1.7;
  white-space: nowrap;
}
.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
}
.eyebrow {
  color: var(--accent);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
}
.dim {
  color: var(--fg-faint);
}
.lead {
  font-size: 1.08rem;
  color: var(--fg);
  max-width: 34em;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* ---------- nav ---------- */

nav.top {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--bg-light);
  transition: background var(--t), border-color var(--t);
}
nav.top .wrap {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--fg-bright);
  font-weight: 600;
  font-size: 1rem;
}
.brand:hover {
  text-decoration: none;
}
.brand svg {
  width: 20px;
  height: 20px;
}
nav.top .links {
  display: flex;
  gap: 1.4rem;
  margin-left: auto;
  font-size: 0.9rem;
}
nav.top .links a {
  color: var(--fg-dim);
}
nav.top .links a:hover {
  color: var(--fg-bright);
  text-decoration: none;
}
.themes {
  display: flex;
  align-items: center;
  gap: 6px;
}
.themes .label {
  color: var(--fg-faint);
  font-size: 0.75rem;
  margin-right: 4px;
}
.swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid transparent;
  padding: 0;
  cursor: pointer;
  background: var(--sw-bg);
  position: relative;
  transition: transform 0.15s var(--ease), border-color 0.15s;
}
.swatch::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sw-accent) 50%, var(--sw-fg) 50%);
}
.swatch:hover {
  transform: scale(1.15);
}
.swatch[aria-pressed="true"] {
  border-color: var(--fg-bright);
}
.themes.big {
  gap: 10px;
  flex-wrap: wrap;
}
.themes.big .swatch {
  width: 30px;
  height: 30px;
}
.themes.big .swatch::after {
  inset: 5px;
}
@media (max-width: 720px) {
  nav.top .links a:not(.gh) {
    display: none;
  }
  nav.top .themes {
    display: none;
  }
}
.grid4.zeros {
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 560px) {
  .grid4.zeros {
    grid-template-columns: 1fr;
  }
}

/* ---------- hero heading + story: sticky desktop + scrolling steps ---------- */

.step.hero .lead {
  font-size: 1rem;
}
.step.hero .cmd {
  margin: 1.4rem 0 1.2rem;
}
.hand {
  font-family: "Caveat", "Segoe Print", "Bradley Hand", cursive;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--accent);
}
.try-note {
  display: flex;
  align-items: flex-end;
  gap: 0.4rem;
  margin: 0.2rem 0 0 1.4rem;
  color: var(--accent);
  opacity: 0.85;
}
.try-note svg {
  width: 46px;
  height: 34px;
  flex: 0 0 auto;
}
.try-note .hand {
  transform: rotate(-4deg) translateY(0.15rem);
}
.tname {
  color: var(--fg-dim);
  font-size: 0.8rem;
  white-space: nowrap;
}
.tname.big {
  font-size: 0.95rem;
  color: var(--fg-bright);
}

.story {
  display: grid;
  grid-template-columns: minmax(300px, 33%) 1fr;
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: start;
}
.steps {
  position: relative;
  z-index: 1;
  grid-column: 1;
  grid-row: 1;
  padding-bottom: 16vh;
}
.stage-wrap {
  grid-column: 2;
  grid-row: 1;
}
.step {
  min-height: 78vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem 0;
  opacity: 0.35;
  transition: opacity 0.4s;
}
.hero-head {
  padding: clamp(1.5rem, 3vw, 2.5rem) var(--pad) 0.5rem;
}
.hero-head h1 {
  font-size: clamp(1.5rem, 2.9vw, 2.6rem);
  letter-spacing: -0.02em;
}
.step.hero {
  min-height: calc(100vh - var(--nav-h) - 8rem);
  justify-content: flex-start;
  padding: 1.5rem 0 3rem;
}
.step .punch {
  font-size: clamp(1.4rem, 2.2vw, 1.9rem);
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -0.01em;
  margin-bottom: 0.8rem;
}
.step .punch .arrow {
  color: var(--fg-faint);
  font-weight: 400;
  margin: 0 0.15em;
}
.step.active,
.step.hero {
  opacity: 1;
}
.step h2 {
  margin-bottom: 0.9rem;
}
.step h1 {
  margin: 0.8rem 0 1.3rem;
}
.step .num {
  color: var(--fg-faint);
  font-size: 0.8rem;
  margin-bottom: 0.6rem;
  letter-spacing: 0.08em;
}
.step .keyrow {
  margin-top: 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}
.step .hint {
  color: var(--fg-faint);
  font-size: 0.82rem;
}

/* Keycaps: buttons that press. */
.key {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--fg-bright);
  background: var(--bg-light);
  border: 1px solid var(--muted);
  border-radius: 8px;
  padding: 0.35em 0.9em;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--muted), 0 4px 10px rgba(0, 0, 0, 0.25);
  transform: translateY(0);
  transition: transform 0.08s, box-shadow 0.08s, background var(--t);
  user-select: none;
}
.key:hover {
  background: color-mix(in srgb, var(--bg-light) 80%, var(--accent));
}
.key:active,
.key.pressed {
  transform: translateY(3px);
  box-shadow: 0 0 0 var(--muted), 0 1px 3px rgba(0, 0, 0, 0.3);
}
.key .plus {
  color: var(--fg-faint);
  font-weight: 400;
}
.key.pulse {
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { outline: 0 solid transparent; }
  50% { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); }
}

.stage-wrap {
  position: sticky;
  top: calc(var(--nav-h) + 1.5rem);
  height: calc(100vh - var(--nav-h) - 3rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
}
.stage {
  width: min(100%, calc((100vh - var(--nav-h) - 3rem) * 1.6));
  aspect-ratio: 16 / 10;
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--bg-light);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.55);
  background: var(--bg-dark);
  font-size: clamp(6px, 0.72vw, 10px);
  transition: border-color var(--t);
}
.stage-wrap .try {
  align-self: flex-start;
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--fg-dim);
  padding-left: 0.2rem;
}
.try .legend-title {
  color: var(--fg-faint);
  margin-bottom: 0.2rem;
}
.try .legend {
  display: grid;
  grid-template-columns: auto auto;
  grid-auto-flow: column;
  grid-template-rows: auto auto;
  gap: 0.15rem 2.2rem;
  width: max-content;
}
.try .legend kbd {
  color: var(--fg-bright);
  margin-right: 0.15rem;
}
.try .legend-foot {
  color: var(--fg-faint);
  font-size: 0.76rem;
  margin-top: 0.4rem;
}

/* The desktop: a wallpaper, the Omarchy bar, workspaces with tiled windows and the pinned note. */
.desktop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 85% 110%, color-mix(in srgb, var(--accent) 28%, transparent), transparent 60%),
    radial-gradient(80% 70% at 5% -10%, color-mix(in srgb, var(--magenta) 18%, transparent), transparent 60%),
    linear-gradient(160deg, var(--bg-light), var(--bg-dark) 70%);
  transition: background var(--t);
}
.bar {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3em;
  display: flex;
  align-items: center;
  padding: 0 1.4em;
  gap: 1.6em;
  background: var(--bg);
  color: var(--fg);
  font-size: 1.25em;
  transition: background var(--t);
}
.bar .logo {
  width: 1.1em;
  height: 1.1em;
  color: var(--fg-bright);
}
.bar .wss {
  display: flex;
  gap: 0.35em;
}
.bar .ws {
  width: 1.7em;
  height: 1.7em;
  display: grid;
  place-items: center;
  border-radius: 4px;
  color: var(--fg-faint);
  font-weight: 500;
  transition: background 0.25s, color 0.25s;
}
.bar .ws.on {
  background: var(--bg-light);
  color: var(--fg-bright);
}
.bar .ws.busy:not(.on) {
  color: var(--fg-dim);
}
.bar .right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1.3em;
  color: var(--fg-dim);
}
.bar .right svg {
  width: 1.15em;
  height: 1.15em;
  display: block;
}
.bar .clock {
  color: var(--fg-bright);
  font-weight: 500;
}

.wins {
  position: absolute;
  left: 0;
  right: 0;
  top: 3em;
  bottom: 0;
}
.workspace {
  position: absolute;
  inset: 0;
  transition: transform 0.5s var(--ease), opacity 0.5s;
}
.workspace.left {
  transform: translateX(-104%);
  opacity: 0;
}
.workspace.right {
  transform: translateX(104%);
  opacity: 0;
}

/* Windows: no rounding, thin gaps, 2px border; the focused one wears the accent. */
.win {
  position: absolute;
  background: var(--bg);
  border: 2px solid var(--muted);
  color: var(--fg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-size: 1.25em;
  line-height: 1.5;
  transition:
    left 0.5s var(--ease), top 0.5s var(--ease), width 0.5s var(--ease), height 0.5s var(--ease),
    transform 0.5s var(--ease), opacity 0.3s var(--ease), border-color 0.3s, background var(--t);
}
.win.focus {
  border-color: var(--accent);
}
.win .body {
  padding: 0.9em 1.1em;
  white-space: pre;
  overflow: hidden;
  flex: 1;
}

.term .prompt {
  color: var(--fg-faint);
}
.term .dir {
  color: var(--blue);
}
.term .branch {
  color: var(--magenta);
}
.term .ok {
  color: var(--green);
}
.term .out {
  color: var(--fg-dim);
}
.term .hash {
  color: var(--yellow);
}
.term .cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.1em;
  background: var(--fg);
  vertical-align: -0.2em;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink {
  50% { opacity: 0; }
}

.browser .chrome {
  display: flex;
  align-items: center;
  gap: 0.7em;
  padding: 0.55em 0.9em;
  background: var(--bg-light);
  color: var(--fg-dim);
  font-size: 0.95em;
}
.browser .chrome .dots i {
  display: inline-block;
  width: 0.7em;
  height: 0.7em;
  border-radius: 50%;
  background: var(--muted);
  margin-right: 0.3em;
}
.browser .chrome .url {
  flex: 1;
  background: var(--bg);
  border-radius: 4px;
  padding: 0.1em 0.7em;
  color: var(--fg-dim);
}
.browser .page {
  padding: 1.6em 2em;
  color: var(--fg-dim);
  white-space: normal;
  line-height: 1.6;
}
.browser .page h4 {
  margin: 0 0 0.6em;
  color: var(--fg-bright);
  font-size: 1.5em;
  font-weight: 600;
}
.browser .page .crumb {
  color: var(--fg-faint);
  font-size: 0.85em;
  margin-bottom: 1em;
}
.browser .page p {
  margin: 0 0 0.8em;
}
.browser .page code {
  font-size: 0.9em;
}

.nvim .body {
  display: grid;
  grid-template-columns: 2.6em 1fr;
  padding: 0.6em 0;
}
.nvim .ln {
  color: var(--fg-faint);
  text-align: right;
  padding-right: 1em;
  user-select: none;
}
.nvim .kw {
  color: var(--magenta);
}
.nvim .fn {
  color: var(--blue);
}
.nvim .str {
  color: var(--green);
}
.nvim .ty {
  color: var(--yellow);
}
.nvim .cm {
  color: var(--fg-faint);
  font-style: italic;
}
.nvim .status {
  display: flex;
  gap: 1em;
  padding: 0.25em 0.8em;
  background: var(--bg-light);
  color: var(--fg-dim);
  font-size: 0.9em;
}
.nvim .status .mode {
  background: var(--accent);
  color: var(--bg);
  padding: 0 0.6em;
  font-weight: 600;
}

/* The Karatasi window: the app's own editor styling at desktop scale. */
.note {
  background: var(--bg);
  z-index: 5;
}
.note.hidden {
  opacity: 0;
  transform: scale(0.96);
  pointer-events: none;
}
.note .doc {
  flex: 1;
  padding: 2.2em 2.6em;
  overflow: hidden;
  white-space: normal;
  line-height: 1.6;
  caret-color: var(--accent);
}
.note .doc h1 {
  font-size: 1.7em;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: var(--fg-bright);
}
.note .doc p {
  margin: 0.3em 0;
}
.note .doc .empty::before {
  content: attr(data-ph);
  color: var(--fg-faint);
}
.note .doc ul {
  list-style: none;
  padding-left: 0.2em;
  margin: 0.3em 0;
}
.note .doc li {
  display: flex;
  align-items: flex-start;
  gap: 0.6em;
  margin: 0.15em 0;
}
.note .doc li.bullet::before {
  content: "•";
  color: var(--fg-dim);
  margin-left: 0.5em;
}
.note .doc li .box {
  flex: 0 0 auto;
  width: 0.95em;
  height: 0.95em;
  margin-top: 0.35em;
  border: 1.5px solid var(--fg-faint);
  border-radius: 4px;
  position: relative;
  transition: background 0.1s, border-color 0.1s;
}
.note .doc li.done .box {
  background: var(--accent);
  border-color: var(--accent);
}
.note .doc li.done .box::after {
  content: "";
  position: absolute;
  left: 0.27em;
  top: 0.05em;
  width: 0.25em;
  height: 0.5em;
  border: solid var(--bg);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.note .doc li.done .txt {
  color: var(--fg-faint);
  text-decoration: line-through;
}
.note .doc .caret {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: var(--accent);
  vertical-align: -0.2em;
  margin-left: 1px;
  animation: blink 1s steps(1) infinite;
}
.note .foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1.1em;
  height: 2.2em;
  font-size: 0.8em;
  color: var(--fg-faint);
  border-top: 1px solid var(--bg-light);
  white-space: nowrap;
  overflow: hidden;
  gap: 1em;
}
.note .foot .hints {
  display: flex;
  gap: 0.8em;
  overflow: hidden;
}
.note .foot kbd {
  border: 0;
  background: var(--bg-light);
  color: var(--fg-dim);
  border-radius: 3px;
  padding: 0 0.4em;
  font-size: 0.95em;
  line-height: 1.5;
}

/* Key toast on the stage, like a screencast overlay. */
.keytoast {
  position: absolute;
  left: 50%;
  bottom: 1.4em;
  transform: translate(-50%, 0.6em);
  z-index: 9;
  font-size: 1.6em;
  font-weight: 600;
  color: var(--fg-bright);
  background: color-mix(in srgb, var(--bg-dark) 92%, transparent);
  border: 1px solid var(--muted);
  padding: 0.3em 0.9em;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s, transform 0.18s;
}
.keytoast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- sections below the story ---------- */

section.band {
  padding: clamp(4rem, 8vw, 7rem) 0;
  border-top: 1px solid var(--bg-light);
}
section.band .head {
  max-width: 44em;
  margin-bottom: 2.5rem;
}
section.band .head h2 {
  margin: 0.6rem 0 1rem;
}
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: start;
}
.grid3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.grid4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}
.card {
  background: var(--bg-dark);
  border: 1px solid var(--bg-light);
  border-radius: 10px;
  padding: 1.4rem 1.5rem;
  transition: background var(--t), border-color var(--t);
}
.card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
}
.card p {
  color: var(--fg-dim);
  font-size: 0.92rem;
}
.card .big {
  font-size: 2rem;
  color: var(--accent);
  margin-bottom: 0.4rem;
  line-height: 1;
}
@media (max-width: 900px) {
  .grid2, .grid3, .grid4 {
    grid-template-columns: 1fr;
  }
  .grid4 {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 560px) {
  .grid4 {
    grid-template-columns: 1fr;
  }
}

/* Standalone fake windows outside the stage (terminal, note, raw file). */
.fakewin {
  border-radius: 10px;
  border: 1px solid var(--muted);
  background: var(--bg);
  overflow: hidden;
  font-size: 0.86rem;
  line-height: 1.6;
  transition: background var(--t), border-color var(--t);
}
.fakewin .title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.9rem;
  background: var(--bg-light);
  color: var(--fg-dim);
  font-size: 0.78rem;
}
.fakewin .title .dots i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted);
  margin-right: 5px;
}
.fakewin pre {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 1rem 1.2rem;
  font-size: inherit;
  color: var(--fg);
}
.fakewin.term .prompt { color: var(--fg-faint); }
.fakewin.term .dir { color: var(--blue); }
.fakewin.term .ok { color: var(--green); }
.fakewin.term .out { color: var(--fg-dim); }
.fakewin.term .hl { color: var(--accent); }
.fakewin.term .cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.1em;
  background: var(--fg);
  vertical-align: -0.2em;
  animation: blink 1.1s steps(1) infinite;
}

/* The welcome note, rendered with the app's editor rules. */
.welcome {
  padding: 2rem 2.4rem 2.4rem;
  line-height: 1.65;
  user-select: text;
  max-height: 720px;
  overflow: auto;
}
.welcome h1 {
  font-size: 1.7em;
  margin: 0 0 0.6em;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.welcome h2 {
  font-size: 1.25em;
  margin: 1.2em 0 0.35em;
  letter-spacing: -0.01em;
}
.welcome p {
  margin: 0.3em 0;
}
.welcome ul, .welcome ol {
  margin: 0.3em 0;
  padding-left: 1.5em;
}
.welcome li {
  margin: 0.15em 0;
}
.welcome li::marker {
  color: var(--fg-dim);
}
.welcome ul.tasks {
  list-style: none;
  padding-left: 0.2em;
}
.welcome ul.tasks li {
  display: flex;
  align-items: flex-start;
  gap: 0.6em;
}
.welcome ul.tasks input {
  appearance: none;
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  margin: 0.4em 0 0;
  border: 1.5px solid var(--fg-faint);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  position: relative;
  transition: background 0.1s, border-color 0.1s;
}
.welcome ul.tasks input:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.welcome ul.tasks input:checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid var(--bg);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.welcome ul.tasks li:has(input:checked) span {
  color: var(--fg-faint);
  text-decoration: line-through;
}
.welcome hr {
  border: 0;
  border-top: 1px solid var(--muted);
  margin: 1.4em 0;
}
.welcome strong {
  color: var(--fg-bright);
}
.welcome pre {
  background: var(--bg-light);
  border: 0;
  border-radius: 6px;
  padding: 0.8em 1em;
  margin: 0.6em 0;
  font-size: 0.9em;
}
.welcome .foot {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 1rem;
  border-top: 1px solid var(--bg-light);
  color: var(--fg-faint);
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
}
.welcome .foot kbd {
  border: 0;
  background: var(--bg-light);
  color: var(--fg-dim);
  border-radius: 3px;
  padding: 0 0.4em;
  line-height: 1.6;
}
.raw pre {
  max-height: 720px;
  overflow: auto;
  color: var(--fg-dim);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.raw .md-h { color: var(--fg-bright); font-weight: 600; }
.raw .md-b { color: var(--fg-bright); }
.raw .md-c { color: var(--green); }
.raw .md-m { color: var(--accent); }

.shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.6rem;
  margin-top: 1.4rem;
  color: var(--fg-dim);
  font-size: 0.9rem;
}
.shortcuts code {
  margin-right: 0.35em;
}

/* Keys table */
table.keys {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
table.keys th {
  text-align: left;
  color: var(--fg-faint);
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0 0.6rem 0.6rem 0;
  border-bottom: 1px solid var(--bg-light);
}
table.keys td {
  padding: 0.5rem 0.6rem 0.5rem 0;
  border-bottom: 1px solid var(--bg-light);
  vertical-align: top;
}
table.keys td:first-child {
  white-space: nowrap;
  width: 1%;
}
table.keys td .where {
  color: var(--fg-faint);
  font-size: 0.8rem;
}
table.keys kbd + kbd {
  margin-left: 0.25rem;
}

/* Install */
.steps-list {
  counter-reset: s;
  display: grid;
  gap: 1.5rem;
}
.steps-list > div {
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  gap: 1rem;
  align-items: start;
}
.steps-list > div::before {
  counter-increment: s;
  content: counter(s);
  width: 2.2rem;
  height: 2.2rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--bg-light);
  color: var(--fg-bright);
  font-weight: 600;
  font-size: 0.9rem;
}
.steps-list h3 {
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
}
.steps-list p {
  color: var(--fg-dim);
  font-size: 0.92rem;
}
.steps-list pre {
  margin: 0.6rem 0 0;
}
.cmd {
  position: relative;
}
.cmd button {
  position: absolute;
  right: 0.6rem;
  top: 0.6rem;
  font: inherit;
  font-size: 0.75rem;
  color: var(--fg-dim);
  background: var(--bg-light);
  border: 1px solid var(--muted);
  border-radius: 5px;
  padding: 0.15rem 0.6rem;
  cursor: pointer;
}
.cmd button:hover {
  color: var(--fg-bright);
}
.hero .cmd {
  margin: 1.6rem 0 0.9rem;
  max-width: 34em;
}
.cmd pre {
  padding-right: 4.5rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.hero .cmd pre {
  font-size: 0.84rem;
  padding-right: 1.2rem;
  padding-bottom: 2.6rem;
}
.hero .cmd button {
  top: auto;
  bottom: 0.6rem;
}
.hero .meta {
  color: var(--fg-faint);
  font-size: 0.82rem;
}
.hero .meta code {
  white-space: nowrap;
}
.hero .meta a {
  color: var(--fg-dim);
}

footer {
  border-top: 1px solid var(--bg-light);
  padding: 2.5rem 0 3rem;
  color: var(--fg-faint);
  font-size: 0.85rem;
}
footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
}
footer a {
  color: var(--fg-dim);
}

/* ---------- responsive: stage on top, steps beneath ---------- */

@media (max-width: 900px) {
  .story {
    display: block;
  }
  .stage-wrap {
    position: sticky;
    top: var(--nav-h);
    height: auto;
    padding: 0.75rem 0;
    background: var(--bg);
    z-index: 5;
  }
  .stage {
    width: 100%;
    font-size: clamp(5px, 1.35vw, 9px);
  }
  .stage-wrap .try {
    display: none;
  }
  .try-note {
    display: none;
  }

  .steps {
    padding-bottom: 0;
  }
  .step {
    min-height: 0;
    padding: 2.5rem 0;
    opacity: 1;
  }
  .step.hero {
    min-height: 0;
    padding: 2rem 0 1rem;
  }
}

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