:root {
  color-scheme: dark;

  /* Surfaces */
  --bg: #080b12;
  --bg-raised: #0c1019;
  --panel: #0f141f;
  --panel-2: #141b29;
  --line: #1e2739;
  --line-strong: #2d3c55;

  /* Text */
  --text: #cbd6e8;
  --text-strong: #f0f5ff;
  --muted: #8593ab;
  --faint: #5a6a82;

  /* Accents — "Signal": vivid blue primary, warm amber secondary */
  --accent: #4c8dff;
  --accent-hover: #5f9bff;
  --on-accent: #0b1626;
  --accent-2: #ffc266;
  --accent-3: #5fd38a;
  --accent-4: #a78bfa;
  --warn: #ffc266;
  --ok: #5fd38a;
  --bad: #ff9d8f;

  /* Type */
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "Cascadia Code", "JetBrains Mono", ui-monospace, "SFMono-Regular",
    Menlo, Consolas, "Liberation Mono", monospace;

  --text-xs: 0.78rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.15rem;
  --text-xl: 1.45rem;
  --text-2xl: 1.85rem;
  --text-3xl: 2.4rem;
  --text-4xl: 3.1rem;

  /* Space */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;

  /* Layout */
  --page: 1180px;
  --measure: 70ch;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;

  --shadow: 0 1px 0 rgba(255, 255, 255, 0.02),
    0 18px 40px -28px rgba(0, 0, 0, 0.9);
  --glow: 0 0 0 1px rgba(76, 141, 255, 0.22),
    0 0 28px -10px rgba(76, 141, 255, 0.5);
}


*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(
    1100px 600px at 100% -10%,
    rgba(76, 141, 255, 0.1),
    transparent 60%
  ),
    radial-gradient(
    900px 520px at -10% 0%,
    rgba(120, 150, 220, 0.05),
    transparent 55%
  ),
    var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

h1,
h2,
h3,
h4 {
  color: var(--text-strong);
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

ul,
ol {
  padding: 0;
}

code,
pre,
kbd,
samp {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

::selection {
  background: rgba(34, 211, 238, 0.28);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 100;
  padding: 0.5rem 0.75rem;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
}

/* Markdown / prose */

.prose {
  max-width: var(--measure);
}

.prose > * + * {
  margin-top: 1rem;
}

.prose h2 {
  margin-top: 2.2rem;
  font-size: var(--text-2xl);
}

.prose h3 {
  margin-top: 1.8rem;
  font-size: var(--text-xl);
}

.prose h4 {
  margin-top: 1.5rem;
  font-size: var(--text-lg);
}

.prose a {
  text-decoration: underline;
  text-decoration-color: rgba(34, 211, 238, 0.4);
}

.prose strong {
  color: var(--text-strong);
}

.prose ul,
.prose ol {
  padding-left: 1.4rem;
}

.prose li + li {
  margin-top: 0.35rem;
}

.prose blockquote {
  border-left: 3px solid var(--accent-3);
  padding: 0.2rem 0 0.2rem 1rem;
  color: var(--muted);
  font-style: italic;
}

.prose blockquote p {
  margin: 0;
}

.prose hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 2rem 0;
}

.prose code {
  padding: 0.1em 0.4em;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 5px;
}

.prose pre {
  padding: 1rem 1.1rem;
  background: #070a0f;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-x: auto;
}

.prose pre code {
  padding: 0;
  background: none;
  border: none;
  font-size: var(--text-sm);
  line-height: 1.6;
}

.prose img {
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.prose th,
.prose td {
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--line);
  text-align: left;
}

.prose th {
  background: var(--panel);
  color: var(--text-strong);
}

/* Heading anchors injected by GitHub-flavored Markdown */

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
  position: relative;
}

.prose .anchor {
  position: absolute;
  top: 0.25em;
  left: -1.15rem;
  color: var(--faint);
  opacity: 0;
  transition: opacity 0.12s ease;
}

