:root {
  /* Brand Colors */
  --color-primary: #00c1fc;
  --color-primary-dark: #007c9b;
  --color-text-main: #2a2a2f;
  --color-text-muted: #666666;
  --color-bg-body: #fdfdfd;
  --color-bg-code: #1e1e1e;
  --color-border: #e0e0e0;

  /* Spacing & Layout */
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 2rem;
  --spacing-xl: 4rem;
  --container-width: 860px;
  --radius-md: 8px;

  /* Typography */
  --font-sans: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "Roboto Mono", "JetBrains Mono", Consolas, "Roboto Mono", monospace;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--color-text-main);
  background: var(--color-bg-body);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

/* --- Layout Container --- */
/* Replaces div#intro and .example fixed widths */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-lg);
  padding: var(--spacing-md) 0;
  border-bottom: 1px solid var(--color-border);
}

.breadcrumbs,
.badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.breadcrumbs {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.breadcrumb-separator {
  color: var(--color-text-muted);
}

main {
  padding-top: 0;
  padding-bottom: var(--spacing-xl);
}

/* --- Site Title & Logo --- */
.site-title {
  font-size: 2.0rem;
  margin: 1.5rem 0;
}

.site-title a {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  color: #202930;
}

.site-title a:hover,
.header-side:last-child a:hover {
  text-decoration: none;
}

.gopher-icon {
  width: 48px;
  height: 48px;
  vertical-align: middle;
}

/* --- Typography --- */
h1, h2, h3, h4 {
  color: #202930;
  margin-top: 0;
  line-height: 1.25;
  font-weight: 600;
}

h1 {
  font-size: 2.0rem;
  font-weight: 700;
  margin-bottom: var(--spacing-md);
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.75rem;
  font-weight: 600;
  margin-top: var(--spacing-lg);
  margin-bottom: var(--spacing-sm);
}

h3 {
  font-size: 1.25rem;
  font-weight: 500;
  margin-top: var(--spacing-md);
}

/* --- Section Headers --- */
/* --- Section Header --- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: var(--spacing-lg) 0 var(--spacing-md) 0;
  padding-bottom: var(--spacing-sm);
  border-bottom: 3px solid var(--color-primary);
  border-radius: 4px;
}

.header-side {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-side:last-child a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  opacity: 1;
  transition: opacity 0.2s;
}

.section-header-icon {
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--color-primary);
  line-height: 1;
}

.section-header-title {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--color-text-main);
  margin: 0;
  letter-spacing: -0.01em;
}

p {
  margin-bottom: var(--spacing-md);
  max-width: 100%;
}

ul {
  padding-left: 1.5rem;
  margin-bottom: var(--spacing-md);
}

li {
  margin-bottom: 0.25rem;
}

/* --- Code Blocks --- */
.code-block {
  background: #f5f5f5;
  border-radius: var(--radius-md);
  margin: var(--spacing-md) 0 var(--spacing-lg) 0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  border: 1px solid var(--color-border);
  position: relative;
}

.code-block pre {
  border: none;
  background: transparent;
}

pre {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.4;
  font-weight: 400;
  padding: var(--spacing-md);
  margin: 0;
  overflow-x: auto;
  white-space: pre;
}

.output-block {
  background: #f5f5f5;
  color: var(--color-text-main);
  border: 1px solid var(--color-border);
}

.output-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: bold;
  color: var(--color-primary);
  margin-top: var(--spacing-lg);
  margin-bottom: var(--spacing-sm);
  display: block;
}

/* --- Navigation & Buttons --- */
.nav-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: var(--spacing-xl);
  padding-top: var(--spacing-lg);
  border-top: 1px solid var(--color-border);
}

.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.15s ease;
  text-decoration: none;
  border: none;
  cursor: pointer;
}

.btn-primary {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.15s ease;
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  background-color: var(--color-primary);
  color: white !important;
}

.btn-primary:hover {
  background-color: var(--color-primary-dark);
  text-decoration: none;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.15s ease;
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  background-color: #f5f5f5;
  color: var(--color-text-main) !important;
}

