@font-face {
  font-family: "Manrope";
  src: url("/assets/fonts/manrope-latin-variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
}

@font-face {
  font-family: "Source Sans 3";
  src: url("/assets/fonts/source-sans-3-latin-variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/jetbrains-mono-latin-variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --accent: #35e5ff;
  --accent-raw: #35e5ff;
  --accent-text: #35e5ff;
  --accent-rgb: 53, 229, 255;
  --accent-ink: #071013;
  --bg: #08090b;
  --bg-soft: #0d0f12;
  --surface: #111317;
  --text: #f2f3f2;
  --text-soft: #a2a7ad;
  --text-muted: #676d74;
  --line: rgb(255 255 255 / 11%);
  --line-strong: rgb(255 255 255 / 24%);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.7, 0, 0.84, 0);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-sharp: cubic-bezier(0.76, 0, 0.24, 1);
  --ease-settle: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-instant: 100ms;
  --duration-fast: 140ms;
  --duration-base: 240ms;
  --duration-hover: 420ms;
  --duration-hover-out: 180ms;
  --duration-slow: 420ms;
  --duration-theme: 540ms;
  --duration-scene: 700ms;
  --duration-hero: 840ms;
  --duration-route-out: 180ms;
  --duration-route-in: 320ms;
  --hover-delay: 18ms;
  --hover-delay-interactive: 8ms;
  --cursor-hit-slop: 5px;
  --cursor-expand-delay: 20ms;
  --cursor-expand-duration: 150ms;
  --topbar-height: 88px;
  --topbar-height-mobile: 74px;
  --page-inline: clamp(22px, 4vw, 58px);
  --lab-rail-width: 210px;
  --lab-rail-gap: clamp(40px, 7vw, 110px);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  --radius-sm: 2px;
  --radius-pill: 999px;
  --control-height-md: 44px;
  --font-content: "Source Sans 3", "Noto Sans SC", "Microsoft YaHei UI", "PingFang SC", sans-serif;
  --font-ui: "Manrope", "Noto Sans SC", "Microsoft YaHei UI", "PingFang SC", sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f2ef;
  --bg-soft: #e9e9e5;
  --surface: #fafaf7;
  --text: #0a0c0e;
  --text-soft: #555b61;
  --text-muted: #8a8f94;
  --line: rgb(8 10 12 / 10%);
  --line-strong: rgb(8 10 12 / 24%);
}

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

html {
  min-width: 320px;
  background: var(--bg);
  scrollbar-color: var(--accent) var(--bg-soft);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: clip;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

button {
  color: inherit;
}

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

:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 5px;
}

.skip-link {
  z-index: 1000;
  position: fixed;
  top: 12px;
  left: 12px;
  padding: 9px 12px;
  color: var(--accent-ink);
  background: var(--accent);
  font: 650 11px var(--font-ui);
  transform: translateY(-160%);
  transition: transform var(--duration-fast) var(--ease-out);
}

.skip-link:focus {
  transform: translateY(0);
}

.minimal-nav {
  z-index: 1000;
  position: sticky;
  top: 0;
  left: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  height: var(--topbar-height);
  padding: 0 var(--page-inline);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  opacity: 1 !important;
  transform: none !important;
  visibility: visible !important;
}

.wordmark {
  justify-self: start;
  color: var(--text);
  font: 680 18px var(--font-ui);
  letter-spacing: -0.025em;
  text-decoration: none;
}

.nav-slot {
  display: block;
}

.theme-dock {
  position: relative;
  justify-self: end;
}

.theme-trigger {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 0;
  border: 0;
  color: var(--text-soft);
  background: transparent;
  cursor: pointer;
  font: 500 11px var(--font-ui);
  transition: color var(--duration-hover-out) ease;
}

.theme-trigger:hover,
.theme-trigger[aria-expanded="true"] {
  color: var(--text);
  transition-duration: var(--duration-hover);
  transition-delay: var(--hover-delay-interactive);
}

.theme-swatch {
  display: block;
  width: 9px;
  height: 9px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px rgb(var(--accent-rgb) / 48%);
  transition: transform var(--duration-base) var(--ease-settle);
}

.theme-trigger:hover .theme-swatch,
.theme-trigger[aria-expanded="true"] .theme-swatch {
  transform: scale(1.35);
}

.theme-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: min(320px, calc(100vw - 44px));
  padding: 14px;
  border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: 0 22px 64px rgb(0 0 0 / 28%);
  transform-origin: top right;
  animation: theme-panel-in var(--duration-base) var(--ease-out) both;
}

