/* ═══════════════════════════════════════════
   GapSight — Review Gap Analyzer v2
   Theme: Dark editorial / forensic intelligence
   ═══════════════════════════════════════════ */

:root {
  --bg:           #0c0c0e;
  --bg-card:      #111115;
  --bg-input:     #16161b;
  --bg-input2:    #1a1a22;
  --border:       rgba(255,255,255,0.07);
  --border-hover: rgba(255,255,255,0.15);
  --text:         #e8e8ec;
  --text-muted:   #6b6b80;
  --text-dim:     #3d3d50;
  --accent:       #f97316;
  --accent-dark:  #ea6a0a;
  --teal:         #2dd4bf;
  --amber:        #fbbf24;
  --violet:       #a78bfa;
  --radius:       14px;
  --font-display: 'Syne', sans-serif;
  --font-body:    'DM Sans', sans-serif;
  --font-mono:    'DM Mono', monospace;
}

*, *::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-body);
  font-size: 16px;
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Noise */
.noise {
  position: fixed; inset: 0; pointer-events: none; z-index: 999;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px;
}

/* Glow */
body::before {
  content: ''; position: fixed; top: -20vh; left: 50%; transform: translateX(-50%);
  width: 80vw; height: 60vh;
  background: radial-gradient(ellipse, rgba(249,115,22,0.055) 0%, transparent 70%);
  pointer-events: none; z-index: 0;
}

/* ── Header ── */
header {
  position: relative; z-index: 1;
  padding: 1.4rem 2.5rem;
  display: flex; align-items: center; gap: 1rem;
  border-bottom: 1px solid var(--border);
}
.logo {
  font-family: var(--font-display); font-weight: 800; font-size: 1.2rem;
  letter-spacing: -0.03em; display: flex; align-items: center; gap: 0.45rem;
}
.logo-dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--accent);
  display: inline-block; box-shadow: 0 0 12px var(--accent);
  animation: pdot 2.5s ease-in-out infinite;
}
@keyframes pdot {
  0%,100% { box-shadow: 0 0 8px var(--accent); }
  50%      { box-shadow: 0 0 22px var(--accent); opacity: .7; }
}
.logo-sub { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted); }

/* ── Hero ── */
.hero {
  position: relative; z-index: 1;
  padding: 4rem 2.5rem 2.5rem; max-width: 820px; margin: 0 auto; text-align: center;
}
.hero h1 {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(2.4rem, 6vw, 4rem); line-height: 1.1;
  letter-spacing: -0.04em; margin-bottom: 1.2rem;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero-sub {
  font-size: 1rem; color: var(--text-muted);
  max-width: 540px; margin: 0 auto 1.8rem; line-height: 1.7;
}

/* Platform badges */
.platforms { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; margin-top: 0.5rem; }
.platform-badge {
  font-family: var(--font-mono); font-size: 0.72rem;
  background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  border-radius: 100px; padding: 0.3rem 0.8rem; color: var(--text-muted);
}
.platform-soon { opacity: 0.4; }

/* ── Main ── */
main {
  position: relative; z-index: 1;
  max-width: 820px; margin: 0 auto; padding: 0 2rem 6rem;
}

/* ── Mode Toggle ── */
.mode-toggle {
  display: flex; gap: 0.5rem; margin-bottom: 1.5rem;
  background: var(--bg-input); border-radius: 12px;
  padding: 0.35rem; border: 1px solid var(--border);
}
.mode-btn {
  flex: 1; background: transparent; border: none;
  border-radius: 9px; padding: 0.65rem 1rem;
  font-family: var(--font-display); font-weight: 600; font-size: 0.85rem;
  color: var(--text-muted); cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.mode-btn.active {
  background: var(--accent); color: #fff;
}
.mode-btn:not(.active):hover { color: var(--text); }

/* ── Form ── */
.form-section { display: flex; flex-direction: column; gap: 1.4rem; animation: fup 0.5s ease both; }
@keyframes fup { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }

.field { display: flex; flex-direction: column; gap: 0.35rem; }

label {
  font-family: var(--font-display); font-weight: 600;
  font-size: 0.85rem; color: var(--text);
}
.label-hint { font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-muted); }

input[type="url"],
textarea {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text);
  font-family: var(--font-body); font-size: 0.88rem; line-height: 1.65;
  padding: 0.85rem 1rem; width: 100%; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input[type="url"] { height: 48px; }
textarea { resize: vertical; }
input[type="url"]:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(249,115,22,0.12);
}
input::placeholder, textarea::placeholder { color: var(--text-dim); font-size: 0.82rem; }

/* URL examples */
.url-examples {
  display: flex; align-items: center; gap: 0.6rem;
  font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted);
}
.example-label { color: var(--text-dim); }
.example-link {
  color: var(--accent); cursor: pointer; text-decoration: underline;
  text-underline-offset: 2px; opacity: 0.8;
  transition: opacity 0.15s;
}
.example-link:hover { opacity: 1; }

