/* ============================================================
   Avyrix — Global Stylesheet
   Design: Terminal-noir with precision grid
   Font: Syne (display) + JetBrains Mono (code) + DM Sans (body)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;1,9..40,300&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ── Tokens ──────────────────────────────────────────────── */
:root {
  --bg-0: #080b10;
  --bg-1: #0d1117;
  --bg-2: #13181f;
  --bg-3: #1a2030;
  --bg-card: #111620;
  --border: rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.15);

  --accent-green: #00e5a0;
  --accent-green-dim: rgba(0,229,160,0.12);
  --accent-green-glow: rgba(0,229,160,0.25);
  --accent-red: #ff4d6a;
  --accent-red-dim: rgba(255,77,106,0.12);
  --accent-blue: #4d9eff;
  --accent-blue-dim: rgba(77,158,255,0.12);
  --accent-amber: #ffb340;
  --accent-amber-dim: rgba(255,179,64,0.10);

  --text-primary: #eef0f4;
  --text-secondary: #8b919e;
  --text-muted: #4e545e;
  --text-code: #a8f0c6;

  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --transition: 220ms cubic-bezier(0.4,0,0.2,1);

  --max-w: 1100px;
  --nav-h: 64px;
}

body {
  font-family: var(--font-body);
  background: var(--bg-1);
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── Noise texture overlay ──────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' 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)' opacity='0.04'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

/* ── Layout ──────────────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* ── Navigation ─────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 100;
  background: rgba(8,11,16,0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}
.nav__logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav__logo-icon {
  width: 28px; height: 28px;
  background: var(--accent-green);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav__logo-icon svg { width: 16px; height: 16px; }
.nav__logo-text { color: var(--text-primary); }
.nav__logo-text span { color: var(--accent-green); }
.nav__links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}
.nav__links a {
  font-size: 14px;
  color: var(--text-secondary);
  transition: color var(--transition);
  font-weight: 400;
}
.nav__links a:hover { color: var(--text-primary); }
.nav__links a.active { color: var(--accent-green); }
.nav__cta {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-body);
  transition: all var(--transition);
  line-height: 1;
  white-space: nowrap;
}
.btn--primary {
  background: var(--accent-green);
  color: #000;
}
.btn--primary:hover {
  background: #00ffb2;
  transform: translateY(-1px);
}
.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
}
.btn--ghost:hover {
  color: var(--text-primary);
  border-color: rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.04);
}
.btn--large {
  padding: 14px 28px;
  font-size: 15px;
  border-radius: var(--radius-lg);
}
.btn--danger {
  background: var(--accent-red);
  color: #fff;
}
.btn--danger:hover { background: #ff2d4a; transform: translateY(-1px); }

/* ── Badge ───────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.03em;
  font-family: var(--font-mono);
}
.badge--green {
  background: var(--accent-green-dim);
  color: var(--accent-green);
  border: 1px solid rgba(0,229,160,0.2);
}
.badge--red {
  background: var(--accent-red-dim);
  color: var(--accent-red);
  border: 1px solid rgba(255,77,106,0.2);
}
.badge--blue {
  background: var(--accent-blue-dim);
  color: var(--accent-blue);
  border: 1px solid rgba(77,158,255,0.2);
}
.badge--amber {
  background: var(--accent-amber-dim);
  color: var(--accent-amber);
  border: 1px solid rgba(255,179,64,0.2);
}
.badge--dot::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ── Section spacing ─────────────────────────────────────── */
.section { padding: 96px 0; position: relative; }
.section--sm { padding: 64px 0; }

/* ── Typography helpers ──────────────────────────────────── */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-green);
  margin-bottom: 16px;
  display: block;
}
h1, h2, h3, h4 { font-family: var(--font-display); }
.display-xl {
  font-size: clamp(42px, 6vw, 72px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.display-lg {
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
}
.display-md {
  font-size: clamp(24px, 3vw, 38px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.text-muted { color: var(--text-secondary); }
.text-accent { color: var(--accent-green); }
.text-mono { font-family: var(--font-mono); }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color var(--transition);
}
.card:hover { border-color: var(--border-strong); }

.card--red {
  background: rgba(255,77,106,0.05);
  border-color: rgba(255,77,106,0.2);
}
.card--blue {
  background: rgba(77,158,255,0.05);
  border-color: rgba(77,158,255,0.2);
}
.card--green {
  background: rgba(0,229,160,0.05);
  border-color: rgba(0,229,160,0.2);
}

/* ── Grid system ─────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }

/* ── Form elements ───────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
}
.form-input, .form-select, .form-textarea {
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  padding: 12px 16px;
  width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  appearance: none;
}
.form-input::placeholder { color: var(--text-muted); }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent-green);
  box-shadow: 0 0 0 3px var(--accent-green-dim);
}
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238b919e' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
  color: var(--text-primary);
}
.form-select option { background: var(--bg-2); color: var(--text-primary); }
.form-textarea {
  min-height: 200px;
  resize: vertical;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
}

/* ── Code block ──────────────────────────────────────────── */
.code-block {
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.code-block__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
}
.code-block__lang {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.code-block__dots { display: flex; gap: 6px; }
.code-block__dot {
  width: 10px; height: 10px;
  border-radius: 50%;
}
.code-block__dot:nth-child(1) { background: #ff5f57; }
.code-block__dot:nth-child(2) { background: #ffbd2e; }
.code-block__dot:nth-child(3) { background: #28ca41; }
.code-block__body {
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-code);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Copy button ─────────────────────────────────────────── */
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 12px;
  font-family: var(--font-mono);
  transition: all var(--transition);
  cursor: pointer;
}
.copy-btn:hover {
  color: var(--accent-green);
  border-color: rgba(0,229,160,0.3);
}
.copy-btn.copied {
  color: var(--accent-green);
  border-color: rgba(0,229,160,0.3);
  background: var(--accent-green-dim);
}

/* ── Divider ─────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 0;
}

/* ── Animations ──────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}
@keyframes scan-line {
  from { transform: translateY(-100%); }
  to   { transform: translateY(100vh); }
}
@keyframes blink-caret {
  50% { opacity: 0; }
}

.fade-up { animation: fadeUp 0.6s cubic-bezier(0.4,0,0.2,1) both; }
.fade-up--d1 { animation-delay: 0.1s; }
.fade-up--d2 { animation-delay: 0.2s; }
.fade-up--d3 { animation-delay: 0.3s; }
.fade-up--d4 { animation-delay: 0.4s; }

/* ── Scanning line effect ────────────────────────────────── */
.scan-overlay {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  border-radius: inherit;
}
.scan-overlay::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 60px;
  background: linear-gradient(to bottom, transparent, rgba(0,229,160,0.04) 50%, transparent);
  animation: scan-line 3s linear infinite;
}

/* ── Stat numbers ────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.stat-item {
  background: var(--bg-card);
  padding: 28px 24px;
  text-align: center;
}
.stat-item__num {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 6px;
}
.stat-item__num span { color: var(--accent-green); }
.stat-item__label {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ── Problem cards ───────────────────────────────────────── */
.problem-card {
  position: relative;
  overflow: hidden;
}
.problem-card__icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  font-size: 20px;
}
.problem-card__num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}
.problem-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}
.problem-card p { color: var(--text-secondary); font-size: 14px; line-height: 1.65; }

/* ── Feature list ────────────────────────────────────────── */
.feature-list { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 15px;
  color: var(--text-secondary);
}
.feature-list li::before {
  content: '';
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-green-dim);
  border: 1px solid rgba(0,229,160,0.3);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='8' viewBox='0 0 10 8'%3E%3Cpath d='M1 4l2.5 2.5L9 1' stroke='%2300e5a0' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  margin-top: 3px;
}

/* ── Footer ──────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  position: relative;
  z-index: 1;
}
.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.footer__copy { font-size: 13px; color: var(--text-muted); }
.footer__links { display: flex; gap: 24px; }
.footer__links a {
  font-size: 13px;
  color: var(--text-muted);
  transition: color var(--transition);
}
.footer__links a:hover { color: var(--text-secondary); }

/* ── Alert messages ──────────────────────────────────────── */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.alert--success {
  background: rgba(0,229,160,0.08);
  border: 1px solid rgba(0,229,160,0.25);
  color: var(--accent-green);
}
.alert--error {
  background: var(--accent-red-dim);
  border: 1px solid rgba(255,77,106,0.25);
  color: var(--accent-red);
}

/* ── Terminal component ──────────────────────────────────── */
.terminal {
  background: var(--bg-0);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 13px;
}
.terminal__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
}
.terminal__dots { display: flex; gap: 6px; }
.terminal__dot { width: 10px; height: 10px; border-radius: 50%; }
.terminal__title {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 auto;
  letter-spacing: 0.04em;
}
.terminal__body {
  padding: 20px;
  line-height: 1.8;
  color: var(--text-secondary);
  min-height: 160px;
}
.terminal__line--green { color: var(--accent-green); }
.terminal__line--red { color: var(--accent-red); }
.terminal__line--blue { color: var(--accent-blue); }
.terminal__line--amber { color: var(--accent-amber); }
.terminal__caret {
  display: inline-block;
  width: 8px;
  height: 14px;
  background: var(--accent-green);
  vertical-align: middle;
  animation: blink-caret 1s step-end infinite;
  margin-left: 2px;
  border-radius: 1px;
}

