:root {
  --bg: #08111f;
  --bg-elevated: rgba(12, 22, 40, 0.72);
  --text: #edf3ff;
  --muted: #96a8cc;
  --line: rgba(255, 255, 255, 0.1);
  --accent: #79d5ff;
  --shadow: 0 28px 80px rgba(1, 9, 21, 0.45);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(64, 124, 255, 0.28), transparent 32%),
    radial-gradient(circle at top right, rgba(33, 211, 255, 0.18), transparent 24%),
    linear-gradient(180deg, #07101c 0%, #0a1221 46%, #08101b 100%);
  color: var(--text);
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(circle at center, black 45%, transparent 92%);
  pointer-events: none;
}

.page-shell { width: min(1440px, calc(100vw - 40px)); margin: 0 auto; padding: 24px 0 80px; }

.topbar {
  position: sticky;
  top: 20px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  background: rgba(7, 16, 28, 0.78);
  backdrop-filter: blur(16px);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.brand { display: inline-flex; align-items: center; gap: 14px; color: var(--text); text-decoration: none; }
.brand strong, .brand small { display: block; }
.brand small { color: var(--muted); }
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.22), rgba(255,255,255,0)), linear-gradient(135deg, #1d4be3, #87e0ff);
  position: relative;
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.84);
}
.nav { display: flex; gap: 18px; }
.nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.nav a.active { color: var(--text); }
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  margin-left: 8px;
  padding: 0 7px;
  border-radius: 999px;
  background: linear-gradient(135deg, #8ce2ff, #70afff);
  color: #041220;
  font-size: 0.75rem;
  font-weight: 800;
  transform-origin: center;
}
.nav-badge.bump {
  animation: badgeBump 0.35s ease;
}

.header-search { min-width: 220px; }
.header-search input {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  border-radius: 999px;
  padding: 12px 16px;
  font: inherit;
}

.primary-button, .ghost-button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.primary-button { color: #041220; background: linear-gradient(135deg, #8ce2ff, #70afff); box-shadow: 0 18px 40px rgba(94, 172, 255, 0.25); }
.ghost-button { color: var(--text); background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.08); }
.primary-button:hover, .ghost-button:hover { transform: translateY(-2px); }

.hero, .section {
  margin-bottom: 22px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 34px;
  background: linear-gradient(180deg, rgba(12, 21, 38, 0.88), rgba(7, 14, 24, 0.78));
  box-shadow: var(--shadow);
}

#app {
  display: grid;
  gap: 22px;
}
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  animation: fadeUp 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}
.delay-1 { animation-delay: 0.08s; }
.delay-2 { animation-delay: 0.16s; }
.delay-3 { animation-delay: 0.24s; }

