/* Part 1 — CSS variables */
:root {
  --bg:          #0d1117;
  --surface:     #161b22;
  --border:      #30363d;
  --accent:      #58a6ff;
  --accent-hover:#79b8ff;
  --accent-dim:  #132034;
  --accent-solid:#238636;
  --success:     #3fb950;
  --text:        #e6edf3;
  --muted:       #8b949e;
  --code-bg:     #1f2428;
  --font-sans:   system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono:   ui-monospace, SFMono-Regular, "SF Mono", Consolas, monospace;
  --radius:      6px;
  --max-w:       1100px;
}

/* Part 2 — Reset + base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
img { display: block; max-width: 100%; height: auto; }
code, pre { font-family: var(--font-mono); }

/* Part 2.5 — Navigation header */
.nav-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-header__container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
}
.nav-header__logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}
.nav-header__logo:hover {
  color: var(--accent);
  text-decoration: none;
}
.nav-header__logo img {
  width: 32px;
  height: 32px;
  border-radius: 6px;
}
.nav-header__links {
  display: flex;
  gap: 20px;
  align-items: center;
}
.nav-header__link {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}
.nav-header__link:hover {
  color: var(--accent);
  text-decoration: none;
}

/* Part 3 — Layout utilities */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
.section { padding: 80px 0; }
.section--alt { background: var(--surface); }
.section__title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  margin-bottom: 12px;
  text-align: center;
}
.section__sub {
  color: var(--muted);
  text-align: center;
  margin-bottom: 48px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Part 4 — Hero */
.hero {
  padding: 96px 0 80px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.hero__headline {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}
.hero__sub {
  color: var(--muted);
  font-size: 1.125rem;
  max-width: 640px;
  margin: 0 auto 36px;
}
.hero__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 36px;
}
.hero__badges img { height: 20px; }
.hero__cta {
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  text-decoration: none;
}
.btn--outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn--outline:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.btn--primary { background: var(--accent-solid); color: #fff; border: none; }
.btn--primary:hover { background: #2ea043; color: #fff; text-decoration: none; }
.btn--large { padding: 14px 28px; font-size: 1rem; }
.install-block { position: relative; display: inline-block; text-align: left; }
.install-block__pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 56px 14px 18px;
  font-size: 0.95rem;
  color: var(--text);
  white-space: pre;
}
.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.75rem;
  padding: 4px 8px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.copy-btn:hover { color: var(--text); border-color: var(--accent); }
.copy-btn.copied { color: var(--success); border-color: var(--success); }

/* Focus styles for keyboard navigation */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn:focus-visible,
.copy-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Part 5 — Why Peaky Peek */
.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 56px;
}
.why-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
}
.why-card__icon { font-size: 2rem; margin-bottom: 12px; }
.why-card__title { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.why-card__body { color: var(--muted); font-size: 0.9rem; line-height: 1.6; }
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.compare-table th,
.compare-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.compare-table thead th {
  background: var(--surface);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.compare-table tbody tr:last-child td { border-bottom: none; }
.compare-table--highlight td { background: var(--accent-dim); color: var(--accent); font-weight: 600; }

/* Part 6 — Features grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s;
}
.feature-card:hover { border-color: var(--accent); }
.feature-card__img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-bottom: 1px solid var(--border);
}
.feature-card__body-wrap { padding: 20px; }
.feature-card__title { font-size: 0.95rem; font-weight: 700; margin-bottom: 6px; }
.feature-card__body { color: var(--muted); font-size: 0.875rem; line-height: 1.5; }

/* Part 7 — Quick install */
.install-steps { max-width: 640px; margin: 0 auto; }
.install-steps__label {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  margin-top: 20px;
}
.install-steps__label:first-child { margin-top: 0; }
.install-steps pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  font-size: 0.9rem;
  color: var(--text);
  overflow-x: auto;
}
.install-steps__note { color: var(--muted); font-size: 0.85rem; margin-top: 24px; text-align: center; }
.install-steps__note a { color: var(--accent); }

/* Part 8 — Footer */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 40px 0;
  text-align: center;
}
.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: center;
  margin-bottom: 16px;
  font-size: 0.9rem;
}
.footer__links a { color: var(--muted); }
.footer__links a:hover { color: var(--text); text-decoration: none; }
.footer__legal { color: var(--muted); font-size: 0.8rem; }

/* Part 9 — Category sections */
.category {
  margin-bottom: 64px;
}
.category:last-child {
  margin-bottom: 0;
}
.category__title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 12px;
}
.category__title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 24px;
  background: var(--accent);
  border-radius: 2px;
}
.category__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

/* Part 10 — Enhanced hero with larger screenshot */
.hero--signature {
  padding: 64px 0 48px;
}
.hero__screenshot {
  margin-top: 48px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}
.hero__screenshot img {
  width: 100%;
  display: block;
}

