/* tokens.css */
/* Design tokens shared by every theme: space, type, radius, motion. */

:root {
  /* 4 px grid */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  --s-10: 128px;

  /* Typography */
  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --fs-xs: 0.8125rem;   /* 13 */
  --fs-sm: 0.9375rem;   /* 15 */
  --fs-md: 1rem;        /* 16 */
  --fs-lg: 1.125rem;    /* 18, article body */
  --fs-xl: 1.375rem;    /* 22, h3 */
  --fs-2xl: 1.5rem;     /* 24, card title */
  --fs-3xl: 1.875rem;   /* 30, h2 */
  --fs-4xl: clamp(2rem, 1.4rem + 2.2vw, 2.75rem);    /* 44, h1 */
  --fs-display: clamp(2.5rem, 1.6rem + 3.6vw, 4rem); /* 64, hero */
  --lh-tight: 1.15;
  --lh-snug: 1.35;
  --lh-body: 1.75;
  --track-tight: -0.025em;
  --track-display: -0.035em;
  --measure: 44rem;

  /* Radius */
  --r-chip: 8px;
  --r-control: 12px;
  --r-card: 20px;
  --r-nav: 22px;
  --r-pill: 999px;

  /* Layout */
  --container: 1200px;
  --sidebar: 300px;
  --gutter: 24px;
  --nav-h: 64px;
  --nav-top: 16px;
  --banner-full: min(78vh, 720px);
  --banner-compact: 360px;

  /* Motion: every duration has a purpose (see README, "Motion") */
  --dur-fast: 140ms;
  --dur-base: 240ms;
  --dur-slow: 420ms;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --spring: linear(0, 0.009, 0.035 2.1%, 0.141, 0.281 6.7%, 0.723 12.9%, 0.938 16.7%, 1.017, 1.077, 1.121, 1.149 24.3%, 1.159, 1.163, 1.161, 1.154 29.9%, 1.129 32.8%, 1.051 39.6%, 1.017 43.1%, 0.991, 0.977 51%, 0.974 53.8%, 0.975 57.1%, 0.997 69.8%, 1.003 76.9%, 1);

  --z-banner: 0;
  --z-content: 1;
  --z-nav: 50;
  --z-progress: 60;
  --z-toast: 90;
}

