/* 1. Theme Tokens & Global Baseline */
:root {
  --bg: #0b0a1a;
  --bg-2: #120a28;
  --text: #e9e7ff;
  --muted: #b2b0d6;
  --accent: #7c5cff;
  --accent-2: #00e5ff;
  --glass: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.25);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  --radius: 14px;
  --focus: 0 0 0 3px rgba(0, 229, 255, 0.6);
}

/* 2. Layered, ultraviolet background (gradient + subtle scanlines/noise) */
html, body { height: 100%; }
* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  line-height: 1.5;
  background-color: var(--bg);
  background-image:
    linear-gradient(135deg, rgba(12,0,40,0.88), rgba(0,0,0,0.6)),
    radial-gradient(circle at 20% 0, rgba(110, 0, 255, 0.18), transparent 25%),
    repeating-linear-gradient(to bottom, rgba(255,255,255,.04) 0 1px, transparent 1px 2px),
    repeating-linear-gradient(to right, rgba(255,255,255,.03) 0 1px, transparent 1px 2px);
  background-blend-mode: overlay, overlay, normal, normal;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 3. Layout helpers (container/grid/card/tag) */
.container {
  width: min(100%, 1100px);
  margin-inline: auto;
  padding-inline: 1rem;
}

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr));
}

.card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius);
  padding: 0.75rem;
  box-shadow: var(--shadow);
}

.tag {
  display: inline-block;
  padding: 0.15em 0.5em;
  font-size: 0.75rem;
  border-radius: 999px;
  color: #041018;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-weight: 700;
  letter-spacing: .02em;
}

/* 4. Glass panels (with backdrop-filter) + fallback for no-backdrop support */
header, article, .product-ad, footer {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

@supports not (backdrop-filter: blur(8px)) {
  header, article, .product-ad, footer {
    background: rgba(255,255,255,0.16);
  }
}

/* 5. Typography (fluid, accessible) */
h1, h2, h3 {
  margin: 0 0 0.5rem;
  line-height: 1.15;
  font-weight: 700;
  color: var(--text);
}
h1 { font-size: clamp(1.6rem, 1.2rem + 3.5vw, 2.8rem); letter-spacing: .01em; }
h2 { font-size: clamp(1.25rem, 0.9rem + 2vw, 2.2rem); }
h3 { font-size: clamp(1.05rem, 0.75rem + 1.5vw, 1.6rem); }
p { margin: .5rem 0 1rem; color: var(--text); opacity: 0.95; }

/* 6. Images & media */
.image-frame {
  aspect-ratio: 16 / 9;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.25);
  box-shadow: 0 6px 16px rgba(0,0,0,.35);
}
.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 7. Content scaffolding (semantic hooks) */
.content { padding: 0.5rem 0; }

/* 8. Links, buttons, CTAs (focus visibility, contrast) */
a, button, .btn, .cta {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s ease, background-color .2s ease, color .2s ease;
  outline: none;
}
a { color: var(--accent-2); }
a:hover { text-decoration: underline; color: var(--accent); }
a:focus-visible, button:focus-visible, .btn:focus-visible, .cta:focus-visible {
  outline: var(--focus);
  outline-offset: 2px;
  border-radius: 6px;
}
button, .btn, .cta {
  background: rgba(0,0,0,.25);
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 999px;
  padding: .6rem 1rem;
  line-height: 1;
}
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; }
.btn--solid {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none;
}
.btn--outline {
  background: rgba(0,0,0,.25);
  border: 1px solid rgba(124, 92, 255, .8);
}
.cta { padding: .65rem 1rem; }

/* 9. Layout primitives for hero/article hooks */
header { padding: 1.25rem; margin: 0 auto 1rem; width: min(100%, 1100px); }
main { padding: 0 0 1rem; }
article { padding: 1rem; }

/* 10. Lists */
ul { margin: .5rem 0; padding-left: 1.25rem; }
li { margin: .25rem 0; }

/* 11. Accessibility helpers (print-friendly) */
@media print {
  body { background: white; color: black; }
  a { color: black; text-decoration: none; }
}

/* 12. Reduced-motion respect */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* 13. Print/fallback tweaks for clarity (optional) */
@media print {
  header, main, article, .product-ad { border: none; background: none; }
  .container { padding: 0; }
}