/* Part 11 — Social proof section */
.social-proof {
  padding: 80px 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.social-proof__quote {
  max-width: 720px;
  margin: 0 auto 48px;
  text-align: center;
}
.social-proof__quote-text {
  font-size: 1.25rem;
  font-style: italic;
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 16px;
}
.social-proof__quote-author {
  color: var(--muted);
  font-size: 0.9rem;
}
.social-proof__logos {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  justify-content: center;
  align-items: center;
  opacity: 0.6;
}
.social-proof__logo {
  height: 32px;
  filter: grayscale(100%) brightness(2);
}

/* Part 12 — Enhanced feature cards with category styling */
.feature-card--category {
  position: relative;
  background: linear-gradient(135deg, var(--surface) 0%, rgba(22, 27, 34, 0.8) 100%);
  border: 1px solid var(--border);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.feature-card--category:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
  border-color: var(--accent);
}
.feature-card--category .feature-card__img {
  border-bottom: 1px solid var(--border);
}
.feature-card__tag {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--accent);
  color: var(--bg);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Part 13 — Comparison table enhancements */
.compare-table--enhanced {
  font-size: 0.875rem;
}
.compare-table--enhanced th:first-child,
.compare-table--enhanced td:first-child {
  width: 28%;
  font-weight: 600;
}
.compare-table--enhanced th:nth-child(2),
.compare-table--enhanced td:nth-child(2) {
  width: 32%;
}
.compare-table--enhanced th:nth-child(3),
.compare-table--enhanced td:nth-child(3) {
  width: 40%;
}
.compare-table__check {
  color: var(--success);
  font-weight: 600;
}
.compare-table__x {
  color: var(--muted);
}
.compare-table--enhanced tbody tr:hover {
  background: rgba(88, 166, 255, 0.05);
}
.compare-table--enhanced .compare-table--highlight td {
  background: linear-gradient(135deg, var(--accent-dim) 0%, rgba(19, 32, 52, 0.5) 100%);
}

/* Part 14 — Get started section enhancements */
.get-started {
  background: linear-gradient(180deg, var(--bg) 0%, var(--surface) 100%);
}
.get-started__steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
  margin-top: 48px;
}
.get-started__step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  position: relative;
}
.get-started__step-num {
  position: absolute;
  top: -12px;
  left: 24px;
  background: var(--accent);
  color: var(--bg);
  font-size: 0.75rem;
  font-weight: 700;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.get-started__step-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.get-started__step pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 0.85rem;
  overflow-x: auto;
}
.get-started__links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  margin-top: 40px;
}

/* Part 15 — Feature category styling */
.feature-category {
  margin-bottom: 56px;
}
.feature-category:last-child {
  margin-bottom: 0;
}
.feature-category__title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 12px;
}
.feature-category__title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 20px;
  background: var(--accent);
  border-radius: 2px;
}

/* Part 16 — Bottom CTA */
.cta-bottom {
  margin-top: 48px;
  text-align: center;
}
.cta-bottom .btn {
  display: inline-flex;
}

/* Part 17 — Hero visual prominence */
.hero__visual {
  margin: 32px auto;
  max-width: 900px;
}

/* Part 18 — Social proof improvements */
.social-proof {
  padding: 0;
  background: transparent;
  border: none;
}
.social-proof__metrics {
  display: flex;
  justify-content: center;
  gap: 64px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}
.social-proof__metric {
  text-align: center;
}
.social-proof__metric-value {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.2;
}
.social-proof__metric-label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 4px;
}
.social-proof__quote {
  max-width: 600px;
  margin: 0 auto 40px;
  text-align: center;
}
.social-proof__quote p {
  font-size: 1.25rem;
  font-style: italic;
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 12px;
}
.social-proof__quote cite {
  font-style: normal;
  color: var(--muted);
  font-size: 0.9rem;
}
.section__subtitle {
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  margin-bottom: 24px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Part 19 — Responsive overrides (MUST be last) */
@media (max-width: 767px) {
  .section { padding: 56px 0; }
  .hero { padding: 64px 0 56px; }
  .hero--signature { padding: 48px 0 32px; }
  .hero__screenshot { margin-top: 32px; border-radius: 8px; }
  .why-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  .category__grid { grid-template-columns: 1fr; }
  .hero__cta { flex-direction: column; align-items: stretch; }
  .btn { justify-content: center; }
  .social-proof { padding: 56px 0; }
  .social-proof__quote-text { font-size: 1.1rem; }
  .social-proof__logos { gap: 24px; }
  .social-proof__logo { height: 24px; }
  .get-started__steps { grid-template-columns: 1fr; gap: 24px; }
  .get-started__step { padding: 24px 20px; }
  .get-started__links { flex-direction: column; align-items: stretch; }
  /* Hides last column on mobile — intentional, keeps table readable */
  .compare-table th:last-child,
  .compare-table td:last-child { display: none; }

  /* Navigation header mobile */
  .nav-header__container {
    flex-direction: column;
    gap: 12px;
    padding: 12px 16px;
  }
  .nav-header__links {
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
  }
}