/* Animate theme colours where the View Transitions API is unavailable. */
@property --bg { syntax: "<color>"; inherits: true; initial-value: #07090f; }
@property --surface { syntax: "<color>"; inherits: true; initial-value: rgb(18 24 38 / 0.72); }
@property --text { syntax: "<color>"; inherits: true; initial-value: #e6edf3; }
@property --text-muted { syntax: "<color>"; inherits: true; initial-value: #8b98a9; }
@property --accent { syntax: "<color>"; inherits: true; initial-value: #22d3ee; }
@property --border { syntax: "<color>"; inherits: true; initial-value: rgb(148 163 184 / 0.14); }

/* themes.css */
/* Four themes, one set of semantic tokens. Components never use raw colours. */

/* Dark: warm black, ember brown, orange accent, smoked glass. The default. */
:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0807;
  --bg-2: #1c110a;
  --surface: rgb(30 21 16 / 0.72);
  --surface-strong: #17110d;
  --surface-hover: rgb(42 29 21 / 0.82);
  --border: rgb(255 200 160 / 0.12);
  --border-strong: rgb(255 200 160 / 0.24);
  --highlight: rgb(255 235 220 / 0.07);
  --text: #f3ece6;
  --text-muted: #a8978a;
  --text-faint: #6f5f53;
  --accent: #ff8a3d;
  --accent-2: #f2b25c;
  --accent-soft: rgb(255 138 61 / 0.13);
  --accent-contrast: #1a0b02;
  --autumn: #f2b25c;
  --code-bg: #120c09;
  --glow: rgb(255 138 61 / 0.16);
  --mark: rgb(255 138 61 / 0.24);
  --shadow: 0 8px 32px rgb(0 0 0 / 0.5);
  --shadow-lg: 0 24px 64px rgb(0 0 0 / 0.6);
  --gradient-text: linear-gradient(100deg, #f3ece6 0%, #ffd2a8 35%, #ff8a3d 65%, #e0573a 100%);
  --syn-comment: #7d6b5e; --syn-keyword: #ff9f66; --syn-string: #b5d98a; --syn-number: #f7c873;
  --syn-function: #ffcf8a; --syn-type: #f2b25c; --syn-attr: #e8a07a; --syn-punct: #a8978a;
  --syn-variable: #f3ece6; --syn-macro: #ff8a3d; --syn-diff-add: rgb(52 211 153 / 0.14); --syn-diff-del: rgb(248 113 113 / 0.14);
}

/* Light: warm off-white, orange accent. */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #faf6f1;
  --bg-2: #fdeee0;
  --surface: rgb(255 255 255 / 0.74);
  --surface-strong: #ffffff;
  --surface-hover: rgb(255 255 255 / 0.92);
  --border: rgb(60 30 10 / 0.1);
  --border-strong: rgb(60 30 10 / 0.2);
  --highlight: rgb(255 255 255 / 0.9);
  --text: #2a1f18;
  --text-muted: #6e5d50;
  --text-faint: #a3907f;
  --accent: #c2550c;
  --accent-2: #f0a35e;
  --accent-soft: rgb(194 85 12 / 0.1);
  --accent-contrast: #ffffff;
  --autumn: #b8621f;
  --code-bg: #f7f1ea;
  --glow: rgb(240 163 94 / 0.25);
  --mark: rgb(194 85 12 / 0.16);
  --shadow: 0 8px 24px rgb(60 30 10 / 0.08);
  --shadow-lg: 0 24px 56px rgb(60 30 10 / 0.14);
  --gradient-text: linear-gradient(100deg, #2a1f18 0%, #c2550c 55%, #e0913a 100%);
  --syn-comment: #8a7a6e; --syn-keyword: #b4460a; --syn-string: #2f7d32; --syn-number: #a15c00;
  --syn-function: #8f3f0b; --syn-type: #8a5a00; --syn-attr: #a0522d; --syn-punct: #8a7a6e;
  --syn-variable: #2a1f18; --syn-macro: #c2550c; --syn-diff-add: rgb(46 160 67 / 0.12); --syn-diff-del: rgb(207 34 46 / 0.1);
}

/* Sakura Light: pastel pink, lavender, warm white. */
:root[data-theme="sakura-light"] {
  color-scheme: light;
  --bg: #fff8f4;
  --bg-2: #fde8ef;
  --surface: rgb(255 255 255 / 0.7);
  --surface-strong: #ffffff;
  --surface-hover: rgb(255 255 255 / 0.9);
  --border: rgb(122 74 110 / 0.12);
  --border-strong: rgb(122 74 110 / 0.22);
  --highlight: rgb(255 255 255 / 0.9);
  --text: #2b2230;
  --text-muted: #73627a;
  --text-faint: #a493a8;
  --accent: #c8507a;
  --accent-2: #a98bdb;
  --accent-soft: rgb(200 80 122 / 0.1);
  --accent-contrast: #ffffff;
  --autumn: #c06a4b;
  --code-bg: #fbf1f5;
  --glow: rgb(169 139 219 / 0.25);
  --mark: rgb(200 80 122 / 0.16);
  --shadow: 0 8px 24px rgb(122 74 110 / 0.1);
  --shadow-lg: 0 24px 56px rgb(122 74 110 / 0.16);
  --gradient-text: linear-gradient(100deg, #2b2230 0%, #c8507a 50%, #8d6cc9 100%);
  --syn-comment: #9a8aa0; --syn-keyword: #b3407a; --syn-string: #5b8a3a; --syn-number: #c05a2a;
  --syn-function: #7353b8; --syn-type: #a0622d; --syn-attr: #8d6cc9; --syn-punct: #8a7a90;
  --syn-variable: #2b2230; --syn-macro: #c8507a; --syn-diff-add: rgb(91 138 58 / 0.12); --syn-diff-del: rgb(200 80 122 / 0.12);
}

/* Sakura Dark: deep pink, dark violet, tinted black. */
:root[data-theme="sakura-dark"] {
  color-scheme: dark;
  --bg: #0d0911;
  --bg-2: #1a0f1f;
  --surface: rgb(30 18 38 / 0.72);
  --surface-strong: #1c1222;
  --surface-hover: rgb(42 26 52 / 0.82);
  --border: rgb(240 150 190 / 0.14);
  --border-strong: rgb(240 150 190 / 0.26);
  --highlight: rgb(255 200 225 / 0.07);
  --text: #f4e9f1;
  --text-muted: #b19ab3;
  --text-faint: #7b6680;
  --accent: #f0609a;
  --accent-2: #9d6bdb;
  --accent-soft: rgb(240 96 154 / 0.14);
  --accent-contrast: #1a0610;
  --autumn: #e8925f;
  --code-bg: #150d19;
  --glow: rgb(240 96 154 / 0.16);
  --mark: rgb(240 96 154 / 0.24);
  --shadow: 0 8px 32px rgb(0 0 0 / 0.5);
  --shadow-lg: 0 24px 64px rgb(0 0 0 / 0.6);
  --gradient-text: linear-gradient(100deg, #f4e9f1 0%, #ffb3d1 40%, #f0609a 65%, #9d6bdb 100%);
  --syn-comment: #7b6680; --syn-keyword: #f0609a; --syn-string: #b5e48c; --syn-number: #ffab76;
  --syn-function: #c3a6ff; --syn-type: #ffd08a; --syn-attr: #ff9cc2; --syn-punct: #9d8aa3;
  --syn-variable: #f4e9f1; --syn-macro: #ff9cc2; --syn-diff-add: rgb(181 228 140 / 0.12); --syn-diff-del: rgb(240 96 154 / 0.14);
}

/* No explicit choice yet: follow the system (dark tokens are the default above). */
@media (prefers-color-scheme: light) {
  :root[data-theme="auto"] {
    color-scheme: light;
    --bg: #faf6f1;
    --bg-2: #fdeee0;
    --surface: rgb(255 255 255 / 0.74);
    --surface-strong: #ffffff;
    --surface-hover: rgb(255 255 255 / 0.92);
    --border: rgb(60 30 10 / 0.1);
    --border-strong: rgb(60 30 10 / 0.2);
    --highlight: rgb(255 255 255 / 0.9);
    --text: #2a1f18;
    --text-muted: #6e5d50;
    --text-faint: #a3907f;
    --accent: #c2550c;
    --accent-2: #f0a35e;
    --accent-soft: rgb(194 85 12 / 0.1);
    --accent-contrast: #ffffff;
    --autumn: #b8621f;
    --code-bg: #f7f1ea;
    --glow: rgb(240 163 94 / 0.25);
    --mark: rgb(194 85 12 / 0.16);
    --shadow: 0 8px 24px rgb(60 30 10 / 0.08);
    --shadow-lg: 0 24px 56px rgb(60 30 10 / 0.14);
    --gradient-text: linear-gradient(100deg, #2a1f18 0%, #c2550c 55%, #e0913a 100%);
    --syn-comment: #8a7a6e; --syn-keyword: #b4460a; --syn-string: #2f7d32; --syn-number: #a15c00;
    --syn-function: #8f3f0b; --syn-type: #8a5a00; --syn-attr: #a0522d; --syn-punct: #8a7a6e;
    --syn-variable: #2a1f18; --syn-macro: #c2550c; --syn-diff-add: rgb(46 160 67 / 0.12); --syn-diff-del: rgb(207 34 46 / 0.1);
  }
}

/* Technology colours, used for dots and the large primary-language mark. */
.tech-rust { --tech: #dea584; }
.tech-kubernetes { --tech: #4a7ff0; }
.tech-docker { --tech: #2496ed; }
.tech-linux { --tech: #e8b923; }
.tech-postgresql { --tech: #5b8cc4; }
.tech-opentelemetry { --tech: #f5a800; }
.tech-grafana { --tech: #f46800; }
.tech-loki { --tech: #f5b400; }
.tech-prometheus { --tech: #e6522c; }
.tech-csharp { --tech: #a463c7; }
.tech-golang { --tech: #00add8; }
.tech-java { --tech: #e76f00; }
.tech-axum { --tech: #a78bfa; }
.tech-askama { --tech: #f0609a; }
.tech-x86-64 { --tech: #94a3b8; }
.lang-rust { --tech: #dea584; }
.lang-go { --tech: #00add8; }
.lang-c\# { --tech: #a463c7; }
.lang-java { --tech: #e76f00; }
.lang-python { --tech: #3572a5; }
.lang-typescript { --tech: #3178c6; }
.lang-javascript { --tech: #f1e05a; }
.lang-shell { --tech: #89e051; }
.lang-swift { --tech: #f05138; }
.lang-c\+\+ { --tech: #f34b7d; }
/* base.css */
/* Reset and base elements. */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--nav-h) + var(--nav-top) + 24px);
  background: var(--bg);
  transition: --bg var(--dur-slow) var(--ease-in-out), --surface var(--dur-slow) var(--ease-in-out),
    --text var(--dur-slow) var(--ease-in-out), --text-muted var(--dur-slow) var(--ease-in-out),
    --accent var(--dur-slow) var(--ease-in-out), --border var(--dur-slow) var(--ease-in-out);
}

@media (prefers-reduced-motion: no-preference) {
  html:focus-within { scroll-behavior: smooth; }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 85% -10%, var(--glow), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, color-mix(in oklab, var(--accent-2) 10%, transparent), transparent 60%),
    linear-gradient(180deg, var(--bg-2), var(--bg) 900px);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
  overflow-x: clip;
}

img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }

a {
  color: inherit;
  text-decoration-color: color-mix(in oklab, var(--accent) 50%, transparent);
  text-underline-offset: 0.2em;
  transition: color var(--dur-fast) var(--ease-out), text-decoration-color var(--dur-fast) var(--ease-out);
}
a:hover { color: var(--accent); }

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 600;
  line-height: var(--lh-tight);
  letter-spacing: var(--track-tight);
  text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; }
ul[class], ol[class] { list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
dialog { color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

::selection { background: var(--mark); }

.icon {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  left: 16px; top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--r-control);
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 600;
  transition: top var(--dur-base) var(--ease-out);
}
.skip-link:focus { top: 16px; }

.muted { color: var(--text-muted); }
.small { font-size: var(--fs-xs); }
.mono { font-family: var(--font-mono); font-size: 0.92em; }

.kbd {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  background: var(--surface);
}

mark {
  background: var(--mark);
  color: inherit;
  border-radius: 4px;
  padding: 0 2px;
}

/* layout.css */
/* Page frame: navigation, banner, containers, sidebar, footer. */

.container {
  width: min(var(--container), 100% - 2 * var(--gutter));
  margin-inline: auto;
}
.container-wide { width: min(1280px, 100% - 2 * var(--gutter)); margin-inline: auto; }
.container-narrow { width: min(820px, 100% - 2 * var(--gutter)); margin-inline: auto; }
.container-narrow-content { max-width: 860px; }

.main {
  position: relative;
  z-index: var(--z-content);
  padding-top: calc(var(--nav-top) + var(--nav-h) + var(--s-7));
  padding-bottom: var(--s-9);
  min-height: 70vh;
}

/* -- glass surfaces --------------------------------------------------------- */

.glass {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 var(--highlight), var(--shadow);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
}
@media (prefers-reduced-transparency: reduce) {
  .glass { background: var(--surface-strong); backdrop-filter: none; -webkit-backdrop-filter: none; }
}

.card {
  border-radius: var(--r-card);
  padding: var(--s-5);
}

/* -- navigation ------------------------------------------------------------- */

.nav-wrap {
  position: fixed;
  inset: var(--nav-top) 0 auto;
  z-index: var(--z-nav);
  pointer-events: none;
}

.nav {
  pointer-events: auto;
  width: min(var(--container), 100% - 2 * var(--s-4));
  height: var(--nav-h);
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: 0 var(--s-3) 0 var(--s-5);
  border-radius: var(--r-nav);
  background: color-mix(in oklab, var(--surface-strong) 62%, transparent);
  transition: background var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out),
    transform var(--dur-slow) var(--ease-out);
}
/* Denser glass once content scrolls under the bar, for legibility. */
.nav-wrap[data-scrolled] .nav {
  background: color-mix(in oklab, var(--surface-strong) 86%, transparent);
  box-shadow: inset 0 1px 0 var(--highlight), var(--shadow-lg);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  backdrop-filter: blur(28px) saturate(160%);
}
/* Hide on scroll down, show on scroll up: more room to read. */
.nav-wrap[data-hidden] .nav { transform: translateY(calc(-100% - var(--nav-top) - 8px)); }

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-weight: 650;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--text);
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border-radius: 10px;
  color: var(--autumn);
  background: color-mix(in oklab, var(--autumn) 14%, transparent);
  transition: transform var(--dur-slow) var(--spring);
}
.brand:hover .brand-mark { transform: rotate(-14deg) scale(1.06); }
.brand:hover { color: var(--text); }

.nav-links {
  display: flex;
  gap: var(--s-1);
  margin-inline: auto;
}
.nav-links a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 12px;
  font-weight: 550;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.nav-links a:hover { color: var(--text); background: var(--accent-soft); }
.nav-links a[aria-current="page"] { color: var(--text); }
.nav-links a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  view-transition-name: nav-indicator;
}
.nav-external .icon { width: 0.85em; height: 0.85em; opacity: 0.7; }

.nav-actions { display: flex; align-items: center; gap: var(--s-1); }
.nav-search { margin: 0; }

.search-trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  height: 40px;
  min-width: 200px;
  padding: 0 10px 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-control);
  background: color-mix(in oklab, var(--bg) 40%, transparent);
  color: var(--text-muted);
  transition: border-color var(--dur-fast), background var(--dur-fast);
}
.search-trigger:hover { border-color: var(--border-strong); color: var(--text); }
.search-label { flex: 1; text-align: left; font-size: var(--fs-sm); }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px; height: 40px;
  border: 0;
  border-radius: var(--r-control);
  background: transparent;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--dur-fast), background var(--dur-fast), transform var(--dur-fast) var(--ease-out);
}
.icon-btn:hover { color: var(--text); background: var(--accent-soft); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn .icon { width: 20px; height: 20px; }
.lang-code { font-family: var(--font-mono); font-size: 0.8rem; font-weight: 600; text-transform: uppercase; }

.theme-menu { position: relative; }
.theme-pop {
  position: absolute;
  right: 0; top: calc(100% + 10px);
  display: grid;
  gap: 2px;
  min-width: 200px;
  padding: 6px;
  border-radius: 16px;
  background: color-mix(in oklab, var(--surface-strong) 88%, transparent);
  transform-origin: top right;
  animation: pop-in var(--dur-base) var(--ease-out);
}
.theme-pop[hidden] { display: none; }
.theme-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  font-size: var(--fs-sm);
}
.theme-option:hover, .theme-option:focus-visible { background: var(--accent-soft); }
.theme-option[aria-checked="true"] { color: var(--accent); font-weight: 600; }
.swatch {
  width: 22px; height: 22px;
  border-radius: 7px;
  box-shadow: inset 0 0 0 1px rgb(127 127 127 / 0.3);
}
.swatch-dark { background: linear-gradient(135deg, #0b0807 45%, #ff8a3d 46%); }
.swatch-light { background: linear-gradient(135deg, #faf6f1 45%, #c2550c 46%); }
.swatch-sakura-light { background: linear-gradient(135deg, #fff8f4 45%, #e26d95 46%); }
.swatch-sakura-dark { background: linear-gradient(135deg, #0d0911 45%, #f0609a 46%); }

.menu-toggle { display: none; }

@media (max-width: 1024px) {
  .search-trigger { min-width: 0; width: 40px; padding: 0; justify-content: center; }
  .search-label, .search-trigger .kbd { display: none; }
}
@media (max-width: 860px) {
  .menu-toggle { display: inline-grid; }
  .nav { padding-left: var(--s-4); }
  .nav-links {
    position: absolute;
    top: calc(100% + 10px);
    left: 0; right: 0;
    flex-direction: column;
    padding: var(--s-2);
    border-radius: var(--r-card);
    background: color-mix(in oklab, var(--surface-strong) 94%, transparent);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
    pointer-events: none;
    transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
  }
  .nav-links a { padding: 14px 16px; font-size: var(--fs-md); }
  .nav[data-open] .nav-links { opacity: 1; transform: none; pointer-events: auto; }
}

/* -- banner ------------------------------------------------------------------ */

.banner {
  position: absolute;
  inset: 0 0 auto;
  height: var(--banner-compact);
  overflow: hidden;
  z-index: var(--z-banner);
  pointer-events: none;
  isolation: isolate;
}
.banner-full { height: var(--banner-full); }

.banner-layer {
  position: absolute;
  inset: -40px 0 0;
  background-repeat: no-repeat;
  background-size: cover;
  will-change: transform;
  transform: translate3d(0, calc(var(--scroll, 0) * var(--depth, 0) * 1px), 0);
}
.layer-sky { background-image: var(--banner-sky); background-position: 72% 35%; }
.layer-far { background-image: var(--banner-far); background-position: center bottom; }
.layer-near { background-image: var(--banner-near); background-position: right top; }
.banner-compact .layer-near { background-size: auto 140%; }
/* Small screens: the picture is cropped behind the text, veil it fully. */
@media (max-width: 720px) {
  .layer-far {
    background-image: linear-gradient(180deg,
      color-mix(in oklab, var(--bg) 60%, transparent),
      color-mix(in oklab, var(--bg) 80%, transparent));
  }
}

.banner-particles { position: absolute; inset: 0; width: 100%; height: 100%; }

.banner-fade {
  position: absolute;
  inset: auto 0 0;
  height: 70%;
  background: linear-gradient(180deg, transparent, color-mix(in oklab, var(--bg) 55%, transparent) 55%, var(--bg));
}

/* -- sidebar layout ---------------------------------------------------------- */

.layout-sidebar {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  gap: var(--gutter);
  align-items: start;
}
.sidebar-sticky {
  position: sticky;
  top: calc(var(--nav-top) + var(--nav-h) + 16px);
  display: grid;
  gap: var(--s-4);
}
.content-col { display: grid; gap: var(--s-7); min-width: 0; }

@media (max-width: 1024px) {
  .layout-sidebar { grid-template-columns: minmax(0, 1fr); }
  .sidebar-sticky { position: static; }
  .sidebar .profile-card { display: grid; grid-template-columns: 96px 1fr; column-gap: var(--s-4); text-align: left; justify-items: start; }
  .sidebar .profile-card > :not(.profile-avatar) { grid-column: 2; }
  .sidebar .profile-avatar { grid-row: span 4; }
  .sidebar .accent-bar { margin-inline: 0; }
  .sidebar .socials { justify-content: flex-start; }
  .sidebar .profile-card > .profile-stats { grid-column: 1 / -1; }
  .sidebar .tag-cloud-card { display: none; }
}

/* -- sections ---------------------------------------------------------------- */

.section { display: grid; gap: var(--s-4); }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-4);
}
.section-title {
  font-size: var(--fs-2xl);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-sm);
  font-weight: 550;
  color: var(--text-muted);
  text-decoration: none;
}
.link-arrow .icon { transition: transform var(--dur-base) var(--ease-out); }
.link-arrow:hover .icon { transform: translateX(3px); }

.page-head {
  padding-block: var(--s-6) var(--s-7);
  max-width: 900px;
  margin-inline: auto;
  text-align: center;
}
.page-title { font-size: var(--fs-4xl); letter-spacing: var(--track-display); }
.page-intro { margin-top: var(--s-3); font-size: var(--fs-lg); color: var(--text-muted); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--s-3);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

/* -- footer -------------------------------------------------------------------- */

.footer {
  position: relative;
  z-index: var(--z-content);
  border-top: 1px solid var(--border);
  padding-block: var(--s-7);
  background: color-mix(in oklab, var(--bg) 70%, transparent);
}
.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--s-5);
  align-items: center;
}
.footer-brand { display: flex; gap: var(--s-3); align-items: center; }
.footer-name { font-weight: 600; }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--s-4); }
.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  text-decoration: none;
}
.footer-copy { grid-column: 1 / -1; }
@media (max-width: 720px) { .footer-inner { grid-template-columns: 1fr; } }

/* components.css */
/* Reusable components. */

/* -- buttons ----------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--r-control);
  font-weight: 600;
  font-size: var(--fs-sm);
  text-decoration: none;
  white-space: nowrap;
  transition: transform var(--dur-fast) var(--ease-out), background var(--dur-fast), border-color var(--dur-fast),
    box-shadow var(--dur-base) var(--ease-out), color var(--dur-fast);
}
.btn:active { transform: translateY(1px) scale(0.98); }
.btn .icon { transition: transform var(--dur-base) var(--ease-out); }
.btn:hover .icon:last-child { transform: translateX(2px); }

.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
  box-shadow: 0 6px 24px -6px color-mix(in oklab, var(--accent) 70%, transparent);
}
.btn-primary:hover { color: var(--accent-contrast); box-shadow: 0 10px 32px -6px color-mix(in oklab, var(--accent) 85%, transparent); }

.btn-glass {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}
.btn-glass:hover { border-color: var(--accent); color: var(--text); }

/* -- chips, pills, tags --------------------------------------------------------- */

.meta-chips { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-3); align-items: center; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-sm);
  font-weight: 550;
  color: var(--text-muted);
  text-decoration: none;
}
a.chip:hover { color: var(--accent); }
.chip-icon {
  display: inline-grid;
  place-items: center;
  width: 32px; height: 32px;
  border-radius: var(--r-chip);
  background: var(--accent-soft);
  color: var(--accent);
}
.chip-icon .icon { width: 17px; height: 17px; }
.chip-tags a { text-decoration: none; }
.chip-tags a:hover { color: var(--accent); }
.chip-tags .sep { margin-inline: 6px; color: var(--text-faint); }
.flagship-meta .chip, .project-head .chip {
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  font-size: var(--fs-xs);
}

.pill-list, .tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.pill, .tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 550;
  color: var(--text-muted);
  text-decoration: none;
  background: color-mix(in oklab, var(--bg) 30%, transparent);
  transition: border-color var(--dur-fast), color var(--dur-fast), background var(--dur-fast);
}
.pill:hover, .tag:hover { border-color: var(--accent); color: var(--text); }
.pill[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.count {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
}
.pill[aria-current="page"] .count { color: inherit; opacity: 0.75; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 600;
  --c: var(--text-muted);
  color: var(--c);
  background: color-mix(in oklab, var(--c) 14%, transparent);
}
.status::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in oklab, currentColor 25%, transparent);
}
.status-active { --c: #34d399; }
.status-beta { --c: #fbbf24; }
.status-stable { --c: var(--accent); }
.status-idea { --c: #a78bfa; }
.status-maintenance { --c: #94a3b8; }
.status-archived { --c: #9ca3af; }
.status-active::before { animation: pulse 2.4s var(--ease-in-out) infinite; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  vertical-align: middle;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0;
  color: var(--autumn);
  background: color-mix(in oklab, var(--autumn) 14%, transparent);
}

.progress-row { display: flex; align-items: center; gap: var(--s-3); }
.progress-bar {
  flex: 1;
  height: 6px;
  border-radius: 6px;
  background: var(--accent-soft);
  overflow: hidden;
}
.progress-bar span {
  display: block;
  width: var(--p, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  transform-origin: left;
  animation: grow 900ms var(--ease-out) both;
}

.tech-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tech-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 550;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.tech-chip::before, .tech-dot {
  content: "";
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--tech, var(--accent));
}

/* -- cards with pointer glow ---------------------------------------------------- */

[data-glow] { isolation: isolate; overflow: hidden; }
[data-glow]::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, -40%), var(--glow), transparent 60%);
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-out);
  pointer-events: none;
}
[data-glow]:hover::after { opacity: 1; }

/* -- post card (reference layout: accent bar, chips, cover on the right) ------- */

.post-list { display: grid; gap: var(--s-4); }
.post-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(200px, 32%, 340px);
  gap: var(--s-5);
  align-items: center;
  padding: var(--s-5);
  transition: transform var(--dur-base) var(--ease-out), border-color var(--dur-base), box-shadow var(--dur-base);
}
.post-card:not(:has(.post-card-cover)) { grid-template-columns: 1fr; }
.post-card:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: inset 0 1px 0 var(--highlight), var(--shadow-lg); }
.post-card-body { display: grid; gap: var(--s-4); min-width: 0; }
.post-card-title {
  position: relative;
  padding-left: 18px;
  font-size: var(--fs-2xl);
  line-height: var(--lh-snug);
}
.post-card-title::before {
  content: "";
  position: absolute;
  left: 0; top: 0.22em;
  width: 4px; height: 1.05em;
  border-radius: 4px;
  background: var(--accent);
  transition: height var(--dur-base) var(--ease-out);
}
.post-card:hover .post-card-title::before { height: 1.25em; }
.post-card-title a { text-decoration: none; }
.post-card-title a::after { content: ""; position: absolute; inset: 0; z-index: 0; }
.post-card .meta-chips, .post-card .meta-chips a { position: relative; z-index: 1; }
.post-card-summary {
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card-stats { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: var(--fs-sm); }
.post-card-stats .dot { color: var(--text-faint); }
.series-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 10px;
  border-radius: var(--r-pill);
  color: var(--autumn);
  background: color-mix(in oklab, var(--autumn) 12%, transparent);
  font-size: var(--fs-xs);
  font-weight: 600;
}
.post-card-cover {
  display: block;
  position: relative;
  z-index: 1;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  box-shadow: 0 0 0 1px var(--border);
}
.post-card-cover img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 700ms var(--ease-out), filter var(--dur-slow);
}
.post-card:hover .post-card-cover img { transform: scale(1.045); }

@media (max-width: 720px) {
  .post-card { grid-template-columns: 1fr; padding: var(--s-4); }
  .post-card-cover { order: -1; }
  .post-card-title { font-size: var(--fs-xl); }
}

/* -- profile card ----------------------------------------------------------------- */

.profile-card { display: grid; justify-items: center; gap: var(--s-3); text-align: center; padding: var(--s-4); }
.profile-avatar {
  display: block;
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 1;
  box-shadow: 0 0 0 1px var(--border);
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; transition: transform 700ms var(--ease-out); }
.profile-card:hover .profile-avatar img { transform: scale(1.03); }
.profile-name { font-size: var(--fs-2xl); margin-top: var(--s-2); }
.accent-bar { display: block; width: 28px; height: 4px; border-radius: 4px; background: var(--accent); margin-inline: auto; }
.profile-motto { font-size: var(--fs-md); color: var(--text-muted); font-style: italic; }
.profile-bio { max-width: 34ch; }
.socials { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.socials .icon-btn { background: var(--accent-soft); color: var(--text); }
.socials .icon-btn:hover { background: var(--accent); color: var(--accent-contrast); }
.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
  margin: var(--s-2) 0 0;
  padding-top: var(--s-3);
  border-top: 1px solid var(--border);
}
.profile-stats dt { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-faint); overflow-wrap: anywhere; }
.profile-stats dd { margin: 2px 0 0; font-weight: 650; font-variant-numeric: tabular-nums; }

.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--s-3);
  font-size: var(--fs-sm);
  font-weight: 650;
  letter-spacing: 0;
  color: var(--text);
}
.card-title .icon { color: var(--accent); }

.side-list { display: grid; gap: 2px; }
.side-list li { display: flex; }
.side-list a, .side-list li > span:first-child {
  flex: 1;
  display: flex;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: var(--fs-sm);
  text-decoration: none;
  color: var(--text-muted);
}
.side-list li > span.count { padding: 6px 8px; }
.side-list a:hover, .side-list a[aria-current="page"] { background: var(--accent-soft); color: var(--text); }

/* -- project cards ------------------------------------------------------------------ */

.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--s-4); }
.project-grid-3 { margin-top: var(--s-5); }
.project-card {
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 0;
  overflow: hidden;
  transition: transform var(--dur-base) var(--ease-out), border-color var(--dur-base);
}
.project-card:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.project-card-cover { display: block; aspect-ratio: 16 / 9; overflow: hidden; }
.project-card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 700ms var(--ease-out); }
.project-card:hover .project-card-cover img { transform: scale(1.05); }
.project-card-body { display: grid; gap: var(--s-3); padding: var(--s-4) var(--s-5) var(--s-5); align-content: start; }
.project-card-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s-2); }
.project-card-title { font-size: var(--fs-xl); }
.project-card-title a { text-decoration: none; }
.project-card-title a::after { content: ""; position: absolute; inset: 0; }
.project-card-tagline { color: var(--text-muted); font-size: var(--fs-sm); }
.project-card-stats { display: flex; gap: var(--s-3); }
.project-card-stats span, .repo-stats span { display: inline-flex; align-items: center; gap: 4px; }

.flagship {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  gap: var(--s-5);
  align-items: center;
  padding: var(--s-6);
  border-color: color-mix(in oklab, var(--accent) 35%, var(--border));
}
.flagship-body { display: grid; gap: var(--s-4); justify-items: start; }
.flagship-body .eyebrow { margin: 0; color: var(--autumn); }
.flagship-title { position: relative; font-size: var(--fs-4xl); display: flex; align-items: center; gap: 14px; }
.flagship-title a { text-decoration: none; }
.accent-line { width: 5px; height: 0.9em; border-radius: 4px; background: var(--accent); }
.flagship-tagline { font-size: var(--fs-lg); color: var(--text-muted); }
.flagship-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.flagship .progress-row { width: 100%; }
.flagship-cover { display: block; border-radius: 16px; overflow: hidden; aspect-ratio: 16 / 10; box-shadow: 0 0 0 1px var(--border), var(--shadow); }
.flagship-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 900ms var(--ease-out); }
.flagship:hover .flagship-cover img { transform: scale(1.04); }
@media (max-width: 860px) {
  .flagship { grid-template-columns: 1fr; padding: var(--s-5); }
  .flagship-cover { order: -1; }
}

.repo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--s-4); }
.repo-card { display: grid; gap: 8px; text-decoration: none; transition: transform var(--dur-base) var(--ease-out), border-color var(--dur-base); }
.repo-card:hover { transform: translateY(-2px); border-color: var(--border-strong); color: inherit; }
.repo-name { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--accent); }
.repo-stats { display: flex; flex-wrap: wrap; gap: var(--s-3); }

