:root {
  --bg: #0a1020;
  --bg-2: #0b0f2a;
  --text: #eaf6ff;
  --muted: #a6b6d6;
  --accent: #7c6bff;
  --accent-2: #4bd0ff;
  --glass: rgba(255, 255, 255, 0.08);
  --glass-strong: rgba(255, 255, 255, 0.18);
  --border: rgba(140, 150, 255, 0.35);
  --shadow: 0 8px 26px rgba(0,0,0,.25);
  --focus: 0 0 0 3px rgba(124, 107, 255, 0.6);
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
html { line-height: 1.4; }
body {
  margin: 0;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  background-color: #05060d;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  position: relative;
  isolation: isolate;
}

/* Layered background: gradient + subtle noise/scanline effect */
body:before,
body:after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
body:before {
  /* Neon gradient bloom + faint blue/purple sparks */
  background:
    radial-gradient(circle at 15% 20%, rgba(150, 240, 255, 0.25) 0 60px, transparent 70px),
    radial-gradient(circle at 70% 60%, rgba(180, 100, 255, 0.25) 0 60px, transparent 70px),
    linear-gradient(135deg, rgba(4,9,30,0.85), rgba(15,0,40,0.85) 60%);
  background-size: 300px 300px, 320px 320px, 100% 100%;
  opacity: 0.95;
  mix-blend-mode: screen;
  animation: drift 60s linear infinite;
}
body:after {
  /* subtle scanline */
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,.025) 0 1px, transparent 1px 2px);
  opacity: 0.25;
  mix-blend-mode: overlay;
  animation: scan 6s linear infinite;
}
@keyframes drift { 0% { transform: translate3d(0,0,0); } 100% { transform: translate3d(-20px, 10px, 0); } }
@keyframes scan { to { transform: translateY(-1px); } }

/* Focus management for accessibility */
:focus-visible { outline: var(--focus); outline-offset: 2px; }

/* Global typography helpers */
:root { color-scheme: dark; }
h1, h2, h3 { line-height: 1.15; margin: .5em 0 .25em; }
p { margin: 0.5em 0; color: var(--text); }

/* Layout primitives */
.container {
  width: 100%;
  max-width: clamp(720px, 76rem, 1120px);
  margin: 0 auto;
  padding-inline: 1rem;
}
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }

/* Glass panel primitives (fallback included) */
.card, header, main, footer, aside, .content, .product-ad, article, nav {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
@supports not (backdrop-filter: blur(12px)) {
  .card, header, main, footer, aside, .content, .product-ad, article {
    background: rgba(255,255,255,.12);
  }
}
header, main, article, footer, aside { padding: 1rem; }

/* Core structural selectors (as requested) */
html, body, header, nav, main, article, footer, aside { /* structural baseline if need overrides later */ }

/* Header / hero styling */
header {
  display: block;
  padding: 1.25rem 1rem;
  margin: 1rem auto;
  max-width: 1100px;
  background: rgba(8, 10, 30, 0.55);
  border: 1px solid rgba(120,125,200,0.35);
  border-radius: 18px;
}
header h1 {
  margin: 0 0 .25rem;
  font-size: clamp(1.6rem, 2.2vw + 1rem, 2.6rem);
  line-height: 1.08;
  letter-spacing: .2px;
  color: #eaf6ff;
  text-shadow: 0 2px 14px rgba(0,0,0,.4);
}
header .meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

/* Main content area */
main {
  padding: 1rem 0 2rem;
  display: block;
}
article { padding: 0; }

/* Image frame (supports required selector) */
.image-frame,
.featured-image {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(180,190,255,.35);
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
  background: #000;
}
.image-frame { aspect-ratio: 16/9; }
.image-frame img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  filter: saturate(1.05);
}
.featured-image img { width: 100%; height: auto; display: block; }

/* Content area within article */
.content { padding: 0; color: var(--text); }

/* Article typography and structure */
article h2 {
  margin: .75rem 0 0.5rem;
  font-size: clamp(1.4rem, 1vw + 1rem, 2rem);
  color: #eaf6ff;
}
article p { color: var(--muted); font-size: clamp(0.98rem, 0.95vw + .9rem, 1.15rem); line-height: 1.6; }
blockquote {
  margin: .75rem 0;
  padding: .75rem 1rem;
  border-left: 3px solid var(--accent);
  background: rgba(0,0,0,.15);
  color: #eaffff;
  border-radius: 8px;
}
ul { padding-left: 1.25rem; color: var(--muted); }
li { margin: .25rem 0; }

/* Footer / product ad blocks (glass panels) */
footer {
  margin-top: 1.25rem;
  padding: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.product-ad {
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: .75rem;
}
.product-ad a { color: #fff; text-decoration: none; display: block; }
.product-ad p { margin: 0; font-weight: 600; }

/* Link and button styling (interactive variants) */
a, button, .btn, .cta {
  color: #eaffff;
  text-decoration: none;
  transition: color .2s ease, background .2s ease, transform .2s ease;
}
a:hover { text-decoration: underline; color: var(--accent-2); }
a:focus-visible { outline: var(--focus); outline-offset: 2px; }

/* Button variants */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .65em 1.05em; border-radius: 999px; border: 1px solid rgba(0,0,0,.0);
  background: var(--accent);
  color: #fff; cursor: pointer; font-weight: 600;
  box-shadow: 0 6px 14px rgba(0,0,0,.25);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); opacity: .95; }

.btn--outline {
  background: transparent; border: 1px solid rgba(124,107,255,.65);
  color: #e7eaff;
}
.btn--outline:hover { background: rgba(124,107,255,.15); }

/* Utility components */
.content .tag {
  display: inline-block;
  padding: .2em .6em;
  border-radius: 999px;
  font-size: .75rem;
  background: rgba(124,107,255,.25);
  border: 1px solid rgba(124,107,255,.6);
  color: #f5fbff;
}
.container p { margin: 0; }

/* Form elements (if present) */
input, textarea, select {
  font: inherit;
  color: var(--text);
  padding: .65em .75em;
  border-radius: 8px;
  border: 1px solid rgba(120,125,200,.4);
  background: rgba(255,255,255,.08);
  outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(75,208,255,.25); }

/* List reset for accessibility */
ul { margin: 0; padding-left: 1.25rem; }

/* Print styles: basic readability */
@media print {
  body { background: #fff; color: #000; }
  header, main, article, footer { background: #fff; border: none; box-shadow: none; }
  a { text-decoration: none; color: #000; }
  .container { padding: 0; max-width: 100%; }
}

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