/* Virtual Git Server: the project page, and the base of the documentation.
   Tokens first (light, then dark: by system unless data-theme says otherwise),
   then the layout from the top of the page to the bottom. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("fonts/bricolage.woff2") format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}

@font-face {
  font-family: "Martian Mono";
  src: url("fonts/martian-mono.woff2") format("woff2");
  font-weight: 100 800;
  font-stretch: 75% 112.5%;
  font-display: swap;
}

:root {
  --bg: #f6f5f9;
  --surface: #ffffff;
  --sunken: #eeecf4;
  --ink: #1c1828;
  --muted: #5d5770;
  --line: #e2dfea;
  --accent: #6a2bd9;          /* links, focus, the one accent */
  --accent-soft: #efe7fe;
  --accent-ink: #ffffff;      /* text on --accent */
  --bar: #7c3aed;             /* chart marks, validated against --surface */
  --online: #17845a;
  --warn: #a8570a;
  --term: #1c1828;            /* the terminal stays dark in both themes */
  --term-ink: #e9e6f2;
  --term-muted: #9a93ae;
  --term-accent: #c9a8ff;
  --shadow: 0 1px 2px rgb(28 24 40 / 6%), 0 12px 32px -12px rgb(28 24 40 / 18%);
  --radius-l: 14px;
  --radius-m: 10px;
  --radius-s: 6px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14121b;
    --surface: #1d1a27;
    --sunken: #191622;
    --ink: #ecebf2;
    --muted: #a39db5;
    --line: #2e2a3b;
    --accent: #c4a3ff;
    --accent-soft: #2a2140;
    --accent-ink: #14121b;
    --bar: #9466f5;
    --online: #4cc995;
    --warn: #f0a85a;
    --term: #0f0d15;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 16px 40px -16px rgb(0 0 0 / 60%);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #14121b;
  --surface: #1d1a27;
  --sunken: #191622;
  --ink: #ecebf2;
  --muted: #a39db5;
  --line: #2e2a3b;
  --accent: #c4a3ff;
  --accent-soft: #2a2140;
  --accent-ink: #14121b;
  --bar: #9466f5;
  --online: #4cc995;
  --warn: #f0a85a;
  --term: #0f0d15;
  --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 16px 40px -16px rgb(0 0 0 / 60%);
  color-scheme: dark;
}

/* in dark, the terminal-coloured blocks need an edge to stand off the page */
:root[data-theme="dark"] .cmd, :root[data-theme="dark"] .term { box-shadow: 0 0 0 1px rgb(255 255 255 / 8%), var(--shadow); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cmd, :root:not([data-theme="light"]) .term { box-shadow: 0 0 0 1px rgb(255 255 255 / 8%), var(--shadow); }
}

/* ---------- base ---------- */

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

html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; line-height: 1.1; font-weight: 700; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
code, pre, .tool { font-family: "Martian Mono", ui-monospace, monospace; font-stretch: 87.5%; }
code { font-size: 0.84em; }
:not(pre) > code {
  background: var(--sunken);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.05em 0.35em;
  white-space: nowrap;
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: min(1160px, 100% - 48px); margin-inline: auto; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: var(--radius-s);
}
.skip:focus { top: 12px; }

/* ---------- header ---------- */

.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.top.scrolled { border-bottom-color: var(--line); }
.top-inner { display: flex; align-items: center; gap: 28px; height: 64px; }

.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.mark { width: 28px; height: 28px; flex: none; }
.brand-name { font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; }
.brand-edition {
  font-size: 0.8rem; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 1px 9px;
}

.nav { display: flex; gap: 22px; margin-left: auto; }
.nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.nav a:hover { color: var(--ink); }