/* -- GitHub activity --------------------------------------------------------------- */

.calendar { display: grid; gap: var(--s-3); }
.calendar-scroll { overflow-x: auto; padding-bottom: 4px; }
.calendar-grid { display: flex; gap: 3px; width: max-content; }
.cal-week { display: grid; grid-template-rows: repeat(7, 11px); gap: 3px; }
.cal-day { width: 11px; height: 11px; border-radius: 3px; background: var(--accent-soft); }
.cal-day.lv1 { background: color-mix(in oklab, var(--accent) 35%, transparent); }
.cal-day.lv2 { background: color-mix(in oklab, var(--accent) 55%, transparent); }
.cal-day.lv3 { background: color-mix(in oklab, var(--accent) 78%, transparent); }
.cal-day.lv4 { background: var(--accent); box-shadow: 0 0 6px var(--glow); }
.cal-pad { visibility: hidden; }

.gh-columns { display: grid; grid-template-columns: 1.3fr 1fr; gap: var(--s-4); }
@media (max-width: 860px) { .gh-columns { grid-template-columns: 1fr; } }
.event-list { display: grid; gap: 2px; }
.event { display: grid; grid-template-columns: 32px 1fr; gap: 10px; padding: 8px 6px; border-radius: 10px; }
.event:hover { background: var(--accent-soft); }
.event-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); }
.event-icon .icon { width: 16px; height: 16px; }
.event-body { display: grid; min-width: 0; }
.event-title { font-size: var(--fs-sm); font-weight: 550; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event-body a:not(.event-title) { color: var(--text-muted); text-decoration: none; }
.snapshot { margin-top: var(--s-3); }

/* -- table of contents ---------------------------------------------------------------- */

.toc { position: relative; padding: var(--s-4); }
.toc-title { margin-bottom: var(--s-2); font-size: var(--fs-xs); font-weight: 650; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); }
.toc-list { display: grid; gap: 1px; border-left: 1px solid var(--border); }
.toc-list a {
  display: block;
  padding: 5px 0 5px 14px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  font-size: var(--fs-sm);
  line-height: 1.4;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--dur-fast), border-color var(--dur-fast);
}
.toc-l3 a { padding-left: 28px; font-size: var(--fs-xs); }
.toc-list a:hover { color: var(--text); }
.toc-list a[aria-current="true"] { color: var(--accent); border-left-color: var(--accent); font-weight: 550; }

