:root {
  /* palette */
  --bg: #141414;
  --bg2: #191919;
  --bg3: #1a1c20;
  --border: #212327;
  --border-h: #ffffff40;
  --tp: #fff;
  --ts: #dadbdf;
  --tt: #878b91;
  --tt-aa: #8d9196;
  --bone: #f0ebe2;
  --ac: #ff4655;
  --ac-soft: #ffa3aa;
  --ac-rgb: 255, 70, 85;
  --on-ac: #141414;
  --sel: #b8303c;
  --ac-dim: #ff46551a;
  --ac-b: #ff465538;
  --sb-hover: #ffffff0a;
  --btn-p-bg: #fff;
  --btn-p-fg: #0a0a0a;
  --code-ink: #dadbdf;
  --focus-ring: 2px solid var(--tp);
  --focus-offset: 2px;

  /* type */
  --sans: "Geist", "Geist Fallback", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --mono: "Geist Mono", "Geist Mono Fallback", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --font-pixel: "Departure Mono", var(--mono);

  /* layout */
  --hdr-h: 64px;
  --hdr-bg: #141414eb;
  --lab-pad-x: clamp(28px, 5vw, 56px);
  --lab-content-x: calc(2 * var(--lab-pad-x) + 1px);
  --lab-hero-pad-y: clamp(40px, 6vh, 64px);

  /* motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)' opacity='0.06'/%3E%3C/svg%3E");
}

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

html {
  scroll-behavior: smooth;
  background: var(--bg);
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
section[id] {
  scroll-margin-top: var(--hdr-h);
}

::selection {
  background: var(--sel);
  color: #fff;
}

body {
  background: var(--bg);
  color: var(--tp);
  font-family: var(--sans);
  min-height: 100vh;
  margin: 0;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2 {
  font-weight: 400;
  margin: 0;
}
p {
  color: var(--ts);
  margin: 0 0 14px;
  font-weight: 400;
  line-height: 1.5;
}
p:last-child {
  margin-bottom: 0;
}
code {
  font-family: var(--mono);
  color: var(--code-ink);
  background: var(--bg3);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 12px;
}
a {
  color: inherit;
}
button {
  font: inherit;
  color: inherit;
}

::-webkit-scrollbar {
  width: 3px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--bg3);
  border-radius: 2px;
}

:focus {
  outline: none;
}
:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
}

.skip-link {
  z-index: 200;
  background: var(--btn-p-bg);
  color: var(--btn-p-fg);
  border-radius: 0 0 8px;
  padding: 10px 16px;
  font-size: 14px;
  text-decoration: none;
  position: absolute;
  top: 0;
  left: -9999px;
}
.skip-link:focus-visible {
  left: 0;
}
.sr-only {
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  position: absolute;
  overflow: hidden;
}

.lab-body {
  min-height: 100vh;
  padding-top: var(--hdr-h);
  flex-direction: column;
  display: flex;
}
@media (max-width: 759px) {
  :root {
    --lab-pad-x: 24px;
  }
}

/* custom spin cursor */
#spin-cursor {
  z-index: 2147483000;
  pointer-events: none;
  transform-origin: 0 0;
  opacity: 0;
  will-change: transform;
  position: fixed;
  top: 0;
  left: 0;
}
#spin-cursor svg {
  display: block;
  overflow: visible;
}
#spin-cursor path {
  fill: #fff;
  stroke: #0009;
  stroke-width: 0.9px;
  stroke-linejoin: round;
}
html.spin-cursor-on,
html.spin-cursor-on * {
  cursor: none !important;
}
html.spin-cursor-on code,
html.spin-cursor-on .term-line {
  cursor: text !important;
}