.btn-secondary:hover {
  background-color: #e8e8e8;
  text-decoration: none;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

/* --- Key Points Box --- */
.key-points-box {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  /* border-left: 4px solid var(--color-primary); */
  border-radius: var(--radius-md);
  padding: var(--spacing-md) var(--spacing-lg);
  margin: var(--spacing-lg) 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.key-points-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-primary-dark);
  margin-top: 0;
  margin-bottom: var(--spacing-md);
}

.key-points-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.key-points-list {
  margin: 0;
  padding-left: 1.5rem;
  list-style-type: disc;
}

.key-points-list li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
  color: var(--color-text-main);
}

.key-points-list li:last-child {
  margin-bottom: 0;
}

.key-points-list code {
  background-color: rgba(255, 255, 255, 0.8);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--color-primary-dark);
  border: 1px solid rgba(42, 201, 249, 0.2);
}

/* --- Tables --- */
.reference-table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.reference-table thead {
  background-color: var(--color-primary);
  color: white;
  position: sticky;
  top: 0;
  z-index: 10;
}

.reference-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.reference-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}

.reference-table tbody tr:nth-child(even) {
  background-color: #fafafa;
}

.reference-table tbody tr:hover {
  background-color: #f0f9ff;
  transition: background-color 0.2s ease;
}

.reference-table code {
  background-color: #f0f0f0;
  padding: 3px 7px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.88em;
  color: var(--color-text-main);
  font-weight: 500;
  white-space: nowrap;
}

.reference-table tbody tr:nth-child(even) code {
  background-color: #f5f5f5;
}

/* --- Example list on home --- */
.home-intro {
  text-align: center;
  margin: 0 auto var(--spacing-lg) auto;
}

.home-intro p {
  max-width: none;
  margin: 0 auto;
}

.shields {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: var(--spacing-lg);
  flex-wrap: wrap;
}

.shields img,
.badges img {
  height: 20px;
  transition: opacity 0.2s;
}

.shields a:hover img,
.badges a:hover img {
  opacity: 0.8;
}

ul.examples {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  text-align: center;
  max-width: 600px;
}

ul.examples li {
  margin-bottom: 1px;
}

ul.examples li a {
  display: inline-block;
  color: var(--color-text-main);
  font-size: 1.1rem;
  transition: background 0.2s, box-shadow 0.2s;
}

ul.examples li a:hover,
ul.examples li a:focus {
  background: transparent;
  text-decoration: underline;
  outline: none;
  box-shadow: 4px;
  color: var(--color-primary);
}

/* --- Footer --- */
footer,
p.footer {
  margin-top: var(--spacing-xl);
  padding: var(--spacing-lg) 0;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.875rem;
  text-align: center;
  max-width: none;
}

p.footer a {
  color: var(--color-text-muted);
  text-decoration: underline;
}

.brand-name {
  color: #00c1fc;
  font-weight: 600;
  font-style: normal;
}

.gh-link img {
  vertical-align: middle;
  margin-right: 6px;
}

/* --- Mobile Responsiveness --- */
@media (max-width: 600px) {
  :root {
    --spacing-lg: 1.5rem;
    --spacing-xl: 3rem;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .nav-buttons {
    flex-direction: column;
    gap: var(--spacing-md);
  }

  .btn,
  .btn-primary,
  .btn-secondary {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .key-points-box {
    padding: var(--spacing-md);
  }

  .key-points-title {
    font-size: 1.1rem;
  }

  .reference-table {
    font-size: 0.85rem;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .reference-table thead {
    display: table-header-group;
  }

  .reference-table th,
  .reference-table td {
    padding: 0.5rem;
    white-space: nowrap;
  }

  .reference-table code {
    font-size: 0.8em;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-sm);
  }

  .breadcrumbs,
  .badges {
    flex-wrap: wrap;
  }
}

.clipboard-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
  opacity: 1;
  transition: background 0.2s;
}

.clipboard-btn:hover {
  background: #f0f0f0;
}

.clipboard-btn img {
  width: 16px;
  height: 18px;
  display: block;
}

#back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  display: none;
  transition: background 0.3s;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

#back-to-top:hover {
  background: var(--color-primary-dark);
}
