/* Borescope Companion — Product Website Styles
   Dark navy aviation theme. Mobile-first responsive.
   System fonts only. No frameworks. */

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

:root {
  /* Primary palette */
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: #1a2233;
  --bg-card-hover: #1f2a3f;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-dim: #64748b;
  --border: #1e293b;

  /* Accent colors */
  --accent: #3b82f6;
  --accent-dim: #2563eb;
  --accent-glow: rgba(59, 130, 246, 0.15);
  --green: #10b981;
  --orange: #f59e0b;
  --teal: #14b8a6;

  /* Protocol group colors */
  --group-bdc: #3b82f6;
  --group-exhaust: #f59e0b;
  --group-intake: #14b8a6;

  /* Spacing */
  --section-pad: 100px;
  --section-pad-mobile: 72px;
  --container-max: 1120px;
  --container-narrow: 800px;
  --card-pad: 28px;
  --grid-gap: 20px;
  --side-pad: 24px;
  --side-pad-mobile: 16px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.9375rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ===== Typography ===== */
h1, h2, h3, h4 {
  color: var(--text-primary);
  line-height: 1.12;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

h3 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h4 {
  font-size: 1rem;
  font-weight: 700;
}

p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

code, .mono {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.8125rem;
}

/* ===== Layout ===== */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--side-pad);
  padding-right: var(--side-pad);
}

.container--narrow {
  max-width: var(--container-narrow);
}

.section {
  padding: var(--section-pad) 0;
}

.section--alt {
  background: var(--bg-secondary);
}

.text-center {
  text-align: center;
}

/* ===== Navigation ===== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 14, 23, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--side-pad);
  height: 64px;
}

.nav__brand {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

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

.nav__links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}

.nav__links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.nav__links a:hover,
.nav__links a.active {
  color: var(--text-primary);
}

.nav__cta {
  background: var(--accent);
  color: #fff !important;
  padding: 8px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.875rem;
  transition: background 0.2s, transform 0.2s;
}

.nav__cta:hover {
  background: var(--accent-dim);
  transform: translateY(-1px);
  color: #fff !important;
}

/* Hamburger menu */
.nav__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav__toggle svg {
  width: 24px;
  height: 24px;
  stroke: var(--text-secondary);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

@media (max-width: 768px) {
  .nav__toggle {
    display: block;
  }

  .nav__links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(10, 14, 23, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 24px var(--side-pad-mobile);
    gap: 16px;
    border-bottom: 1px solid var(--border);
  }

  .nav__links.open {
    display: flex;
  }

  .nav__links a {
    font-size: 1rem;
    padding: 8px 0;
  }

  .nav__download-mobile {
    display: block !important;
  }
}

.nav__download-mobile {
  display: none;
}

/* ===== Hero ===== */
.hero {
  padding: 160px 0 var(--section-pad);
  text-align: center;
  background: radial-gradient(ellipse at 50% 20%, rgba(59, 130, 246, 0.08) 0%, transparent 60%);
}

.hero h1 {
  margin-bottom: 24px;
}

.hero__sub {
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto 40px;
}

.hero__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 12px;
  padding: 14px 32px;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s, border-color 0.2s;
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn--primary {
  background: var(--accent);
  color: #fff;
}

.btn--primary:hover {
  background: var(--accent-dim);
  color: #fff;
}

.btn--secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn--secondary:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

/* App Store badge */
.app-store-badge {
  display: inline-block;
  transition: transform 0.2s;
}

.app-store-badge:hover {
  transform: translateY(-2px);
}

.app-store-badge img {
  height: 48px;
  width: auto;
}

/* ===== Cards ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: var(--card-pad);
  transition: border-color 0.2s, background 0.2s;
}

.card:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
}

.card--small {
  border-radius: 12px;
  padding: 20px;
}

.card__icon {
  width: 40px;
  height: 40px;
  margin-bottom: 16px;
  color: var(--accent);
}

.card__icon svg {
  width: 100%;
  height: 100%;
}

.card h3 {
  margin-bottom: 12px;
}

.card p {
  margin-bottom: 0;
}

/* ===== Grid Layouts ===== */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--grid-gap);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--grid-gap);
}

@media (max-width: 768px) {
  .grid-3, .grid-2 {
    grid-template-columns: 1fr;
  }
}

/* ===== Section Heading ===== */
.section__header {
  text-align: center;
  margin-bottom: 48px;
}

.section__header h2 {
  margin-bottom: 16px;
}

.section__header p {
  max-width: 600px;
  margin: 0 auto;
}

/* ===== Steps (How It Works) ===== */
.steps {
  display: flex;
  flex-direction: column;
  gap: 64px;
}

