/* ── Tokens ─────────────────────────────────────────────── */
:root {
  --bg:           #04080f;
  --bg-2:         #060d18;
  --surface:      rgba(255,255,255,0.055);
  --surface-el:   rgba(255,255,255,0.09);
  --border:       rgba(255,255,255,0.075);
  --accent:       #f59e0b;
  --accent-h:     #fbbf24;
  --accent-glow:  rgba(245,158,11,0.18);
  --text-1:       #edf2f7;
  --text-2:       #8a9ab0;
  --text-3:       #44556a;
  --radius:       14px;
  --radius-lg:    22px;
  --ease:         cubic-bezier(0.16,1,0.3,1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text-1);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Skip link ──────────────────────────────────────────── */
.skip { position:absolute; top:-100%; left:1rem; z-index:9999;
  background:var(--accent); color:#07111e; padding:.5rem 1rem;
  border-radius:0 0 8px 8px; font-weight:700; font-size:.875rem;
  transition:top .15s; }
.skip:focus { top:0; }

/* ── Animated background ────────────────────────────────── */
.bg-canvas {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  overflow: hidden;
}
.blob {
  position: absolute; border-radius: 50%; filter: blur(80px);
  animation: drift 20s ease-in-out infinite alternate;
}
.blob-1 { width:700px; height:700px; top:-200px; left:-200px;
  background: radial-gradient(circle, rgba(245,158,11,0.12) 0%, transparent 70%);
  animation-duration: 22s; }
.blob-2 { width:500px; height:500px; bottom:-150px; right:-100px;
  background: radial-gradient(circle, rgba(59,130,246,0.08) 0%, transparent 70%);
  animation-duration: 28s; animation-delay: -8s; }
.blob-3 { width:400px; height:400px; top:40%; left:50%;
  background: radial-gradient(circle, rgba(245,158,11,0.05) 0%, transparent 70%);
  animation-duration: 18s; animation-delay: -14s; }

@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(60px, 40px) scale(1.12); }
}
@media (prefers-reduced-motion: reduce) {
  .blob { animation: none; }
}

/* ── Shared layout ──────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

section { position: relative; z-index: 1; scroll-margin-top: 80px; }

.section-label {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .75rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent);
  background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.2);
  padding: 5px 14px; border-radius: 100px; margin-bottom: 20px;
}
.section-label::before {
  content: ''; display: block; width: 6px; height: 6px;
  border-radius: 50%; background: var(--accent);
}

h2.section-title {
  font-size: clamp(2rem, 4vw, 3rem); font-weight: 800;
  line-height: 1.15; letter-spacing: -.02em; color: var(--text-1);
  margin-bottom: 16px;
}
p.section-sub {
  font-size: 1.1rem; line-height: 1.7; color: var(--text-2);
  max-width: 560px;
}

/* ── Nav ────────────────────────────────────────────────── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 0 24px;
}
.nav-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
  background: rgba(4,8,15,0.7);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 0 28px;
  margin-top: 0;
  box-shadow: 0 4px 32px rgba(0,0,0,0.5);
}
.nav-logo {
  font-family: 'Orbitron', sans-serif; font-weight: 900;
  font-size: 1.25rem; letter-spacing: .05em;
  color: var(--text-1); text-decoration: none;
  display: flex; align-items: center; gap: 10px;
}
.nav-logo-mark { flex-shrink: 0; display: block; }
.nav-links {
  display: flex; align-items: center; gap: 32px;
  list-style: none;
}
.nav-links a {
  font-size: .9rem; font-weight: 500; color: var(--text-2);
  text-decoration: none; transition: color .2s;
}
.nav-links a:hover { color: var(--text-1); }
.nav-cta {
  display: flex; align-items: center; gap: 12px;
}
.btn { display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; font-family: inherit; font-size: .9rem; font-weight: 600;
  border: none; border-radius: var(--radius-sm, 10px); cursor: pointer;
  text-decoration: none; transition: all .2s var(--ease);
  padding: 10px 22px; line-height: 1; white-space: nowrap; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.btn-ghost { background: transparent; color: var(--text-2);
  border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface); color: var(--text-1);
  border-color: rgba(255,255,255,0.12); }
.btn-primary { background: var(--accent); color: #07111e; font-weight: 700;
  box-shadow: 0 0 24px var(--accent-glow); }
.btn-primary:hover { background: var(--accent-h); transform: translateY(-1px);
  box-shadow: 0 0 36px rgba(245,158,11,0.3); }
.btn-primary:active { transform: translateY(0); }
.btn-lg { padding: 14px 32px; font-size: 1rem; border-radius: var(--radius); }

@media (max-width: 768px) {
  .nav-links { display: none; }
}

/* Theme toggle button + auto-mode badge.
   Replaces the previous inline `style=`s on landing.html so we can
   drop CSP `'unsafe-inline'` for styles. */