/* -- search, filters, pagination --------------------------------------------------------- */

.search-card { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 14px; border-radius: var(--r-control); }
.search-card input { flex: 1; min-width: 0; height: 40px; border: 0; background: transparent; outline: none; }
.search-card-icon { color: var(--text-muted); }
.search-card-lg { padding: 8px 8px 8px 18px; margin-bottom: var(--s-5); }
.search-card-lg input { font-size: var(--fs-lg); height: 48px; }

.filters { display: grid; gap: var(--s-3); padding: var(--s-4) var(--s-5); }
.filter-row { display: grid; grid-template-columns: 96px 1fr; gap: var(--s-3); align-items: start; }
.filter-label { padding-top: 6px; font-size: var(--fs-xs); font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); }
@media (max-width: 720px) { .filter-row { grid-template-columns: 1fr; } }

.pagination { display: flex; justify-content: space-between; align-items: center; gap: var(--s-4); }

.empty { color: var(--text-muted); text-align: center; padding: var(--s-6); }

/* -- command palette ----------------------------------------------------------------------- */

.palette {
  width: min(640px, 100% - 32px);
  max-height: min(560px, 80vh);
  margin: 12vh auto auto;
  padding: 0;
  border-radius: 20px;
  background: color-mix(in oklab, var(--surface-strong) 90%, transparent);
  box-shadow: var(--shadow-lg), inset 0 1px 0 var(--highlight);
  overflow: hidden;
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  backdrop-filter: blur(28px) saturate(160%);
}
.palette[open] { display: grid; grid-template-rows: auto 1fr auto; animation: palette-in var(--dur-base) var(--ease-out); }
.palette::backdrop { background: rgb(4 6 12 / 0.45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade-in var(--dur-base) var(--ease-out); }
.palette-form { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); margin: 0; }
.palette-icon { color: var(--accent); }
.palette-input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: var(--fs-lg); }
.palette-input::-webkit-search-cancel-button { display: none; }
.palette-results { overflow-y: auto; padding: 8px; }
.palette-group { padding: 10px 10px 4px; font-size: 0.7rem; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); }
.palette-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  text-align: left;
  text-decoration: none;
  color: var(--text);
}
.palette-item[aria-selected="true"] { background: var(--accent-soft); }
.palette-item[aria-selected="true"] .palette-item-icon { color: var(--accent); }
.palette-item-icon { display: grid; place-items: center; color: var(--text-muted); }
.palette-item-title { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-item-sub { grid-column: 2; font-size: var(--fs-xs); color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-item-meta { font-size: var(--fs-xs); color: var(--text-faint); }
.palette-empty { padding: 24px; text-align: center; color: var(--text-muted); }
.palette-foot { display: flex; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--border); }
.palette-foot .kbd { margin-right: 2px; }

/* -- toast ------------------------------------------------------------------------------------- */

.toast {
  position: fixed;
  left: 50%; bottom: 28px;
  z-index: var(--z-toast);
  padding: 10px 16px;
  border-radius: var(--r-pill);
  background: var(--text);
  color: var(--bg);
  font-size: var(--fs-sm);
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.toast[data-show] { opacity: 1; transform: translate(-50%, 0); }

.inline-icon { display: inline-flex; vertical-align: middle; color: var(--autumn); }

/* prose.css */
/* Long-form reading: articles, project docs, about page. */

.prose {
  padding: clamp(var(--s-5), 4vw, var(--s-7));
  font-size: var(--fs-lg);
  line-height: var(--lh-body);
  overflow-wrap: break-word;
}
.prose > * { max-width: var(--measure); margin-inline: auto; }
.prose > * + * { margin-top: 1.15em; }
.prose > .code-block, .prose > .figure-wide, .prose > .tabs, .prose > table, .prose > .mermaid-figure { max-width: 100%; }

.prose h2, .prose h3, .prose h4 { position: relative; scroll-margin-top: 110px; }
.prose h2 { margin-top: 2.2em; font-size: var(--fs-3xl); line-height: 1.25; }
.prose h3 { margin-top: 1.8em; font-size: var(--fs-xl); line-height: var(--lh-snug); letter-spacing: -0.01em; }
.prose h4 { margin-top: 1.5em; font-size: var(--fs-lg); }
.prose > h2:first-child, .prose > h3:first-child { margin-top: 0; }
.prose h2 + *, .prose h3 + * { margin-top: 0.7em; }

.prose .anchor {
  margin-left: 0.35em;
  color: var(--text-faint);
  text-decoration: none;
  opacity: 0;
  transition: opacity var(--dur-fast), color var(--dur-fast);
}
.prose :is(h2, h3, h4):hover .anchor, .prose .anchor:focus-visible { opacity: 1; }
.prose .anchor:hover { color: var(--accent); }

.prose p, .prose li { color: color-mix(in oklab, var(--text) 92%, var(--text-muted)); }
.prose strong { color: var(--text); font-weight: 650; }
.prose a { color: var(--accent); text-decoration-thickness: 1px; }
.prose a:hover { text-decoration-thickness: 2px; }
.prose a.external::after { content: "↗"; font-size: 0.75em; margin-left: 2px; vertical-align: super; opacity: 0.7; }

.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 0.4em; }
.prose li::marker { color: var(--accent); }
.prose ol > li::marker { font-family: var(--font-mono); font-size: 0.85em; }
.prose input[type="checkbox"] { accent-color: var(--accent); margin-right: 6px; }

.prose blockquote {
  margin-inline: auto;
  padding: 0.4em 0 0.4em 1.2em;
  border-left: 3px solid var(--autumn);
  color: var(--text-muted);
  font-style: italic;
}

.prose hr { border: 0; height: 1px; margin-block: 2.5em; background: linear-gradient(90deg, transparent, var(--border-strong), transparent); }

.prose code:not(pre code) {
  padding: 0.12em 0.4em;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--accent-soft);
  color: var(--text);
  border: 1px solid var(--border);
}

