:root {
  --primary-color: #3f51b5;
  --primary-dark: #303f9f;
  --primary-light: #e8eaf6;
  --accent-color: #536dfe;
  --text-color: #1e293b;
  --text-muted: #64748b;
  --bg-color: #ffffff;
  --bg-subtle: #f8fafc;
  --border-color: #e2e8f0;
  --border-subtle: #cbd5e1;
  --code-bg: #f1f5f9;
  --sidebar-width: 280px;
  --header-height: 64px;
  --content-width: 1080px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg-color);
  color: var(--text-color);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary-color);
  font-weight: 500;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid #f59e0b;
  outline-offset: 3px;
}

button {
  font: inherit;
}

.skip-link {
  background: #ffffff;
  border: 2px solid var(--primary-dark);
  border-radius: 0 0 6px 6px;
  left: 1rem;
  padding: 0.5rem 0.8rem;
  position: fixed;
  top: -4rem;
  z-index: 1100;
}

.skip-link:focus {
  top: 0;
}

.site-header {
  align-items: center;
  background: var(--primary-color);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
  color: #ffffff;
  display: flex;
  height: var(--header-height);
  justify-content: space-between;
  left: 0;
  padding: 0 1.5rem;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 1000;
}

.header-left,
.header-actions,
.header-brand,
.github-link {
  align-items: center;
  display: flex;
}

.header-left,
.header-actions {
  gap: 1rem;
}

.header-brand {
  color: #ffffff;
  font-size: 1.2rem;
  font-weight: 700;
  gap: 0.7rem;
  text-decoration: none;
}

.header-brand:hover {
  text-decoration: none;
}

.logo-icon {
  font-size: 1.55rem;
}

.header-tagline {
  border-left: 1px solid rgba(255, 255, 255, 0.35);
  font-size: 0.82rem;
  font-weight: 400;
  margin-left: 0.3rem;
  opacity: 0.88;
  padding-left: 0.8rem;
}

.version-badge {
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  font-family: "Roboto Mono", SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
}

