:root {
  color-scheme: dark;
  --bg: #05060a;
  --panel: #10151d;
  --text: #f4fbff;
  --muted: #aebac4;
  --line: rgba(220, 245, 255, 0.18);
  --accent: #9ff4ff;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 70% 0%, rgba(159, 244, 255, 0.1), transparent 28rem),
    var(--bg);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.65;
}

a {
  color: var(--accent);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: 1rem;
  transform: translateY(-200%);
}

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

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(5, 6, 10, 0.82);
}

.header-inner,
.content-wrap {
  width: min(calc(100% - 32px), 1120px);
  margin: 0 auto;
  min-width: 0;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 0;
}

.project-title {
  color: var(--text);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-decoration: none;
}

.project-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 14px;
  font-size: 0.9rem;
}

.top-nav a {
  color: var(--muted);
  text-decoration: none;
}

.top-nav a[aria-current="page"] {
  color: var(--text);
}

.content-wrap {
  padding: 56px 0 84px;
}

.with-toc {
  display: grid;
  grid-template-columns: minmax(0, 860px) minmax(220px, 280px);
  gap: 48px;
  align-items: start;
}

.prose {
  max-width: 860px;
  min-width: 0;
}

.prose h1 {
  margin: 0 0 22px;
  font-size: clamp(2.6rem, 7vw, 5.5rem);
  line-height: 0.95;
}

.prose h2 {
  margin-top: 42px;
  color: var(--text);
  font-size: clamp(1.55rem, 4vw, 2.5rem);
  line-height: 1.08;
}

.prose h3 {
  margin-top: 28px;
}

.prose p,
.prose li,
.prose td,
.prose th {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.prose strong {
  color: var(--text);
}

.prose a,
.prose code,
.site-footer code {
  overflow-wrap: anywhere;
}

.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 1.25rem 0 2rem;
}

.video-embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.prose table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 24px 0;
  background: rgba(255, 255, 255, 0.035);
}

.prose th,
.prose td {
  border: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 42px 0;
}

.toc {
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow: auto;
  border: 1px solid var(--line);
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.02)),
    rgba(5, 6, 10, 0.72);
  backdrop-filter: blur(18px);
}

.toc h2 {
  margin: 0 0 14px;
  color: var(--text);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.toc ul {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc li {
  line-height: 1.25;
}

.toc a {
  color: var(--muted);
  font-size: 0.82rem;
  text-decoration: none;
  transition: color 160ms ease;
}

.toc a:hover,
.toc a:focus-visible {
  color: var(--text);
}

.toc-sub {
  padding-left: 12px;
}

.site-footer {
  width: min(calc(100% - 32px), 1120px);
  margin: 0 auto 48px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}

.site-footer p {
  margin: 6px 0;
  color: var(--muted);
}

img.logo{
  width: 200px;
  display: block;
  position: relative;
}

@media (max-width: 760px) {
  .header-inner {
    flex-direction: column;
  }

  .top-nav {
    justify-content: flex-start;
  }

  .with-toc {
    grid-template-columns: 1fr;
  }

  .toc {
    position: static;
    max-height: none;
    order: -1;
  }
}
