/* House style of hendrikboettcher.com and Redraft: warm paper, Fraunces, a beige highlighter
   as the only accent, and the hand-drawn stick figure. Shared by the landing page and the docs. */
:root {
  --bg: #fbfaf7;
  --ink: #1d1b18;
  --muted: #8a847b;
  --line: #ddd6cc;
  --mark: #e9dfd5;
  --card: #ffffff;
  --bar: #f3efe9;
  --good: #5d7a4f;
  --warn: #a86a3d;
  --rec: #c0392b;
  --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 12px 40px rgba(0, 0, 0, .08);

  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --gutter: max(clamp(16px, 4vw, 72px), env(safe-area-inset-left, 0px));
  --gutter-r: max(clamp(16px, 4vw, 72px), env(safe-area-inset-right, 0px));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161513; --ink: #ece7df; --muted: #8f887e; --line: #3a3631; --mark: #3a332c;
    --card: #1e1c1a; --bar: #23211e; --good: #95b483; --warn: #d39a6c; --rec: #e0675a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 40px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #161513; --ink: #ece7df; --muted: #8f887e; --line: #3a3631; --mark: #3a332c;
  --card: #1e1c1a; --bar: #23211e; --good: #95b483; --warn: #d39a6c; --rec: #e0675a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 40px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 16px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-variation-settings: "SOFT" 100, "WONK" 1;
  font-weight: 360;
  font-size: clamp(17px, 1.3vw, 20px);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
p { margin: 0; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 2px; }
code { font-family: var(--mono); font-size: .8em; }

a {
  color: inherit;
  text-decoration: none;
  background-image: linear-gradient(var(--line), var(--line));
  background-size: 100% 1px;
  background-position: 0 92%;
  background-repeat: no-repeat;
  transition: color .2s ease;
}
a:hover { background-image: linear-gradient(var(--ink), var(--ink)); }

.col {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter-r);
}

h1, h2, h3, h4 { margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.05em, 3vw, 3em); line-height: 1.08; font-weight: 440; letter-spacing: -.02em; }
h2 { font-size: clamp(1.55em, 2.2vw, 2.2em); line-height: 1.12; font-weight: 440; letter-spacing: -.015em; }
h3 { font-size: 1.12em; line-height: 1.3; font-weight: 480; }
h4 { font-size: 1em; line-height: 1.35; font-weight: 480; }
.lead { color: var(--muted); max-width: 34em; }
.kicker { font-size: .74em; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.fine { font-size: .8em; color: var(--muted); }
mark { color: inherit; background: linear-gradient(var(--mark), var(--mark)) 0 100% / 100% .42em no-repeat; }

/* ---------- top bar ---------- */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 8px 20px; flex-wrap: wrap; padding-block: 20px 0; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 480; background: none; }
.brand svg { width: 18px; height: 24px; }
.brand .sub { color: var(--muted); font-weight: 360; }
.nav { display: flex; align-items: center; gap: 4px 20px; flex-wrap: wrap; font-size: .82em; }
.nav a { color: var(--muted); background: none; }
.nav a:hover, .nav a[aria-current] { color: var(--ink); }
.nav .btn { margin-left: 4px; }

/* Buttons and the share control, in the Redraft pill style. */
.btn {
  display: inline-flex; align-items: center; gap: .5em;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 999px; padding: .62em 1.2em; font: inherit; font-weight: 450; line-height: 1.2;
  cursor: pointer; background-image: none;
  transition: border-color .2s ease, opacity .2s ease, transform .1s ease;
}
.btn:hover { border-color: var(--muted); background-image: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.primary:hover { opacity: .88; }
.btn.sm { font-size: .82em; padding: .5em 1em; }
.btn svg { width: 1em; height: 1em; flex: none; }
.nav .btn.primary { color: var(--bg); }
.share { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.share svg { width: .9em; height: .9em; transform: translateY(.08em); }
.install { margin: 1.2em 0 1.1em; }
.install code { display: block; font-family: var(--mono); font-size: .86em; line-height: 1.55; padding: .9em 1.1em;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow-wrap: anywhere; user-select: all; }
.ctas { display: flex; flex-wrap: wrap; align-items: center; gap: .8em 1.2em; }
.say { display: inline-flex; align-items: baseline; gap: .35em; font-weight: 480; background: none; }
.say span { background: linear-gradient(var(--mark), var(--mark)) 0 100% / 100% .42em no-repeat; transition: background-size .25s ease; }
.say:hover { background: none; }
.say:hover span { background-size: 100% 100%; }
.say svg { width: .5em; height: .5em; transform: translateY(-.02em); transition: transform .2s ease; }
.say:hover svg { transform: translate(.15em, -.02em); }
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 20;
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg); border-radius: 999px; padding: .6em 1.1em;
  font: 400 .78rem/1.3 var(--sans); box-shadow: var(--shadow); max-width: calc(100vw - 32px); text-align: center;
  transition: opacity .25s ease, transform .25s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- shared pieces ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; min-width: 0; }
.card-head {
  display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap;
  padding: 11px 18px 10px; border-bottom: 1px solid var(--line); font: 500 .72rem/1.3 var(--sans);
}
.card-head span { font-weight: 400; color: var(--muted); }
.term { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; }
.term pre { margin: 0; padding: .8em 1em; font: 400 .72rem/1.75 var(--mono); }
.term pre i { color: var(--muted); font-style: normal; }
.tip { background: var(--mark); border-radius: 12px; padding: .9em 1.1em; font-size: .9em; display: grid; gap: .3em; }
.tip h4 { display: flex; align-items: center; gap: .5em; }
.recpill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 999px;
  background: var(--mark); color: var(--ink); font: 500 .7rem/1 var(--sans); font-variant-numeric: tabular-nums;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--rec); flex: none; animation: blink 2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .35; } }

/* Four numbers in one card. */
.figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fig { padding: 1.1em 1.2em; display: grid; gap: .35em; align-content: start; }
.fig + .fig { border-left: 1px solid var(--line); }
.fig b { font-size: clamp(1.6em, 2.4vw, 2.3em); font-weight: 400; line-height: 1.05; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.fig span { font: 400 .7rem/1.45 var(--sans); color: var(--muted); }

/* ---------- footer ---------- */
footer { padding-block: clamp(96px, 14vh, 160px) 48px; }
.small { font-size: .78em; color: var(--muted); display: flex; flex-wrap: wrap; gap: .4em 1.4em; }
.small a, .small .share { background: none; color: inherit; font-size: inherit; }
.small a:hover, .small .share:hover { color: var(--ink); }

@media (max-width: 1180px) {
  .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fig:nth-child(3) { border-left: 0; }
  .fig:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
  .dot { animation: none; }
}
