/* ============================================
   ErrorDecoder Landing Page — Styles
   Dark-first, matches extension design system
   ============================================ */

:root {
  --bg: #0a0a0a;
  --bg-card: #1e1e1e;
  --bg-secondary: #252526;
  --text: #e4e4e4;
  --text-muted: #808080;
  --accent: #569cd6;
  --accent-hover: #6cb0f0;
  --border: #3e3e3e;
  --error-red: #f48771;
  --warning-yellow: #cca700;
  --success: #4ec9b0;
  --sonnet: #c586c0;
  --code-bg: #1a1a1a;
  --mono: "Fira Code", Consolas, monospace;
  --section-gap: 80px;
  --max-width: 1080px;
  --radius: 8px;
}

/* ============================================
   Reset & Base
   ============================================ */

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

/* ============================================
   Scrollbars
   ============================================ */

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================
   Layout Utilities
   ============================================ */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: var(--section-gap) 0;
}

/* ============================================
   Navigation
   ============================================ */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.3px;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: 28px;
  flex: 1;
  justify-content: center;
}

.nav-links a {
  font-size: 14px;
  color: var(--text-muted);
  transition: color 0.15s;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--accent);
  color: white;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s;
  flex-shrink: 0;
  white-space: nowrap;
}

.nav-cta:hover {
  background: var(--accent-hover);
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .nav-inner {
    justify-content: space-between;
  }
}

@media (max-width: 480px) {
  .nav-cta {
    padding: 7px 12px;
    font-size: 13px;
  }
}

/* ============================================
   Hero
   ============================================ */

.hero {
  padding: 80px 0 60px;
  text-align: center;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  background: rgba(86, 156, 214, 0.1);
  border: 1px solid rgba(86, 156, 214, 0.25);
  border-radius: 20px;
  padding: 4px 14px;
  margin-bottom: 24px;
  letter-spacing: 0.3px;
}

.hero h1 {
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1.5px;
  margin-bottom: 20px;
  color: var(--text);
}

.hero-subtitle {
  font-size: clamp(16px, 2.5vw, 20px);
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 36px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 56px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: var(--accent);
  color: white;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 700;
  transition: background 0.15s, transform 0.1s;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 14px 24px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 16px;
  transition: color 0.15s, border-color 0.15s;
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

/* ============================================
   Hero Mock — Sidebar Preview
   ============================================ */

.hero-mock {
  max-width: 560px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255,255,255,0.04);
  text-align: left;
}

.mock-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.mock-logo {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}

.mock-status {
  font-size: 11px;
  color: var(--text-muted);
}

.mock-error-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(244, 135, 113, 0.05);
}

.mock-error-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.mock-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--error-red);
  flex-shrink: 0;
}