.github-link {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  color: #ffffff;
  font-size: 0.85rem;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.github-link:hover {
  background: rgba(255, 255, 255, 0.25);
  text-decoration: none;
}

.nav-toggle-btn {
  background: transparent;
  border: 0;
  color: #ffffff;
  cursor: pointer;
  display: none;
  font-size: 1.5rem;
  line-height: 1;
  padding: 0.25rem;
}

.app-container {
  display: flex;
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
}

.sidebar {
  background: var(--bg-subtle);
  border-right: 1px solid var(--border-color);
  bottom: 0;
  left: 0;
  overflow-y: auto;
  padding: 1.5rem 1rem;
  position: fixed;
  top: var(--header-height);
  width: var(--sidebar-width);
  z-index: 900;
}

.nav-section {
  margin-bottom: 1.5rem;
}

.nav-section-title {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
  padding-left: 0.5rem;
  text-transform: uppercase;
}

.nav-list {
  list-style: none;
}

.nav-item {
  margin-bottom: 0.2rem;
}

.nav-link {
  align-items: center;
  border-radius: 6px;
  color: var(--text-color);
  display: flex;
  font-size: 0.9rem;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-link:hover,
.nav-link.active {
  background: var(--primary-light);
  color: var(--primary-dark);
  text-decoration: none;
}

.nav-link.active {
  font-weight: 600;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  max-width: var(--content-width);
  overflow-wrap: break-word;
  padding: 2.5rem 3.5rem;
}

main > :first-child {
  margin-top: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: #0f172a;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.75rem;
  margin-top: 2rem;
}

h1 {
  border-bottom: 1px solid var(--border-color);
  font-size: 2.1rem;
  margin-top: 0;
  padding-bottom: 0.5rem;
}

h2 {
  border-bottom: 1px solid var(--border-color);
  font-size: 1.5rem;
  padding-bottom: 0.35rem;
}

h3 {
  font-size: 1.25rem;
}

h4 {
  font-size: 1.05rem;
}

p,
ul,
ol,
blockquote,
table,
pre {
  margin-bottom: 1.25rem;
}

ul,
ol {
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.35rem;
}

hr {
  background: var(--border-color);
  border: 0;
  height: 1px;
  margin: 2rem 0;
}

code {
  background: var(--code-bg);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: #0f172a;
  font-family: "Roboto Mono", SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.88em;
  padding: 0.15em 0.35em;
}

pre {
  background: #1e293b;
  border-radius: 8px;
  color: #f8fafc;
  font-size: 0.9em;
  line-height: 1.55;
  overflow-x: auto;
  padding: 1rem 1.25rem;
}

pre code {
  background: transparent;
  border: 0;
  color: inherit;
  padding: 0;
}

table {
  border: 1px solid var(--border-color);
  border-collapse: collapse;
  display: block;
  font-size: 0.92rem;
  max-width: 100%;
  overflow-x: auto;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--border-color);
  min-width: 9rem;
  padding: 0.75rem 1rem;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f1f5f9;
  border-bottom: 2px solid var(--border-subtle);
  color: #0f172a;
  font-weight: 600;
}

tr:nth-child(even) {
  background: #f8fafc;
}

tr:hover {
  background: #f1f5f9;
}

blockquote {
  background: #eff6ff;
  border-left: 4px solid #3b82f6;
  border-radius: 0 8px 8px 0;
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
}

blockquote p:last-child {
  margin-bottom: 0;
}

.callout.callout-tip {
  background: #ecfdf5;
  border-left-color: #10b981;
}

.callout.callout-important {
  background: #f5f3ff;
  border-left-color: #8b5cf6;
}

.callout.callout-warning {
  background: #fffbeb;
  border-left-color: #f59e0b;
}

.callout.callout-caution {
  background: #fef2f2;
  border-left-color: #ef4444;
}

.callout-title {
  display: block;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.hero-panel {
  background:
    radial-gradient(circle at 90% 15%, rgba(83, 109, 254, 0.18), transparent 32%),
    linear-gradient(135deg, #eef2ff, #f8fafc 62%);
  border: 1px solid #c7d2fe;
  border-radius: 12px;
  margin-bottom: 2.5rem;
  padding: 2.5rem;
}

.hero-panel h1 {
  border: 0;
  font-size: clamp(2.2rem, 5vw, 3.7rem);
  letter-spacing: -0.04em;
  max-width: 760px;
  padding: 0;
}

.hero-panel h1 span {
  color: var(--primary-color);
}

.hero-panel p {
  color: #475569;
  font-size: 1.08rem;
  max-width: 700px;
}

.eyebrow {
  color: var(--primary-dark);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin-bottom: 0.8rem;
  text-transform: uppercase;
}

.hero-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.button {
  border: 1px solid transparent;
  border-radius: 6px;
  display: inline-flex;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.65rem 1rem;
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.button:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

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

.button-primary:hover {
  background: var(--primary-dark);
  color: #ffffff;
}

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

.button-secondary:hover {
  border-color: var(--primary-color);
}

.hero-meta {
  color: var(--text-muted);
  font-size: 0.84rem;
  margin-top: 1.25rem;
}

.card-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 1.5rem 0 2rem;
}

.card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  padding: 1.25rem;
}

.card:hover {
  border-color: #a5b4fc;
  box-shadow: 0 8px 22px rgba(63, 81, 181, 0.1);
}

.card h3 {
  font-size: 1.05rem;
  margin-top: 0;
}

.card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 0;
}

.card .card-link {
  display: inline-block;
  font-size: 0.88rem;
  margin-top: 0.75rem;
}

.card-grid.two-up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.phase-list {
  counter-reset: phase;
  display: grid;
  gap: 0.75rem;
  list-style: none;
  margin: 1.5rem 0 2rem;
  padding: 0;
}

.phase-list li {
  align-items: flex-start;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  counter-increment: phase;
  display: flex;
  gap: 0.9rem;
  margin: 0;
  padding: 0.9rem 1rem;
}

.phase-list li::before {
  align-items: center;
  background: var(--primary-light);
  border-radius: 999px;
  color: var(--primary-dark);
  content: counter(phase, decimal-leading-zero);
  display: inline-flex;
  flex: 0 0 2.15rem;
  font-size: 0.78rem;
  font-weight: 700;
  height: 2.15rem;
  justify-content: center;
}

.phase-list strong {
  display: block;
  margin-bottom: 0.1rem;
}

.phase-list span {
  color: var(--text-muted);
  display: block;
  font-size: 0.9rem;
}

.stat-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 1.5rem 0 2rem;
}

.stat {
  background: var(--primary-color);
  border-radius: 8px;
  color: #ffffff;
  padding: 1.1rem;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
}

.stat-label {
  font-size: 0.82rem;
  opacity: 0.88;
}

.site-footer {
  align-items: center;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  display: flex;
  font-size: 0.82rem;
  gap: 1rem;
  justify-content: space-between;
  margin-top: 4rem;
  padding-top: 1.5rem;
}

.site-footer a {
  white-space: nowrap;
}

@media (max-width: 980px) {
  .card-grid,
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .nav-toggle-btn {
    display: block;
  }

  .header-tagline,
  .version-badge {
    display: none;
  }

  .sidebar {
    box-shadow: 4px 0 12px rgba(15, 23, 42, 0.12);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
    padding: 1.5rem;
  }
}

@media (max-width: 560px) {
  .site-header {
    padding: 0 1rem;
  }

  .header-actions {
    gap: 0.35rem;
  }

  .hero-panel {
    padding: 1.5rem;
  }

  .card-grid,
  .card-grid.two-up,
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
