:root {
  --bg: #0a0f1e;
  --bg-card: #111827;
  --bg-elevated: #1a2235;
  --fg: #e8ecf1;
  --fg-muted: #8892a4;
  --fg-dim: #5a6478;
  --accent-red: #e63946;
  --accent-green: #2ec4b2;
  --accent-amber: #f5a623;
  --accent-blue: #4a7cff;
  --font-heading: 'Space Grotesk', sans-serif;
  --font-body: 'DM Sans', sans-serif;
}

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

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

/* HERO */
.hero {
  padding: 120px 24px 80px;
  background: linear-gradient(180deg, #0d1429 0%, var(--bg) 100%);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -200px;
  right: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(230,57,70,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-container {
  max-width: 900px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-red);
  border: 1px solid rgba(230,57,70,0.3);
  padding: 6px 16px;
  border-radius: 4px;
  margin-bottom: 32px;
}

.hero h1 {
  font-size: clamp(42px, 6vw, 72px);
  color: var(--fg);
  margin-bottom: 24px;
}

.grade-bad {
  color: var(--accent-red);
  position: relative;
}

.grade-bad::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--accent-red);
  opacity: 0.4;
}

.hero-sub {
  font-size: 19px;
  color: var(--fg-muted);
  max-width: 640px;
  margin-bottom: 56px;
  line-height: 1.7;
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 32px;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
}

.stat {
  flex: 1;
}

.stat-num {
  display: block;
  font-family: var(--font-heading);
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 4px;
}

.stat-num.red { color: var(--accent-red); }
.stat-num.green { color: var(--accent-green); }
.stat-num.white { color: var(--fg); }

.stat-label {
  font-size: 13px;
  color: var(--fg-dim);
  line-height: 1.5;
}

.stat-divider {
  width: 1px;
  height: 48px;
  background: rgba(255,255,255,0.08);
}

/* PROBLEM */
.problem {
  padding: 100px 24px;
}

.problem-container {
  max-width: 900px;
  margin: 0 auto;
}

.problem-label,
.how-label,
.grades-label {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-red);
  margin-bottom: 16px;
}

.problem h2,
.how h2,
.grades h2 {
  font-size: clamp(32px, 4vw, 48px);
  margin-bottom: 56px;
  color: var(--fg);
}

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

.problem-card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 32px 28px;
  transition: border-color 0.2s;
}

.problem-card:hover {
  border-color: rgba(230,57,70,0.2);
}

.problem-icon {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-red);
  margin-bottom: 20px;
  opacity: 0.6;
}

.problem-card h3 {
  font-size: 20px;
  margin-bottom: 12px;
  color: var(--fg);
}

.problem-card p {
  font-size: 15px;
  color: var(--fg-muted);
  line-height: 1.65;
}

/* HOW IT WORKS */
.how {
  padding: 100px 24px;
  background: var(--bg-card);
}

.how-container {
  max-width: 900px;
  margin: 0 auto;
}

.how-label {
  color: var(--accent-green);
}

.how-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.step {
  display: flex;
  align-items: flex-start;
  gap: 32px;
  padding: 36px;
  background: var(--bg-elevated);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.04);
}

.step-grade {
  font-family: var(--font-heading);
  font-size: 48px;
  font-weight: 700;
  min-width: 80px;
  text-align: center;
  flex-shrink: 0;
}

.step-grade.grade-bad { color: var(--accent-red); }
.step-grade.grade-mid { color: var(--accent-amber); }
.step-grade.grade-good { color: var(--accent-green); }

.step-content h3 {
  font-size: 22px;
  margin-bottom: 8px;
  color: var(--fg);
}

.step-content p {
  font-size: 15px;
  color: var(--fg-muted);
  line-height: 1.65;
}

.step-arrow {
  width: 2px;
  height: 32px;
  background: linear-gradient(180deg, var(--accent-red), var(--accent-green));
  margin: 0 auto;
  opacity: 0.3;
}

/* GRADES TABLE */
.grades {
  padding: 100px 24px;
}

.grades-container {
  max-width: 900px;
  margin: 0 auto;
}

.grades-label {
  color: var(--accent-blue);
}

.grades-table {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  overflow: hidden;
}

.grade-row {
  display: grid;
  grid-template-columns: 160px 140px 1fr;
  padding: 18px 28px;
  font-size: 15px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  align-items: center;
}

.grade-row:last-child {
  border-bottom: none;
}

.grade-row.header {
  background: var(--bg-elevated);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-dim);
}

.grade-row.highlight {
  background: rgba(46,196,178,0.06);
  border: 1px solid rgba(46,196,178,0.15);
}

.grade-row.highlight span:first-child {
  color: var(--accent-green);
  font-weight: 700;
  font-family: var(--font-heading);
}

.grade-row span:first-child {
  color: var(--fg);
  font-weight: 500;
}

.grade-row span:nth-child(2) {
  color: var(--fg-muted);
  font-family: var(--font-heading);
  font-weight: 500;
}