.prose table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--fs-sm);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
@media (max-width: 720px) { .prose table { display: block; overflow-x: auto; } }
.prose th, .prose td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); }
.prose th { background: var(--accent-soft); font-weight: 650; color: var(--text); }
.prose tr:last-child td { border-bottom: 0; }

.prose img { border-radius: 14px; }
.prose .figure { display: grid; gap: 10px; }
.prose .figure img { width: 100%; box-shadow: 0 0 0 1px var(--border); cursor: zoom-in; }
.prose figcaption { text-align: center; font-size: var(--fs-sm); color: var(--text-muted); }

/* Callouts from the MDX <Callout> component and GFM alerts. */
.callout, .prose blockquote[class^="markdown-alert"] {
  --c: var(--accent);
  padding: var(--s-4) var(--s-5);
  border-radius: 16px;
  border: 1px solid color-mix(in oklab, var(--c) 35%, transparent);
  background: color-mix(in oklab, var(--c) 9%, transparent);
  font-style: normal;
  color: var(--text);
}
.callout-tip, .markdown-alert-tip { --c: #34d399; }
.callout-warn, .markdown-alert-warning { --c: #fbbf24; }
.callout-danger, .markdown-alert-caution { --c: #f87171; }
.markdown-alert-important { --c: var(--accent-2); }
.callout-title { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-weight: 650; color: var(--c); font-size: var(--fs-md); }
.callout-title svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.callout-body > * + * { margin-top: 0.6em; }
.callout-body p { color: var(--text); }

.prose .footnote-definition { font-size: var(--fs-sm); color: var(--text-muted); }

/* <GitHubRepo> card */
.gh-repo {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  align-items: center;
  padding: var(--s-4);
  border: 1px solid var(--border);
  border-radius: 16px;
  background: color-mix(in oklab, var(--bg) 40%, transparent);
  text-decoration: none !important;
  color: var(--text) !important;
  transition: border-color var(--dur-fast), transform var(--dur-base) var(--ease-out);
}
.gh-repo:hover { border-color: var(--accent); transform: translateY(-1px); }
.gh-repo svg { width: 28px; height: 28px; grid-row: span 3; fill: none; stroke: currentColor; stroke-width: 1.6; }
.gh-repo-name { font-weight: 650; }
.gh-repo-stats { font-size: var(--fs-sm); color: var(--text-muted); display: grid; }
.gh-repo-desc { font-size: var(--fs-sm); }

/* <Tabs> */
.tabs { border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.tab-list { display: flex; gap: 4px; padding: 6px; background: var(--accent-soft); overflow-x: auto; }
.tab-list button {
  padding: 6px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  font-size: var(--fs-sm);
  font-weight: 550;
  color: var(--text-muted);
}
.tab-list button[aria-selected="true"] { background: var(--surface-strong); color: var(--text); box-shadow: var(--shadow); }
.tabs [role="tabpanel"] { padding: var(--s-4); }
.tabs [role="tabpanel"] > .code-block { margin: calc(-1 * var(--s-4)); border-radius: 0; border: 0; }
.tabs [role="tabpanel"] > * + * { margin-top: 1em; }

.mermaid-figure { overflow-x: auto; }
.mermaid { background: transparent; font-size: var(--fs-sm); }

.prose-compact { padding: 0; font-size: var(--fs-md); }
.prose-compact > * { max-width: none; }

/* code.css */
/* Code blocks. Syntect emits classes (hl-keyword, hl-string...) that each
   theme colours through --syn-* tokens. */

.code-block {
  margin-inline: auto;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--code-bg);
  overflow: hidden;
  box-shadow: inset 0 1px 0 var(--highlight);
}
.code-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 16px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  background: color-mix(in oklab, var(--accent) 4%, transparent);
}
.code-title { color: var(--text); font-weight: 500; }
.code-lang {
  margin-left: auto;
  padding: 1px 8px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  text-transform: lowercase;
}
.code-copy {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  transition: background var(--dur-fast), color var(--dur-fast), transform var(--dur-fast) var(--ease-out);
}
.code-copy:hover { background: var(--accent-soft); color: var(--text); }
.code-copy svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.code-copy[data-copied] { color: #34d399; animation: pop var(--dur-slow) var(--spring); }

.code-block pre {
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.65;
  tab-size: 4;
  font-variant-ligatures: none;
  color: var(--syn-variable);
}
.code-block code { font-family: inherit; }
.code-block pre::-webkit-scrollbar { height: 8px; }
.code-block pre::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }

.hl-comment { color: var(--syn-comment); font-style: italic; }
.hl-keyword, .hl-storage { color: var(--syn-keyword); }
.hl-keyword.hl-operator, .hl-punctuation { color: var(--syn-punct); }
.hl-string, .hl-string .hl-punctuation { color: var(--syn-string); }
.hl-constant.hl-numeric, .hl-constant.hl-language, .hl-constant.hl-character { color: var(--syn-number); }
.hl-entity.hl-name.hl-function, .hl-support.hl-function, .hl-meta.hl-function-call .hl-variable.hl-function { color: var(--syn-function); }
.hl-entity.hl-name.hl-type, .hl-support.hl-type, .hl-storage.hl-type, .hl-entity.hl-name.hl-class, .hl-entity.hl-name.hl-struct, .hl-entity.hl-name.hl-enum { color: var(--syn-type); }
.hl-meta.hl-attribute, .hl-entity.hl-other.hl-attribute-name, .hl-entity.hl-name.hl-tag { color: var(--syn-attr); }
.hl-support.hl-macro, .hl-entity.hl-name.hl-macro, .hl-meta.hl-macro { color: var(--syn-macro); }
.hl-variable.hl-parameter { color: var(--syn-variable); font-style: italic; }
.hl-markup.hl-inserted { background: var(--syn-diff-add); display: inline-block; width: 100%; }
.hl-markup.hl-deleted { background: var(--syn-diff-del); display: inline-block; width: 100%; }
.hl-entity.hl-name.hl-section, .hl-markup.hl-heading { color: var(--syn-function); font-weight: 600; }
.hl-meta.hl-mapping.hl-key, .hl-entity.hl-name.hl-tag.hl-yaml, .hl-support.hl-type.hl-property-name { color: var(--syn-attr); }

/* pages.css */
/* Page-specific layout. */

/* -- home ------------------------------------------------------------------ */

.hero {
  min-height: calc(var(--banner-full) - var(--nav-h) - var(--nav-top) - 120px);
  display: grid;
  align-content: center;
  justify-items: start;
  gap: var(--s-4);
  padding-block: var(--s-6) var(--s-8);
  max-width: var(--container);
}
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text);
  background: color-mix(in oklab, var(--surface-strong) 50%, transparent);
  border: 1px solid var(--border);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.hero-kicker .icon { color: var(--autumn); }
.hero-title {
  max-width: 16ch;
  font-size: var(--fs-display);
  line-height: 1.05;
  letter-spacing: var(--track-display);
  text-shadow: 0 2px 40px color-mix(in oklab, var(--bg) 60%, transparent);
}
.gradient-text {
  background: var(--gradient-text);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradient-drift 12s var(--ease-in-out) infinite alternate;
}
.hero-sub { max-width: 56ch; font-size: var(--fs-lg); color: var(--text-muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-2); }

.stack-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-4); }
.stack-primary {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--s-5);
  align-items: center;
  padding: var(--s-5) var(--s-6);
}
.tech-mono {
  display: grid;
  place-items: center;
  width: 96px; height: 96px;
  border-radius: 24px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--tech);
  background: color-mix(in oklab, var(--tech) 14%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--tech) 35%, transparent), 0 10px 40px -10px var(--tech);
}
.stack-primary .eyebrow { margin-bottom: 4px; }
.stack-primary-name { font-size: var(--fs-3xl); font-weight: 650; letter-spacing: var(--track-tight); }
.stack-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: var(--s-3); }
.stack-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 10px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  font-weight: 550;
  transition: transform var(--dur-base) var(--ease-out), border-color var(--dur-base);
}
.stack-item .tech-dot { grid-row: span 2; width: 10px; height: 10px; box-shadow: 0 0 10px var(--tech); }
.stack-item:hover { transform: translateY(-2px); border-color: color-mix(in oklab, var(--tech) 50%, var(--border)); }
.tag-cloud-card .tag-cloud { gap: 6px; }

