/* Revue's website (server/src/site). Light and dark follow the system.
 *
 * Design tokens (custom properties on :root, light values here, dark ones
 * under prefers-color-scheme: dark). Other stylesheets (docs.css) build on
 * these names, so keep them stable:
 *
 *   --bg, --bg-soft, --card       page, tinted band, raised surface
 *   --fg, --muted, --faint        text: body, secondary, decorative only
 *   --line, --line-strong         borders
 *   --accent, --accent-2, --accent-3   violet, cyan, pink (all AA on --bg)
 *   --accent-fg                   text on a filled accent button
 *   --accent-soft                 tinted accent background (badges, hovers)
 *   --grad, --grad-text           accent gradients: fills, heading text
 *   --glow-1, --glow-2            translucent colours for background glows
 *   --code-bg, --code-fg          inline `code`
 *   --pre-bg, --pre-fg, --pre-line   code blocks (dark in both themes)
 *   --syn-key, --syn-str, --syn-fn, --syn-num, --syn-comment   syntax colours
 *   --add, --del                  diff +/- colours
 *   --dot                         background grid dots
 *   --font-sans, --font-mono
 *   --radius, --radius-sm, --wrap, --header-h
 *   --shadow, --shadow-glow
 *   --ease                        the site's easing curve
 */