/* ── Analyze Button ── */
#analyze-btn {
  align-self: flex-start; background: var(--accent); color: #fff;
  border: none; border-radius: 10px;
  font-family: var(--font-display); font-weight: 700;
  font-size: 0.92rem; letter-spacing: -0.02em;
  padding: 0.85rem 2rem; cursor: pointer;
  display: flex; align-items: center; gap: 0.5rem;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}
#analyze-btn:hover { background: var(--accent-dark); transform: translateY(-2px); box-shadow: 0 8px 28px rgba(249,115,22,.35); }
#analyze-btn:active { transform: translateY(0); }
#analyze-btn:disabled { opacity: 0.5; pointer-events: none; }
.btn-icon { display: inline-block; }

/* ── Error ── */
.error-msg {
  background: rgba(239,68,68,0.09); border: 1px solid rgba(239,68,68,0.25);
  border-radius: 10px; color: #fca5a5;
  font-family: var(--font-mono); font-size: 0.8rem; padding: 0.85rem 1rem;
}

/* ── Loading ── */
#loading-section { animation: fup 0.4s ease both; }
.loading-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2.5rem 2rem;
  text-align: center; margin-top: 1rem;
}
.loading-spinner {
  width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1.2rem;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.1rem; margin-bottom: 0.3rem;
}
.loading-sub { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.loading-steps { display: flex; flex-direction: column; gap: 0.5rem; max-width: 240px; margin: 0 auto; text-align: left; }
.load-step {
  font-family: var(--font-mono); font-size: 0.75rem;
  color: var(--text-dim); transition: color 0.3s;
}
.load-step.active { color: var(--accent); }
.load-step.done   { color: var(--teal); }

/* ── Results ── */
#results { animation: fup 0.5s ease both; }
.results-header { text-align: center; padding: 2.5rem 0 2rem; }
.results-badge {
  display: inline-block;
  background: rgba(45,212,191,.1); border: 1px solid rgba(45,212,191,.25);
  color: var(--teal); font-family: var(--font-mono);
  font-size: 0.68rem; letter-spacing: .08em; text-transform: uppercase;
  padding: 0.3rem 0.8rem; border-radius: 100px; margin-bottom: 0.8rem;
}
.results-header h2 {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(1.5rem, 4vw, 2.2rem); letter-spacing: -0.04em; margin-bottom: 0.4rem;
}
.results-meta { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-muted); }

/* ── Cards ── */
.cards-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
@media (max-width: 640px) {
  .cards-grid { grid-template-columns: 1fr; }
  header { flex-direction: column; align-items: flex-start; gap: 0.3rem; }
  .hero { padding: 2.5rem 1.5rem 2rem; }
  main { padding: 0 1.2rem 4rem; }
  #analyze-btn { width: 100%; justify-content: center; }
  .mode-toggle { flex-direction: column; }
}

.card {
  border-radius: var(--radius); border: 1px solid var(--border);
  padding: 1.3rem; transition: border-color 0.2s, transform 0.2s;
  animation: fup 0.5s ease both;
}
.card:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.card--blindspot   { background: rgba(249,115,22,.07); animation-delay: .05s; }
.card--signal      { background: rgba(251,191,36,.07); animation-delay: .10s; }
.card--opportunity { background: rgba(45,212,191,.07); animation-delay: .15s; }
.card--insight     { background: rgba(167,139,250,.07); animation-delay: .20s; }

.card-label {
  font-family: var(--font-display); font-weight: 700; font-size: 0.85rem;
  letter-spacing: -.01em; margin-bottom: 0.4rem;
  display: flex; align-items: center; gap: 0.35rem;
}
.card--blindspot   .card-label { color: var(--accent); }
.card--signal      .card-label { color: var(--amber);  }
.card--opportunity .card-label { color: var(--teal);   }
.card--insight     .card-label { color: var(--violet); }

.card-desc {
  font-size: 0.72rem; color: var(--text-muted);
  margin-bottom: 0.9rem; line-height: 1.45;
  font-family: var(--font-mono);
}
.card ul { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; }
.card ul li {
  font-size: 0.84rem; color: var(--text);
  line-height: 1.55; padding-left: 1rem; position: relative;
}
.card ul li::before { content: '→'; position: absolute; left: 0; color: var(--text-dim); font-size: .75rem; }

/* ── Reset ── */
.reset-btn {
  display: block; margin: 2rem auto 0;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-muted); border-radius: 10px;
  font-family: var(--font-mono); font-size: 0.78rem;
  padding: 0.65rem 1.4rem; cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.reset-btn:hover { border-color: var(--border-hover); color: var(--text); }

/* ── Footer ── */
footer {
  position: relative; z-index: 1;
  padding: 1.8rem 2.5rem; border-top: 1px solid var(--border);
  text-align: center; font-family: var(--font-mono);
  font-size: 0.7rem; color: var(--text-dim);
}