/* ── Scan result section (demo.html) ─────────────────────── */
.scan-results { display: flex; flex-direction: column; gap: 20px; margin-top: 32px; }
.result-card { border-radius: var(--radius-lg); overflow: hidden; }
.result-card__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.result-card__icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.result-card__title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.result-card__subtitle { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.result-card__body { padding: 20px; }

/* ── Severity indicator ──────────────────────────────────── */
.severity {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 500;
}
.severity__bar {
  display: flex;
  gap: 3px;
}
.severity__seg {
  width: 20px;
  height: 4px;
  border-radius: 2px;
  background: var(--border-strong);
}
.severity--critical .severity__seg:nth-child(-n+5) { background: var(--accent-red); }
.severity--high .severity__seg:nth-child(-n+4) { background: var(--accent-amber); }
.severity--medium .severity__seg:nth-child(-n+3) { background: var(--accent-amber); }

/* ── Steps list ──────────────────────────────────────────── */
.steps-list { list-style: none; display: flex; flex-direction: column; gap: 12px; counter-reset: steps; }
.steps-list li {
  display: flex;
  gap: 14px;
  font-size: 14px;
  color: var(--text-secondary);
  counter-increment: steps;
}
.steps-list li::before {
  content: counter(steps);
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-green-dim);
  border: 1px solid rgba(0,229,160,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-green);
  margin-top: 2px;
}