:root {
  color-scheme: light dark;
  --bg: #fbfbfd;
  --bg-soft: #f3f3f8;
  --card: #ffffff;
  --fg: #16171d;
  --muted: #545b69;
  --faint: #9aa0ad;
  --line: #e1e3ea;
  --line-strong: #c9ccd6;
  --accent: #6d4aff;
  --accent-2: #0e7490;
  --accent-3: #be185d;
  --accent-fg: #ffffff;
  --accent-soft: #efeaff;
  --grad: linear-gradient(120deg, #6d4aff 0%, #5b3df0 45%, #4338ca 100%);
  --grad-text: linear-gradient(100deg, #16171d 0%, #16171d 28%, #6d4aff 55%, #0e7490 78%, #be185d 100%);
  --glow-1: rgb(109 74 255 / 0.18);
  --glow-2: rgb(14 165 233 / 0.14);
  --code-bg: #f0eef8;
  --code-fg: #8a1f8f;
  --pre-bg: #12131b;
  --pre-fg: #e4e6ee;
  --pre-line: #262837;
  --syn-key: #c084fc;
  --syn-str: #86efac;
  --syn-fn: #67e8f9;
  --syn-num: #fcd34d;
  --syn-comment: #6b7280;
  --add: #15803d;
  --del: #b91c1c;
  --dot: rgb(22 23 29 / 0.08);
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", "Fira Code", Menlo, Consolas,
    "Liberation Mono", monospace;
  --radius: 12px;
  --radius-sm: 8px;
  --wrap: 72rem;
  --header-h: 60px;
  --shadow: 0 1px 2px rgb(16 18 27 / 0.04), 0 8px 24px rgb(16 18 27 / 0.06);
  --shadow-glow: 0 10px 30px -8px rgb(109 74 255 / 0.45);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #08090d;
    --bg-soft: #0e1016;
    --card: #12141c;
    --fg: #e8e9f0;
    --muted: #a2a7b6;
    --faint: #5d6272;
    --line: #22252f;
    --line-strong: #343846;
    --accent: #a78bfa;
    --accent-2: #22d3ee;
    --accent-3: #f472b6;
    --accent-fg: #0b0a14;
    --accent-soft: #1f1a36;
    --grad: linear-gradient(120deg, #b6a0ff 0%, #a78bfa 45%, #818cf8 100%);
    --grad-text: linear-gradient(100deg, #f1f1f6 0%, #f1f1f6 25%, #a78bfa 52%, #22d3ee 76%, #f472b6 100%);
    --glow-1: rgb(139 92 246 / 0.28);
    --glow-2: rgb(34 211 238 / 0.14);
    --code-bg: #1a1c27;
    --code-fg: #f5a8dc;
    --pre-bg: #0c0e15;
    --pre-fg: #e4e6ee;
    --pre-line: #22252f;
    --add: #4ade80;
    --del: #f87171;
    --dot: rgb(232 233 240 / 0.07);
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 10px 30px rgb(0 0 0 / 0.35);
    --shadow-glow: 0 12px 36px -10px rgb(167 139 250 / 0.55);
  }
}

@property --angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
  interpolate-size: allow-keywords;
}

body {
  margin: 0;
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 1px, transparent 1.2px);
  background-size: 24px 24px;
  color: var(--fg);
  font: 17px/1.6 var(--font-sans);
  overflow-wrap: break-word;
  overflow-x: clip;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

::selection {
  background: var(--accent);
  color: var(--accent-fg);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
  transition: color 0.15s, text-decoration-color 0.15s;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

/* Generic content: also what docs pages are made of. */

code,
kbd,
pre,
samp {
  font-family: var(--font-mono);
}

code {
  font-size: 0.86em;
  line-height: 1.4;
  background: var(--code-bg);
  color: var(--code-fg);
  padding: 0.12em 0.4em;
  border-radius: 5px;
  overflow-wrap: anywhere;
}

kbd {
  font-size: 0.82em;
  padding: 0.1em 0.45em;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--card);
  color: var(--fg);
  white-space: nowrap;
}

pre {
  margin: 0 0 1.2em;
  padding: 1rem 1.1rem;
  background: var(--pre-bg);
  color: var(--pre-fg);
  border: 1px solid var(--pre-line);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  line-height: 1.65;
  overflow-x: auto;
  max-width: 100%;
  tab-size: 4;
}

pre code {
  background: none;
  color: inherit;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
  overflow-wrap: normal;
}

/* A terminal: a code block with window dots and drawn prompts. */
pre.term {
  position: relative;
  padding-top: 2.1rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

pre.term code {
  overflow-wrap: anywhere;
}

pre.term::before {
  content: "";
  position: absolute;
  top: 0.75rem;
  left: 1rem;
  width: 44px;
  height: 10px;
  background:
    radial-gradient(circle at 5px 5px, #ff5f57 4px, transparent 4.5px),
    radial-gradient(circle at 22px 5px, #febc2e 4px, transparent 4.5px),
    radial-gradient(circle at 39px 5px, #28c840 4px, transparent 4.5px);
  opacity: 0.85;
}

.line {
  display: block;
  padding-left: 2ch;
  text-indent: -2ch;
}

.ps {
  color: var(--syn-str);
  font-family: var(--font-mono);
  margin-right: 1ch;
  user-select: none;
  -webkit-user-select: none;
}

blockquote {
  margin: 0 0 1.2em;
  padding: 0.8rem 1.1rem;
  border-left: 3px solid var(--accent);
  background: var(--bg-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--muted);
}

blockquote > :last-child {
  margin-bottom: 0;
}

table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 0 0 1.2em;
  font-size: 0.95rem;
}

th,
td {
  text-align: left;
  padding: 0.5rem 0.8rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  border-bottom-color: var(--line-strong);
}

tbody tr {
  transition: background-color 0.15s;
}

tbody tr:hover {
  background: var(--bg-soft);
}

hr {
  border: 0;
  height: 1px;
  margin: 2rem 0;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}

details {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  margin: 0 0 1.2em;
  transition: border-color 0.2s;
}

details[open] {
  border-color: var(--line-strong);
}

summary {
  cursor: pointer;
  list-style: none;
  padding: 0.7rem 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border-radius: inherit;
}

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

summary::before {
  content: "›";
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 1.2em;
  line-height: 1;
  width: 0.7em;
  flex: none;
  transition: rotate 0.2s var(--ease);
}

details[open] > summary::before {
  rotate: 90deg;
}

summary:hover {
  background: var(--bg-soft);
}

details > :not(summary) {
  margin-left: 1rem;
  margin-right: 1rem;
}

details > :last-child:not(summary) {
  margin-bottom: 1rem;
}

@supports selector(::details-content) {
  details::details-content {
    block-size: 0;
    overflow: clip;
    transition:
      block-size 0.25s var(--ease),
      content-visibility 0.25s allow-discrete;
  }

  details[open]::details-content {
    block-size: auto;
  }
}

h1,
h2,
h3,
h4 {
  line-height: 1.2;
  margin: 0 0 0.6em;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.1rem, 5.2vw, 3.4rem);
  letter-spacing: -0.03em;
  font-weight: 750;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2.05rem);
  font-weight: 700;
}

h3 {
  font-size: 1.1rem;
}

p {
  margin: 0 0 1em;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 40rem) {
  .wrap {
    padding: 0 24px;
  }
}

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--card);
  padding: 8px 12px;
  z-index: 100;
}

.skip:focus {
  left: 8px;
}

/* Header: sticks to the top, translucent over what scrolls under it. */

header.site {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  header.site {
    background: color-mix(in srgb, var(--bg) 72%, transparent);
    -webkit-backdrop-filter: saturate(1.6) blur(14px);
    backdrop-filter: saturate(1.6) blur(14px);
  }
}

/* Its border and shadow come in once the page is scrolled. */
@supports (animation-timeline: scroll()) {
  header.site {
    animation: header-scrolled linear both;
    animation-timeline: scroll(root);
    animation-range: 0 64px;
  }
}

@keyframes header-scrolled {
  from {
    border-bottom-color: transparent;
    box-shadow: none;
  }
  to {
    border-bottom-color: var(--line);
    box-shadow: 0 6px 24px -12px rgb(0 0 0 / 0.25);
  }
}

header.site .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 100%;
}

.brand {
  display: flex;
  align-items: center;
  flex: none;
  gap: 10px;
  color: var(--fg);
  text-decoration: none;
}

/* The logo on a small tile with a soft accent glow. */
.brand .logo {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background:
    linear-gradient(var(--card), var(--card)) padding-box,
    var(--grad) border-box;
  border: 1px solid transparent;
  box-shadow: 0 0 0 0 transparent, 0 6px 18px -8px color-mix(in srgb, var(--accent) 70%, transparent);
  transition: box-shadow 0.3s var(--ease), translate 0.3s var(--ease);
}

.brand .logo img {
  display: block;
  transition: rotate 0.4s var(--ease), scale 0.4s var(--ease);
}

.brand .wordmark {
  font-family: var(--font-sans);
  font-weight: 750;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
  background: linear-gradient(100deg, var(--fg) 0%, var(--fg) 50%, var(--accent) 75%, var(--accent-2) 100%);
  background-size: 220% 100%;
  background-position: 0% 50%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transition: background-position 0.6s var(--ease);
}

/* "code review" in small mono, after a thin divider. */
.brand .tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  padding-left: 10px;
  border-left: 1px solid var(--line);
  line-height: 1.2;
}