.top-actions { display: flex; align-items: center; gap: 6px; }
.icon-link, .theme {
  display: grid; place-items: center; width: 38px; height: 38px;
  border-radius: 999px; border: 1px solid transparent; background: none; color: var(--ink); cursor: pointer;
}
.icon-link:hover, .theme:hover { border-color: var(--line); background: var(--surface); }
.icon-link svg { width: 20px; height: 20px; fill: currentColor; }
.theme svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.theme .moon { display: none; }
.dark-active .theme .sun { display: none; }
.dark-active .theme .moon { display: block; }

/* ---------- hero ---------- */

.hero { padding: 72px 0 96px; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 64px; align-items: center; }

h1 {
  font-size: clamp(2.6rem, 5.4vw, 4.4rem);
  font-weight: 720;
  font-stretch: 86%;
  letter-spacing: -0.02em;
  line-height: 0.98;
}
.lead { margin-top: 24px; font-size: 1.2rem; line-height: 1.55; color: var(--muted); max-width: 34em; }

.cmd {
  position: relative; margin-top: 32px;
  background: var(--term); color: var(--term-ink);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow);
}
.cmd pre { margin: 0; padding: 18px 84px 18px 20px; overflow-x: auto; font-size: 0.8rem; line-height: 1.7; scrollbar-width: thin; }
.cmd code { font-size: inherit; }
.cmd .sh { color: var(--term-muted); user-select: none; }
.cmd [data-origin] { color: var(--term-accent); }
.copy {
  position: absolute; top: 10px; right: 10px;
  font: inherit; font-size: 0.82rem; font-weight: 600;
  color: var(--term-ink); background: rgb(255 255 255 / 8%);
  border: 1px solid rgb(255 255 255 / 14%); border-radius: var(--radius-s);
  padding: 5px 12px; cursor: pointer;
}
.copy:hover { background: rgb(255 255 255 / 16%); }
.copy.done { color: #8fe3bd; border-color: rgb(143 227 189 / 40%); }

.after-cmd { margin-top: 12px; color: var(--muted); font-size: 0.95rem; }
.after-cmd code { background: none; border: 0; padding: 0; color: var(--ink); }

.facts { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 28px 0 0; }
.facts li { font-size: 0.88rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; }

@keyframes blink { 50% { opacity: 0; } }

/* ---------- sections ---------- */

.section { padding: 104px 0; border-top: 1px solid var(--line); }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); font-weight: 700; font-stretch: 88%; letter-spacing: -0.02em; max-width: 22em; }
.section-lead { margin-top: 16px; color: var(--muted); font-size: 1.12rem; max-width: 40em; }
h3 { font-size: 1.2rem; font-weight: 650; letter-spacing: -0.01em; }

/* why */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 48px; }
.compare-col { border-radius: var(--radius-l); padding: 28px 30px; }
.compare-col ul { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; }
.compare-col li { position: relative; padding-left: 28px; }
.compare-col li::before { content: ""; position: absolute; left: 0; top: 0.52em; width: 14px; height: 14px; border-radius: 50%; }
.before { background: var(--sunken); color: var(--muted); }
.before h3 { color: var(--ink); }
.before li::before { border: 1.5px solid var(--muted); width: 12px; height: 12px; top: 0.55em; border-radius: 3px; }
.after { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.after li::before { background: var(--accent); }
.after li::after {
  content: ""; position: absolute; left: 5px; top: calc(0.52em + 3px); width: 3.5px; height: 6.5px;
  border: solid var(--surface); border-width: 0 1.8px 1.8px 0; transform: rotate(45deg);
}
.proof { margin-top: 28px; color: var(--muted); max-width: 46em; }


/* good to know */
.know-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; margin-top: 40px; }
.know-grid > div { border-top: 2px solid var(--ink); padding-top: 18px; }
.know-grid p { margin-top: 10px; color: var(--muted); }

