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

:root {
  --bg: #0A0A0B;
  --surface: #111113;
  --surface2: #1A1A1E;
  --border: #222226;
  --text: #E8E8EC;
  --text-secondary: #9696A5;
  --text-dim: #76767F;
  --accent: #D4A843;
  --accent-light: #E8C96A;
  --accent-dark: #B8922F;
  --accent-dim: rgba(212,168,67,0.12);
  --accent-glow: rgba(212,168,67,0.2);
  --green: #22c55e;
  --red: #ef4444;
  --yellow: #eab308;
  --radius: 10px;
  --font: system-ui, -apple-system, 'Helvetica Neue', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

::selection { background: var(--accent-dim); color: var(--accent-light); }

/* ── State Management ─────────────────────────── */
.state { display: none; }
.state.active { display: block; }

/* ── Utilities ────────────────────────────────── */
.gold-text {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.fade-in {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
  transition-delay: var(--delay, 0s);
}

.fade-in.visible { opacity: 1; transform: none; }

/* ── Shared: Input Row ────────────────────────── */
.input-row {
  display: flex;
  gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.4rem;
}

.input-row input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 1rem;
  padding: 0.75rem 1rem;
  min-height: 44px;
  font-family: var(--font);
}

.input-row input::placeholder { color: var(--text-dim); }

.input-row button {
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  color: var(--bg);
  border: none;
  border-radius: 7px;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
  transition: opacity 0.15s;
  white-space: nowrap;
  min-height: 44px;
}

.input-row button:hover { opacity: 0.9; }
.input-row button:disabled { opacity: 0.5; cursor: not-allowed; }

/* ══════════════════════════════════════════════ */
/* ── LANDING PAGE                              ── */
/* ══════════════════════════════════════════════ */

/* Nav */
.landing-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 32px;
  max-width: 1100px;
  margin: 0 auto;
}

.nav-logo { display: flex; align-items: center; gap: 10px; }
.nav-wordmark { font-size: 20px; letter-spacing: -1px; }
.wm-light { font-weight: 300; }
.wm-bold { font-weight: 700; }

.nav-links { display: flex; gap: 28px; align-items: center; }

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.nav-cta {
  padding: 10px 20px;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  transition: border-color 0.15s, color 0.15s;
}

.nav-cta:hover { border-color: var(--text-secondary); color: var(--text); }

/* Hero */
.hero {
  padding: 110px 24px 100px;
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 100px;
  border: 1px solid var(--border);
  margin-bottom: 36px;
  font-size: 12px;
  color: var(--text-secondary);
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: var(--green);
  display: inline-block;
}

.hero-title {
  font-size: clamp(38px, 5.5vw, 64px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -2px;
  margin-bottom: 24px;
}

.hero-subtitle {
  font-size: 20px;
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 500px;
  margin-bottom: 52px;
}

.hero-form { width: 100%; max-width: 540px; }

.hero-hint {
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.3px;
}

/* Landing Sections */
.landing-section {
  padding: 100px 24px;
  border-top: 1px solid var(--border);
  max-width: 1000px;
  margin: 0 auto;
}

.section-title {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  letter-spacing: -1px;
  text-align: center;
  margin-bottom: 48px;
}

.section-subtitle {
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 480px;
  margin: -36px auto 52px;
}

/* How It Works */
.how-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.how-card {
  padding: 28px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.how-number {
  position: absolute;
  top: 14px;
  right: 18px;
  font-size: 40px;
  font-weight: 800;
  color: var(--accent-dim);
  line-height: 1;
}

.how-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 10px; }
.how-card p { font-size: 14px; color: var(--text-secondary); line-height: 1.65; }

/* Calibration */
.cal-section { max-width: 900px; }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.cal-card {
  padding: 28px 20px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cal-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--cal-color);
}

