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

:root {
  --bg: #080c14;
  --surface: #0e1420;
  --surface2: #141b2d;
  --border: rgba(99,102,241,.18);
  --primary: #6366f1;
  --primary-glow: rgba(99,102,241,.35);
  --purple: #a855f7;
  --cyan: #06b6d4;
  --green: #22c55e;
  --orange: #f97316;
  --red: #ef4444;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --subtle: #334155;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 32px rgba(0,0,0,.5);
  --font: 'Inter', sans-serif;
  --font-display: 'Space Grotesk', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }

/* ── Animated Orbs ──────────────────────────────────────────── */
.bg-orbs { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.orb { position: absolute; border-radius: 50%; filter: blur(120px); opacity: .25; animation: orb-drift 20s ease-in-out infinite alternate; }
.orb-1 { width: 600px; height: 600px; background: radial-gradient(circle, #6366f1, transparent); top: -200px; left: -200px; animation-duration: 18s; }
.orb-2 { width: 500px; height: 500px; background: radial-gradient(circle, #a855f7, transparent); bottom: -100px; right: -100px; animation-duration: 22s; animation-delay: -8s; }
.orb-3 { width: 400px; height: 400px; background: radial-gradient(circle, #06b6d4, transparent); top: 50%; left: 50%; transform: translate(-50%,-50%); animation-duration: 25s; animation-delay: -4s; }
@keyframes orb-drift { from { transform: translate(0,0) scale(1); } to { transform: translate(40px,30px) scale(1.1); } }
.orb-3 { animation-name: orb3-drift; }
@keyframes orb3-drift { from { transform: translate(-50%,-50%) scale(1); } to { transform: translate(calc(-50% + 30px), calc(-50% + 20px)) scale(1.08); } }

/* ── Header ─────────────────────────────────────────────────── */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  backdrop-filter: blur(20px);
  background: rgba(8,12,20,.7);
  border-bottom: 1px solid var(--border);
  padding: .9rem 0;
}
.header-inner { display: flex; align-items: center; gap: 2rem; }
.logo { display: flex; align-items: center; gap: .7rem; text-decoration: none; }
.logo-icon svg { width: 36px; height: 36px; }
.logo-text { display: flex; align-items: center; gap: .4rem; }
.logo-name { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; letter-spacing: -.02em; }
.logo-badge { background: linear-gradient(135deg, var(--primary), var(--purple)); font-size: .65rem; font-weight: 700; padding: .15rem .45rem; border-radius: 6px; letter-spacing: .05em; }
.header-nav { display: flex; gap: 1.8rem; margin-left: auto; }
.header-nav a { color: var(--muted); text-decoration: none; font-size: .9rem; font-weight: 500; transition: color .2s; }
.header-nav a:hover { color: var(--text); }
.status-pill { display: flex; align-items: center; gap: .5rem; background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.2); border-radius: 20px; padding: .35rem .8rem; font-size: .78rem; color: var(--green); white-space: nowrap; }
.status-dot { width: 7px; height: 7px; background: var(--green); border-radius: 50%; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:.4; } }

/* ── Sections (z-index above orbs) ──────────────────────────── */
.hero, .upload-section, .classes-section, .about-section, .footer { position: relative; z-index: 1; }

/* ── Hero ───────────────────────────────────────────────────── */
.hero { padding: 9rem 0 4rem; text-align: center; }
.hero-badge { display: inline-flex; align-items: center; gap: .5rem; background: rgba(99,102,241,.1); border: 1px solid rgba(99,102,241,.25); border-radius: 20px; padding: .4rem 1rem; font-size: .8rem; color: #a5b4fc; margin-bottom: 1.5rem; }
.badge-dot { width: 6px; height: 6px; background: #818cf8; border-radius: 50%; }
.hero-title { font-family: var(--font-display); font-size: clamp(2.4rem, 6vw, 4rem); font-weight: 800; line-height: 1.1; letter-spacing: -.03em; margin-bottom: 1.2rem; }
.gradient-text { background: linear-gradient(135deg, #818cf8, #c084fc, #67e8f9); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-subtitle { font-size: 1.1rem; color: var(--muted); max-width: 640px; margin: 0 auto 2.5rem; line-height: 1.7; }
.hero-subtitle strong { color: #c4b5fd; }
.hero-stats { display: flex; align-items: center; justify-content: center; gap: 2rem; flex-wrap: wrap; }
.stat-item { text-align: center; }
.stat-value { display: block; font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; background: linear-gradient(135deg, var(--primary), var(--purple)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.stat-label { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.stat-divider { width: 1px; height: 36px; background: var(--border); }

/* ── Upload Section ─────────────────────────────────────────── */
.upload-section { padding: 4rem 0 6rem; }
.section-header { text-align: center; margin-bottom: 3rem; }
.section-title { font-family: var(--font-display); font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 700; letter-spacing: -.02em; margin-bottom: .5rem; }
.section-subtitle { color: var(--muted); font-size: .95rem; }
.upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 820px) { .upload-grid { grid-template-columns: 1fr; } }

/* ── Drop Zone ──────────────────────────────────────────────── */
.upload-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.drop-zone {
  border: 2px dashed var(--border); border-radius: var(--radius-sm);
  min-height: 260px; display: flex; align-items: center; justify-content: center;
  position: relative; cursor: pointer; transition: border-color .25s, background .25s;
  overflow: hidden;
}
.drop-zone:hover, .drop-zone.drag-over { border-color: var(--primary); background: rgba(99,102,241,.05); }
.file-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.drop-content { text-align: center; padding: 2rem; pointer-events: none; }
.drop-icon svg { width: 56px; height: 56px; color: var(--primary); margin-bottom: 1rem; opacity: .8; }
.drop-title { font-weight: 600; font-size: 1rem; margin-bottom: .4rem; }
.drop-subtitle { color: var(--muted); font-size: .88rem; }
.browse-link { background: none; border: none; color: var(--primary); cursor: pointer; font: inherit; text-decoration: underline; pointer-events: all; }
.preview-content { padding: 1rem; width: 100%; }
.preview-img { width: 100%; max-height: 200px; object-fit: contain; border-radius: 8px; border: 1px solid var(--border); }
.preview-info { display: flex; align-items: center; justify-content: space-between; margin-top: .75rem; }
.preview-name { font-size: .85rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
.remove-btn { background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.2); border-radius: 8px; color: var(--red); width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background .2s; flex-shrink: 0; }
.remove-btn svg { width: 14px; height: 14px; }
.remove-btn:hover { background: rgba(239,68,68,.2); }

.analyze-btn {
  margin-top: 1rem; width: 100%;
  display: flex; align-items: center; justify-content: center; gap: .6rem;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  border: none; border-radius: var(--radius-sm);
  color: #fff; font-family: var(--font); font-size: 1rem; font-weight: 600;
  padding: .9rem 1.5rem; cursor: pointer;
  transition: opacity .2s, transform .15s, box-shadow .2s;
  box-shadow: 0 0 24px var(--primary-glow);
}
.analyze-btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.analyze-btn:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 8px 32px var(--primary-glow); }
.btn-arrow { width: 18px; height: 18px; }
.btn-spinner { animation: spin 1s linear infinite; display: flex; }
.btn-spinner svg { width: 20px; height: 20px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Result Panel ───────────────────────────────────────────── */
.result-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2rem;
  display: flex; align-items: center; justify-content: center; min-height: 420px;
}
.result-empty { text-align: center; color: var(--muted); }
.empty-icon svg { width: 64px; height: 64px; color: var(--subtle); margin-bottom: 1rem; }
.result-empty h3 { font-size: 1.1rem; margin-bottom: .4rem; color: var(--subtle); }

/* Loading */
.result-loading { text-align: center; }
.scan-animation { position: relative; width: 80px; height: 80px; margin: 0 auto 1.5rem; }
.scan-circle { width: 80px; height: 80px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--primary); animation: spin 1.2s linear infinite; }
.scan-line { position: absolute; top: 50%; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--primary), transparent); animation: scan-sweep 1.5s ease-in-out infinite; }
.scan-pulse { position: absolute; inset: 10px; border-radius: 50%; border: 1px solid rgba(99,102,241,.3); animation: pulse-ring 1.5s ease-out infinite; }
@keyframes scan-sweep { 0%,100% { top: 20%; opacity: 0; } 50% { top: 80%; opacity: 1; } }
@keyframes pulse-ring { 0% { transform: scale(.8); opacity: 1; } 100% { transform: scale(1.2); opacity: 0; } }
.result-loading h3 { font-size: 1.1rem; margin-bottom: .4rem; }
.result-loading p { color: var(--muted); font-size: .88rem; }

/* Result Content */
.result-content { width: 100%; }
.result-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.result-icon { font-size: 2rem; }
.result-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: .2rem; }
.result-name { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; }
.confidence-section { margin-bottom: 1.25rem; }
.confidence-header { display: flex; justify-content: space-between; font-size: .85rem; margin-bottom: .5rem; color: var(--muted); }
.confidence-value { font-weight: 700; color: var(--text); }
.confidence-bar-track { height: 8px; background: var(--surface2); border-radius: 999px; overflow: hidden; }
.confidence-bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary), var(--purple)); width: 0%; transition: width 1s cubic-bezier(.4,0,.2,1); }

/* All Scores */
.all-scores { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1.25rem; }
.score-row { display: flex; align-items: center; gap: .75rem; font-size: .82rem; }
.score-label { width: 120px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.score-track { flex: 1; height: 5px; background: var(--surface2); border-radius: 999px; overflow: hidden; }
.score-fill { height: 100%; border-radius: 999px; transition: width .8s ease; }
.score-pct { width: 42px; text-align: right; color: var(--muted); }

/* Info */
.result-info { display: flex; flex-direction: column; gap: .75rem; margin-bottom: 1.25rem; }
.info-item { display: flex; gap: .75rem; background: var(--surface2); border-radius: var(--radius-sm); padding: .9rem; }
.info-item.recommendation { border-left: 3px solid var(--primary); }
.info-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: .1rem; }
.info-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: .3rem; }
.info-text { font-size: .88rem; line-height: 1.55; color: #cbd5e1; }

/* Disclaimer */
.disclaimer { display: flex; align-items: flex-start; gap: .5rem; background: rgba(245,158,11,.06); border: 1px solid rgba(245,158,11,.15); border-radius: var(--radius-sm); padding: .75rem 1rem; font-size: .78rem; color: #fbbf24; margin-bottom: 1rem; }
.disclaimer svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: .1rem; }

.reset-btn { width: 100%; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--muted); font-family: var(--font); font-size: .9rem; font-weight: 500; padding: .7rem; cursor: pointer; transition: background .2s, color .2s; }
.reset-btn:hover { background: var(--surface); color: var(--text); }

/* Error */
.result-error { text-align: center; }
.error-icon { font-size: 2.5rem; margin-bottom: .8rem; }
.result-error h3 { margin-bottom: .4rem; }
.result-error p { color: var(--muted); font-size: .9rem; margin-bottom: 1rem; }

/* ── Classes Section ─────────────────────────────────────────── */
.classes-section { padding: 5rem 0; background: linear-gradient(180deg, transparent, rgba(14,20,40,.8), transparent); }
.classes-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem; }
.class-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; transition: transform .2s, border-color .2s, box-shadow .2s; }
.class-card:hover { transform: translateY(-4px); border-color: rgba(99,102,241,.4); box-shadow: 0 12px 40px rgba(99,102,241,.12); }
.class-badge { font-size: 2rem; margin-bottom: 1rem; }
.class-card h3 { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; margin-bottom: .4rem; }
.class-severity { display: inline-block; font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; padding: .2rem .6rem; border-radius: 20px; margin-bottom: .75rem; }
.class-severity.high { background: rgba(239,68,68,.12); color: var(--red); }
.class-severity.medium { background: rgba(249,115,22,.12); color: var(--orange); }
.class-severity.none { background: rgba(34,197,94,.12); color: var(--green); }
.class-card p { font-size: .87rem; color: var(--muted); line-height: 1.6; margin-bottom: 1rem; }
.class-meta { display: flex; gap: .5rem; flex-wrap: wrap; }
.class-meta span { font-size: .72rem; background: var(--surface2); border: 1px solid var(--border); border-radius: 6px; padding: .2rem .55rem; color: var(--muted); }