.theme-toggle-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 8px; background: transparent;
  border: 1px solid var(--border); color: var(--text-2); cursor: pointer;
  position: relative; transition: color .15s, border-color .15s, background .15s;
}
.theme-icon { display: none; }
.theme-auto-badge {
  display: none; position: absolute; bottom: 2px; right: 2px;
  font-size: .55rem; font-weight: 800; line-height: 1;
  padding: 1px 3px; border-radius: 3px;
  background: var(--accent); color: #07111e;
}

/* ── Hero ───────────────────────────────────────────────── */
#hero {
  min-height: 100dvh;
  display: flex; align-items: center;
  padding: 120px 24px 80px;
}
.hero-inner {
  max-width: 1200px; margin: 0 auto; width: 100%;
  display: grid; grid-template-columns: 1fr 1fr; gap: 64px;
  align-items: center;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .8rem; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--accent);
  margin-bottom: 24px;
}
h1 {
  font-size: clamp(2.8rem, 5vw, 4.2rem);
  font-weight: 900; line-height: 1.08;
  letter-spacing: -.03em; color: var(--text-1);
  margin-bottom: 24px;
}
h1 span {
  background: linear-gradient(135deg, var(--accent) 0%, #fcd34d 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-desc {
  font-size: 1.15rem; line-height: 1.7; color: var(--text-2);
  margin-bottom: 40px; max-width: 480px;
}
.hero-actions {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.hero-trust {
  margin-top: 48px; display: flex; align-items: center; gap: 24px;
  flex-wrap: wrap;
}
.hero-trust-item {
  display: flex; align-items: center; gap: 8px;
  font-size: .85rem; color: var(--text-3);
}
.hero-trust-item svg { color: var(--accent); flex-shrink: 0; }

/* Dashboard mockup */
.hero-visual {
  position: relative;
}
.mockup-frame {
  position: relative; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 20px;
  box-shadow: 0 32px 96px rgba(0,0,0,0.7),
              0 0 0 1px rgba(255,255,255,0.05),
              inset 0 1px 0 rgba(255,255,255,0.08);
  animation: float 6s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
@media (prefers-reduced-motion: reduce) {
  .mockup-frame { animation: none; }
}
.mockup-bar {
  display: flex; align-items: center; gap: 8px; margin-bottom: 16px;
}
.mockup-dot {
  width: 10px; height: 10px; border-radius: 50%;
}
.mockup-dot-r { background: #ff5f57; }
.mockup-dot-y { background: #febc2e; }
.mockup-dot-g { background: #28c840; }
.mockup-title {
  flex: 1; text-align: center; font-size: .75rem; color: var(--text-3);
  font-weight: 500;
}

/* Stat cards in mockup */
.mockup-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin-bottom: 12px;
}
.mockup-stat {
  background: var(--surface-el); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px;
}
.mockup-stat-label {
  font-size: .65rem; color: var(--text-3); margin-bottom: 4px;
  font-weight: 500; text-transform: uppercase; letter-spacing: .06em;
}
.mockup-stat-val {
  font-size: 1.2rem; font-weight: 800; color: var(--text-1);
  font-variant-numeric: tabular-nums;
}
.mockup-stat-val.accent { color: var(--accent); }
.mockup-stat-val.green { color: #10b981; }
.mockup-stat-val.red { color: #ef4444; }

/* Inventory rows in mockup */
.mockup-rows { display: flex; flex-direction: column; gap: 6px; }
.mockup-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px;
}
.mockup-row-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.mockup-row-dot--amber { background: #f59e0b; }
.mockup-row-dot--blue  { background: #3b82f6; }
.mockup-row-dot--green { background: #10b981; }
.mockup-row-dot--red   { background: #ef4444; }
.mockup-row-cal { font-size: .75rem; font-weight: 700; color: var(--text-1); flex: 1; }
.mockup-row-brand { font-size: .7rem; color: var(--text-3); }
.mockup-row-qty {
  font-size: .75rem; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.mockup-row-qty--green { color: #10b981; }
.mockup-row-qty--amber { color: #f59e0b; }
.mockup-row-qty--red   { color: #ef4444; }
.mockup-badge {
  font-size: .6rem; font-weight: 700; padding: 2px 7px; border-radius: 100px;
}
.badge-warn { background: rgba(239,68,68,.15); color: #f87171; }
.badge-ok   { background: rgba(16,185,129,.12); color: #34d399; }

/* Glow ring behind mockup */
.mockup-glow {
  position: absolute; inset: -40px;
  background: radial-gradient(ellipse at 50% 60%, rgba(245,158,11,0.08) 0%, transparent 70%);
  z-index: -1; pointer-events: none;
}

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 48px; }
  .hero-visual { order: -1; max-width: 480px; margin: 0 auto; }
}

/* ── Stats bar ──────────────────────────────────────────── */
#stats-bar {
  padding: 48px 24px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}
.stats-grid {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px;
  text-align: center;
}
.stat-item {}
.stat-number {
  font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 900;
  font-variant-numeric: tabular-nums; line-height: 1;
  background: linear-gradient(135deg, var(--accent) 0%, #fcd34d 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; margin-bottom: 8px;
}
.stat-desc { font-size: .9rem; color: var(--text-2); font-weight: 500; }

@media (max-width: 640px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Features ───────────────────────────────────────────── */
#features { padding: 120px 24px; }
.features-header { margin-bottom: 64px; }
.features-grid {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.feature-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 32px;
  transition: transform .3s var(--ease), border-color .3s, box-shadow .3s;
  position: relative; overflow: hidden;
}
.feature-card::before {
  content: ''; position: absolute; inset: 0; opacity: 0;
  background: radial-gradient(ellipse at 0% 0%, var(--accent-glow) 0%, transparent 60%);
  transition: opacity .3s;
}
.feature-card:hover { transform: translateY(-4px);
  border-color: rgba(245,158,11,0.25);
  box-shadow: 0 16px 48px rgba(0,0,0,0.4), 0 0 0 1px rgba(245,158,11,0.08); }
.feature-card:hover::before { opacity: 1; }
.feature-icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.2);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px; color: var(--accent); position: relative;
}
.feature-card h3 {
  font-size: 1.1rem; font-weight: 700; color: var(--text-1);
  margin-bottom: 10px; letter-spacing: -.015em;
}
.feature-card p {
  font-size: .9rem; line-height: 1.65; color: var(--text-2);
}

@media (max-width: 900px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .features-grid { grid-template-columns: 1fr; }
}

/* ── How it works ───────────────────────────────────────── */
#how { padding: 120px 24px; }
.how-inner { max-width: 1200px; margin: 0 auto; }
.how-header { text-align: center; }
.how-header .section-label { margin: 0 auto 20px; }
.how-header .section-title { text-align: center; margin: 0 auto 16px; }
.how-header .section-sub { margin: 0 auto; text-align: center; }
.how-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px;
  margin-top: 64px; position: relative;
}
.how-grid::before {
  content: ''; position: absolute; top: 28px; left: calc(16.66% + 16px);
  right: calc(16.66% + 16px); height: 1px;
  background: linear-gradient(90deg, transparent, var(--border) 20%, var(--border) 80%, transparent);
}
.how-step { text-align: center; }
.how-num {
  width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 24px;
  background: var(--surface-el); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; font-weight: 900; color: var(--accent);
  position: relative; z-index: 1;
}
.how-step h3 { font-size: 1rem; font-weight: 700; margin-bottom: 10px; }
.how-step p { font-size: .9rem; color: var(--text-2); line-height: 1.6; }

@media (max-width: 640px) {
  .how-grid { grid-template-columns: 1fr; }
  .how-grid::before { display: none; }
}

/* ── Highlight / feature showcase ──────────────────────── */
#showcase { padding: 120px 24px; }
.showcase-inner {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center;
}
.showcase-list { list-style: none; margin-top: 32px; display: flex; flex-direction: column; gap: 20px; }
.showcase-item {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  transition: border-color .2s, background .2s;
  cursor: default;
}
.showcase-item:hover { border-color: rgba(245,158,11,.2); background: var(--surface-el); }
.showcase-item-icon {
  width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0;
  background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.2);
  display: flex; align-items: center; justify-content: center; color: var(--accent);
}
.showcase-item-text h4 { font-size: .95rem; font-weight: 700; margin-bottom: 4px; }
.showcase-item-text p  { font-size: .85rem; color: var(--text-2); line-height: 1.5; }

/* Chart mockup */
.chart-mockup {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
}
.chart-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 24px;
}
.chart-title { font-size: .85rem; font-weight: 700; color: var(--text-1); }
.chart-legend { display: flex; gap: 12px; }
.legend-item { display: flex; align-items: center; gap: 5px; font-size: .7rem; color: var(--text-2); }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.legend-dot--accent { background: var(--accent); }
.legend-dot--blue { background: #3b82f6; }

/* SVG bar chart */
.chart-bars { display: flex; align-items: flex-end; gap: 8px; height: 120px; margin-bottom: 12px; }
.chart-bar-group { flex: 1; display: flex; gap: 3px; align-items: flex-end; }
.chart-bar {
  flex: 1; border-radius: 4px 4px 0 0;
  transition: opacity .2s;
}
.chart-bar:hover { opacity: .8; }
.chart-bar.amber { background: linear-gradient(180deg, var(--accent) 0%, rgba(245,158,11,0.4) 100%); }
.chart-bar.blue  { background: linear-gradient(180deg, #3b82f6 0%, rgba(59,130,246,0.3) 100%); }
.chart-bar--h20 { height: 20%; }
.chart-bar--h30 { height: 30%; }
.chart-bar--h35 { height: 35%; }
.chart-bar--h40 { height: 40%; }
.chart-bar--h45 { height: 45%; }
.chart-bar--h50 { height: 50%; }
.chart-bar--h55 { height: 55%; }
.chart-bar--h60 { height: 60%; }
.chart-bar--h70 { height: 70%; }
.chart-bar--h75 { height: 75%; }
.chart-bar--h85 { height: 85%; }

.chart-labels { display: flex; gap: 8px; }
.chart-label { flex: 1; text-align: center; font-size: .65rem; color: var(--text-3); }

.chart-stats { margin-top: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.chart-stat {
  background: var(--surface-el); border-radius: 10px; padding: 14px;
  border: 1px solid var(--border);
}
.chart-stat-label { font-size: .65rem; color: var(--text-3); font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.chart-stat-val { font-size: 1.2rem; font-weight: 800; }
.chart-stat-val.amber { color: var(--accent); }
.chart-stat-val.blue  { color: #60a5fa; }

@media (max-width: 900px) {
  .showcase-inner { grid-template-columns: 1fr; }
}

/* ── CTA section ────────────────────────────────────────── */
#cta { padding: 120px 24px; }
.cta-box {
  max-width: 860px; margin: 0 auto; text-align: center;
  background: var(--surface); border: 1px solid rgba(245,158,11,0.2);
  border-radius: var(--radius-lg); padding: 80px 48px;
  position: relative; overflow: hidden;
}
.cta-box::before {
  content: ''; position: absolute; top: -120px; left: 50%; transform: translateX(-50%);
  width: 600px; height: 300px;
  background: radial-gradient(ellipse, rgba(245,158,11,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.cta-box h2 { font-size: clamp(2rem,4vw,3rem); font-weight: 900; margin-bottom: 16px; letter-spacing:-.02em; }
.cta-box p  { font-size: 1.1rem; color: var(--text-2); margin-bottom: 40px; max-width: 480px; margin-left: auto; margin-right: auto; }
.cta-actions { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }
.cta-note { margin-top: 20px; font-size: .8rem; color: var(--text-3); }
.cta-section-label { margin: 0 auto 24px; }

@media (max-width: 560px) { .cta-box { padding: 48px 24px; } }

/* ── Footer ─────────────────────────────────────────────── */
footer {
  position: relative; z-index: 1;
  border-top: 1px solid var(--border);
  padding: 48px 24px;
}
.footer-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 24px;
}
.footer-brand {
  font-family: 'Orbitron', sans-serif; font-weight: 900;
  font-size: 1rem; color: var(--text-1); text-decoration: none;
}
.footer-links { display: flex; gap: 24px; list-style: none; }
.footer-links a { font-size: .85rem; color: var(--text-3); text-decoration: none;
  transition: color .2s; }
.footer-links a:hover { color: var(--text-1); }
.footer-copy { font-size: .8rem; color: var(--text-3); }

/* ── Scroll reveal ──────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(20px);
  transition: opacity .5s var(--ease), transform .5s var(--ease); }
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: .1s; }
.reveal-delay-2 { transition-delay: .2s; }
.reveal-delay-3 { transition-delay: .3s; }
.reveal-delay-4 { transition-delay: .4s; }
.reveal-delay-5 { transition-delay: .5s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ── Light mode (manual via /theme.js, falls back to OS) ───── */
html[data-theme="light"] {
  --bg:          #e5e7eb;
  --bg-2:        #d1d5db;
  --surface:     rgba(255,255,255,0.65);
  --surface-el:  rgba(255,255,255,0.9);
  --border:      rgba(0,0,0,0.08);
  --accent:      #f59e0b;
  --accent-h:    #fbbf24;
  --accent-glow: rgba(245,158,11,0.18);
  --text-1:      #1a2233;
  --text-2:      #475569;
  --text-3:      #94a3b8;
}
html[data-theme="light"] .blob-1 { background: radial-gradient(circle, rgba(245,158,11,0.10) 0%, transparent 70%); }
html[data-theme="light"] .blob-2 { background: radial-gradient(circle, rgba(59,130,246,0.05) 0%, transparent 70%); }
html[data-theme="light"] .blob-3 { background: radial-gradient(circle, rgba(245,158,11,0.05) 0%, transparent 70%); }
html[data-theme="light"] h1 span {
  background: linear-gradient(135deg, #f59e0b 0%, #fcd34d 100%);
  -webkit-background-clip: text; background-clip: text;
}
html[data-theme="light"] .stat-number {
  background: linear-gradient(135deg, #f59e0b 0%, #fcd34d 100%);
  -webkit-background-clip: text; background-clip: text;
}
html[data-theme="light"] .nav-inner { background: rgba(229,231,235,0.82); }