.mock-dot-network { background: #cc6633; }

.mock-error-type {
  font-size: 11px;
  color: var(--error-red);
  font-weight: 600;
}

.mock-error-time {
  font-size: 10px;
  color: var(--text-muted);
  margin-left: auto;
}

.mock-error-text {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mock-decode-section {
  padding: 14px;
}

.mock-decode-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.mock-decode-title::before {
  content: "🤖";
  font-size: 13px;
}

/* Typing animation for the mock response */

.mock-response {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text);
}

.mock-line {
  opacity: 0;
  animation: mock-reveal 0.4s ease forwards;
}

.mock-line:nth-child(1) { animation-delay: 0.3s; }
.mock-line:nth-child(2) { animation-delay: 0.8s; }
.mock-line:nth-child(3) { animation-delay: 1.3s; }
.mock-line:nth-child(4) { animation-delay: 1.8s; }
.mock-line:nth-child(5) { animation-delay: 2.3s; }
.mock-line:nth-child(6) { animation-delay: 2.8s; }
.mock-line:nth-child(7) { animation-delay: 3.3s; }
.mock-line:nth-child(8) { animation-delay: 3.8s; }

@keyframes mock-reveal {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mock-heading {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  margin-top: 10px;
  margin-bottom: 4px;
}

.mock-text {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  line-height: 1.5;
}

.mock-inline-code {
  font-family: var(--mono);
  font-size: 11px;
  background: rgba(86, 156, 214, 0.12);
  color: var(--accent);
  padding: 2px 5px;
  border-radius: 3px;
}

.mock-code {
  font-family: var(--mono);
  font-size: 10px;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  padding: 8px 10px;
  margin: 6px 0;
  color: var(--success);
  display: block;
  overflow-x: auto;
  white-space: pre;
}

/* ============================================
   Tech Badge Strip — Marquee
   ============================================ */

.tech-strip {
  padding: 28px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  background: var(--bg);
}

.tech-strip-label {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

.tech-strip-track {
  overflow: hidden;
  width: 100%;
  /* fade edges */
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
}

.tech-strip-inner {
  display: flex;
  gap: 10px;
  width: max-content;
  animation: marquee 32s linear infinite;
}

.tech-strip-inner:hover {
  animation-play-state: paused;
}

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.tech-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  color: white;
  white-space: nowrap;
  flex-shrink: 0;
  opacity: 0.9;
}

.tech-badge:hover {
  opacity: 1;
}

/* ============================================
   How It Works
   ============================================ */

.section-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 12px;
  display: block;
}

.section-heading {
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 800;
  letter-spacing: -0.8px;
  line-height: 1.15;
  margin-bottom: 16px;
  color: var(--text);
}

.section-sub {
  font-size: 17px;
  color: var(--text-muted);
  max-width: 540px;
  line-height: 1.6;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-top: 56px;
}

.step {
  position: relative;
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

@supports (animation-timeline: view()) {
  .step {
    opacity: 0;
    transform: translateY(20px);
    animation: scroll-reveal 0.5s ease forwards;
    animation-timeline: view();
    animation-range: entry 0% entry 30%;
  }
}

@supports not (animation-timeline: view()) {
  .step {
    opacity: 1;
    transform: none;
  }
}

@keyframes scroll-reveal {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.step-number {
  position: absolute;
  top: 16px;
  right: 20px;
  font-size: 56px;
  font-weight: 900;
  color: var(--accent);
  opacity: 0.1;
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

.step-num-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(86, 156, 214, 0.15);
  border: 1px solid rgba(86, 156, 214, 0.3);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.step h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.step p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

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

/* ============================================
   Features Bento Grid
   ============================================ */

.features-header {
  margin-bottom: 48px;
}

.bento {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(86, 156, 214, 0.15), 0 12px 32px rgba(0, 0, 0, 0.4);
}

@supports (animation-timeline: view()) {
  .feature-card {
    opacity: 0;
    animation: scroll-reveal 0.5s ease forwards;
    animation-timeline: view();
    animation-range: entry 0% entry 25%;
    /* transition handles hover independently of the animation */
  }
}

@supports not (animation-timeline: view()) {
  .feature-card {
    opacity: 1;
    transform: none;
  }
}

.feature-icon {
  font-size: 28px;
  margin-bottom: 16px;
  display: block;
  line-height: 1;
}

.feature-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.feature-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

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

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

/* ============================================
   Error Types Section
   ============================================ */

.error-types-header {
  text-align: center;
  margin-bottom: 40px;
}

.error-types-header .section-sub {
  margin: 0 auto;
}

.error-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.error-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
}

.pill-red {
  background: rgba(244, 135, 113, 0.12);
  color: var(--error-red);
  border-color: rgba(244, 135, 113, 0.25);
}

.pill-orange {
  background: rgba(204, 102, 51, 0.12);
  color: #cc6633;
  border-color: rgba(204, 102, 51, 0.25);
}

.pill-yellow {
  background: rgba(204, 167, 0, 0.12);
  color: var(--warning-yellow);
  border-color: rgba(204, 167, 0, 0.25);
}

/* ============================================
   Pricing
   ============================================ */

.pricing-header {
  text-align: center;
  margin-bottom: 48px;
}

.pricing-header .section-sub {
  margin: 0 auto;
}

/* Pure CSS price toggle */
.price-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 40px;
  padding: 4px;
  margin-bottom: 40px;
}

.price-toggle input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.price-toggle label {
  padding: 7px 18px;
  border-radius: 32px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  user-select: none;
}

/* Monthly label is highlighted by default via the rule near .pricing-section */

.save-badge {
  font-size: 11px;
  font-weight: 700;
  background: rgba(78, 201, 176, 0.15);
  color: var(--success);
  border: 1px solid rgba(78, 201, 176, 0.3);
  border-radius: 10px;
  padding: 1px 7px;
  margin-left: 4px;
}

.pricing-section {
  position: relative;
}

.pricing-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 760px;
  margin: 32px auto 0;
  padding: 0 24px;
}

.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px 28px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.pricing-card.featured {
  border-color: var(--sonnet);
  box-shadow: 0 0 0 1px rgba(197, 134, 192, 0.2), 0 8px 32px rgba(197, 134, 192, 0.1);
  transform: scale(1.02);
}

.pricing-card-top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 12px 12px 0 0;
}

