@font-face {
  font-family: "Familjen Grotesk";
  src: url("fonts/familjen-grotesk.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

/* Paper by default; ink follows the system unless a theme is chosen. */
:root {
  --bg: #f2f3ef;
  --fg: #15181d;
  --muted: #535a63;
  --rule: #d4d7d0;
  --accent: #3a60aa;
  --accent-fg: #ffffff;
  --code-bg: #e7e9e3;
  --term-bg: #10141a;
  --term-fg: #d9dde3;
  --term-dim: #8a929c;
  --term-rule: #262c35;
  --add: #4cc35e;
  --upd: #dcab3c;
  --del: #f0645c;
  --blue: #7ea2e8;
  --sans: "Familjen Grotesk", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="paper"]) {
    --bg: #0c0f13;
    --fg: #e6e8eb;
    --muted: #9aa2ac;
    --rule: #22272f;
    --accent: #84a7ee;
    --accent-fg: #0c0f13;
    --code-bg: #161a20;
    --term-bg: #131820;
    --term-rule: #2a313b;
    color-scheme: dark;
  }
}
:root[data-theme="ink"] {
  --bg: #0c0f13;
  --fg: #e6e8eb;
  --muted: #9aa2ac;
  --rule: #22272f;
  --accent: #84a7ee;
  --accent-fg: #0c0f13;
  --code-bg: #161a20;
  --term-bg: #131820;
  --term-rule: #2a313b;
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  scrollbar-color: var(--rule) var(--bg);
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 1.0625rem/1.6 var(--sans);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
a:hover {
  text-decoration-thickness: 2px;
}

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

code,
pre {
  font-family: var(--mono);
  font-size: 0.875em;
  font-variant-ligatures: none;
}
p code,
dd code,
h3 code {
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  font-size: 0.85em;
}

h1,
h2,
h3 {
  text-wrap: balance;
  margin: 0;
}
p,
dd {
  text-wrap: pretty;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -3rem;
  padding: 0.5rem 0.75rem;
  background: var(--fg);
  color: var(--bg);
  border-radius: 6px;
  z-index: 10;
}
.skip:focus {
  top: 1rem;
}

/* Header */
.top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 1rem max(clamp(1rem, 4vw, 2.5rem), (100% - 76rem) / 2 + clamp(1rem, 4vw, 2.5rem));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
}
.wordmark {
  color: var(--fg);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.top nav {
  display: flex;
  gap: 1.5rem;
}
.top nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}
.top nav a:hover {
  color: var(--fg);
}
.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.theme {
  display: inline-flex;
  gap: 0.35rem;
  border: 1px solid var(--rule);
  background: none;
  color: var(--muted);
  font: 500 0.8rem var(--mono);
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  cursor: pointer;
}
.theme span[aria-hidden] {
  opacity: 0.5;
}
:root:not([data-theme]) .theme [data-theme-label="paper"],
:root[data-theme="paper"] .theme [data-theme-label="paper"],
:root[data-theme="ink"] .theme [data-theme-label="ink"] {
  color: var(--fg);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .theme [data-theme-label="paper"] {
    color: inherit;
  }
  :root:not([data-theme]) .theme [data-theme-label="ink"] {
    color: var(--fg);
  }
}
.github {
  display: inline-flex;
  color: var(--fg);
}
.github svg {
  width: 1.35rem;
  height: 1.35rem;
  fill: currentColor;
}

/* Hero */
main {
  max-width: 76rem;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2.5rem);
}
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  padding: clamp(2.5rem, 7vw, 6rem) 0 clamp(3rem, 8vw, 7rem);
}
h1 {
  font-size: clamp(2.5rem, 5.4vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  font-weight: 680;
}
.lede {
  margin: 1.5rem 0 2rem;
  max-width: 34rem;
  font-size: 1.2rem;
  color: var(--muted);
}
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
}
.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.15rem;
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 600;
  border-radius: 10px;
  text-decoration: none;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.button svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.25s var(--ease);
}
.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--accent) 70%, transparent);
}
.button:hover svg {
  transform: translateX(2px);
}
.link {
  font-weight: 500;
}
.fine {
  margin: 1rem 0 0;
  font-size: 0.875rem;
  color: var(--muted);
}

