:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --panel: #ffffff;
  --panel-muted: #eef3f7;
  --text: #17212b;
  --muted: #566573;
  --line: #d7e0e7;
  --accent: #006d68;
  --accent-strong: #004f4b;
  --accent-soft: #d9f0ee;
  --focus: #b45f06;
  --code-bg: #111820;
  --code-text: #eef6f8;
  --radius: 8px;
  --max: 1100px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #11161b;
  --panel: #1a2229;
  --panel-muted: #222d35;
  --text: #eef4f7;
  --muted: #a9b6c0;
  --line: #34434e;
  --accent: #4ed0c5;
  --accent-strong: #84e6de;
  --accent-soft: #173f3c;
  --focus: #f2b35e;
  --code-bg: #0c1116;
  --code-text: #f4fbfc;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

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

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: 1rem;
  z-index: 20;
  transform: translateY(-180%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.6rem 0.8rem;
}

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

header {
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.nav {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1rem;
  display: grid;
  gap: 0.9rem;
}

.brand {
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
  line-height: 1.2;
}

.brand span {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
}

nav ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

nav a,
.theme-toggle,
.button {
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 700;
  min-height: 2.75rem;
  padding: 0.55rem 0.75rem;
}

nav a {
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

nav a:hover,
nav a[aria-current="page"] {
  background: var(--panel-muted);
  color: var(--text);
}

.theme-toggle {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  cursor: pointer;
}

main {
  overflow: clip;
}

section {
  padding: 3.5rem 1rem;
}

section:nth-of-type(even) {
  background: var(--panel);
  border-block: 1px solid var(--line);
}

.inner {
  max-width: var(--max);
  margin: 0 auto;
}

.hero {
  padding-top: 4rem;
}

.hero-grid,
.cards,
.doc-links,
.architecture-branches,
.guide-layout {
  display: grid;
  gap: 1rem;
}

.eyebrow {
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 0.4rem;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  letter-spacing: 0;
  line-height: 1.15;
  margin: 0;
}

h1 {
  font-size: 2.35rem;
  max-width: 12ch;
}

h2 {
  font-size: 1.55rem;
  margin-bottom: 0.75rem;
}

h3 {
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
}

p {
  margin: 0;
}

.lead,
.muted,
.section-intro {
  color: var(--muted);
}

.lead {
  font-size: 1.1rem;
  margin-top: 1rem;
  max-width: 67ch;
}

.section-intro {
  max-width: 76ch;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.4rem;
}

.button {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  display: inline-flex;
  justify-content: center;
  text-decoration: none;
}

.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

[data-theme="dark"] .button.primary {
  color: #06201e;
}

.summary-list {
  display: grid;
  gap: 0.8rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.summary-list li,
.card,
.doc-link,
.main-flow li,
.architecture-branches article,
.guide-toc,
.guide-content {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

section:nth-of-type(even) .summary-list li,
section:nth-of-type(even) .card,
section:nth-of-type(even) .doc-link,
section:nth-of-type(even) .main-flow li,
section:nth-of-type(even) .architecture-branches article {
  background: var(--bg);
}

.summary-list li,
.card,
.doc-link,
.architecture-branches article {
  padding: 1rem;
}

.cards,
.doc-links,
.architecture-flow {
  margin-top: 1.2rem;
}

.card p,
.doc-link span,
.architecture-branches span {
  color: var(--muted);
}

.main-flow {
  display: grid;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-flow li {
  min-height: 4rem;
  display: grid;
  place-items: center;
  padding: 0.7rem;
  position: relative;
  text-align: center;
  font-weight: 800;
}

.main-flow li:not(:last-child)::after {
  content: "\2193";
  color: var(--accent-strong);
  position: absolute;
  bottom: -1.55rem;
  font-size: 1.15rem;
}

.main-flow li:nth-child(5) {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.architecture-branches {
  margin-top: 1rem;
}

.architecture-branches article {
  display: grid;
  gap: 0.25rem;
}

pre {
  background: var(--code-bg);
  border-radius: var(--radius);
  color: var(--code-text);
  overflow-x: auto;
  padding: 1rem;
  margin: 1rem 0 0;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

p code,
span code,
li code {
  background: var(--panel-muted);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 0.92em;
  padding: 0.05rem 0.25rem;
}

.doc-link {
  color: var(--text);
  display: grid;
  gap: 0.2rem;
  text-decoration: none;
}

footer {
  color: var(--muted);
  padding: 2rem 1rem;
}

footer div {
  max-width: var(--max);
  margin: 0 auto;
}

.guide-hero {
  padding-bottom: 2.5rem;
}

.guide-hero h1 {
  max-width: none;
}

.guide-section {
  padding-top: 0;
}

.guide-toc,
.guide-content {
  padding: 1rem;
}

.guide-toc {
  align-self: start;
}

.guide-toc h2 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.guide-toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.guide-toc li + li {
  margin-top: 0.45rem;
}

.guide-toc .toc-level-3 {
  padding-left: 1rem;
}

.guide-toc a {
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
}

.guide-toc a:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

.guide-content {
  min-width: 0;
}

.guide-content h2,
.guide-content h3 {
  scroll-margin-top: 1.5rem;
}

.guide-content h2 {
  font-size: 1.35rem;
  margin: 2.5rem 0 0.75rem;
}

.guide-content h2:first-child {
  margin-top: 0;
}

.guide-content h3 {
  font-size: 1.05rem;
  margin: 1.6rem 0 0.45rem;
}

.guide-content p,
.guide-content li {
  color: var(--muted);
  max-width: 72ch;
}

.guide-content p + p,
.guide-content ul + p,
.guide-content ol + p,
.guide-content pre + p {
  margin-top: 0.85rem;
}

.guide-content ul,
.guide-content ol {
  margin: 0.75rem 0 0;
  padding-left: 1.35rem;
}

.guide-content li + li {
  margin-top: 0.35rem;
}

.guide-content pre {
  margin: 0.85rem 0 0;
}

.guide-content pre code {
  background: transparent;
  border: 0;
  color: inherit;
  padding: 0;
}

.guide-content blockquote {
  border-left: 4px solid var(--accent);
  color: var(--muted);
  margin: 1rem 0 0;
  padding-left: 1rem;
}

@media (min-width: 760px) {
  .nav {
    align-items: center;
    grid-template-columns: 1fr auto;
  }

  nav ul {
    display: flex;
    flex-wrap: wrap;
  }

  .theme-toggle {
    width: auto;
  }

  h1 {
    font-size: 3.6rem;
  }

  h2 {
    font-size: 2.1rem;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(18rem, 0.8fr);
    align-items: start;
  }

  .cards,
  .doc-links,
  .architecture-branches {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .main-flow {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .main-flow li:not(:last-child)::after {
    content: "\2192";
    right: -0.7rem;
    bottom: auto;
  }

  .guide-content h2 {
    font-size: 1.8rem;
  }
}

@media (min-width: 900px) {
  .guide-layout {
    grid-template-columns: minmax(14rem, 0.32fr) minmax(0, 1fr);
    align-items: start;
  }

  .guide-toc {
    position: sticky;
    top: 1rem;
  }
}

@media (max-width: 420px) {
  .actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .button {
    width: 100%;
  }
}

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