@view-transition { navigation: auto; }

:root {
  --bg: #050609;
  --bg-elevated: #0a0c14;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-hover: rgba(255, 255, 255, 0.06);
  --surface-solid: #10121b;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.18);

  --text-primary: #f5f6f8;
  --text-secondary: #98a0b3;
  --text-muted: #666e80;

  --accent-violet: #7c3aed;
  --accent-blue: #2563eb;
  --accent-cyan: #06b6d4;
  --gradient-brand: linear-gradient(135deg, var(--accent-violet), var(--accent-blue) 55%, var(--accent-cyan));
  --gradient-text: linear-gradient(90deg, #a78bfa, #60a5fa 50%, #22d3ee);

  --severity-none: #94a3b8;
  --severity-minor: #22c55e;
  --severity-minor-tint: rgba(34, 197, 94, 0.12);
  --severity-moderate: #f59e0b;
  --severity-moderate-tint: rgba(245, 158, 11, 0.12);
  --severity-severe: #ef4444;
  --severity-severe-tint: rgba(239, 68, 68, 0.12);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 18px;
  --radius-full: 999px;

  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 40px rgba(124, 58, 237, 0.25);

  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", "Inter", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

/* film-grain texture so flat dark sections read as designed, not empty */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

h1, h2, h3, h4 { font-family: var(--font-display); letter-spacing: -0.02em; }

a { color: inherit; }

.mono {
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

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

/* ── Cursor spotlight (hover-capable devices only) ───────── */
.cursor-glow {
  position: fixed;
  top: 0; left: 0;
  width: 480px; height: 480px;
  margin-left: -240px; margin-top: -240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.16), transparent 70%);
  pointer-events: none;
  z-index: 1;
  transform: translate(var(--x, -1000px), var(--y, -1000px));
  will-change: transform;
}

/* ── Background ambience ─────────────────────────────────── */
.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
  animation: float 14s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(20px, -30px); }
}

/* ── Glass surfaces ──────────────────────────────────────── */
.glass-card {
  position: relative;
  background:
    linear-gradient(var(--bg-elevated), var(--bg-elevated)) padding-box,
    linear-gradient(160deg, rgba(255,255,255,0.16), rgba(255,255,255,0.02) 40%, rgba(124,58,237,0.18)) border-box;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}

/* ── Nav ─────────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.25s var(--ease-out), border-color 0.25s var(--ease-out), backdrop-filter 0.25s;
}
.navbar.navbar-scrolled {
  background: rgba(5, 6, 10, 0.72);
  border-bottom-color: var(--border);
  backdrop-filter: blur(14px);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--gradient-brand);
  color: #fff;
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links a {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--text-primary); }

.navbar-actions { display: flex; align-items: center; gap: 1rem; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  width: 38px;
  height: 38px;
  cursor: pointer;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn-primary, .btn-secondary, .btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  border-radius: var(--radius-md);
  padding: 0.8rem 1.5rem;
  font-size: 0.92rem;
  font-weight: 600;
  border: 1px solid transparent;
  text-decoration: none;
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s var(--ease-out), background 0.15s, border-color 0.15s, opacity 0.15s;
  font-family: inherit;
  will-change: transform;
}

.btn-primary {
  background: var(--gradient-brand);
  color: #fff;
  box-shadow: 0 0 0 rgba(124, 58, 237, 0);
}
.btn-primary:hover:not(:disabled) {
  box-shadow: 0 0 28px rgba(124, 58, 237, 0.45);
}
.btn-primary:active:not(:disabled) { transform: scale(0.96) !important; }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; box-shadow: none; }

.btn-secondary {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text-primary);
}
.btn-secondary:hover:not(:disabled) { border-color: var(--accent-blue); background: var(--surface-hover); }
.btn-secondary:active:not(:disabled) { transform: scale(0.96) !important; }
.btn-secondary:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-ghost {
  background: none;
  border: none;
  color: var(--accent-cyan);
  padding: 0.4rem 0;
  font-weight: 600;
}
.btn-ghost:hover { color: #67e8f9; }

.btn-sm { padding: 0.55rem 1.1rem; font-size: 0.85rem; }
.btn-block { width: 100%; }

/* ── Badges / eyebrow ────────────────────────────────────── */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
}
.eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ── Scroll reveal (staggered) ───────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 90ms);
}
.reveal.reveal-visible { opacity: 1; transform: translateY(0); }

/* ── Stepper (workspace / report pages) ─────────────────── */
.stepper-bar {
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}
.stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
}
.step {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text-muted);
}
.step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: background 0.3s var(--ease-out), border-color 0.3s, color 0.3s;
}
.step-label { font-size: 0.85rem; font-weight: 600; white-space: nowrap; }

.step.active .step-num { background: var(--gradient-brand); border-color: transparent; color: #fff; }
.step.active .step-label { color: var(--text-primary); }

.step.completed .step-num { background: var(--severity-minor); border-color: transparent; color: #06210f; }
.step.completed .step-label { color: var(--text-secondary); }

.step-line {
  width: 40px;
  height: 1.5px;
  background: var(--border-strong);
  position: relative;
  overflow: hidden;
}
.step-line::after {
  content: "";
  position: absolute; inset: 0;
  background: var(--severity-minor);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s var(--ease-out);
}
.step-line.filled::after { transform: scaleX(1); }

/* ── Toasts ──────────────────────────────────────────────── */
.toast-stack {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  z-index: 200;
}
.toast {
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  padding: 0.75rem 1.1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  box-shadow: var(--shadow-card);
  max-width: 320px;
  animation: toast-in 0.3s var(--ease-spring);
}
.toast.error { border-color: var(--severity-severe); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Footer ──────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
  margin-top: 4rem;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-brand { display: flex; align-items: center; gap: 0.6rem; color: var(--text-secondary); font-size: 0.85rem; }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { font-size: 0.85rem; color: var(--text-secondary); text-decoration: none; }
.footer-links a:hover { color: var(--text-primary); }

/* ── Shared: swatch / findings / confidence bars (workspace + report) ─ */
.swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  display: inline-block;
  flex-shrink: 0;
}

.empty-note { color: var(--text-muted); font-size: 0.9rem; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 760px) {
  .cursor-glow { display: none; }
  .nav-links { display: none; }
  .nav-links.mobile-open {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    padding: 1.25rem 1.5rem;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
  }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .step-label { display: none; }
  .step-line { width: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal, .glow-orb, .eyebrow .dot, .glass-card, .btn-primary, .btn-secondary { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