@keyframes theme-panel-in {
  from {
    opacity: 0;
    clip-path: inset(0 0 100% 0);
    transform: translateY(-5px);
  }

  to {
    opacity: 1;
    clip-path: inset(0);
    transform: translateY(0);
  }
}

.theme-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--line);
}

.theme-modes button {
  min-height: 36px;
  border: 0;
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
  font: 600 9px var(--font-mono);
  letter-spacing: 0.06em;
  transition:
    color var(--duration-hover) ease,
    background var(--duration-hover) ease;
}

.theme-modes button:hover,
.theme-modes button[aria-pressed="true"] {
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 11%, transparent);
}

.theme-modes button[aria-pressed="true"] {
  box-shadow: inset 0 -2px var(--accent);
}

.accent-presets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  padding-top: 14px;
}

.accent-preset {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition:
    border-color var(--duration-hover-out) ease,
    transform var(--duration-hover-out) var(--ease-out);
}

.accent-preset span {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--preset-visible, var(--preset));
  transition: transform var(--duration-base) var(--ease-settle);
}

.accent-preset:hover {
  border-color: var(--preset-visible, var(--preset));
  transform: translateY(-2px);
  transition-duration: var(--duration-hover);
  transition-delay: var(--hover-delay-interactive);
}

.accent-preset:hover span {
  transform: scale(1.25);
}

.accent-preset[aria-pressed="true"] {
  border-color: var(--line-strong);
  box-shadow: inset 0 -2px var(--preset-visible, var(--preset));
}

.custom-accent {
  display: grid;
  place-items: center;
  width: 44px;
  height: 34px;
  cursor: pointer;
}

.custom-accent input {
  width: 32px;
  height: 24px;
  padding: 2px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
  cursor: pointer;
}

::view-transition-old(root),
::view-transition-new(root) {
  mix-blend-mode: normal;
  animation-duration: 1ms;
}

::view-transition-new(root) {
  animation: theme-reveal var(--duration-theme) var(--ease-out) both;
}

@keyframes theme-reveal {
  from {
    clip-path: circle(0 at var(--theme-x, 90%) var(--theme-y, 10%));
  }

  to {
    clip-path: circle(150vmax at var(--theme-x, 90%) var(--theme-y, 10%));
  }
}

html.is-theme-shifting body {
  animation: theme-fallback var(--duration-slow) var(--ease-out);
}

@keyframes theme-fallback {
  from {
    filter: brightness(0.75);
    opacity: 0.86;
  }
}

.page-frame {
  position: relative;
  z-index: 0;
  animation: page-frame-in var(--duration-route-in) var(--ease-out) both;
}

body.is-routing .page-frame {
  animation: none;
  opacity: 0;
  transform: translateY(-8px) scale(0.995);
  clip-path: inset(0 0 5% 0);
  pointer-events: none;
  transition:
    opacity var(--duration-route-out) var(--ease-in),
    transform var(--duration-route-out) var(--ease-in),
    clip-path var(--duration-route-out) var(--ease-in);
}

body.is-routing .minimal-nav {
  opacity: 1 !important;
  transform: none !important;
  visibility: visible !important;
}

@keyframes page-frame-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.995);
    clip-path: inset(5% 0 0 0);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    clip-path: inset(0);
  }
}

@media (max-width: 600px) {
  .minimal-nav {
    height: var(--topbar-height-mobile);
    padding: 0 18px;
  }

  .wordmark {
    font-size: 16px;
  }

  .theme-panel {
    right: -4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}

html.snapshot-mode *,
html.snapshot-mode *::before,
html.snapshot-mode *::after {
  animation: none !important;
  transition: none !important;
}

html.snapshot-mode {
  scroll-behavior: auto;
}