.brand:hover .logo {
  translate: 0 -1px;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent),
    0 8px 22px -8px color-mix(in srgb, var(--accent) 85%, transparent);
}

.brand:hover .logo img {
  rotate: -8deg;
  scale: 1.06;
}

.brand:hover .wordmark {
  background-position: 100% 50%;
}

header.site nav {
  display: flex;
  gap: 2px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

header.site nav::-webkit-scrollbar {
  display: none;
}

header.site nav a {
  position: relative;
  flex: none;
  color: var(--muted);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  padding: 6px 12px;
  border-radius: 7px;
  white-space: nowrap;
  transition: color 0.15s, background-color 0.15s;
}

header.site nav a:hover {
  color: var(--fg);
  background: var(--accent-soft);
}

header.site nav a[aria-current="page"] {
  color: var(--accent);
}

header.site nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 1px;
  height: 2px;
  border-radius: 2px;
  background: var(--grad);
}

@media (max-width: 40rem) {
  header.site .brand .tag {
    display: none;
  }

  :root {
    --header-h: 54px;
  }

  header.site .wrap {
    gap: 8px;
  }

  header.site nav {
    mask-image: linear-gradient(90deg, #000 85%, transparent);
  }

  header.site nav a {
    font-size: 0.84rem;
    padding: 6px 8px;
  }
}

@media (max-width: 23rem) {
  header.site .brand .wordmark,
  header.site .brand .tag {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

/* Footer */

footer.site {
  position: relative;
  padding: 2.5rem 0 3rem;
  color: var(--muted);
  font-size: 0.9rem;
  background: var(--bg);
}

footer.site::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent-2), transparent);
  opacity: 0.6;
}

footer.site .wrap {
  display: grid;
  gap: 0.6rem;
}

footer.site .brand .logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

footer.site .brand {
  font-size: 0.95rem;
  justify-self: start;
}

footer.site p {
  margin: 0;
  max-width: 44rem;
}

footer.site p:last-child {
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

/* Sections */

main > section {
  position: relative;
  padding: 4rem 0;
}

main > section:nth-of-type(even) {
  background: color-mix(in srgb, var(--bg-soft) 88%, transparent);
  border-block: 1px solid var(--line);
}

/* A section heading reads like a Markdown one. */
main > section > .wrap > h2::before,
main > section .split > div > h2::before {
  content: "## ";
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.8em;
  color: var(--accent);
  opacity: 0.75;
  white-space: pre;
}

main > section.cta > .wrap > h2::before {
  content: none;
}

/* Glows: slow-moving colour behind the hero and page heads. */

.hero,
.page-head,
.cta {
  isolation: isolate;
  overflow: clip;
}

.hero::before,
.page-head::before,
.cta::before {
  content: "";
  position: absolute;
  inset: -30% -10% -10%;
  z-index: -1;
  background:
    radial-gradient(36% 38% at 72% 55%, var(--glow-1), transparent 72%),
    radial-gradient(28% 32% at 16% 62%, var(--glow-2), transparent 72%);
  animation: drift 22s ease-in-out infinite alternate;
  pointer-events: none;
}

.hero {
  padding-top: 3.5rem;
}

.hero-grid {
  display: grid;
  gap: 3rem;
  align-items: center;
}

@media (min-width: 56rem) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  }
}

.hero-text {
  min-width: 0;
}

.hero h1 {
  font-size: clamp(2.3rem, 5.6vw, 3.9rem);
  line-height: 1.06;
}

@supports (background-clip: text) or (-webkit-background-clip: text) {
  .hero h1,
  .page-head h1,
  .cta h2 {
    background: var(--grad-text);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: shimmer 9s ease-in-out infinite alternate;
  }
}

/* The terminal line above the hero heading, typed out once. */
.prompt {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  margin: 0 0 1.4rem;
  padding: 0.4rem 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--fg);
  background: color-mix(in srgb, var(--card) 80%, transparent);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
}

.prompt .typed {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  min-width: 0;
  animation: typing 2s steps(41, end) 0.4s both;
}

.prompt::after {
  content: "";
  flex: none;
  width: 0.55em;
  height: 1.1em;
  margin-left: 3px;
  background: var(--accent);
  border-radius: 1px;
  animation:
    caret 2s steps(41, end) 0.4s both,
    blink 1.1s steps(1) 2.4s infinite;
}

@media (max-width: 30rem) {
  .prompt {
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
  }

  .prompt .typed {
    width: auto;
    white-space: normal;
    word-break: break-all;
    animation: none;
  }

  .prompt::after {
    animation: blink 1.1s steps(1) infinite;
  }
}

.hero-text > * {
  animation: rise 0.7s var(--ease) both;
}

.hero-text > :nth-child(2) {
  animation-delay: 0.08s;
}

.hero-text > :nth-child(3) {
  animation-delay: 0.16s;
}

.hero-text > :nth-child(4) {
  animation-delay: 0.24s;
}

.hero-text > :nth-child(5) {
  animation-delay: 0.32s;
}

.hero-shot {
  max-width: 48rem;
  justify-self: center;
  width: 100%;
  animation: rise 0.9s var(--ease) 0.25s both;
}

/* The hero screenshot: a slowly turning gradient border, glowing. */
.hero-shot .shot {
  position: relative;
}