/* Content overlaps the banner, like the reference design. */
.page-home .layout-sidebar { margin-top: calc(-1 * var(--s-6)); }

/* -- blog ---------------------------------------------------------------------- */

.month-group { display: grid; gap: var(--s-3); }
.month-label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: var(--fs-sm);
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
}
.month-label::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.series-steps { display: grid; gap: 4px; counter-reset: step; }
.series-steps a { display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: 10px; text-decoration: none; }
.series-steps a:hover { background: var(--accent-soft); }
.step-n {
  display: grid; place-items: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  background: var(--accent-soft);
  color: var(--accent);
}

/* -- article ---------------------------------------------------------------------- */

.page-blog .main:has(.article) { padding-top: calc(var(--nav-top) + var(--nav-h) + var(--s-6)); }

.reading-progress { position: fixed; inset: 0 0 auto; height: 3px; z-index: var(--z-progress); pointer-events: none; }
.reading-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent), var(--autumn));
  transform-origin: left;
  transform: scaleX(var(--progress, 0));
}

.article-head { display: grid; gap: var(--s-4); padding-block: var(--s-6) var(--s-5); text-align: left; }
.breadcrumb { display: flex; gap: 8px; }
.breadcrumb a { text-decoration: none; }
.article-title { font-size: var(--fs-4xl); letter-spacing: var(--track-display); line-height: 1.1; }
.article-summary { font-size: var(--fs-lg); color: var(--text-muted); }
.series-note a { display: inline-flex; align-items: center; gap: 6px; color: var(--autumn); font-weight: 600; text-decoration: none; }
.translation-note a { display: inline-flex; gap: 6px; align-items: center; }
.draft-banner {
  display: flex; gap: 8px; align-items: center;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 600;
  color: #fbbf24;
  background: rgb(251 191 36 / 0.12);
  border: 1px solid rgb(251 191 36 / 0.3);
}

