:root {
  color-scheme: light dark;
  --bg: light-dark(#f3f4f7, #0b0c11);
  --raise: light-dark(#fff, #12141b);
  --ink: light-dark(#15171e, #e8e9ee);
  --soft: light-dark(#3b3f4b, #c3c6d0);
  --muted: light-dark(#6a6f7d, #8a8fa0);
  --line: light-dark(#e0e2e8, #22252f);
  --accent: light-dark(#b45309, #fcd34d);
  --term: #14161f;
  --bar: #1b1e29;
  --shadow: 0 0 0 1px light-dark(#15171e14, #ffffff0a), 0 2px 4px light-dark(#15171e0f, #0000), 0 24px 48px -24px light-dark(#15171e4d, #000);
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --serif: ui-serif, "New York", Georgia, serif;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
main > section, footer { width: min(1440px, 100% - 48px); margin-inline: auto; }
a { color: inherit; }
h1, h2, h3 { letter-spacing: -.03em; line-height: 1.08; }
h2 { font-size: clamp(26px, 2.6vw, 34px); margin: 0 0 16px; }
code, kbd, pre, small, figcaption, .eyebrow, .brand, .cue { font-family: var(--mono); }
code { font-size: .88em; padding: .1em .35em; border-radius: 4px; background: var(--line); }
kbd { font-size: .82em; padding: .15em .4em; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; white-space: nowrap; }
.eyebrow { font-size: 12.5px; color: var(--muted); margin: 0 0 20px; }
small { display: block; font-size: 13px; margin-bottom: 18px; }
.brand b, small, .deep > .eyebrow { color: var(--accent); }

header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
  padding-inline: max(24px, (100% - 1440px) / 2);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; text-decoration: none; }
nav { display: flex; align-items: center; gap: 28px; font-size: 15px; }
nav a { text-decoration: none; color: var(--muted); }
nav a:hover, nav a:last-of-type { color: var(--ink); }
.star { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink) !important; font-size: 14px; }
.star svg { color: var(--accent); }
.star:hover { border-color: var(--muted); }
.star .count { margin-left: 2px; padding-left: 8px; border-left: 1px solid var(--line); color: var(--muted); font-variant-numeric: tabular-nums; }
.theme { display: grid; place-items: center; width: 30px; height: 30px; margin-left: -8px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.theme:hover { color: var(--ink); border-color: var(--muted); }

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(320px, 440px) 1fr;
  gap: 64px;
  align-items: center;
  min-height: calc(100svh - 60px);
  padding: 48px 0 88px;
}
h1 { font-size: clamp(40px, 3.9vw, 58px); line-height: .98; letter-spacing: -.045em; margin: 0; }
h1 span { display: block; color: var(--muted); margin-top: .06em; }
h1 em { font: italic 400 1.14em/1 var(--serif); letter-spacing: -.01em; color: var(--accent); }
.lede { color: var(--soft); margin: 24px 0 0; }
.cta { display: flex; gap: 10px; margin: 28px 0 0; }
.btn { padding: 10px 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--raise); font-weight: 500; font-size: 15px; text-decoration: none; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.facts { list-style: none; margin: 32px 0 0; padding: 10px 0 0; border-top: 1px solid var(--line); font-size: 14.5px; color: var(--muted); }
.facts li { margin-top: 8px; padding-left: 18px; background: linear-gradient(var(--accent) 0 0) 0 .6em / 6px 6px no-repeat; }
.facts b { color: var(--ink); }
.cue { position: absolute; bottom: 24px; left: 50%; translate: -50%; font-size: 12.5px; color: var(--muted); text-decoration: none; }
.cue i { display: inline-grid; place-items: center; width: 26px; height: 26px; margin-left: 8px; border: 1px solid var(--line); border-radius: 50%; font-style: normal; animation: nudge 2.4s infinite; }
@keyframes nudge { 30% { translate: 0 4px; } 60% { translate: 0; } }

.term { margin: 0; min-width: 0; border-radius: 12px; overflow: hidden; background: var(--term); box-shadow: var(--shadow); }
.term figcaption { position: relative; display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 8px; font-size: 11.5px; color: #7c8394; white-space: nowrap; background: var(--bar); }
.term figcaption > span:first-of-type { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.term figcaption button, .pager label { display: inline-grid; place-items: center; flex: none; min-width: 26px; height: 24px; padding: 0 6px; border: 0; border-radius: 6px; background: none; color: #c9cdd8; font: 13px/1 var(--mono); cursor: pointer; }
.term figcaption button:hover, .pager label:hover { background: #ffffff14; color: #fff; }
.pp { font-size: 10px !important; }
.time { flex: none; color: #9aa0b0; font-variant-numeric: tabular-nums; }
.pager { display: flex; align-items: center; gap: 2px; color: #9aa0b0; }
.seek { position: absolute; inset: auto 0 -4px; height: 9px; z-index: 1; cursor: pointer; }
.seek::before, .seek i { content: ""; position: absolute; left: 0; top: 4px; height: 1px; transition: height .15s, top .15s; }
.seek::before { right: 0; background: #262a38; }
.seek i { width: 0; background: var(--accent); }
.seek:hover::before, .seek:hover i { height: 4px; top: 2px; }

#features { padding: 48px 0 24px; }
.row { display: grid; grid-template-columns: minmax(260px, 360px) 1fr; gap: 64px; align-items: center; padding: 64px 0; }
.row + .row { border-top: 1px solid var(--line); }
.row .term { width: 100%; max-width: 920px; justify-self: end; }
.row:nth-child(even) { grid-template-columns: 1fr minmax(260px, 360px); }
.row:nth-child(even) > div { order: 2; }
.row:nth-child(even) .term { justify-self: start; }
.row p { margin: 0; color: var(--soft); font-size: 16.5px; }

.deep { padding: 88px 0 72px; border-top: 1px solid var(--line); }
.deep > .eyebrow { margin-bottom: 12px; }
.deep > h2 { margin-bottom: 40px; }
.carousel { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 56px; align-items: start; }
.tabs input { position: absolute; opacity: 0; pointer-events: none; }
.tabs label { position: relative; display: block; padding: 16px 18px 18px; margin-bottom: 6px; border: 1px solid transparent; border-radius: 12px; cursor: pointer; overflow: hidden; }
.tabs label > b { display: block; font-size: 17px; color: var(--muted); }
.tabs label > span { display: none; margin-top: 6px; font-size: 15px; line-height: 1.55; color: var(--soft); }
.tabs :checked + label { background: var(--raise); border-color: var(--line); }
.tabs :checked + label > b { color: var(--ink); }
.tabs :checked + label > span { display: block; }
.tabs :checked + label::after { content: ""; position: absolute; inset: auto 0 0; height: 2px; background: var(--accent); transform-origin: left; scale: 0 1; }
.playing .tabs :checked + label::after { animation: fill var(--dur, 30s) linear forwards; }
.paused .tabs :checked + label::after { animation-play-state: paused; }
@keyframes fill { to { scale: 1 1; } }
.slides { display: grid; }
.slides > * { grid-area: 1 / 1; opacity: 0; visibility: hidden; transition: opacity .5s, visibility 0s .5s; }
.deep:has(#d1:checked) .slides > :nth-child(1),
.deep:has(#d2:checked) .slides > :nth-child(2),
.deep:has(#d3:checked) .slides > :nth-child(3) { opacity: 1; visibility: visible; transition: opacity .5s; }

.install { padding: 88px 0 96px; border-top: 1px solid var(--line); }
.install h2 { font-size: clamp(32px, 4vw, 48px); margin-bottom: 32px; }
.install a { color: var(--accent); }
pre { margin: 0; padding: 18px 20px; font-size: 14px; line-height: 1.7; color: #e5e7eb; background: var(--term); border-radius: 12px; white-space: pre-wrap; overflow-wrap: anywhere; user-select: all; box-shadow: var(--shadow); }
pre.ap-term-text { user-select: text; cursor: text; }

dialog { width: min(96vw, (92vh - 36px) * 1.76); max-width: none; max-height: none; padding: 0; border: 0; background: none; overflow: hidden; }
html:has(dialog[open]) { overflow: hidden; }
dialog::backdrop { background: #05060ac7; backdrop-filter: blur(6px); }

footer { display: flex; justify-content: space-between; gap: 32px; padding: 36px 0 48px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
footer p { margin: 0; max-width: 70ch; }

.ap-wrapper { background: var(--term); }
.asciinema-player-theme-gr {
  --term-color-foreground: #e5e7eb;
  --term-color-background: #14161f;
  --term-color-0: #232737; --term-color-8: #4b5263;
  --term-color-1: #fca5a5; --term-color-9: #fca5a5;
  --term-color-2: #6ee7b7; --term-color-10: #6ee7b7;
  --term-color-3: #fcd34d; --term-color-11: #fcd34d;
  --term-color-4: #93c5fd; --term-color-12: #93c5fd;
  --term-color-5: #a78bfa; --term-color-13: #a78bfa;
  --term-color-6: #67e8f9; --term-color-14: #67e8f9;
  --term-color-7: #bac2cf; --term-color-15: #fff;
}

@media (min-width: 981px) {
  #features { display: grid; grid-template-columns: minmax(280px, 400px) 1fr; column-gap: 64px; padding: 24px 0 64px; }
  #features .row { display: contents; }
  #features .row > div { grid-column: 1; display: flex; flex-direction: column; justify-content: center; min-height: 78vh; opacity: .3; transition: opacity .4s; }
  #features .row.on > div { opacity: 1; }
  #features .row .term { grid-column: 2; grid-row: 1 / 5; align-self: start; position: sticky; top: max(76px, calc(50vh - 300px)); max-width: none; opacity: 0; visibility: hidden; transition: opacity .4s, visibility 0s .4s; }
  #features .row.on .term { opacity: 1; visibility: visible; transition: opacity .4s; }
  #features .row:nth-child(1) > div { grid-row: 1; }
  #features .row:nth-child(2) > div { grid-row: 2; }
  #features .row:nth-child(3) > div { grid-row: 3; }
  #features .row:nth-child(4) > div { grid-row: 4; }
}
@media (max-width: 980px) {
  .hero, .row, .row:nth-child(even), .carousel { grid-template-columns: 1fr; gap: 28px; }
  .hero { min-height: 0; padding: 40px 0 48px; }
  .row:nth-child(even) > div { order: 0; }
  .cue { display: none; }
  footer { flex-direction: column; }
}
@media (max-width: 560px) {
  nav { gap: 16px; font-size: 14px; }
  nav a:nth-child(-n+2) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cue i, .playing .tabs :checked + label::after { animation: none; }
}
.term button:focus:not(:focus-visible) { outline: none; }
.ap-overlay-start { display: none !important; }

.early {
  margin: 0;
  padding: 8px 16px;
  text-align: center;
  font-size: 14px;
  background: light-dark(#fff3d6, #3a2f12);
  color: light-dark(#6b4e00, #fcd34d);
}
.early a { color: inherit; font-weight: 600; }

.card { padding: 22px; border-radius: 18px; background: var(--raise); box-shadow: var(--shadow); }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; margin-bottom: 18px; border-radius: 12px; background: var(--bg); }
.seg button { border: 0; border-radius: 9px; padding: 7px 14px; background: transparent; color: var(--muted); font: 600 14px var(--sans); cursor: pointer; }
.seg button.on { background: var(--raise); color: var(--ink); box-shadow: 0 1px 3px #15171e1f; }
.pane { display: none; }
.pane.on { display: block; }
.card pre { position: relative; padding-right: 54px; box-shadow: none; }
.card pre code { background: none; padding: 0; font-size: inherit; }
.card dl { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 10px 14px; margin: 16px 2px 0; align-items: start; }
.card dt { padding-top: 14px; font: 700 12.5px var(--mono); color: var(--muted); text-transform: uppercase; }
.card dd { margin: 0; }
.card dd pre { padding: 12px 54px 12px 16px; font-size: 13.5px; }
.hint { margin: 12px 2px 0; font-size: 15px; color: var(--muted); }
.run { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.run > span { display: block; margin: 0 2px 10px; font: 700 12.5px var(--mono); color: var(--muted); text-transform: uppercase; }
.copy { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 8px; background: #ffffff12; color: #9ca3af; cursor: pointer; }
.copy:hover { background: #ffffff24; color: #e5e7eb; }
.copy svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
