:root {
  --bg-canvas: #0e0e0d;
  --bg-chrome: #141413;
  --bg-card: #1a1a18;
  --bg-card-header: #1f1f1d;
  --bg-input: #111110;
  --bg-control: #232321;
  --text-primary: #ecebe6;
  --text-secondary: #a1a09a;
  --text-muted: #6e6d68;
  --accent: #d97757;
  --accent-soft: rgba(217, 119, 87, 0.14);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-default: rgba(255, 255, 255, 0.14);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--bg-canvas);
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-card-header);
  border: 1px solid var(--border-subtle);
  padding: 0.12em 0.42em;
  border-radius: 5px;
  color: var(--text-primary);
}

/* Top bar */
.topbar {
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(14, 14, 13, 0.94);
}

.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.brand img {
  border-radius: 6px;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 13.5px;
  color: var(--text-secondary);
}

.topnav a {
  white-space: nowrap;
}

.topnav a:hover {
  color: var(--text-primary);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid var(--border-default);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #0e0e0d;
  font-weight: 600;
}

.btn-primary:hover {
  filter: brightness(1.06);
}

.btn-secondary {
  background: var(--bg-control);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: #2b2b28;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

/* Hero Section */
.hero {
  border-bottom: 1px solid var(--border-subtle);
  padding: 52px 24px 60px;
}

.hero-inner {
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 34px;
}

.hero-copy {
  max-width: 720px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-logo {
  border-radius: 14px;
  margin-bottom: 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(2.4rem, 5vw, 3.3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.08;
}

.hero-subtitle {
  margin: 8px 0 18px;
  font-family: var(--font-mono);
  font-size: 0.96rem;
  color: var(--accent);
  letter-spacing: 0.04em;
  text-transform: lowercase;
}

.hero-lead {
  margin: 0 0 24px;
  color: var(--text-secondary);
  font-size: 1.02rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.hero-media {
  width: 100%;
  max-width: 960px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65);
}

.hero-screenshot {
  display: block;
  width: 100%;
  height: auto;
}

/* Centered Documentation Container */
.content-band {
  padding: 44px 24px 72px;
}

.content-container {
  max-width: 820px;
  margin: 0 auto;
}

/* Compact GitHub Stats & Clickable Contributor Avatars right after Hero (scrolls naturally) */
.repo-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  margin-bottom: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
}

.repo-strip-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.repo-name {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.repo-name:hover {
  color: var(--accent);
}

.repo-metrics {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  font-size: 12.5px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.repo-metrics strong {
  color: var(--text-primary);
}

.lang-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.lang-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #dea584;
}

.repo-strip-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.contrib-label {
  font-size: 12px;
  color: var(--text-muted);
}

.avatar-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.avatar-link {
  display: inline-flex;
  border-radius: 50%;
  border: 1px solid var(--border-default);
  overflow: hidden;
  transition: border-color 0.15s ease, transform 0.12s ease;
}

.avatar-link:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.avatar-link img {
  display: block;
  width: 32px;
  height: 32px;
}

/* Segmented Section Control (inset track + rectangular active tab, matching AGENTS.md) */
.doc-segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  padding: 4px;
  margin-bottom: 36px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.doc-segmented a {
  flex: 1 1 auto;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.doc-segmented a:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.doc-segmented a.is-active {
  background: var(--bg-card);
  border-color: var(--border-default);
  color: var(--text-primary);
}

.doc-column {
  min-width: 0;
}

.doc-section {
  margin-bottom: 52px;
}

.doc-section h2 {
  margin: 0 0 18px;
  font-size: 1.65rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.doc-section h3 {
  margin: 0 0 14px;
  font-size: 1.18rem;
  font-weight: 600;
  color: var(--text-primary);
}

.section-intro {
  margin: 0 0 18px;
  color: var(--text-secondary);
}

.feature-block {
  margin-bottom: 38px;
}

.shot-frame {
  margin: 0 0 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.shot-frame img {
  display: block;
  width: 100%;
  height: auto;
}

.shot-frame figcaption {
  padding: 9px 14px;
  font-size: 12.5px;
  color: var(--text-muted);
  background: var(--bg-card-header);
  border-top: 1px solid var(--border-subtle);
}

.doc-column ul {
  margin: 0;
  padding-left: 20px;
  color: var(--text-secondary);
}

.doc-column li {
  margin-bottom: 10px;
}

.doc-column li strong {
  color: var(--text-primary);
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  text-align: left;
}

th {
  background: var(--bg-card-header);
  color: var(--text-primary);
  font-weight: 600;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-default);
}

td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  vertical-align: top;
}

tr:last-child td {
  border-bottom: none;
}

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

/* Card Grids */
.split-notes,
.arch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.note-card,
.arch-card,
.license-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
}

.note-card h4,
.arch-card h4 {
  margin: 0 0 8px;
  font-size: 14.5px;
  color: var(--text-primary);
}

.note-card p,
.arch-card p,
.license-card p {
  margin: 0 0 8px;
  font-size: 13.5px;
  color: var(--text-secondary);
}

.license-card p:last-child {
  margin-bottom: 0;
}

.license-card strong {
  color: var(--text-primary);
}

/* Code Block */
.code-card {
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-top: 16px;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--bg-card-header);
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
}

.copy-btn {
  background: var(--bg-control);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}

.copy-btn:hover {
  border-color: var(--accent);
}

pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-primary);
}

pre code {
  background: none;
  border: none;
  padding: 0;
}

/* Footer with Clickable Contributor Avatars */
.site-footer {
  background: var(--bg-chrome);
  border-top: 1px solid var(--border-subtle);
  padding: 40px 24px 30px;
}

.footer-inner {
  max-width: 820px;
  margin: 0 auto;
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.brand-lockup img {
  border-radius: 7px;
}

.brand-lockup p {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 13px;
  color: var(--text-secondary);
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-contributors {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.footer-contributors h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.footer-bottom {
  padding-top: 18px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
  color: var(--text-muted);
}

@media (max-width: 820px) {
  .topnav {
    display: none;
  }

  .split-notes,
  .arch-grid {
    grid-template-columns: 1fr;
  }

  .footer-contributors {
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .hero {
    padding: 40px 16px 48px;
  }

  .content-band {
    padding: 32px 16px 52px;
  }
}