.step {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.step:nth-child(even) .step__content {
  order: 2;
}

.step:nth-child(even) .step__image {
  order: 1;
}

.step__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.875rem;
  margin-bottom: 16px;
}

.step__content h3 {
  margin-bottom: 12px;
  font-size: 1.5rem;
}

.step__image {
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.step__image .placeholder-img {
  aspect-ratio: 4/3;
}

@media (max-width: 768px) {
  .step {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .step:nth-child(even) .step__content {
    order: 1;
  }

  .step:nth-child(even) .step__image {
    order: 2;
  }
}

/* ===== Social Proof ===== */
.social-proof {
  text-align: center;
}

.social-proof__stat {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.social-proof__note {
  color: var(--text-dim);
  font-size: 0.875rem;
}

/* ===== Pricing Cards ===== */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--grid-gap);
  max-width: 800px;
  margin: 0 auto;
}

@media (max-width: 600px) {
  .pricing-grid {
    grid-template-columns: 1fr;
  }
}

.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px var(--card-pad);
  text-align: center;
  position: relative;
}

.pricing-card--recommended {
  border-color: var(--accent);
}

.pricing-card__badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 16px;
  border-radius: 20px;
  white-space: nowrap;
}

.pricing-card__tagline {
  color: var(--text-dim);
  font-size: 0.875rem;
  margin-bottom: 8px;
}

.pricing-card__name {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.pricing-card__price {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.pricing-card__price span {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-dim);
}

.pricing-card__desc {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 24px;
}

.pricing-card__features {
  list-style: none;
  text-align: left;
  margin-bottom: 28px;
}

.pricing-card__features li {
  padding: 6px 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.pricing-card__features li::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  min-width: 16px;
  margin-top: 2px;
  background: var(--green);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E") center/contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E") center/contain no-repeat;
}

/* ===== Feature Grid ===== */
.feature-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  margin-bottom: 64px;
}

.feature-block:nth-child(even) .feature-block__content {
  order: 2;
}

.feature-block:nth-child(even) .feature-block__image {
  order: 1;
}

@media (max-width: 768px) {
  .feature-block {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .feature-block:nth-child(even) .feature-block__content,
  .feature-block:nth-child(even) .feature-block__image {
    order: unset;
  }
}

.feature-block__content h3 {
  margin-bottom: 12px;
  font-size: 1.25rem;
}

/* Secondary feature list */
.feature-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (max-width: 600px) {
  .feature-list {
    grid-template-columns: 1fr;
  }
}

.feature-list__item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.feature-list__icon {
  width: 20px;
  height: 20px;
  min-width: 20px;
  color: var(--accent);
  margin-top: 2px;
}

.feature-list__item p {
  margin: 0;
  font-size: 0.875rem;
}

/* ===== Comparison Table ===== */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin: 32px 0;
}

.comparison-table th,
.comparison-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}

.comparison-table th {
  color: var(--text-primary);
  font-weight: 600;
  background: var(--bg-secondary);
  position: sticky;
  top: 64px;
}

.comparison-table td {
  color: var(--text-secondary);
}

.comparison-table td:nth-child(2),
.comparison-table td:nth-child(3) {
  text-align: center;
}

.comparison-table th:nth-child(2),
.comparison-table th:nth-child(3) {
  text-align: center;
}

.check {
  color: var(--green);
  font-weight: 700;
}

/* ===== FAQ Accordion ===== */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.faq-question {
  width: 100%;
  background: none;
  border: none;
  color: var(--text-primary);
  padding: 20px 24px;
  font-size: 0.9375rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-family: inherit;
}

.faq-question:hover {
  color: var(--accent);
}

.faq-chevron {
  width: 20px;
  height: 20px;
  min-width: 20px;
  transition: transform 0.3s;
  color: var(--text-dim);
}

.faq-item.open .faq-chevron {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq-item.open .faq-answer {
  max-height: 600px;
}

.faq-answer__inner {
  padding: 0 24px 20px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.faq-answer__inner a {
  color: var(--accent);
}

/* ===== Guide Page ===== */
.guide-group {
  margin-bottom: 48px;
}

.guide-group__header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border);
}

.guide-group__badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fff;
}

.guide-group__badge--bdc {
  background: var(--group-bdc);
}

.guide-group__badge--exhaust {
  background: var(--group-exhaust);
  color: #0a0e17;
}

.guide-group__badge--intake {
  background: var(--group-intake);
  color: #0a0e17;
}