.pricing-card.free .pricing-card-top-bar {
  background: var(--accent);
}

.pricing-card.featured .pricing-card-top-bar {
  background: var(--sonnet);
}

.most-popular-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--sonnet);
  background: rgba(197, 134, 192, 0.12);
  border: 1px solid rgba(197, 134, 192, 0.3);
  border-radius: 10px;
  padding: 2px 10px;
  position: absolute;
  top: 20px;
  right: 20px;
}

.pricing-tier {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.pricing-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin: 8px 0 4px;
}

.price-amount {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -2px;
  color: var(--text);
  line-height: 1;
}

.price-period {
  font-size: 14px;
  color: var(--text-muted);
}

/* Show/hide monthly vs yearly prices.
   #toggle-yearly is a direct child of .pricing-section.
   .pricing-cards is also a direct child of .pricing-section.
   The general sibling combinator (~) reaches across. */
.price-yearly {
  display: none;
}

#toggle-yearly:checked ~ .pricing-cards .price-monthly {
  display: none;
}

#toggle-yearly:checked ~ .pricing-cards .price-yearly {
  display: flex;
}

/* Active toggle label highlight.
   Radio inputs are direct children of .pricing-section.
   .container (which wraps the toggle UI) is also a direct child,
   so ~ reaches it. Then we descend into .label-monthly/.label-yearly. */
#toggle-monthly:checked ~ .container .label-monthly,
#toggle-yearly:checked ~ .container .label-yearly {
  color: white;
  background: var(--accent);
}

.pricing-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.pricing-features li {
  font-size: 14px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
}

.pricing-features li::before {
  content: "✓";
  color: var(--success);
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.pricing-features li.muted {
  opacity: 0.5;
}

.pricing-features li.muted::before {
  content: "—";
  color: var(--text-muted);
}

.btn-pricing {
  display: block;
  width: 100%;
  padding: 13px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  transition: opacity 0.15s, transform 0.1s;
}

.btn-pricing:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-pricing.accent {
  background: var(--accent);
  color: white;
}

.btn-pricing.sonnet {
  background: var(--sonnet);
  color: white;
}

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

  .pricing-card.featured {
    transform: none;
  }
}

/* ============================================
   FAQ
   ============================================ */

.faq-list {
  max-width: 680px;
  margin: 40px auto 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

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

details + details {
  margin-top: 8px;
}

summary {
  padding: 18px 22px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: color 0.15s;
  user-select: none;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "+";
  font-size: 20px;
  font-weight: 300;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.2s ease, color 0.15s;
  line-height: 1;
}

details[open] summary::after {
  transform: rotate(45deg);
  color: var(--accent);
}

details[open] summary {
  color: var(--accent);
}

.faq-answer {
  padding: 0 22px 18px;
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.65;
  border-top: 1px solid var(--border);
}

.faq-answer p {
  padding-top: 16px;
}

/* ============================================
   Final CTA
   ============================================ */

.final-cta {
  text-align: center;
  background: linear-gradient(to bottom, transparent, rgba(86, 156, 214, 0.04));
  border-top: 1px solid var(--border);
}

.final-cta h2 {
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 800;
  letter-spacing: -0.8px;
  margin-bottom: 16px;
  color: var(--text);
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.final-cta .sub {
  font-size: 17px;
  color: var(--text-muted);
  margin-bottom: 36px;
}

.cta-note {
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ============================================
   Footer
   ============================================ */

.footer {
  padding: 28px 0;
  border-top: 1px solid var(--border);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-brand {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
}

.footer-copy {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  font-size: 13px;
  color: var(--text-muted);
  transition: color 0.15s;
}

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

.footer-author {
  font-size: 13px;
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
}