.cal-score { font-size: 40px; font-weight: 800; color: var(--cal-color); margin-bottom: 6px; line-height: 1; }
.cal-site { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.cal-label { font-size: 12px; color: var(--text-secondary); }

/* Features */
.feat-section { max-width: 700px; }

.feat-item {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.feat-check { color: var(--accent); font-size: 14px; flex-shrink: 0; }
.feat-item span:last-child { font-size: 16px; line-height: 1.5; }

/* Report Preview */
.preview-section { max-width: 700px; }

.preview-report {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  position: relative;
  overflow: hidden;
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.preview-score-row { display: flex; align-items: center; gap: 14px; }

.preview-score-circle { display: flex; align-items: baseline; gap: 4px; }
.preview-score-num { font-size: 40px; font-weight: 800; color: var(--yellow); line-height: 1; }
.preview-score-max { font-size: 14px; color: var(--text-secondary); font-weight: 400; }

.preview-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
}

.preview-below-avg { background: rgba(239,68,68,0.1); color: var(--red); }

.preview-url { font-size: 12px; color: var(--text-secondary); font-family: monospace; }

.preview-dims { margin-bottom: 20px; }

.preview-dim {
  display: grid;
  grid-template-columns: 160px 1fr 32px;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}

.preview-dim-label { font-size: 12px; font-weight: 500; color: var(--text-secondary); }

.preview-bar-track {
  height: 6px;
  background: var(--surface2);
  border-radius: 3px;
  overflow: hidden;
}

.preview-bar-fill { height: 100%; border-radius: 3px; }
.preview-fill-high { background: var(--green); }
.preview-fill-mid { background: var(--yellow); }
.preview-fill-low { background: var(--red); }

.preview-dim-score { font-weight: 700; font-size: 16px; text-align: right; }
.preview-high { color: var(--green); }
.preview-mid { color: var(--yellow); }
.preview-low { color: var(--red); }

.preview-evidence {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.preview-chip {
  font-size: 12px;
  line-height: 1.4;
  padding: 3px 8px;
  border-radius: 4px;
  border-left: 3px solid;
  background: var(--surface2);
  color: var(--text-secondary);
}

.chip-pass { border-left-color: var(--green); }
.chip-warn { border-left-color: var(--yellow); }
.chip-fail { border-left-color: var(--red); }

.preview-fix {
  padding: 14px 16px;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.preview-fix-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.preview-fix-text {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.6;
}

.preview-fade {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(transparent, var(--surface));
  pointer-events: none;
}

/* Problem */
.problem-section { max-width: 700px; }

.problem-card {
  padding: 44px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.problem-glow {
  position: absolute;
  top: -80px;
  right: -80px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: var(--accent-glow);
  filter: blur(100px);
  pointer-events: none;
}

.pg-quote {
  font-size: 20px;
  font-style: italic;
  line-height: 1.6;
  color: var(--text);
  border-left: 3px solid var(--accent);
  padding-left: 20px;
  margin-bottom: 28px;
}

.pg-quote cite {
  display: block;
  font-size: 12px;
  font-style: normal;
  color: var(--text-secondary);
  margin-top: 8px;
}

.problem-card h2 {
  font-size: clamp(20px, 3.5vw, 28px);
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 20px;
  line-height: 1.2;
}

.problem-card p { font-size: 16px; color: var(--text-secondary); line-height: 1.75; margin-bottom: 16px; }
.problem-punch { font-weight: 600; color: var(--text) !important; }

/* CTA */
.cta-section {
  padding: 120px 24px 100px;
  text-align: center;
  border-top: none;
}

.cta-content { max-width: 560px; margin: 0 auto; }
.cta-crown { display: block; margin: 0 auto 36px; }

.cta-section h2 {
  font-size: clamp(28px, 4.5vw, 40px);
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1.1;
  margin-bottom: 20px;
}

.cta-section p { font-size: 14px; color: var(--text-secondary); margin-bottom: 36px; line-height: 1.6; }

.cta-btn {
  padding: 16px 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  color: var(--bg);
  font-weight: 700;
  font-size: 16px;
  border: none;
  cursor: pointer;
  letter-spacing: 0.3px;
  box-shadow: 0 0 40px var(--accent-dim);
  font-family: var(--font);
  min-height: 44px;
}

/* Footer */
.landing-footer {
  padding: 24px 32px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
}

.footer-logo { display: flex; align-items: center; gap: 8px; }
.footer-wm { font-size: 12px; color: var(--text-dim); letter-spacing: -0.5px; }
.footer-copy { font-size: 12px; color: var(--text-dim); }

/* ══════════════════════════════════════════════ */
/* ── LOADING STATE                             ── */
/* ══════════════════════════════════════════════ */

.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
}

.loading-container h2 { font-size: 1.5rem; margin-bottom: 2rem; }

.progress-steps {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 280px;
}

.step {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-secondary);
  transition: color 0.3s;
}

.step.active { color: var(--accent); }
.step.done { color: var(--green); }

.step-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  transition: background 0.3s;
}

.step.active .step-dot {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  animation: pulse 1.2s ease-in-out infinite;
}

.step.done .step-dot { background: var(--green); }

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

.loading-hint { color: var(--text-secondary); font-size: 0.85rem; margin-top: 2rem; }

/* ══════════════════════════════════════════════ */
/* ── REPORT STATE                              ── */
/* ══════════════════════════════════════════════ */

.report { max-width: 840px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }
.report-header { margin-bottom: 2rem; }

.back-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.875rem;
  font-family: var(--font);
  margin-bottom: 1rem;
  transition: border-color 0.15s;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.back-btn:hover { border-color: var(--text-secondary); }
.report-title h1 { font-size: 1.6rem; font-weight: 700; }
.report-url { color: var(--text-secondary); font-size: 0.9rem; word-break: break-all; }

/* Overall Score */
.overall-section {
  text-align: center;
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.overall-score-circle {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
  margin-bottom: 0.75rem;
}

.score-number { font-size: 4.5rem; font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.score-max { font-size: 1.3rem; color: var(--text-secondary); font-weight: 400; }

.classification-badge {
  display: inline-block;
  padding: 0.3rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.classification-badge.exceptional { background: rgba(34,197,94,0.15); color: var(--green); box-shadow: 0 0 16px rgba(34,197,94,0.2); }
.classification-badge.strong { background: rgba(34,197,94,0.1); color: var(--green); box-shadow: 0 0 12px rgba(34,197,94,0.15); }
.classification-badge.average { background: rgba(234,179,8,0.12); color: var(--yellow); }
.classification-badge.below-average { background: rgba(239,68,68,0.1); color: var(--red); }
.classification-badge.poor { background: rgba(239,68,68,0.15); color: var(--red); }

.overall-summary { color: var(--text-secondary); max-width: 600px; margin: 0 auto; font-size: 0.95rem; }

/* Screenshot */
.screenshot-section { margin-bottom: 2.5rem; }
.screenshot-section img { width: 100%; border-radius: var(--radius); border: 1px solid var(--border); }

/* Dimension Scores */
.dimensions-section { margin-bottom: 2.5rem; }

.dimensions-section h2,
.hotspots-section h2,
.recommendations-section h2,
.share-section h2,
.waitlist-section h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.dimensions-grid { display: flex; flex-direction: column; gap: 0.75rem; }

.dim-row {
  display: grid;
  grid-template-columns: 180px 1fr 40px;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-radius: 8px;
  border: 1px solid var(--border);
  transition: background 0.15s;
}

.dim-row:hover { background: var(--surface2); }

.dim-label { font-size: 0.88rem; font-weight: 500; }
.dim-bar-track { height: 8px; background: var(--surface2); border-radius: 4px; overflow: hidden; }
.dim-bar-fill { height: 100%; border-radius: 4px; transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1); }
.dim-score { font-weight: 700; font-size: 0.95rem; text-align: right; }

.score-high { color: var(--green); }
.score-high .dim-bar-fill { background: var(--green); }
.score-mid { color: var(--yellow); }
.score-mid .dim-bar-fill { background: var(--yellow); }
.score-low { color: var(--red); }
.score-low .dim-bar-fill { background: var(--red); }

.dim-reasoning { grid-column: 1 / -1; font-size: 0.82rem; color: var(--text-secondary); line-height: 1.5; padding-top: 0.25rem; }

/* Evidence Chips */
.dim-evidence { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0.4rem; padding-top: 0.4rem; }

.evidence-chip {
  font-size: 0.73rem;
  line-height: 1.4;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  border-left: 3px solid;
  background: var(--surface2);
  color: var(--text-secondary);
}

.evidence-chip.evidence-pass { border-left-color: var(--green); }
.evidence-chip.evidence-warn { border-left-color: var(--yellow); }
.evidence-chip.evidence-fail { border-left-color: var(--red); }

/* Hotspots */
.hotspots-section { margin-bottom: 2.5rem; }
.hotspot-list { display: flex; flex-direction: column; gap: 0.75rem; }

.hotspot-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--red);
  border-radius: 8px;
  padding: 1rem 1.1rem;
}

.hotspot-meta { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.5rem; }
.hotspot-dim { font-size: 0.78rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; }

.hotspot-impact {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
}

.impact-high { background: rgba(239,68,68,0.15); color: var(--red); }
.impact-med { background: rgba(234,179,8,0.12); color: var(--yellow); }
.impact-low { background: rgba(142,142,150,0.12); color: var(--text-secondary); }

.hotspot-issue { font-size: 0.9rem; font-weight: 500; color: var(--text); margin-bottom: 0.3rem; }
.hotspot-why { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.5; margin-bottom: 0.4rem; font-style: italic; }
.hotspot-fix { font-size: 0.82rem; color: var(--green); line-height: 1.5; }

/* Recommendations */
.recommendations-list { padding-left: 1.25rem; display: flex; flex-direction: column; gap: 0.6rem; }
.recommendations-list li { font-size: 0.92rem; line-height: 1.5; color: var(--text-secondary); }

/* Score Animation */
@keyframes scoreReveal {
  0% { transform: scale(0.3); filter: blur(10px); opacity: 0; }
  60% { transform: scale(1.08); filter: blur(0); opacity: 1; }
  100% { transform: scale(1); filter: blur(0); opacity: 1; }
}

.score-number.animate { animation: scoreReveal 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

/* Share Section */
.share-section {
  text-align: center;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  margin-top: 2.5rem;
}

.share-buttons { display: flex; justify-content: center; gap: 0.75rem; flex-wrap: wrap; }

.share-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.625rem 1.2rem;
  border-radius: 7px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font);
  transition: transform 0.15s, border-color 0.15s;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.share-btn:hover { border-color: var(--text-secondary); transform: translateY(-1px); }
.share-copy { background: var(--accent); border-color: var(--accent); color: var(--bg); font-weight: 600; }
.share-copy:hover { border-color: var(--accent); opacity: 0.9; }

/* Waitlist Section */
.waitlist-section {
  text-align: center;
  padding: 2.5rem 0 1rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

.waitlist-subtitle { color: var(--text-secondary); font-size: 0.95rem; margin-bottom: 1.25rem; }
.waitlist-section .input-row { max-width: 420px; margin: 0 auto; }
.waitlist-feedback { font-size: 0.88rem; margin-top: 0.75rem; min-height: 1.4em; }
.feedback-success { color: var(--green); }
.feedback-error { color: var(--red); }

/* ══════════════════════════════════════════════ */
/* ── ERROR STATE                               ── */
/* ══════════════════════════════════════════════ */

.error-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
  text-align: center;
}

.error-container h2 { margin-bottom: 0.75rem; }
#error-message { color: var(--text-secondary); max-width: 400px; margin-bottom: 1.5rem; }

.retry-btn {
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  color: var(--bg);
  border: none;
  border-radius: 7px;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  min-height: 44px;
}

/* ══════════════════════════════════════════════ */
/* ── REDUCED MOTION                            ── */
/* ══════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  .fade-in { opacity: 1; transform: none; transition: none; }
  .score-number.animate { animation: none; }
  .step.active .step-dot { animation: none; }
  html { scroll-behavior: auto; }
}

/* ══════════════════════════════════════════════ */
/* ── RESPONSIVE                                ── */
/* ══════════════════════════════════════════════ */

@media (max-width: 768px) {
  .landing-nav { padding: 16px 20px; }
  .nav-links { gap: 16px; }
  .nav-link { display: none; }
  .hero { padding: 80px 20px 60px; }
  .hero-subtitle { font-size: 16px; }
  .hero-title { font-size: clamp(32px, 8vw, 40px); }
  .how-grid { grid-template-columns: 1fr; }
  .cal-grid { grid-template-columns: 1fr 1fr; }
  .problem-card { padding: 28px; }
  .preview-report { padding: 20px; }
  .preview-dim { grid-template-columns: 120px 1fr 28px; gap: 8px; }
  .preview-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .dim-row { grid-template-columns: 140px 1fr 36px; }
}
