:root {
  --accent: #6f767e;
  --accent-dim: rgba(111, 118, 126, 0.14);
  --page-max: 1200px;
  --prose-max: 760px;
}

html {
  color-scheme: light;
}

[data-theme="dark"] html,
[data-theme="dark"] {
  color-scheme: dark;
}

.nav-link:focus-visible,
.theme-toggle:focus-visible,
.csn-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Keep light/dark toggle icon style visually consistent */
.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  width: 18px;
  height: 18px;
  color: var(--text);
  fill: currentColor;
  stroke: currentColor;
  filter: none !important;
}

.theme-toggle .icon-sun {
  fill: none;
  stroke-width: 2;
}

.theme-toggle .icon-sun circle,
.theme-toggle .icon-sun line {
  stroke: currentColor !important;
  fill: none !important;
  stroke-width: 2 !important;
  stroke-linecap: round;
}

/* Keep button chrome identical between light and dark themes */
[data-theme="dark"] .theme-toggle {
  background: var(--bg-alt) !important;
  border-color: var(--border) !important;
}

[data-theme="dark"] .theme-toggle:hover {
  border-color: var(--text) !important;
}

/* Shared floating section nav */
.cs-sidenav {
  position: fixed;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 800;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.cs-sidenav.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.cs-sidenav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.csn-link {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--secondary);
  text-decoration: none;
  transition: color 0.2s ease;
  padding: 5px 0;
  white-space: nowrap;
}

.csn-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  flex-shrink: 0;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.25s ease;
}

.csn-link:hover {
  color: var(--text);
}

.csn-link:hover .csn-dot {
  background: var(--text);
  border-color: var(--text);
}

.csn-link.active {
  color: var(--accent);
}

.csn-link.active .csn-dot {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.5);
}

@media (max-width: 1340px) {
  .cs-sidenav {
    display: none;
  }
}

/* Alignment harmonization */
.cs-body {
  max-width: var(--prose-max);
}

.cs-stat-desc {
  max-width: none;
}

.cs-row,
.cs-hero,
.cs-results-inner,
.cs-conclusion,
.cs-next,
.footer-grid,
.footer-top {
  max-width: var(--page-max);
}

.footer {
  padding: 64px var(--margin) 40px;
}

.info-section {
  padding: 80px var(--margin);
}

/* Home spline zoom-out tweak */
.spline-wrap canvas.spline-zoom-adjust {
  transform: none;
}

.spline-wrap.home-spline-padding {
  padding-left: 5px;
  padding-right: 5px;
}

@media (max-width: 960px) {
  .spline-wrap canvas.spline-zoom-adjust {
    transform: none;
  }

  .project-row {
    grid-template-columns: 32px 1fr;
    gap: 20px;
    align-items: start;
  }

  .project-desc-col {
    grid-column: 2 / -1;
  }
}