.guide-view {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  align-items: start;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

@media (max-width: 600px) {
  .guide-view {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.guide-view__image {
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid var(--border);
}

.guide-view__image--bdc {
  border-color: var(--group-bdc);
}

.guide-view__image--exhaust {
  border-color: var(--group-exhaust);
}

.guide-view__image--intake {
  border-color: var(--group-intake);
}

.guide-view__name {
  font-weight: 700;
  margin-bottom: 8px;
}

.guide-view__instructions {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 0;
}

/* Checklist */
.checklist {
  list-style: none;
}

.checklist li {
  padding: 8px 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--text-secondary);
}

.checklist li::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin-top: 2px;
  border: 2px solid var(--accent);
  border-radius: 4px;
}

/* Tips list */
.tips-list {
  list-style: none;
}

.tips-list li {
  padding: 8px 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.tips-list li::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  min-width: 6px;
  margin-top: 8px;
  background: var(--accent);
  border-radius: 50%;
}

/* Borescope compatibility table */
.compat-table {
  width: 100%;
  border-collapse: collapse;
}

.compat-table th,
.compat-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}

.compat-table th {
  color: var(--text-primary);
  font-weight: 600;
  background: var(--bg-secondary);
}

.compat-table td {
  color: var(--text-secondary);
}

/* ===== Placeholder Images ===== */
.placeholder-img {
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  color: var(--text-dim);
  font-size: 0.8125rem;
  text-align: center;
  min-height: 200px;
}

/* ===== CTA Section ===== */
.cta-section {
  text-align: center;
  padding: var(--section-pad) 0;
}

.cta-section h2 {
  margin-bottom: 16px;
}

.cta-section p {
  margin-bottom: 32px;
}

.cta-section .hero__actions {
  margin-top: 32px;
}

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 48px 0;
  background: var(--bg-primary);
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 32px;
}

.footer__nav {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.footer__nav a {
  font-size: 0.8125rem;
  color: var(--text-dim);
}

.footer__nav a:hover {
  color: var(--text-secondary);
}

.footer__credit {
  color: var(--text-dim);
  font-size: 0.8125rem;
}

.footer__contact {
  color: var(--text-dim);
  font-size: 0.8125rem;
  margin-top: 8px;
}

.footer__contact a {
  color: var(--text-dim);
}

/* ===== Legal Pages ===== */
.legal-content {
  max-width: var(--container-narrow);
  margin: 0 auto;
}

.legal-content h2 {
  font-size: 1.5rem;
  margin-top: 48px;
  margin-bottom: 16px;
}

.legal-content h3 {
  font-size: 1.125rem;
  margin-top: 32px;
  margin-bottom: 12px;
}

.legal-content p {
  margin-bottom: 16px;
}

.legal-content ul {
  margin-bottom: 16px;
  padding-left: 24px;
}

.legal-content ul li {
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.legal-content .effective-date {
  color: var(--text-dim);
  font-size: 0.875rem;
  margin-bottom: 32px;
}

/* ===== Support Page Categories ===== */
.faq-category {
  margin-bottom: 40px;
}

.faq-category h3 {
  margin-bottom: 16px;
  color: var(--accent);
}

/* ===== Contact Card ===== */
.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px;
  text-align: center;
  max-width: 500px;
  margin: 0 auto;
}

.contact-card h3 {
  margin-bottom: 12px;
}

.contact-card .email-link {
  font-size: 1.125rem;
  font-weight: 600;
}

/* ===== Changelog ===== */
.changelog-entry {
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}

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

.changelog-entry__version h3 {
  margin: 0;
}

.changelog-entry__date {
  color: var(--text-dim);
  font-size: 0.8125rem;
}

.changelog-entry ul {
  list-style: disc;
  padding-left: 24px;
}

.changelog-entry li {
  color: var(--text-secondary);
  margin-bottom: 4px;
  font-size: 0.875rem;
}

/* ===== Tutorial Steps ===== */
.tutorial-steps {
  counter-reset: tutorial;
}

.tutorial-step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 16px 0;
  counter-increment: tutorial;
}

.tutorial-step::before {
  content: counter(tutorial);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.875rem;
  margin-top: 2px;
}

.tutorial-step p {
  margin: 0;
}

/* ===== Utility ===== */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mt-5 { margin-top: 48px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.mb-5 { margin-bottom: 48px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ===== Page spacer (for fixed nav) ===== */
main {
  padding-top: 64px;
}

/* ===== Responsive adjustments ===== */
@media (max-width: 768px) {
  :root {
    --section-pad: 72px;
    --card-pad: 20px;
    --side-pad: 16px;
  }

  .hero {
    padding-top: 120px;
  }

  .hero h1 {
    font-size: clamp(2rem, 8vw, 2.5rem);
  }
}
