:root {
  color-scheme: light dark;

  --bg: #f6f8fa;
  --text: #24292f;
  --muted: #57606a;
  --card: #ffffff;
  --border: #d0d7de;
  --accent: #0969da;
  --accent-soft: rgba(9, 105, 218, 0.10);
  --header-bg: #ffffff;
  --header-text: #24292f;
  --nav-text: #57606a;
  --nav-hover: #0969da;
  --shadow: 0 8px 24px rgba(140, 149, 159, 0.18);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --text: #c9d1d9;
    --muted: #8b949e;
    --card: #161b22;
    --border: #30363d;
    --accent: #58a6ff;
    --accent-soft: rgba(88, 166, 255, 0.12);
    --header-bg: #010409;
    --header-text: #f0f6fc;
    --nav-text: #c9d1d9;
    --nav-hover: #58a6ff;
    --shadow: 0 8px 24px rgba(1, 4, 9, 0.35);
  }
}

* {
  box-sizing: border-box;
}

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

.site-header {
  background: var(--header-bg);
  color: var(--header-text);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 2rem 1.25rem 1.4rem;
}

.site-title {
  margin: 0;
  font-size: 2rem;
  line-height: 1.2;
}

.site-title a {
  color: var(--header-text);
  text-decoration: none;
}

.site-subtitle {
  margin: 0.35rem 0 1.2rem;
  color: var(--muted);
  font-size: 1rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

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

.site-nav a:hover {
  color: var(--nav-hover);
  text-decoration: underline;
}

main {
  max-width: 980px;
  margin: 2rem auto;
  padding: 0 1.25rem;
}

.content-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 2rem;
}

h1,
h2,
h3 {
  color: var(--text);
  line-height: 1.3;
}

h1 {
  margin-top: 0;
  font-size: 2rem;
}

h2 {
  margin-top: 2rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

h3 {
  margin-top: 1.5rem;
}

p {
  color: var(--text);
}

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

a:hover {
  text-decoration-thickness: 2px;
}

ul {
  padding-left: 1.4rem;
}

li {
  margin-bottom: 0.4rem;
}

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

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

code {
  background: var(--accent-soft);
  color: var(--text);
  padding: 0.15rem 0.35rem;
  border-radius: 5px;
}

.site-footer {
  max-width: 980px;
  margin: 2rem auto;
  padding: 0 1.25rem 2rem;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 640px) {
  .header-inner {
    padding: 1.5rem 1rem 1.1rem;
  }

  .site-title {
    font-size: 1.6rem;
  }

  main {
    margin: 1.2rem auto;
    padding: 0 1rem;
  }

  .content-card {
    padding: 1.25rem;
    border-radius: 10px;
  }

  h1 {
    font-size: 1.65rem;
  }

  .site-nav {
    gap: 0.65rem;
  }
}

/* Layout correction for header and navigation */

.site-header {
  padding: 1.8rem max(1.25rem, calc((100vw - 980px) / 2)) 1.2rem;
}

.site-header .header-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 0;
}

.site-header h1,
.site-title {
  margin: 0;
  font-size: 2rem;
  line-height: 1.2;
}

.site-header h1 a,
.site-title a {
  color: var(--header-text);
  text-decoration: none;
}

.site-subtitle,
.site-header p {
  margin: 0.35rem 0 1.15rem;
  color: var(--muted);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 0.5rem;
}

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

.site-nav a:hover {
  color: var(--nav-hover);
  text-decoration: underline;
}

.content-card {
  max-width: 980px;
  margin: 0 auto;
}

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

  .site-header h1,
  .site-title {
    font-size: 1.6rem;
  }

  .site-nav {
    gap: 0.65rem;
  }
}

/* Final navigation polish */

.site-header nav,
.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.9rem;
}

.site-header nav a,
.site-nav a {
  display: inline-block;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--nav-text);
  background: var(--card);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.2;
}

.site-header nav a:hover,
.site-nav a:hover {
  color: var(--nav-hover);
  border-color: var(--accent);
  background: var(--accent-soft);
  text-decoration: none;
}

.site-header {
  padding-top: 1.9rem;
  padding-bottom: 1.3rem;
}

.site-subtitle,
.site-header p {
  margin-bottom: 0;
}