.grade-row span:nth-child(3) {
  color: var(--fg-dim);
}

/* CLOSING */
.closing {
  padding: 120px 24px;
  text-align: center;
  background: linear-gradient(180deg, var(--bg) 0%, #0d1429 100%);
  position: relative;
}

.closing::before {
  content: '';
  position: absolute;
  bottom: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(46,196,178,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.closing-container {
  max-width: 700px;
  margin: 0 auto;
  position: relative;
}

.closing h2 {
  font-size: clamp(32px, 4vw, 52px);
  margin-bottom: 24px;
}

.closing-text {
  font-size: 18px;
  color: var(--fg-muted);
  line-height: 1.75;
  margin-bottom: 40px;
}

.closing-detail p {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 600;
  color: var(--accent-green);
}

/* FOOTER */
.footer {
  padding: 48px 24px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.footer-container {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.footer-brand {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 8px;
}

.footer-line {
  font-size: 14px;
  color: var(--fg-dim);
  margin-bottom: 4px;
}

.footer-location {
  font-size: 13px;
  color: var(--fg-dim);
  opacity: 0.6;
}

/* ─── SCANNER FORM ─────────────────────────────────────────────────────────── */

.scanner-form-wrap {
  margin-bottom: 56px;
}

.scanner-form { width: 100%; }

.scanner-input-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.scanner-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 0 16px;
  transition: border-color 0.2s;
}

.scanner-input-wrap:focus-within { border-color: var(--accent-red); }

.scanner-icon {
  font-size: 18px;
  color: var(--fg-dim);
  margin-right: 10px;
  flex-shrink: 0;
}

.scanner-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  padding: 16px 0;
}

.scanner-input::placeholder { color: var(--fg-dim); }

.scanner-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-red);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0 28px;
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, transform 0.1s;
}

.scanner-btn:hover { background: #d42f3b; }
.scanner-btn:active { transform: scale(0.98); }
.scanner-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.scanner-btn:hover .scanner-btn-arrow { transform: translateX(3px); }
.scanner-btn-arrow { font-size: 18px; transition: transform 0.2s; }

.scanner-note { font-size: 13px; color: var(--fg-dim); }

.scanner-error {
  margin-top: 10px;
  padding: 10px 14px;
  background: rgba(230,57,70,0.1);
  border: 1px solid rgba(230,57,70,0.3);
  border-radius: 6px;
  color: var(--accent-red);
  font-size: 14px;
}

.scanner-progress {
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
}

.progress-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.progress-dot-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-red);
  animation: pulse 1.4s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.progress-label {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
}

.progress-bar-wrap {
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  height: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-red), var(--accent-amber));
  border-radius: 4px;
  transition: width 0.8s ease;
}

.progress-url { font-size: 13px; color: var(--fg-dim); font-family: monospace; }

/* ─── REPORT PAGE ───────────────────────────────────────────────────────────── */

.report-loading {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
}