.hero-shot .shot::before {
  content: "";
  position: absolute;
  inset: 8% 6% 14%;
  z-index: -1;
  background: var(--grad);
  filter: blur(48px);
  opacity: 0.45;
}

.hero-shot picture {
  display: block;
  padding: 1.5px;
  border-radius: calc(var(--radius) + 2px);
  background: conic-gradient(
    from var(--angle),
    var(--accent),
    var(--accent-2),
    var(--accent-3),
    var(--accent)
  );
  animation: spin 8s linear infinite;
}

.hero-shot picture img {
  border: 0;
  border-radius: var(--radius);
}

.lead {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 40rem;
}

.lead strong {
  color: var(--fg);
}

.intro {
  max-width: 44rem;
  color: var(--muted);
}

.small {
  font-size: 0.88rem;
  color: var(--muted);
  font-family: var(--font-mono);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 0.8rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 14px;
  margin: 1.75rem 0 1.25rem;
}

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--grad);
  background-size: 160% 100%;
  background-position: 0% 50%;
  color: var(--accent-fg);
  text-decoration: none;
  font-weight: 650;
  padding: 0.72rem 1.3rem;
  border-radius: 10px;
  max-width: 100%;
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.18) inset, 0 4px 14px -6px rgb(109 74 255 / 0.5);
  transition:
    translate 0.2s var(--ease),
    box-shadow 0.2s var(--ease),
    background-position 0.4s var(--ease);
}

.button::after {
  content: "→";
  font-family: var(--font-mono);
  transition: translate 0.2s var(--ease);
}

.button:hover {
  translate: 0 -2px;
  background-position: 100% 50%;
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.18) inset, var(--shadow-glow);
  text-decoration: none;
}

.button:hover::after {
  translate: 3px 0;
}

.button:active {
  translate: 0 0;
}

.quiet {
  font-weight: 500;
}

.actions .quiet {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.68rem 1.1rem;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--fg);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  background: color-mix(in srgb, var(--card) 70%, transparent);
  transition:
    border-color 0.2s,
    translate 0.2s var(--ease),
    color 0.2s;
}

.actions .quiet::before {
  content: "</>";
  color: var(--accent);
}

.actions .quiet:hover {
  border-color: var(--accent);
  translate: 0 -2px;
}

.split {
  display: grid;
  gap: 2rem;
}

@media (min-width: 48rem) {
  .split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 3rem;
  }
}

.split > * {
  min-width: 0;
}

/* Cards, numbered like lines of code */

.cards {
  list-style: none;
  margin: 1.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  counter-reset: card;
}

.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.3rem 1.25rem;
  min-width: 0;
  box-shadow: var(--shadow);
  transition:
    translate 0.25s var(--ease),
    box-shadow 0.25s var(--ease),
    border-color 0.25s;
}

.card::before {
  counter-increment: card;
  content: "// " counter(card, decimal-leading-zero);
  display: block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--faint);
  margin-bottom: 0.45rem;
  transition: color 0.25s;
}

/* A gradient border that fades in on hover. */
.card::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2) 55%, var(--accent-3));
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box exclude,
    linear-gradient(#000 0 0);
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}

.card:hover {
  translate: 0 -3px;
  box-shadow: var(--shadow), var(--shadow-glow);
}

.card:hover::before {
  color: var(--accent);
}

.card:hover::after {
  opacity: 1;
}

.card h3 {
  margin-bottom: 0.45em;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
}

/* Lists with diff-style + markers */

.ticks {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ticks li {
  position: relative;
  padding-left: 1.6rem;
  margin-bottom: 0.7em;
}

.ticks li::before {
  content: "+";
  position: absolute;
  left: 0.2rem;
  top: 0;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--add);
}

.ticks.wide {
  max-width: 48rem;
}

/* Screenshots */

.shot {
  margin: 0;
  min-width: 0;
}

.shot picture,
.shot img {
  border-radius: var(--radius);
}

.shot img {
  border: 1px solid var(--line);
  box-shadow: 0 18px 50px -20px rgb(0 0 0 / 0.35);
}

.shot figcaption {
  margin-top: 0.75rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.gallery {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
}

.gallery .shot picture,
.gallery .shot-missing {
  display: block;
  transition:
    translate 0.3s var(--ease),
    box-shadow 0.3s var(--ease);
}

.gallery .shot:hover picture,
.gallery .shot:hover .shot-missing {
  translate: 0 -4px;
}

.shot-missing {
  aspect-ratio: 16 / 10;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 16px;
  text-align: center;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background:
    repeating-linear-gradient(-45deg, transparent 0 10px, var(--dot) 10px 11px),
    var(--card);
}

.shot-missing .what {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  opacity: 0.85;
}

/* A screenshot opens big in the viewer. */
.shot-open {
  display: block;
  position: relative;
  border-radius: var(--radius);
  cursor: zoom-in;
}

.shot-open::after {
  content: "⤢";
  content: "⤢" / "";
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgb(8 9 13 / 0.66);
  color: #fff;
  font-size: 1.05rem;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.2s var(--ease);
  pointer-events: none;
}

.shot-open:hover::after,
.shot-open:focus-visible::after {
  opacity: 1;
}

/* The gallery viewer (pages.rs, `viewers`): one dialog per screenshot, shown
 * while the address names it (:target), so it works without the script.
 * gallery.js adds keys, swipe, focus and the zoom from the thumbnail. Dark
 * over either theme, so its colours are its own. */

html:has(.viewer:target) {
  overflow: hidden;
}

/* The scrollbar's room stays when the viewer hides it, so the page under
 * it doesn't shift sideways. */
html {
  scrollbar-gutter: stable;
}

.viewer {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
  padding: 60px 72px 24px;
  background: rgb(6 7 10 / 0.78);
  color: #e8e9f0;
  overscroll-behavior: contain;
}

@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .viewer {
    background: rgb(6 7 10 / 0.62);
    -webkit-backdrop-filter: blur(12px) saturate(0.8);
    backdrop-filter: blur(12px) saturate(0.8);
  }
}

