:root {
  /* Colors */
  --color-bg: #050711;
  --color-bg-elevated: #0d101c;
  --color-bg-soft: #141827;
  --color-surface: #181c2b;
  --color-border-subtle: #252a3b;
  --color-border-strong: #3b425a;

  --color-text: #f5f7ff;
  --color-text-soft: #c3c7de;
  --color-text-muted: #8b90aa;
  --color-text-inverse: #050711;

  --color-primary: #6366f1; /* electric indigo */
  --color-primary-soft: rgba(99, 102, 241, 0.16);
  --color-primary-strong: #4f46e5;

  --color-success: #22c55e;
  --color-success-soft: rgba(34, 197, 94, 0.16);
  --color-warning: #eab308;
  --color-warning-soft: rgba(234, 179, 8, 0.18);
  --color-danger: #ef4444;
  --color-danger-soft: rgba(239, 68, 68, 0.18);

  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2933;
  --gray-900: #111827;

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  --font-size-xs: 0.75rem;   /* 12px */
  --font-size-sm: 0.875rem;  /* 14px */
  --font-size-base: 1rem;    /* 16px */
  --font-size-lg: 1.125rem;  /* 18px */
  --font-size-xl: 1.25rem;   /* 20px */
  --font-size-2xl: 1.5rem;   /* 24px */
  --font-size-3xl: 1.875rem; /* 30px */
  --font-size-4xl: 2.25rem;  /* 36px */

  --line-height-tight: 1.2;
  --line-height-snug: 1.35;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.7;

  /* Spacing scale (px values) */
  --space-0: 0;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 999px;

  /* Shadows (subtle neon/glow variants) */
  --shadow-soft: 0 8px 20px rgba(0, 0, 0, 0.55);
  --shadow-md: 0 14px 35px rgba(0, 0, 0, 0.7);
  --shadow-strong: 0 22px 60px rgba(0, 0, 0, 0.85);
  --shadow-focus: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 0 0 2px rgba(99, 102, 241, 0.75);

  /* Transitions */
  --transition-fast: 120ms ease-out;
  --transition-base: 180ms ease-out;
  --transition-slow: 260ms ease-out;
}

/* ========================================
   RESET / NORMALIZE
   ======================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
  text-size-adjust: 100%;
}

body {
  margin: 0;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
ol,
ul,
dl,
dd {
  margin: 0;
}

ol,
ul {
  padding-left: 1.25rem;
}

img,
svg,
video,
canvas,
audio,
iframe {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  margin: 0;
}

button {
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

pre,
code,
kbd,
samp {
  font-family: var(--font-mono);
}

/* Remove default link styling; will restyle in base */
a {
  color: inherit;
  text-decoration: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* ========================================
   BASE STYLES
   ======================================== */

body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background: radial-gradient(circle at top, #141838 0, #050711 48%, #010208 100%);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

main {
  min-height: 60vh;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  line-height: var(--line-height-tight);
  letter-spacing: 0.01em;
  color: var(--color-text);
}

h1 {
  font-size: clamp(2.1rem, 2.8vw, 2.6rem);
  margin-bottom: var(--space-4);
}

h2 {
  font-size: clamp(1.75rem, 2.2vw, 2rem);
  margin-bottom: var(--space-3);
}

h3 {
  font-size: 1.5rem;
  margin-bottom: var(--space-3);
}

h4 {
  font-size: 1.25rem;
  margin-bottom: var(--space-2);
}

h5 {
  font-size: 1.125rem;
  margin-bottom: var(--space-2);
}

h6 {
  font-size: 1rem;
  margin-bottom: var(--space-1);
}

p {
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
  color: var(--color-text-soft);
  margin-bottom: var(--space-3);
}

strong {
  font-weight: 600;
}

small {
  font-size: var(--font-size-sm);
}

a {
  position: relative;
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-base), opacity var(--transition-fast);
}

a:hover {
  color: var(--color-primary-strong);
}

a:focus-visible {
  outline: none;
}

hr {
  border: 0;
  border-top: 1px solid var(--color-border-subtle);
  margin: var(--space-6) 0;
}

/* ========================================
   ACCESSIBILITY & REDUCED MOTION
   ======================================== */

:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
  border-radius: var(--radius-md);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ========================================
   UTILITIES
   ======================================== */

.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--space-4);
}