.report-loading-inner { max-width: 480px; }
.report-loading h2 { font-size: 28px; margin-bottom: 16px; color: var(--fg); }
.loading-url { font-size: 14px; color: var(--fg-dim); font-family: monospace; margin-bottom: 12px; word-break: break-all; }
.loading-sub { font-size: 15px; color: var(--fg-muted); }

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent-red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 24px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.report-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: rgba(10,15,30,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.report-nav-brand {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.report-nav-actions { display: flex; gap: 12px; align-items: center; }

.report-hero {
  padding: 80px 24px 60px;
  background: linear-gradient(180deg, #0d1429 0%, var(--bg) 100%);
}

.report-container { max-width: 960px; margin: 0 auto; }

.report-url-chip {
  display: inline-block;
  font-size: 13px;
  color: var(--fg-dim);
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 4px;
  padding: 5px 12px;
  font-family: monospace;
  margin-bottom: 40px;
  word-break: break-all;
}

.report-grade-layout { display: flex; gap: 64px; align-items: flex-start; }

.report-grade-circle {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: 4px solid;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.report-grade-letter {
  font-family: var(--font-heading);
  font-size: 80px;
  font-weight: 700;
  line-height: 1;
}

.report-grade-score { font-size: 14px; color: var(--fg-dim); font-family: var(--font-heading); margin-top: 2px; }

.report-grade-right { flex: 1; padding-top: 8px; }

.report-grade-label {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.report-grade-headline { font-size: clamp(22px, 3vw, 34px); color: var(--fg); margin-bottom: 16px; line-height: 1.2; }
.report-grade-meta { font-size: 14px; color: var(--fg-dim); margin-bottom: 32px; }

.score-bars { display: flex; flex-direction: column; gap: 12px; }

.score-bar-row {
  display: grid;
  grid-template-columns: 160px 1fr 40px;
  align-items: center;
  gap: 12px;
}

.score-bar-label { font-size: 13px; color: var(--fg-muted); }

.score-bar-track {
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  height: 6px;
  overflow: hidden;
}

.score-bar-fill { height: 100%; border-radius: 3px; transition: width 1s ease; }
.score-bar-num { font-family: var(--font-heading); font-size: 13px; font-weight: 600; color: var(--fg-muted); text-align: right; }

.report-section { padding: 80px 24px; }
.report-section-alt { background: var(--bg-card); }

.section-label {
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.section-label.red { color: var(--accent-red); }
.section-label.blue { color: var(--accent-blue); }
.section-label.green { color: var(--accent-green); }

.report-section h2 { font-size: clamp(24px, 3vw, 36px); color: var(--fg); margin-bottom: 40px; }

.issues-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.issue-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 20px 22px;
  background: var(--bg-card);
  border: 1px solid rgba(230,57,70,0.1);
  border-radius: 10px;
  transition: border-color 0.2s;
}

.issue-card:hover { border-color: rgba(230,57,70,0.3); }

.issue-count {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  color: var(--accent-red);
  flex-shrink: 0;
  line-height: 1;
}

.issue-count span { font-size: 14px; opacity: 0.6; }
.issue-text { font-size: 14px; color: var(--fg-muted); line-height: 1.5; }

.pages-table { border: 1px solid rgba(255,255,255,0.06); border-radius: 12px; overflow: hidden; }

.pages-table-header {
  display: grid;
  grid-template-columns: 1fr 60px 60px 80px 80px 60px;
  padding: 12px 20px;
  background: var(--bg-elevated);
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-dim);
  gap: 12px;
}

.pages-table-row {
  display: grid;
  grid-template-columns: 1fr 60px 60px 80px 80px 60px;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  gap: 12px;
  align-items: center;
  font-size: 14px;
  transition: background 0.15s;
}

.pages-table-row:hover { background: rgba(255,255,255,0.02); }
.pages-table-row:last-of-type { border-bottom: none; }

.page-url { color: var(--fg-muted); font-family: monospace; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-grade { font-family: var(--font-heading); font-size: 16px; }
.page-score, .page-dim { font-family: var(--font-heading); font-size: 13px; color: var(--fg-muted); }

.pages-table-issues {
  padding: 6px 20px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.page-issue-tag {
  font-size: 11px;
  color: var(--fg-dim);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 4px;
  padding: 2px 8px;
}

.report-cta {
  padding: 80px 24px;
  background: linear-gradient(180deg, var(--bg) 0%, #0d1429 100%);
}

.cta-box {
  display: flex;
  gap: 48px;
  align-items: center;
  padding: 56px;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  position: relative;
  overflow: hidden;
}

.cta-box::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(46,196,178,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.cta-grade-preview {
  font-family: var(--font-heading);
  font-size: 120px;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
  opacity: 0.4;
}

.cta-content { flex: 1; position: relative; }
.cta-content h2 { font-size: clamp(24px, 3vw, 36px); margin-bottom: 16px; color: var(--fg); }
.cta-content p { font-size: 16px; color: var(--fg-muted); margin-bottom: 24px; line-height: 1.7; }
.cta-pricing { font-size: 14px; color: var(--fg-dim); margin-bottom: 28px; }
.cta-pricing strong { color: var(--fg); font-weight: 700; }
.cta-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn-primary {
  display: inline-block;
  padding: 14px 28px;
  background: var(--accent-red);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}

.btn-primary:hover { background: #d42f3b; }

.btn-share, .btn-share-report, .btn-scan-another {
  display: inline-block;
  padding: 12px 20px;
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
}

.btn-share:hover, .btn-share-report:hover, .btn-scan-another:hover {
  border-color: rgba(255,255,255,0.25);
  color: var(--fg);
}

/* ─── RESPONSIVE ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .hero {
    padding: 80px 20px 60px;
  }

  .hero-stats {
    flex-direction: column;
    gap: 24px;
    padding: 24px;
  }

  .stat-divider {
    width: 100%;
    height: 1px;
  }

  .stat-num {
    font-size: 28px;
  }

  .problem-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .problem, .how, .grades {
    padding: 64px 20px;
  }

  .step {
    flex-direction: column;
    gap: 16px;
    padding: 24px;
  }

  .step-grade {
    font-size: 36px;
    min-width: auto;
    text-align: left;
  }

  .grade-row {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 16px 20px;
  }

  .grade-row.header {
    display: none;
  }

  .closing {
    padding: 80px 20px;
  }

  .scanner-input-row { flex-direction: column; }
  .scanner-btn { padding: 16px 24px; justify-content: center; }
  .report-grade-layout { flex-direction: column; gap: 32px; }
  .report-grade-circle { width: 140px; height: 140px; }
  .report-grade-letter { font-size: 60px; }
  .score-bar-row { grid-template-columns: 120px 1fr 36px; }
  .pages-table-header, .pages-table-row { grid-template-columns: 1fr 50px 50px; }
  .col-hide-sm { display: none; }
  .cta-box { flex-direction: column; gap: 24px; padding: 32px 24px; }
  .cta-grade-preview { font-size: 60px; }
  .report-nav { padding: 12px 20px; }
}