.prose h1:hover .anchor,
.prose h2:hover .anchor,
.prose h3:hover .anchor,
.prose h4:hover .anchor,
.prose .anchor:focus-visible {
  opacity: 1;
}

.prose .anchor:hover {
  color: var(--accent);
}

.prose .anchor svg {
  width: 0.7em;
  height: 0.7em;
}

/* Task lists */

.prose ul:has(> li > input[type="checkbox"]) {
  padding-left: 0;
  list-style: none;
}

.prose li > input[type="checkbox"] {
  margin-right: 0.45rem;
  accent-color: var(--accent-2);
}

@media (max-width: 640px) {
  .prose .anchor {
    display: none;
  }
}

/* Syntax highlighting (highlight.js) */

.hljs-comment,
.hljs-quote {
  color: var(--faint);
}

.hljs-punctuation,
.hljs-operator {
  color: #93a4bd;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-meta,
.hljs-addition {
  color: var(--accent);
}

.hljs-string,
.hljs-doctag,
.hljs-regexp,
.hljs-attr,
.hljs-attribute,
.hljs-name,
.hljs-tag,
.hljs-selector-attr,
.hljs-selector-pseudo {
  color: var(--ok);
}

.hljs-number,
.hljs-literal,
.hljs-symbol,
.hljs-bullet,
.hljs-link,
.hljs-variable,
.hljs-template-variable,
.hljs-selector-class,
.hljs-selector-id {
  color: var(--warn);
}

.hljs-title,
.hljs-section,
.hljs-title.function_,
.hljs-function .hljs-title,
.hljs-class .hljs-title,
.hljs-title.class_ {
  color: var(--accent-3);
}

.hljs-type,
.hljs-built_in,
.hljs-builtin-name {
  color: var(--accent-4);
}

.hljs-deletion,
.hljs-subst {
  color: var(--bad);
}

.hljs-emphasis {
  font-style: italic;
}

.hljs-strong {
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}


.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  padding: 0.7rem clamp(1rem, 4vw, 2rem);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-strong);
  font-size: var(--text-lg);
}

.brand:hover {
  text-decoration: none;
}

.brand__mark {
  color: var(--accent);
}

.brand__mark-bar {
  color: var(--accent-2);
}

.brand__initials {
  font-weight: 800;
  letter-spacing: 0.04em;
}

.brand__tld {
  color: var(--muted);
  font-weight: 500;
}

.nav {
  min-width: 0;
  overflow-x: auto;
}

.nav__list {
  display: flex;
  gap: 0.2rem;
  list-style: none;
}

.nav__link {
  display: inline-block;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: var(--text-sm);
  white-space: nowrap;
}

.nav__link:hover {
  color: var(--text-strong);
  background: var(--panel);
  text-decoration: none;
}

.nav__link.is-active {
  color: var(--text-strong);
  background: var(--panel-2);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.main {
  flex: 1;
  width: min(100%, var(--page));
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 4vw, 2rem) var(--space-7);
}

.workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: var(--space-5) var(--space-6);
}

.section--wide,
.section--full {
  grid-column: 1 / -1;
}

.stack {
  display: grid;
  align-content: start;
  gap: var(--space-6);
}

.site-footer {
  padding: var(--space-6) clamp(1rem, 4vw, 2rem);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--text-sm);
  text-align: center;
}

.site-footer__note {
  margin-top: 0.5rem;
  color: var(--accent-2);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

.site-footer__meta {
  margin-top: 0.35rem;
  color: var(--faint);
}

.site-footer__meta a {
  color: var(--muted);
}

@media (max-width: 900px) {
  .site-header {
    flex-wrap: wrap;
  }

  .workbench {
    grid-template-columns: 1fr;
  }
}


/* Hero */

.hero {
  margin-bottom: var(--space-7);
}

.hero--compact {
  margin-bottom: var(--space-6);
}

.hero__eyebrow {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.28em;
}

.hero__title {
  margin-top: 0.6rem;
  font-size: clamp(2rem, 6vw, var(--text-4xl));
}

.hero__lede {
  max-width: var(--measure);
  margin-top: 0.9rem;
  color: var(--muted);
  font-size: var(--text-lg);
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5);
  margin-top: var(--space-5);
}