@media (min-width: 1200px) {
  .container {
    padding-inline: 0;
  }
}

/* Flex helpers */

.flex {
  display: flex;
}

.inline-flex {
  display: inline-flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.gap-2 {
  gap: var(--space-2);
}

.gap-3 {
  gap: var(--space-3);
}

.gap-4 {
  gap: var(--space-4);
}

/* Grid helpers */

.grid {
  display: grid;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

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

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

/* Spacing utilities (margin / padding) */

.mt-0 { margin-top: 0; }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }

.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }

/* Text alignment */

.text-center { text-align: center; }
.text-right { text-align: right; }

/* Screen reader only */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ========================================
   COMPONENTS
   ======================================== */

/* Buttons */

.button,
button,
input[type="button"],
input[type="submit"],
input[type="reset"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  padding: 0.6rem 1.5rem;
  font-size: var(--font-size-sm);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-strong) 100%);
  color: var(--color-text-inverse);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.02), 0 12px 30px rgba(99, 102, 241, 0.45);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast), filter var(--transition-fast), opacity var(--transition-fast);
}

.button:hover,
button:hover,
input[type="button"]:hover,
input[type="submit"]:hover,
input[type="reset"]:hover {
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 18px 45px rgba(99, 102, 241, 0.6);
  filter: brightness(1.03);
}

.button:active,
button:active,
input[type="button"]:active,
input[type="submit"]:active,
input[type="reset"]:active {
  transform: translateY(0) scale(0.99);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.8);
}

.button:disabled,
button:disabled,
input[type="button"]:disabled,
input[type="submit"]:disabled,
input[type="reset"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.button--ghost {
  background: rgba(24, 28, 43, 0.8);
  border-color: rgba(99, 102, 241, 0.4);
  color: var(--color-text);
  box-shadow: var(--shadow-soft);
}

.button--ghost:hover {
  background: rgba(34, 39, 60, 0.95);
}

.button--secondary {
  background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
}

/* Form inputs */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="number"],
select,
textarea {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
  background-color: var(--color-bg-soft);
  color: var(--color-text);
  padding: 0.65rem 0.85rem;
  font-size: var(--font-size-sm);
  line-height: 1.4;
  outline: none;
  transition: border-color var(--transition-base), box-shadow var(--transition-base), background-color var(--transition-base), transform var(--transition-fast);
}

input::placeholder,
textarea::placeholder {
  color: var(--color-text-muted);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.03), 0 0 0 2px rgba(99, 102, 241, 0.7);
  background-color: #171b2a;
}

input[disabled],
select[disabled],
textarea[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Card */

.card {
  position: relative;
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at top, rgba(99, 102, 241, 0.08) 0, rgba(24, 28, 43, 0.98) 40%, #050711 100%);
  border: 1px solid rgba(99, 102, 241, 0.14);
  padding: var(--space-4);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base), background var(--transition-base);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 0 0, rgba(56, 189, 248, 0.22), transparent 55%);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-strong);
  border-color: rgba(129, 140, 248, 0.7);
}

.card:hover::before {
  opacity: 1;
}

.card-header {
  margin-bottom: var(--space-3);
}

.card-title {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-1);
}

.card-subtitle {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.card-body {
  font-size: var(--font-size-sm);
  color: var(--color-text-soft);
}

/* Tag / badge for small emphasis (e.g., sale, new) */

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-full);
  padding: 0.15rem 0.55rem;
  font-size: var(--font-size-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid rgba(148, 163, 253, 0.7);
  background: linear-gradient(135deg, rgba(129, 140, 248, 0.18), rgba(37, 99, 235, 0.05));
  color: var(--color-text);
}

.badge--success {
  border-color: rgba(34, 197, 94, 0.7);
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.18), rgba(21, 128, 61, 0.1));
}

.badge--danger {
  border-color: rgba(239, 68, 68, 0.7);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.18), rgba(185, 28, 28, 0.1));
}

/* Helper component for image-driven product tiles */

.product-thumb {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background-color: #020308;
}

.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 260ms ease-out, filter 260ms ease-out;
}

.product-thumb:hover img {
  transform: scale(1.05);
  filter: saturate(1.15);
}