.article-cover { margin-block: 0 var(--s-6); }
.article-cover img {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  border-radius: var(--r-card);
  box-shadow: 0 0 0 1px var(--border), var(--shadow-lg);
}

.article-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: var(--s-6);
  align-items: start;
}
.article-aside .sidebar-sticky { gap: var(--s-3); }
.article-main { display: grid; gap: var(--s-6); min-width: 0; }
.share { padding: var(--s-4); }
.share-buttons { display: flex; gap: 4px; }
.edit-link { display: inline-flex; align-items: center; gap: 6px; margin-top: var(--s-3); color: var(--text-muted); text-decoration: none; }
@media (max-width: 1024px) {
  .article-layout { grid-template-columns: 1fr; }
  .article-aside { order: 2; }
  .article-aside .toc { display: none; }
}

.series-nav { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }
.series-link { display: grid; gap: 4px; text-decoration: none; transition: border-color var(--dur-base), transform var(--dur-base) var(--ease-out); }
.series-link:hover { border-color: var(--accent); transform: translateY(-2px); color: inherit; }
.series-link span:first-child { display: inline-flex; align-items: center; gap: 6px; }
.series-link.next { text-align: right; justify-items: end; }

.author-card { display: grid; grid-template-columns: auto 1fr auto; gap: var(--s-4); align-items: center; }
.author-avatar { width: 72px; height: 72px; border-radius: 18px; object-fit: cover; }
.author-name { font-weight: 650; font-size: var(--fs-lg); }
.author-actions { display: flex; gap: 6px; align-items: center; }
@media (max-width: 720px) { .author-card { grid-template-columns: auto 1fr; } .author-actions { grid-column: 1 / -1; } }