.viewer:target {
  display: grid;
}

.viewer:focus {
  outline: none;
}

/* A click outside the image closes it. */
.viewer-backdrop {
  position: absolute;
  inset: 0;
  cursor: zoom-out;
}

.viewer-figure {
  position: relative;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 100%;
  max-height: 100%;
  min-width: 0;
  min-height: 0;
}

.viewer-figure img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(1600px, 100vw - 144px);
  max-height: calc(100vh - 150px);
  max-height: calc(100dvh - 150px);
  object-fit: contain;
  border-radius: var(--radius);
  border: 1px solid rgb(255 255 255 / 0.12);
  box-shadow: 0 30px 80px -20px rgb(0 0 0 / 0.7);
}

.viewer-figure figcaption {
  max-width: 48rem;
  text-align: center;
  font-size: 0.92rem;
  color: #c5c8d3;
}

.viewer-count {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #8d93a3;
  margin-right: 0.35em;
}

/* The visitor's theme first; the toggle shows the other one. */
.viewer .v-dark,
.viewer-theme .when-dark,
.viewer:has(.viewer-flip:checked) .v-light {
  display: none;
}

.viewer:has(.viewer-flip:checked) .v-dark {
  display: block;
}

@media (prefers-color-scheme: dark) {
  .viewer .v-dark {
    display: block;
  }

  .viewer .v-light,
  .viewer-theme .when-light,
  .viewer:has(.viewer-flip:checked) .v-dark {
    display: none;
  }

  .viewer:has(.viewer-flip:checked) .v-light {
    display: block;
  }

  .viewer-theme .when-dark {
    display: inline;
  }
}

.viewer-close,
.viewer-prev,
.viewer-next,
.viewer-theme {
  position: absolute;
  z-index: 1;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgb(255 255 255 / 0.1);
  border: 1px solid rgb(255 255 255 / 0.16);
  text-decoration: none;
  transition: background 0.15s;
}

.viewer-close:hover,
.viewer-prev:hover,
.viewer-next:hover,
.viewer-theme:hover {
  background: rgb(255 255 255 / 0.2);
}

.viewer :focus-visible,
.viewer-theme:has(:focus-visible) {
  outline: 2px solid #a78bfa;
  outline-offset: 2px;
}

.viewer-close {
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.6rem;
  line-height: 1;
}

.viewer-prev,
.viewer-next {
  top: 50%;
  width: 48px;
  height: 48px;
  margin-top: -24px;
  border-radius: 50%;
  font-size: 2rem;
  line-height: 1;
}

.viewer-prev {
  left: 12px;
}

.viewer-next {
  right: 12px;
}

.viewer-theme {
  top: 12px;
  left: 12px;
  grid-auto-flow: column;
  gap: 8px;
  height: 40px;
  padding: 0 14px 0 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
}

.viewer-flip {
  margin: 0;
  accent-color: #a78bfa;
}

.viewer-theme :focus-visible {
  outline: none;
}

/* Phones: the arrows under the image, the image the screen's width. */
@media (max-width: 40rem) {
  .viewer {
    padding: 60px 8px 76px;
  }

  .viewer-prev,
  .viewer-next {
    top: auto;
    bottom: 14px;
    margin-top: 0;
  }

  .viewer-prev {
    left: calc(50% - 60px);
  }

  .viewer-next {
    right: calc(50% - 60px);
  }

  .viewer-figure img {
    max-height: calc(100vh - 200px);
    max-height: calc(100dvh - 200px);
    max-width: calc(100vw - 16px);
  }
}

/* It fades in, the image growing a little; with the script, view
 * transitions do it instead (the zoom from the thumbnail, a crossfade
 * between shots), and this would run again on each change. */
@media (prefers-reduced-motion: no-preference) {
  .viewer:target {
    animation: viewer-in 0.25s var(--ease);
  }

  .viewer:target .viewer-figure {
    animation: viewer-zoom 0.35s var(--ease);
  }

  .viewer-vt .viewer:target,
  .viewer-vt .viewer:target .viewer-figure {
    animation: none;
  }

  ::view-transition-group(viewer-shot) {
    animation-duration: 0.38s;
    animation-timing-function: var(--ease);
  }

  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 0.22s;
  }
}

@keyframes viewer-in {
  from {
    opacity: 0;
  }
}

@keyframes viewer-zoom {
  from {
    opacity: 0;
    scale: 0.92;
  }
}

.cta {
  text-align: center;
}

.cta h2 {
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: -0.03em;
}

.cta .actions {
  justify-content: center;
}

/* Downloads */

.page-head {
  padding-bottom: 2.5rem !important;
}

.page-head .lead {
  margin-bottom: 0;
}

time {
  white-space: nowrap;
}

/* Inline icons (icons.rs) take the text's color and size. */
.icon {
  width: 1.15em;
  height: 1.15em;
  flex: none;
}

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