.hero { display: grid; grid-template-columns: 1.12fr 0.88fr; gap: 28px; min-height: 660px; }
.hero-copy { display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.eyebrow { color: #9edcff; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.14em; }
.hero h1, .section h2, .section h3 { margin: 0; font-family: "Manrope", sans-serif; line-height: 1.02; }
.hero h1 { font-size: clamp(3rem, 7vw, 5.8rem); letter-spacing: -0.05em; }
.hero p, .section p { color: var(--muted); line-height: 1.7; }
.hero-actions, .composer-actions, .search-panel, .chip-row { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stats, .catalog-grid, .insights-grid, .security-grid, .split { display: grid; gap: 18px; }
.hero-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-card, .product-card, .panel, .security-card, .semantic-card, .mini-card, .cart-row, .order-card {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 24px;
}
.stat-card { padding: 18px; }
.stat-card strong { display: block; font-size: 2rem; }
.hero-visual { display: flex; align-items: center; }
.hero-glass {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-height: 580px;
  border-radius: 32px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(180deg, rgba(27, 51, 88, 0.5), rgba(7, 14, 24, 0.42));
  isolation: isolate;
}
.hero-glass img { width: 100%; height: 100%; object-fit: cover; animation: pulseZoom 18s ease-in-out infinite alternate; }
.hero-glass::before {
  content: "";
  position: absolute;
  inset: -8%;
  background:
    radial-gradient(circle at 20% 18%, rgba(120, 210, 255, 0.26), transparent 28%),
    radial-gradient(circle at 78% 18%, rgba(255, 188, 111, 0.22), transparent 26%),
    radial-gradient(circle at 72% 76%, rgba(113, 230, 196, 0.22), transparent 24%);
  animation: auraShift 15s ease-in-out infinite alternate;
  z-index: 0;
  pointer-events: none;
}
.hero-glass::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0));
  z-index: 1;
  pointer-events: none;
}
.hero-glass img,
.visual-overlay {
  position: relative;
  z-index: 2;
}
.visual-overlay {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 24px;
  padding: 18px 20px;
  border-radius: 22px;
  background: rgba(8, 15, 28, 0.68);
  backdrop-filter: blur(14px);
}
.hero-visual.float {
  transform: translate3d(var(--parallax-x, 0px), var(--parallax-y, 0px), 0);
  transition: transform 0.18s ease-out;
}
.hero-copy p {
  max-width: 760px;
}
.hero-actions + .hero-stats {
  margin-top: 8px;
}
.visual-overlay span { display: block; color: #9edcff; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.16em; margin-bottom: 6px; }
.section-heading { display: flex; justify-content: space-between; gap: 20px; align-items: end; margin-bottom: 22px; }
.page-grid { display: grid; gap: 22px; }
.page-columns { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 18px; }
.page-card, .auth-card, .category-card {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  border-radius: 24px;
  padding: 22px;
}
.category-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.category-card h3, .page-card h3 { margin-top: 0; }
.category-card p, .page-card p { color: var(--muted); }
.detail-list { display: grid; gap: 10px; }
.detail-row { display: flex; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,0.08); }
.detail-row:last-child { border-bottom: 0; }
.form-grid { display: grid; gap: 12px; }
.form-grid input, .form-grid textarea, .form-grid select {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  border-radius: 16px;
  padding: 14px 16px;
  font: inherit;
}
.form-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.account-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.banner-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.empty-state { padding: 24px; border-radius: 24px; border: 1px dashed rgba(255,255,255,0.16); color: var(--muted); }
.cart-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  padding: 14px 18px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(8, 15, 28, 0.88);
  color: var(--text);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(18px);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.cart-toast.visible {
  opacity: 1;
  transform: translateY(0);
}
.cart-flyer {
  position: fixed;
  z-index: 60;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #8ce2ff, #70afff);
  box-shadow: 0 10px 24px rgba(94, 172, 255, 0.4);
  pointer-events: none;
}
.table-stack { display: grid; gap: 12px; }
.security-event {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
}
.risk-high, .risk-critical { border-color: rgba(255, 159, 122, 0.4); }
.risk-medium { border-color: rgba(255, 210, 110, 0.35); }
.route-kicker { color: #9edcff; text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.82rem; }
.headline-row { display: flex; justify-content: space-between; gap: 16px; align-items: end; }
.subnav-links { display: flex; gap: 10px; flex-wrap: wrap; }
.subnav-links a { text-decoration: none; color: var(--text); }
.security-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.trust-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  padding: 20px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 28px;
  background: rgba(255,255,255,0.03);
}
.trust-pill {
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}
.trust-pill strong {
  display: block;
  margin-bottom: 6px;
}
.search-panel input, .composer textarea, .checkout-box textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 20px;
  padding: 15px 18px;
  outline: none;
  font: inherit;
}
.chip-row button {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
}
.chip-row button.active { background: rgba(117, 173, 255, 0.18); border-color: rgba(141, 201, 255, 0.45); }
.semantic-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 20px; }
.semantic-card { padding: 16px; }
.catalog-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.product-card { position: relative; overflow: hidden; padding: 18px; transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease; }
.product-card::before { content: ""; position: absolute; inset: 0; background: var(--tone); opacity: 0.95; }
.product-card > * { position: relative; z-index: 1; }
.product-card:hover { transform: translateY(-8px); border-color: rgba(255, 255, 255, 0.24); box-shadow: 0 24px 50px rgba(0, 0, 0, 0.28); }
.product-media { width: 100%; aspect-ratio: 4 / 3; border-radius: 20px; object-fit: cover; margin-bottom: 18px; border: 1px solid rgba(255, 255, 255, 0.15); }
.product-topline, .metric-row, .order-meta, .cart-meta { display: flex; justify-content: space-between; gap: 14px; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); color: rgba(255, 255, 255, 0.9); font-size: 0.84rem; }
.product-card h3 { margin: 10px 0 8px; font-size: 1.45rem; }
.product-card p { min-height: 76px; }
.product-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 16px; }
.split { grid-template-columns: 1.2fr 0.8fr; }
.panel { padding: 22px; }
.side-panel { background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.03)); }
.agent-feed, .cart-items, .orders-list, .vector-debug, .metric-stack { display: grid; gap: 12px; }
.agent-message { padding: 16px; border-radius: 18px; background: rgba(255, 255, 255, 0.05); }
.agent-message strong { display: block; margin-bottom: 6px; }
.agent-message.thinking {
  border: 1px solid rgba(140, 226, 255, 0.22);
  background: rgba(120, 210, 255, 0.08);
}
.agent-message.blocked {
  border: 1px solid rgba(255, 193, 122, 0.28);
  background: rgba(255, 193, 122, 0.08);
}
.agent-message.error {
  border: 1px solid rgba(255, 138, 138, 0.3);
  background: rgba(255, 138, 138, 0.08);
}
.thinking-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.thinking-dots {
  display: inline-flex;
  gap: 6px;
}
.thinking-dots span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #9edcff;
  opacity: 0.35;
  animation: thinkingPulse 1.2s ease-in-out infinite;
}
.thinking-dots span:nth-child(2) { animation-delay: 0.15s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.3s; }
.bundle-result, .checkout-box { margin-top: 16px; padding: 18px; border-radius: 22px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); }
.wide-button { width: 100%; margin-top: 12px; }
.fine-print { font-size: 0.88rem; }
.cart-row, .order-card, .metric-row, .mini-card { padding: 16px; }
.cart-row, .order-card { display: grid; gap: 10px; }
.metric-row strong, .mini-title { color: var(--text); font-weight: 700; }
.insights-grid, .security-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.security-card { padding: 20px; }
.price { font-size: 1.4rem; font-weight: 800; }
.muted { color: var(--muted); }

