:root {
  --peach-50: #fdf6f2;
  --peach-100: #f8ece5;
  --peach-200: #f1dbce;
  --peach-300: #e8c4b0;
  --peach-400: #dba68a;
  --peach-500: #c7805d;
  --peach-600: #af6a4d;
  --navy-950: #111827;
  --navy-900: #1f2937;
  --navy-800: #374151;
  --ink-900: #111827;
  --ink-700: #374151;
  --ink-500: #6b7280;
  --surface: #ffffff;
  --surface-soft: rgba(255, 255, 255, 0.92);
  --line: #e5e7eb;
  --shadow-lg: 0 20px 50px rgba(17, 24, 39, 0.08);
  --shadow-md: 0 10px 30px rgba(17, 24, 39, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
  background: #f3f4f6;
  color: var(--ink-900);
}

code,
pre,
.font-mono {
  font-family: 'JetBrains Mono', monospace;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(18px);
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(229, 231, 235, 0.9);
}

.site-header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
}

.brand-name {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-tag {
  display: block;
  font-size: 0.75rem;
  color: var(--ink-500);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(229, 231, 235, 0.95);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--navy-900);
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

.nav-toggle:hover {
  background: rgba(17, 24, 39, 0.05);
  border-color: rgba(55, 65, 81, 0.25);
  transform: translateY(-1px);
}

.nav-toggle-box {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.nav-toggle-line {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.site-header.nav-open .nav-toggle-line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.site-header.nav-open .nav-toggle-line:nth-child(2) {
  opacity: 0;
}

.site-header.nav-open .nav-toggle-line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.nav-link {
  text-decoration: none;
  color: var(--ink-700);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 999px;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.nav-link:hover {
  background: rgba(17, 24, 39, 0.06);
  color: var(--navy-900);
  transform: translateY(-1px);
}

.nav-link.active {
  background: rgba(17, 24, 39, 0.1);
  color: var(--navy-900);
}

.page-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 24px 72px;
}

.page-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid rgba(229, 231, 235, 0.95);
  border-radius: 28px;
  padding: 42px;
  color: var(--ink-900);
  box-shadow: var(--shadow-lg);
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(17, 24, 39, 0.05), transparent 24%),
    radial-gradient(circle at 78% 16%, rgba(55, 65, 81, 0.04), transparent 22%),
    radial-gradient(circle at 65% 78%, rgba(17, 24, 39, 0.03), transparent 30%);
  pointer-events: none;
}

.page-hero .text-slate-100,
.page-hero .text-slate-200,
.page-hero .text-slate-300 {
  color: var(--ink-700) !important;
}

.page-hero > * {
  position: relative;
  z-index: 1;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(229, 231, 235, 0.9);
  color: var(--ink-700);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 28px;
  align-items: end;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.hero-grid > *,
.metric-grid > *,
.section-stack > *,
.grid > * {
  min-width: 0;
}

.metric-card {
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: 18px;
  padding: 18px;
}

.metric-value {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--ink-900);
}

.metric-label {
  display: block;
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--ink-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.card {
  background: var(--surface-soft);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow-md);
}

.feature-card,
.source-card {
  background: var(--surface-soft);
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow-md);
}

.feature-card:hover,
.source-card:hover {
  transform: translateY(-2px);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  border-color: rgba(55, 65, 81, 0.25);
  box-shadow: 0 18px 36px rgba(17, 24, 39, 0.08);
}

.feature-link {
  text-decoration: none;
  color: inherit;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 8px;
  overflow-wrap: anywhere;
}

.card-copy {
  color: var(--ink-700);
  line-height: 1.7;
  margin: 0;
  overflow-wrap: anywhere;
}

.section-intro,
.font-mono {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.card,
.download-item {
  min-width: 0;
}

.cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.button-primary,
.button-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.button-primary {
  background: linear-gradient(135deg, var(--navy-900), var(--navy-800));
  color: white;
  box-shadow: 0 12px 24px rgba(17, 24, 39, 0.2);
}

.button-primary:hover,
.button-secondary:hover {
  transform: translateY(-1px);
}

.button-secondary {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(229, 231, 235, 0.95);
  color: var(--ink-900);
}

.section-stack {
  display: grid;
  gap: 24px;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  color: var(--navy-900);
}

.section-intro {
  margin: 0;
  color: var(--ink-700);
  line-height: 1.7;
}

.anno-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.anno-table th {
  background: #f8fafc;
  text-align: left;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
}

.anno-table td {
  padding: 8px 14px;
  font-size: 13px;
  border-top: 1px solid #e2e8f0;
}

.path-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.path-legend-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 10px;
  padding: 8px 12px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  font-size: 11px;
  color: #4b5563;
}

.path-legend-bar .legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.zoom-slider {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  outline: none;
}

.zoom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--peach-500);
  cursor: pointer;
}

#qr-tooltip {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  background: #1e293b;
  color: #fff;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12px;
  line-height: 1.5;
  font-family: 'JetBrains Mono', monospace;
  display: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  max-width: 320px;
  white-space: pre-line;
}

.source-badge {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #f9fafb;
  color: var(--ink-700);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  flex-shrink: 0;
}

.source-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.source-pill-orange { background: #f9fafb; color: #4b5563; border: 1px solid #e5e7eb; }
.source-pill-blue { background: #f8fafc; color: #334155; border: 1px solid #e2e8f0; }
.source-pill-green { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.source-pill-purple { background: #f8fafc; color: #334155; border: 1px solid #e2e8f0; }

.cite-box {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 20px 24px;
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.cite-box pre,
.code-block {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  line-height: 1.7;
  color: #334155;
  white-space: pre;
  word-break: normal;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  margin: 0;
}

.copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--navy-900);
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.copy-btn:hover {
  background: var(--navy-800);
}

.copy-btn.copied {
  background: #16a34a;
}

.download-list {
  display: grid;
  gap: 16px;
}

.download-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(226, 232, 240, 0.9);
}

.site-footer {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px 40px;
  color: var(--ink-500);
  font-size: 0.82rem;
}

@media (max-width: 900px) {
  .page-hero {
    padding: 30px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .site-header-inner,
  .page-shell,
  .site-footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .page-hero {
    padding: 24px;
    border-radius: 24px;
  }

  .cta-row {
    flex-direction: column;
    align-items: stretch;
  }

  .cta-row a {
    justify-content: center;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
  }

  .brand-tag {
    display: none;
  }

  .has-nav-toggle .nav-toggle {
    display: inline-flex;
  }

  .has-nav-toggle .site-header-inner {
    align-items: center;
  }

  .has-nav-toggle .site-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding-top: 12px;
  }

  .has-nav-toggle .site-header.nav-open .site-nav {
    display: flex;
  }

  .has-nav-toggle .nav-link {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
  }

  .download-item {
    flex-direction: column;
  }
}