/* One card: the systems as tabs (pages.rs, `downloads`), hidden radio
   buttons picking the panel shown, then that system's panel. */
.get {
  position: relative;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background:
    linear-gradient(var(--card), var(--card)) padding-box,
    conic-gradient(from var(--angle), var(--accent), var(--accent-2), var(--accent-3), var(--accent))
      border-box;
  box-shadow: var(--shadow), var(--shadow-glow);
  animation: spin 10s linear infinite;
  overflow: hidden;
}

.get > .os-pick {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.os-tabs {
  display: flex;
  margin: 0;
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
}

.os-tabs label {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 0.75rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition:
    color 0.15s,
    background 0.15s,
    border-color 0.15s;
}

.os-tabs label .icon {
  width: 1.35em;
  height: 1.35em;
}

.os-tabs label:hover {
  color: var(--fg);
}

/* The visitor's system: a pulsing dot. */
.os-tabs .yours {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--add);
  animation: pulse 2s ease-out infinite;
}

.get > .os-pick:nth-of-type(1):checked ~ .os-tabs label:nth-child(1),
.get > .os-pick:nth-of-type(2):checked ~ .os-tabs label:nth-child(2),
.get > .os-pick:nth-of-type(3):checked ~ .os-tabs label:nth-child(3) {
  color: var(--accent);
  background: var(--card);
  border-bottom-color: var(--accent);
}

.get > .os-pick:nth-of-type(1):focus-visible ~ .os-tabs label:nth-child(1),
.get > .os-pick:nth-of-type(2):focus-visible ~ .os-tabs label:nth-child(2),
.get > .os-pick:nth-of-type(3):focus-visible ~ .os-tabs label:nth-child(3) {
  outline: 2px solid var(--accent);
  outline-offset: -4px;
}

.os {
  display: none;
  padding: 1.5rem;
  scroll-margin-top: calc(var(--header-h) + 1rem);
}

.get > .os-pick:nth-of-type(1):checked ~ .os:nth-of-type(1),
.get > .os-pick:nth-of-type(2):checked ~ .os:nth-of-type(2),
.get > .os-pick:nth-of-type(3):checked ~ .os:nth-of-type(3) {
  display: block;
}

/* The button and its package manager, side by side when there's room. */
.os-main {
  display: grid;
  gap: 1.5rem;
  align-items: start;
}

@media (min-width: 48rem) {
  .os-main {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 2rem;
  }
}

.os-main > * {
  min-width: 0;
}

.get-button {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.95rem 1.25rem;
  border-radius: var(--radius-sm);
  background: var(--grad);
  background-size: 160% 100%;
  color: var(--accent-fg);
  text-decoration: none;
  box-shadow: var(--shadow-glow);
  transition:
    translate 0.2s var(--ease),
    background-position 0.4s var(--ease);
}

.get-button:hover {
  translate: 0 -2px;
  background-position: 100% 50%;
  text-decoration: none;
}

.get-button .icon {
  width: 1.6rem;
  height: 1.6rem;
}

/* Its arrow dips into the tray and springs back; the tray stays. */
.get-button .icon path:last-child {
  transform-box: fill-box;
}

.get-button:hover .icon path:last-child {
  animation: dip 0.5s var(--ease);
}

.get-text {
  display: grid;
  line-height: 1.3;
}

.get-title {
  font-weight: 700;
  font-size: 1.1rem;
}

.get-meta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  opacity: 0.85;
}

.os .req {
  margin: 0.6rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
}

.cli-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.6rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.os p {
  font-size: 0.94rem;
}

.os .note {
  font-size: 0.85rem;
  color: var(--muted);
}

.os pre {
  margin: 0;
  font-size: 0.8rem;
}

.cli-intro {
  margin: 0 0 0.5rem;
  color: var(--muted);
}

/* Folded parts, for those who want them: the first launch, every file
   (the site's details, a little smaller). */
.more {
  margin: 0.75rem 0 0;
}

.os-main + .more {
  margin-top: 1.5rem;
}

.more summary {
  font-size: 0.92rem;
}

.more summary .icon {
  color: var(--muted);
}

.more-body {
  font-size: 0.94rem;
  color: var(--muted);
}

.more-body > p,
.more-body .steps {
  margin: 0 0 0.75rem;
}

/* Every file of the system: name, what it is, size, checksum. */
.file-list {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.file-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: baseline;
  gap: 0.25rem 1rem;
  padding: 0.55rem 0.85rem;
}

.file-list li + li {
  border-top: 1px solid var(--line);
}

.file-name {
  font-family: var(--font-mono);
  overflow-wrap: anywhere;
}

.file-size,
.file-sum {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  white-space: nowrap;
}

.file-sum {
  color: var(--muted);
}

.file-sum:hover {
  color: var(--fg);
}

@media (max-width: 36rem) {
  .os {
    padding: 1.1rem 1rem;
  }

  .os-tabs label {
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.7rem 0.4rem;
    font-size: 0.85rem;
  }

  .file-list li {
    grid-template-columns: auto auto 1fr;
  }

  .file-name {
    grid-column: 1 / -1;
  }
}