@keyframes pulseZoom {
  from { transform: scale(1) translate3d(0, 0, 0); }
  to { transform: scale(1.06) translate3d(-12px, -6px, 0); }
}

@keyframes auraShift {
  from { transform: translate3d(0, 0, 0) scale(1); opacity: 0.92; }
  to { transform: translate3d(10px, -12px, 0) scale(1.05); opacity: 1; }
}

@keyframes badgeBump {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes thinkingPulse {
  0%, 80%, 100% {
    transform: translateY(0) scale(1);
    opacity: 0.35;
  }
  40% {
    transform: translateY(-2px) scale(1.15);
    opacity: 1;
  }
}

@media (max-width: 1024px) {
  .hero, .split, .section-heading, .page-columns, .account-layout, .banner-grid { grid-template-columns: 1fr; display: grid; }
  .trust-band { grid-template-columns: 1fr 1fr; }
  .nav { display: none; }
  .hero h1 { font-size: clamp(2.7rem, 12vw, 4.2rem); }
}

@media (max-width: 720px) {
  .page-shell { width: min(100vw - 20px, 100%); padding-top: 12px; }
  .topbar, .hero, .section { padding: 18px; border-radius: 24px; }
  .hero-stats { grid-template-columns: 1fr; }
  .trust-band { grid-template-columns: 1fr; }
  .search-panel { flex-direction: column; }
}