.stats__item dt {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.stats__item dd {
  color: var(--text-strong);
  font-size: var(--text-2xl);
  font-weight: 700;
}

/* Sections */

.section {
  min-width: 0;
}

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--line);
}

.section__title {
  font-size: var(--text-xl);
}

.section__more {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  white-space: nowrap;
}

.section__more:hover {
  color: var(--accent);
}

/* Cards */

.card-list {
  display: grid;
  gap: var(--space-3);
}

.card {
  padding: var(--space-4);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}

.card__head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.card__title {
  color: var(--text-strong);
  font-size: var(--text-lg);
  font-weight: 620;
}

.card__title:hover {
  color: var(--accent);
  text-decoration: none;
}

.card__summary {
  margin-top: 0.4rem;
  color: var(--muted);
  font-size: var(--text-sm);
}

.card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-top: 0.6rem;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

/* Tags */

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  list-style: none;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.1rem 0.45rem;
  color: var(--accent-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  background: color-mix(in srgb, var(--accent-2) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent-2) 25%, transparent);
  border-radius: 999px;
}

.tag:hover {
  background: color-mix(in srgb, var(--accent-2) 18%, transparent);
  text-decoration: none;
}

.tag--cloud {
  padding: 0.3rem 0.7rem;
  font-size: var(--text-sm);
}

.tag__count {
  color: var(--faint);
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
}

/* Experiment status */

.status {
  padding: 0.12rem 0.5rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.status--success {
  color: var(--ok);
}

.status--failed {
  color: var(--bad);
}

.status--in-progress {
  color: var(--accent);
}

.status--abandoned {
  color: var(--faint);
}

.status--surprising {
  color: var(--accent-4);
}

.status--revisit {
  color: var(--warn);
}

/* Page + item headers */

.page-head,
.item__head {
  max-width: var(--measure);
  margin-bottom: var(--space-6);
}

.page-head__kicker,
.item__kicker {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.page-head__title,
.item__title {
  margin-top: 0.35rem;
  font-size: clamp(1.8rem, 4vw, var(--text-3xl));
}

.page-head__lede,
.item__summary {
  margin-top: 0.7rem;
  color: var(--muted);
  font-size: var(--text-lg);
}

.item__summary {
  font-size: var(--text-base);
}

.page-head__count,
.item__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-top: 0.5rem;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

/* Related links */

.related {
  max-width: var(--measure);
  margin-top: var(--space-7);
  padding-top: var(--space-5);
  border-top: 1px solid var(--line);
}

.related__title {
  font-size: var(--text-lg);
}

.related__list {
  display: grid;
  gap: 0.4rem;
  margin-top: var(--space-3);
  list-style: none;
}

.related__type {
  margin-left: 0.5rem;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

/* Compact lists */

.mini-list,
.note-list {
  display: grid;
  gap: var(--space-3);
  list-style: none;
}

.mini {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px dashed var(--line);
}

.mini:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.mini__title {
  color: var(--text);
}

.mini__title:hover {
  color: var(--accent);
  text-decoration: none;
}

.mini__date {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  white-space: nowrap;
}

.note {
  padding-bottom: var(--space-3);
  border-bottom: 1px dashed var(--line);
}

.note:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.note__title {
  color: var(--text-strong);
  font-weight: 600;
}

.note__summary {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: var(--text-sm);
}

.note__date {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

/* Misc */

.empty {
  color: var(--faint);
  font-style: italic;
}

.quote {
  color: var(--muted);
  font-style: italic;
}