/* ── About Section ───────────────────────────────────────────── */
.about-section { padding: 5rem 0; }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; }
@media (max-width: 820px) { .about-grid { grid-template-columns: 1fr; } }
.about-steps { display: flex; flex-direction: column; gap: 1.5rem; }
.step { display: flex; gap: 1.25rem; }
.step-num { font-family: var(--font-display); font-size: 2rem; font-weight: 800; background: linear-gradient(135deg, var(--primary), var(--purple)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; line-height: 1; flex-shrink: 0; }
.step h3 { font-size: .95rem; font-weight: 600; margin-bottom: .3rem; }
.step p { font-size: .87rem; color: var(--muted); line-height: 1.6; }
.about-tech { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.75rem; }
.about-tech h3 { font-family: var(--font-display); font-size: 1rem; font-weight: 700; margin-bottom: 1.25rem; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
.tech-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.tech-item { display: flex; flex-direction: column; gap: .15rem; background: var(--surface2); border-radius: var(--radius-sm); padding: .85rem; }
.tech-icon { font-size: 1.3rem; margin-bottom: .2rem; }
.tech-name { font-size: .85rem; font-weight: 600; }
.tech-desc { font-size: .75rem; color: var(--muted); }

/* ── Footer ─────────────────────────────────────────────────── */
.footer { border-top: 1px solid var(--border); padding: 2.5rem 0; }
.footer-inner { text-align: center; display: flex; flex-direction: column; align-items: center; gap: .75rem; }
.footer-logo { display: flex; align-items: center; gap: .4rem; }
.footer-disclaimer { font-size: .82rem; color: var(--muted); max-width: 520px; line-height: 1.5; }
.footer-disclaimer strong { color: #fbbf24; }
.footer-copy { font-size: .78rem; color: var(--subtle); }

/* ── Animations ─────────────────────────────────────────────── */
.animate-fade-up { opacity: 0; transform: translateY(24px); animation: fade-up .7s ease forwards; }
.animate-fade-up:nth-child(2) { animation-delay: .1s; }
.animate-fade-up:nth-child(3) { animation-delay: .2s; }
.animate-fade-up:nth-child(4) { animation-delay: .3s; }
@keyframes fade-up { to { opacity: 1; transform: translateY(0); } }

/* ── Severity border accent ──────────────────────────────────── */
.result-panel.severity-high  { border-color: rgba(239,68,68,.35); }
.result-panel.severity-medium{ border-color: rgba(249,115,22,.35); }
.result-panel.severity-none  { border-color: rgba(34,197,94,.35); }
.result-panel.severity-purple{ border-color: rgba(168,85,247,.35); }

/* ── Try a Sample section ────────────────────────────────────── */
.sample-section { position: relative; z-index: 1; padding: 1.5rem 0 0; }
.sample-bar {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.25rem;
}
.sample-bar-left { display: flex; flex-direction: column; gap: .15rem; min-width: 160px; }
.sample-label { font-family: var(--font-display); font-size: .9rem; font-weight: 700; color: var(--text); }
.sample-hint   { font-size: .75rem; color: var(--muted); }

.sample-pills { display: flex; gap: .45rem; flex-wrap: wrap; flex: 1; }
.sample-pill {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 999px; color: var(--muted);
  font-family: var(--font); font-size: .8rem; font-weight: 500;
  padding: .35rem .85rem; cursor: pointer;
  transition: background .18s, color .18s, border-color .18s;
  white-space: nowrap;
}
.sample-pill:hover { background: rgba(99,102,241,.12); color: var(--text); border-color: rgba(99,102,241,.3); }
.sample-pill.active {
  background: linear-gradient(135deg, rgba(99,102,241,.25), rgba(168,85,247,.25));
  border-color: rgba(99,102,241,.5); color: #a5b4fc; font-weight: 600;
}

.sample-go-btn {
  display: flex; align-items: center; gap: .5rem;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  border: none; border-radius: var(--radius-sm);
  color: #fff; font-family: var(--font); font-size: .88rem; font-weight: 600;
  padding: .6rem 1.1rem; cursor: pointer; white-space: nowrap;
  transition: opacity .2s, transform .15s, box-shadow .2s;
  box-shadow: 0 0 18px var(--primary-glow);
}
.sample-go-btn svg { width: 16px; height: 16px; }
.sample-go-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 24px var(--primary-glow); }
.sample-go-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.sample-go-btn.loading svg { animation: spin 1s linear infinite; }

.sample-notice {
  display: flex; align-items: flex-start; gap: .6rem;
  background: rgba(234,179,8,.06); border: 1px solid rgba(234,179,8,.18);
  border-radius: var(--radius-sm); padding: .75rem 1rem;
  font-size: .82rem; color: #fde68a; margin-top: .75rem;
}
.sample-notice code { background: rgba(255,255,255,.08); border-radius: 4px; padding: .1rem .35rem; font-size: .78rem; }

/* ── True-label badge ────────────────────────────────────────── */
.true-label-tag {
  display: inline-flex; align-items: center; gap: .4rem;
  background: rgba(99,102,241,.1); border: 1px solid rgba(99,102,241,.25);
  border-radius: 999px; padding: .3rem .85rem;
  font-size: .78rem; color: #a5b4fc; margin-bottom: .85rem;
}
.true-label-tag strong { color: #c4b5fd; }