.page-foot {
  margin: 1.5rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

/* A system's ways to install, as tabs (pages.rs, `methods`): radio
   buttons, hidden, pick the panel shown. Up to six. */
.methods > .method-pick {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.methods .method-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 0.75rem;
  padding: 4px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.method-tabs label {
  flex: 1 1 auto;
  text-align: center;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 0.15s,
    color 0.15s;
}

.method-tabs label:hover {
  color: var(--fg);
}

.methods > input:nth-of-type(1):checked ~ .method-tabs label:nth-child(1),
.methods > input:nth-of-type(2):checked ~ .method-tabs label:nth-child(2),
.methods > input:nth-of-type(3):checked ~ .method-tabs label:nth-child(3),
.methods > input:nth-of-type(4):checked ~ .method-tabs label:nth-child(4),
.methods > input:nth-of-type(5):checked ~ .method-tabs label:nth-child(5),
.methods > input:nth-of-type(6):checked ~ .method-tabs label:nth-child(6) {
  background: var(--card);
  color: var(--accent);
  box-shadow: 0 1px 3px color-mix(in srgb, var(--fg) 14%, transparent);
}

.methods > input:nth-of-type(1):focus-visible ~ .method-tabs label:nth-child(1),
.methods > input:nth-of-type(2):focus-visible ~ .method-tabs label:nth-child(2),
.methods > input:nth-of-type(3):focus-visible ~ .method-tabs label:nth-child(3),
.methods > input:nth-of-type(4):focus-visible ~ .method-tabs label:nth-child(4),
.methods > input:nth-of-type(5):focus-visible ~ .method-tabs label:nth-child(5),
.methods > input:nth-of-type(6):focus-visible ~ .method-tabs label:nth-child(6) {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.method {
  display: none;
}

.methods > input:nth-of-type(1):checked ~ .method:nth-of-type(1),
.methods > input:nth-of-type(2):checked ~ .method:nth-of-type(2),
.methods > input:nth-of-type(3):checked ~ .method:nth-of-type(3),
.methods > input:nth-of-type(4):checked ~ .method:nth-of-type(4),
.methods > input:nth-of-type(5):checked ~ .method:nth-of-type(5),
.methods > input:nth-of-type(6):checked ~ .method:nth-of-type(6) {
  display: block;
}

/* A single way has no tabs: always shown. */
.method:only-of-type {
  display: block;
}

.method > :last-child {
  margin-bottom: 0;
}

/* A terminal block with its Copy button in the title bar. */
.copyable {
  position: relative;
  margin: 0 0 0.75rem;
}

/* Long commands wrap under themselves, past the prompt. */
.copyable pre.term .line {
  padding-left: 2ch;
  text-indent: -2ch;
}

button.copy {
  position: absolute;
  top: 0.4rem;
  right: 0.5rem;
  font: 600 0.72rem var(--font-mono);
  color: var(--pre-fg);
  background: color-mix(in srgb, var(--pre-fg) 10%, transparent);
  border: 1px solid var(--pre-line);
  border-radius: 6px;
  padding: 0.2rem 0.6rem;
  cursor: pointer;
  transition: background 0.15s;
}

button.copy:hover {
  background: color-mix(in srgb, var(--pre-fg) 20%, transparent);
}

button.copy:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button.copy.done {
  color: var(--add);
}

.steps {
  margin: 0 0 0.75rem;
}

/* Every file of the system: name, what it is, size, checksum. */
.file-list {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.file-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: baseline;
  gap: 0.25rem 1rem;
  padding: 0.55rem 0.85rem;
}

.file-list li + li {
  border-top: 1px solid var(--line);
}

.file-name {
  font-family: var(--font-mono);
  overflow-wrap: anywhere;
}

.file-size,
.file-sum {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  white-space: nowrap;
}

.file-sum {
  color: var(--muted);
}

.file-sum:hover {
  color: var(--fg);
}

@media (max-width: 36rem) {
  .os {
    padding: 1.1rem 1rem;
  }

  .os-tabs label {
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.7rem 0.4rem;
    font-size: 0.85rem;
  }

  .file-list li {
    grid-template-columns: auto auto 1fr;
  }

  .file-name {
    grid-column: 1 / -1;
  }
}

.page-foot {
  margin: 1.5rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

/* A system's ways to install, as tabs (pages.rs, `methods`): radio
   buttons, hidden, pick the panel shown. Up to six. */
.methods > .method-pick {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.methods .method-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 0.75rem;
  padding: 4px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.method-tabs label {
  flex: 1 1 auto;
  text-align: center;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 0.15s,
    color 0.15s;
}

.method-tabs label:hover {
  color: var(--fg);
}

.methods > input:nth-of-type(1):checked ~ .method-tabs label:nth-child(1),
.methods > input:nth-of-type(2):checked ~ .method-tabs label:nth-child(2),
.methods > input:nth-of-type(3):checked ~ .method-tabs label:nth-child(3),
.methods > input:nth-of-type(4):checked ~ .method-tabs label:nth-child(4),
.methods > input:nth-of-type(5):checked ~ .method-tabs label:nth-child(5),
.methods > input:nth-of-type(6):checked ~ .method-tabs label:nth-child(6) {
  background: var(--card);
  color: var(--accent);
  box-shadow: 0 1px 3px color-mix(in srgb, var(--fg) 14%, transparent);
}

.methods > input:nth-of-type(1):focus-visible ~ .method-tabs label:nth-child(1),
.methods > input:nth-of-type(2):focus-visible ~ .method-tabs label:nth-child(2),
.methods > input:nth-of-type(3):focus-visible ~ .method-tabs label:nth-child(3),
.methods > input:nth-of-type(4):focus-visible ~ .method-tabs label:nth-child(4),
.methods > input:nth-of-type(5):focus-visible ~ .method-tabs label:nth-child(5),
.methods > input:nth-of-type(6):focus-visible ~ .method-tabs label:nth-child(6) {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.method {
  display: none;
}

.methods > input:nth-of-type(1):checked ~ .method:nth-of-type(1),
.methods > input:nth-of-type(2):checked ~ .method:nth-of-type(2),
.methods > input:nth-of-type(3):checked ~ .method:nth-of-type(3),
.methods > input:nth-of-type(4):checked ~ .method:nth-of-type(4),
.methods > input:nth-of-type(5):checked ~ .method:nth-of-type(5),
.methods > input:nth-of-type(6):checked ~ .method:nth-of-type(6) {
  display: block;
}

.method > :last-child {
  margin-bottom: 0;
}

/* A terminal block with its Copy button in the title bar. */
.copyable {
  position: relative;
  margin: 0 0 0.75rem;
}

/* Long commands wrap under themselves, past the prompt. */
.copyable pre.term .line {
  padding-left: 2ch;
  text-indent: -2ch;
}

button.copy {
  position: absolute;
  top: 0.4rem;
  right: 0.5rem;
  font: 600 0.72rem var(--font-mono);
  color: var(--pre-fg);
  background: color-mix(in srgb, var(--pre-fg) 10%, transparent);
  border: 1px solid var(--pre-line);
  border-radius: 6px;
  padding: 0.2rem 0.6rem;
  cursor: pointer;
  transition: background 0.15s;
}

button.copy:hover {
  background: color-mix(in srgb, var(--pre-fg) 20%, transparent);
}

button.copy:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button.copy.done {
  color: var(--add);
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
}

.steps li {
  position: relative;
  padding-left: 2rem;
  margin-bottom: 0.55rem;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.1em;
  width: 1.4rem;
  height: 1.4rem;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
}

.steps strong {
  color: var(--fg);
}

.notice {
  border: 1px solid var(--line);
  border-left: 3px solid var(--syn-num);
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
}

.notice p {
  margin: 0;
}

/* "Vibe coded": said plainly, like a code comment. */
.disclaimer {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  border-left: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  padding: 0.15rem 0 0.15rem 0.75rem;
  max-width: 44rem;
}

.disclaimer::before {
  content: "// ";
  color: var(--faint);
}

/* Motion */

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* Typed by uncovering the text, the caret moving along (41 characters). */
@keyframes typing {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0);
  }
}

@keyframes caret {
  from {
    translate: calc(-41ch - 3px) 0;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    translate: 0 16px;
  }
}

@keyframes reveal {
  from {
    opacity: 0;
    translate: 0 28px;
  }
}

@keyframes spin {
  to {
    --angle: 360deg;
  }
}

@keyframes shimmer {
  from {
    background-position: 0% 50%;
  }
  to {
    background-position: 100% 50%;
  }
}

@keyframes drift {
  from {
    transform: translate3d(-3%, -2%, 0) rotate(0deg);
  }
  to {
    transform: translate3d(4%, 3%, 0) rotate(8deg);
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--add) 60%, transparent);
  }
  70%,
  100% {
    box-shadow: 0 0 0 7px transparent;
  }
}

@keyframes dip {
  0%,
  100% {
    translate: 0 0;
  }
  45% {
    translate: 0 18%;
  }
  70% {
    translate: 0 -6%;
  }
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  /* Sections and cards slide in as they scroll into view. */
  @supports (animation-timeline: view()) {
    main > section:not(.hero, .page-head) > .wrap > *,
    .cards > .card,
    .gallery > .shot {
      animation: reveal linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 60%;
    }

    .page-body .wrap > .get {
      animation:
        reveal linear both,
        spin 10s linear infinite;
      animation-timeline: view(), auto;
      animation-range: entry 0% entry 60%, normal;
    }
  }
}

/* Downloads page: its head comes in on load too. */
.page-head .wrap > * {
  animation: rise 0.6s var(--ease) both;
}

.page-head .wrap > :nth-child(2) {
  animation-delay: 0.06s;
}

.page-head .wrap > :nth-child(3) {
  animation-delay: 0.12s;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}

/* Home: "Browse the code, then open it in your own tools" */

.spotlight .split {
  align-items: center;
}

.eyebrow {
  margin: 0 0 0.4rem;
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.spotlight .ticks li {
  margin-bottom: 0.8em;
}

/* Its screenshots, one under another beside the text. */
.spotlight .split:has(> .shot-stack) {
  align-items: start;
}

.shot-stack {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}


/* Home: "In your editor", its other screenshots under the text */

.spotlight .editor-shots {
  margin-top: 2.5rem;
}

/* "Coming soon": an editor a companion is planned for (pages.rs,
   SOON_EDITORS), muted beside the ones that work. */
.soon {
  display: inline-block;
  font: 600 0.7rem var(--font-mono);
  letter-spacing: 0.02em;
  color: var(--muted);
  background: var(--bg-soft);
  border: 1px dashed var(--line-strong);
  border-radius: 999px;
  padding: 0.05rem 0.55rem;
  vertical-align: 0.1em;
  white-space: nowrap;
}

.ticks li.later {
  color: var(--muted);
}

.ticks li.later::before {
  content: "~";
  color: var(--faint);
}