/* Copyable command */
.cmd {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-top: 1.5rem;
  padding: 0.75rem 0.75rem 0.75rem 1rem;
  background: var(--code-bg);
  border-radius: 10px;
  max-width: 100%;
}
.cmd code {
  flex: 1;
  min-width: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.7;
}
.prompt {
  color: var(--muted);
  user-select: none;
}
.copy {
  flex: none;
  border: 1px solid var(--rule);
  background: var(--bg);
  color: var(--muted);
  font: 500 0.75rem var(--mono);
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.copy:hover {
  color: var(--fg);
  border-color: var(--muted);
}
.copy[data-copied] {
  color: var(--accent);
  border-color: var(--accent);
}

/* Terminal */
.term {
  margin: 0;
  background: var(--term-bg);
  color: var(--term-fg);
  border-radius: 14px;
  border: 1px solid var(--term-rule);
  box-shadow: 0 30px 60px -30px rgb(0 0 0 / 0.45), 0 12px 24px -16px rgb(0 0 0 / 0.3);
  overflow: hidden;
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--term-rule);
}
.dots {
  display: inline-flex;
  gap: 0.4rem;
}
.dots i {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: #3a414b;
}
.term-title {
  flex: 1;
  text-align: center;
  font: 500 0.8rem var(--mono);
  color: var(--term-dim);
}
.replay {
  border: 0;
  background: none;
  color: var(--term-dim);
  font: 500 0.75rem var(--mono);
  cursor: pointer;
  padding: 0.2rem 0.3rem;
  border-radius: 4px;
}
.replay:hover {
  color: var(--term-fg);
}
.term-body {
  margin: 0;
  padding: 1rem 1.1rem 1.25rem;
  min-height: 25.5rem;
  font-size: 0.8rem;
  line-height: 1.65;
}
.term-body code {
  font-size: inherit;
  white-space: pre-wrap;
}
.term figcaption {
  padding: 0.55rem 1.1rem;
  border-top: 1px solid var(--term-rule);
  font-size: 0.78rem;
  color: var(--term-dim);
}
.t-dim {
  color: var(--term-dim);
}
.t-add {
  color: var(--add);
}
.t-upd {
  color: var(--upd);
}
.t-del {
  color: var(--del);
}
.t-blue {
  color: var(--blue);
}
.t-bold {
  color: #ffffff;
  font-weight: 600;
}
.caret {
  display: inline-block;
  width: 0.55em;
  height: 1.1em;
  margin-left: 1px;
  vertical-align: -0.2em;
  background: var(--term-fg);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* Sections */
.block {
  padding: clamp(3.5rem, 8vw, 6rem) 0;
  border-top: 1px solid var(--rule);
}
h2 {
  font-size: clamp(2rem, 3.6vw, 2.9rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  font-weight: 660;
}
.block-lede {
  margin: 1rem 0 3rem;
  max-width: 40rem;
  font-size: 1.15rem;
  color: var(--muted);
}
h3 {
  font-size: 1.15rem;
  font-weight: 620;
  letter-spacing: -0.01em;
}

.lists {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(2rem, 5vw, 4rem);
}
.mods {
  margin: 1rem 0 0;
}
.mods > div {
  display: grid;
  grid-template-columns: minmax(9rem, 13rem) 1fr;
  gap: 1rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--rule);
}
.mods dt {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.6rem;
  align-content: start;
}
.mods dt code {
  font-size: 0.85rem;
  color: var(--fg);
  font-weight: 500;
}
.mods dd {
  margin: 0;
  color: var(--muted);
}
.note {
  margin: 2rem 0 0;
  max-width: 40rem;
  color: var(--muted);
}

/* Steps: the order matters, so they are numbered */
.steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
  max-width: 52rem;
}
.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 2.25rem 3.25rem;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -0.05rem;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--rule);
  border-radius: 50%;
  font: 600 0.85rem var(--mono);
  color: var(--muted);
}
.steps li::after {
  content: "";
  position: absolute;
  left: 1rem;
  top: 2.25rem;
  bottom: 0.25rem;
  width: 1px;
  background: var(--rule);
}
.steps li:last-child::after {
  display: none;
}
.steps h3 {
  line-height: 1.6;
}
.steps p {
  margin: 0.3rem 0 0;
  color: var(--muted);
  max-width: 38rem;
}
.steps .cmd {
  margin-top: 0.85rem;
}

/* Tabs */
.tabs {
  max-width: 52rem;
  border: 1px solid var(--rule);
  border-radius: 14px;
  overflow: hidden;
}
.tablist {
  display: flex;
  border-bottom: 1px solid var(--rule);
}
.tablist button {
  flex: none;
  border: 0;
  background: none;
  color: var(--muted);
  font: 500 0.875rem var(--mono);
  padding: 0.8rem 1.2rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tablist button[aria-selected="true"] {
  color: var(--fg);
  border-bottom-color: var(--accent);
}
.tablist button:hover {
  color: var(--fg);
}
.panel pre {
  margin: 0;
  padding: 1.25rem 1.4rem 1.5rem;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--rule) transparent;
  line-height: 1.7;
  background: var(--code-bg);
}
.c {
  color: var(--muted);
}
.v {
  color: var(--accent);
}
.s {
  color: var(--fg);
  font-weight: 600;
}

.pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(2rem, 5vw, 4rem);
  margin-top: 3.5rem;
  max-width: 64rem;
}
.pair p {
  margin: 0.6rem 0 0;
  color: var(--muted);
}

.daily {
  max-width: 52rem;
}
.daily > div {
  grid-template-columns: minmax(16rem, 20rem) 1fr;
}

/* Closing */
.closing {
  padding: clamp(4rem, 10vw, 8rem) 0;
  border-top: 1px solid var(--rule);
  text-align: center;
}
.closing h2 {
  font-size: clamp(2.4rem, 5vw, 4rem);
  margin-bottom: 2rem;
}
.closing .actions {
  justify-content: center;
}

.foot {
  max-width: 76rem;
  margin: 0 auto;
  padding: 2rem clamp(1rem, 4vw, 2.5rem) 3rem;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.foot p {
  margin: 0;
}
.foot a {
  color: inherit;
}

@media (min-width: 641px) {
  p code,
  dd code {
    white-space: nowrap;
  }
}
@media (max-width: 960px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
  }
  .lists,
  .pair {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 640px) {
  .top {
    gap: 1rem;
  }
  .top nav {
    display: none;
  }
  .mods > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.25rem;
  }
  .term-body {
    min-height: 0;
    font-size: 0.72rem;
  }
  .steps li {
    padding-left: 2.75rem;
  }
}