/* ── Empty/placeholder state ─────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}
.empty-state__icon { font-size: 40px; margin-bottom: 16px; opacity: 0.4; }
.empty-state__title { font-size: 16px; font-weight: 600; margin-bottom: 8px; color: var(--text-secondary); }
.empty-state__desc { font-size: 14px; line-height: 1.6; }

/* ── Loading spinner ─────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent-green);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

/* ── Selection ───────────────────────────────────────────── */
::selection { background: rgba(0,229,160,0.2); color: var(--text-primary); }

/* ── Page header (inner pages) ───────────────────────────── */
.page-header {
  padding: calc(var(--nav-h) + 64px) 0 64px;
  text-align: center;
}
.page-header p {
  max-width: 540px;
  margin: 16px auto 0;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.7;
}

/* ── Grid glow accent ────────────────────────────────────── */
.glow-accent {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}
.glow-accent--green {
  width: 500px; height: 400px;
  background: radial-gradient(ellipse, rgba(0,229,160,0.12) 0%, transparent 70%);
}
.glow-accent--red {
  width: 400px; height: 300px;
  background: radial-gradient(ellipse, rgba(255,77,106,0.10) 0%, transparent 70%);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr; }
  .nav__links { display: none; }
  .footer__inner { flex-direction: column; text-align: center; }
  .display-xl { font-size: 36px; }
  .display-lg { font-size: 28px; }
}
@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .section { padding: 64px 0; }
}