/* faq */
.faq-wrap { display: grid; grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr); gap: 64px; align-items: start; }
.faq-list { border-top: 1px solid var(--line); }
details { border-bottom: 1px solid var(--line); }
summary {
  list-style: none; cursor: pointer; padding: 18px 40px 18px 0; position: relative; font-weight: 600; font-size: 1.1rem;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: ""; position: absolute; right: 8px; top: 50%; width: 10px; height: 10px; margin-top: -7px;
  border: solid var(--muted); border-width: 0 1.8px 1.8px 0; transform: rotate(45deg); transition: transform .2s;
}
details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
summary:hover { color: var(--accent); }
details p { padding: 0 0 20px; color: var(--muted); max-width: 40em; }

/* closing */
.closing { padding: 112px 0 96px; background: var(--term); color: var(--term-ink); }
.closing-inner { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: start; }
.closing h2 { color: #fff; font-size: clamp(2rem, 4.6vw, 3.4rem); font-stretch: 82%; }
.closing .cmd { margin-top: 36px; background: rgb(255 255 255 / 6%); box-shadow: none; border: 1px solid rgb(255 255 255 / 12%); max-width: 100%; }
.links { display: flex; flex-wrap: wrap; gap: 10px 28px; list-style: none; padding: 0; margin: 36px 0 0; }
.links a { color: var(--term-accent); }

/* footer */
.foot { padding: 28px 0 36px; background: var(--term); color: var(--term-muted); font-size: 0.9rem; border-top: 1px solid rgb(255 255 255 / 8%); }
.foot-inner { display: flex; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; }
.foot a { color: var(--term-ink); }

/* ---------- code blocks, on the page and in the docs ---------- */

.code {
  position: relative; background: var(--term); color: var(--term-ink);
  border-radius: var(--radius-m); box-shadow: var(--shadow); overflow: hidden;
}
.code-label {
  font: 600 0.72rem "Martian Mono", ui-monospace, monospace; font-stretch: 87.5%;
  color: var(--term-muted); padding: 10px 16px 0; letter-spacing: 0.02em;
}
.code pre { margin: 0; padding: 12px 16px 16px; overflow-x: auto; font-size: 0.8rem; line-height: 1.7; scrollbar-width: thin; tab-size: 4; }
.code-label + pre { padding-top: 8px; }
.code pre code { font-size: inherit; background: none; border: 0; padding: 0; white-space: pre; }
.code .copy { top: 8px; right: 8px; opacity: 0; transition: opacity .15s; }
.code:hover .copy, .code .copy:focus-visible, .code .copy.done { opacity: 1; }
@media (hover: none) { .code .copy { opacity: 1; } }
:root[data-theme="dark"] .code { box-shadow: 0 0 0 1px rgb(255 255 255 / 8%), var(--shadow); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .code { box-shadow: 0 0 0 1px rgb(255 255 255 / 8%), var(--shadow); } }

/* highlight.js, on the dark block in both themes */
.hljs-comment, .hljs-quote { color: #8a83a0; font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-built_in, .hljs-literal { color: #c9a8ff; }
.hljs-string, .hljs-regexp, .hljs-addition, .hljs-template-string { color: #8fe3bd; }
.hljs-number, .hljs-symbol, .hljs-bullet { color: #f6c177; }
.hljs-title, .hljs-title.function_, .hljs-section { color: #7cc7ff; }
.hljs-title.class_, .hljs-type, .hljs-class .hljs-title { color: #ffd38a; }
.hljs-attr, .hljs-attribute, .hljs-variable, .hljs-template-variable, .hljs-property { color: #a5d6ff; }
.hljs-meta, .hljs-meta .hljs-keyword { color: #ff9e9e; }
.hljs-name, .hljs-tag { color: #ff9ebd; }
.hljs-params { color: var(--term-ink); }
.hljs-deletion { color: #ff8f8f; }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 700; }


/* ---------- the project page ---------- */

.hero-grid { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); gap: 56px; align-items: center; }
h1 .soft { color: var(--accent); }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 28px; }
.btn { display: inline-block; background: var(--accent); color: var(--accent-ink); text-decoration: none; font-weight: 600; padding: 10px 18px; border-radius: var(--radius-m); }
.btn:hover { filter: brightness(1.08); }
.btn-line { color: var(--ink); text-decoration: none; font-weight: 600; padding: 9px 17px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); }
.btn-line:hover { border-color: var(--accent); }

.demo { display: grid; gap: 14px; min-width: 0; }
.demo .code { margin: 0; }
.shell .out { color: var(--term-muted); }
.shell .ok { color: #8fe3bd; }
.shell .sh { color: var(--term-muted); user-select: none; }
.shell .rem { color: var(--term-accent); }

/* the interface: four methods */
.methods { list-style: none; padding: 0; margin: 48px 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; counter-reset: m; }
.methods li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 22px 22px 24px; }
.methods li > code { display: block; width: fit-content; max-width: 100%; overflow-wrap: anywhere; white-space: normal; color: var(--accent); font-size: 0.8rem; }
.methods h3 { margin-top: 14px; }
.methods p { margin-top: 8px; color: var(--muted); font-size: 0.97rem; }
.methods .opt { background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface)); border-style: dashed; }

.two { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 56px; align-items: start; margin-top: 48px; }
.two .code { margin: 0; }
.points { list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; }
.points b { display: block; }
.points span { color: var(--muted); }

/* use cases */
.uses { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; margin-top: 40px; }
.uses > div { border-top: 2px solid var(--ink); padding-top: 18px; }
.uses p { margin-top: 10px; color: var(--muted); }

/* the feature table */
.matrix { width: 100%; border-collapse: collapse; margin-top: 40px; font-size: 0.98rem; }
.matrix th, .matrix td { text-align: left; vertical-align: top; padding: 14px 0; border-top: 1px solid var(--line); }
.matrix th { padding-right: 28px; font-weight: 650; white-space: nowrap; width: 9rem; }
.matrix td { color: var(--muted); }
.matrix td code { white-space: normal; }
.not { margin-top: 20px; color: var(--muted); font-size: 0.95rem; max-width: 52em; }

/* ---------- smaller screens ---------- */

@media (max-width: 1020px) {
  .hero-grid, .two, .faq-wrap { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .methods { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .uses { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  html { scroll-padding-top: 116px; }
  .top-inner { flex-wrap: wrap; height: auto; min-height: 56px; column-gap: 12px; row-gap: 0; padding-top: 8px; }
  .top-inner > .nav {
    order: 3; width: calc(100% + 32px); margin: 0 -16px; padding: 2px 16px 10px; gap: 20px;
    overflow-x: auto; white-space: nowrap; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .top-inner > .nav::-webkit-scrollbar { display: none; }
  .top-inner > .nav a[href^="docs"] { order: -1; color: var(--accent); font-weight: 600; }
  .wrap { width: min(1160px, 100% - 32px); }
  .top-actions { margin-left: auto; }
  .brand-edition { display: none; }
  .hero { padding: 40px 0 72px; }
  .section { padding: 72px 0; }
  .compare, .methods, .uses { grid-template-columns: minmax(0, 1fr); }
  .matrix th, .matrix td { display: block; padding: 4px 0; border: 0; width: auto; }
  .matrix tr { display: block; border-top: 1px solid var(--line); padding: 10px 0; }
  .cmd pre { padding-right: 20px; padding-top: 46px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media (forced-colors: active) {
  .after li::before { background: CanvasText; }
}

/* ---------- 404 ---------- */

.lost { padding: 96px 0 128px; min-height: 70vh; }
.lost-code { font-family: "Martian Mono", ui-monospace, monospace; font-stretch: 87.5%; color: var(--accent); font-size: 0.95rem; }
.lost h1 { margin-top: 12px; max-width: 14em; }
.lost-links { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: 36px; }
.lost-home { background: var(--accent); color: var(--accent-ink); text-decoration: none; font-weight: 600; padding: 10px 18px; border-radius: var(--radius-m); }