.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s-4); }
.related-card { display: grid; gap: 8px; align-content: start; padding: var(--s-3); text-decoration: none; transition: transform var(--dur-base) var(--ease-out); }
.related-card:hover { transform: translateY(-3px); color: inherit; }
.related-card img { border-radius: 12px; aspect-ratio: 16 / 10; object-fit: cover; }
.related-title { font-weight: 600; line-height: 1.35; }

.comments { display: grid; gap: var(--s-4); justify-items: start; }
.comments .giscus { width: 100%; }

.back-to-top {
  position: fixed;
  right: 24px; bottom: 24px;
  z-index: var(--z-nav);
  border-radius: 14px;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.back-to-top[data-show] { opacity: 1; transform: none; pointer-events: auto; }

/* -- projects ---------------------------------------------------------------------- */

.flagship-wide { margin-bottom: var(--s-2); }

.project-head { padding-block: var(--s-5) var(--s-6); }
.project-head-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr); gap: var(--s-6); align-items: center; }
.project-head-grid > div { display: grid; gap: var(--s-4); justify-items: start; }
.project-cover { padding: 8px; margin: 0; }
.project-cover img { border-radius: 14px; }
@media (max-width: 860px) { .project-head-grid { grid-template-columns: 1fr; } .project-cover { order: -1; } }

.project-tabs {
  position: sticky;
  top: calc(var(--nav-top) + var(--nav-h) + 10px);
  z-index: 5;
  display: flex;
  gap: 4px;
  width: fit-content;
  max-width: calc(100% - 2 * var(--gutter));
  margin: 0 auto var(--s-6);
  padding: 6px;
  border-radius: 14px;
  overflow-x: auto;
}
.project-tabs a { padding: 8px 14px; border-radius: 10px; font-size: var(--fs-sm); font-weight: 550; text-decoration: none; color: var(--text-muted); white-space: nowrap; }
.project-tabs a:hover, .project-tabs a[aria-current="true"] { background: var(--accent-soft); color: var(--text); }
.project-sections { display: grid; gap: var(--s-7); }
.project-sections > .prose { scroll-margin-top: 150px; }

.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--s-4); }
.shot { margin: 0; padding: 8px; display: grid; gap: 8px; }
.shot img { border-radius: 12px; cursor: zoom-in; }
.shot figcaption { padding: 0 8px 6px; }

.timeline { position: relative; display: grid; gap: var(--s-4); padding-left: 28px; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(var(--accent), transparent); }
.timeline-item { position: relative; }
.timeline-dot { position: absolute; left: -26px; top: 22px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 3px solid var(--accent); }
.timeline-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.version { font-weight: 700; color: var(--accent); font-size: var(--fs-lg); }

.roadmap { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); }
@media (max-width: 860px) { .roadmap { grid-template-columns: 1fr; } }
.roadmap-col { padding: var(--s-4); }
.roadmap-col-title { display: flex; align-items: center; gap: 8px; margin-bottom: var(--s-3); font-size: var(--fs-md); }
.state-dot { width: 10px; height: 10px; border-radius: 50%; }
.state-planned { background: var(--text-faint); }
.state-in_progress { background: #fbbf24; box-shadow: 0 0 10px rgb(251 191 36 / 0.6); }
.state-done { background: #34d399; }
.roadmap-items { display: grid; gap: 8px; }
.roadmap-item {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg) 35%, transparent);
  font-size: var(--fs-sm);
}
.roadmap-done .roadmap-item { color: var(--text-muted); }
.milestone { font-size: 0.72rem; color: var(--accent); }

/* -- search & errors ------------------------------------------------------------------- */

.search-results { display: grid; gap: var(--s-3); }
.search-hit { display: grid; gap: 6px; }
.hit-kind { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); font-weight: 650; }
.hit-title { font-size: var(--fs-xl); font-weight: 600; text-decoration: none; }

.error-page { display: grid; justify-items: center; text-align: center; gap: var(--s-4); padding-block: var(--s-9); }
.error-code {
  font-size: clamp(5rem, 14vw, 9rem);
  font-weight: 700;
  line-height: 1;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* -- zoomed images ------------------------------------------------------------------------ */

.zoom-overlay {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  padding: 4vmin;
  background: rgb(4 6 12 / 0.78);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  cursor: zoom-out;
  animation: fade-in var(--dur-base) var(--ease-out);
}
.zoom-overlay img { max-width: 100%; max-height: 100%; border-radius: 16px; box-shadow: var(--shadow-lg); animation: zoom-in var(--dur-slow) var(--ease-out); }

/* motion.css */
/* Motion. Each animation has one job:
   - reveal: pace the discovery of cards, once, as they enter the viewport
   - view transitions: keep continuity between a card and its article
   - theme switch: show where the new theme comes from (the button)
   - gradient drift: a single focal point on the home page
   Everything is disabled with prefers-reduced-motion. */

@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(-6px) scale(0.96); } }
@keyframes palette-in { from { opacity: 0; transform: translateY(-12px) scale(0.98); } }
@keyframes zoom-in { from { opacity: 0; transform: scale(0.94); } }
@keyframes grow { from { transform: scaleX(0); } }
@keyframes pop { 50% { transform: scale(1.2); } }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px transparent; } }
@keyframes gradient-drift { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }

/* Scroll-driven reveal, no JavaScript: browsers without support simply show
   the content. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 35%;
    }
  }
}

/* First paint of the hero. */
@media (prefers-reduced-motion: no-preference) {
  .hero > * { animation: rise 700ms var(--ease-out) both; }
  .hero > :nth-child(2) { animation-delay: 60ms; }
  .hero > :nth-child(3) { animation-delay: 120ms; }
  .hero > :nth-child(4) { animation-delay: 180ms; }
  .page-head > *, .article-head > * { animation: rise 600ms var(--ease-out) both; }
  .page-head > :nth-child(2), .article-head > :nth-child(2) { animation-delay: 50ms; }
  .page-head > :nth-child(3), .article-head > :nth-child(3) { animation-delay: 100ms; }
}

/* Cross-document view transitions between pages of the site. */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: var(--dur-slow); animation-timing-function: var(--ease-out); }
::view-transition-group(*) { animation-duration: var(--dur-slow); animation-timing-function: var(--ease-out); }

/* Theme switch: the new theme grows out of the button (animated from JS). */
html[data-theme-switching]::view-transition-old(root),
html[data-theme-switching]::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
html[data-theme-switching]::view-transition-old(root) { z-index: 1; }
html[data-theme-switching]::view-transition-new(root) { z-index: 2; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .banner-layer { transform: none !important; }
  .banner-particles { display: none; }
  @view-transition { navigation: none; }
}

