:root {
  --bg: #0a0720;              /* deep galaxy base */
  --bg-2: #1a0f2f;            /* secondary gradient stop */
  --text: #eef2ff;             /* high-contrast on dark glass */
  --muted: #cbd5e1;            /* subdued text for meta */
  --accent: #6b8e23;           /* olive accent (primary) */
  --accent-2: #8a5aff;          /* purple galaxy accent */
  --card: rgba(255, 255, 255, 0.08);
  --card-2: rgba(255, 255, 255, 0.12);
  --border: rgba(255, 255, 255, 0.25);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  --focus: #a7ff4d;              /* accessible focus color */
  --radius: 12px;
}

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

html, body {
  height: 100%;
  background: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  line-height: 1.5;
  font-size: clamp(14px, 1.4vw, 18px);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  color-scheme: dark;
}

/* Layered background: gradient + lens-flare scatter + subtle scanlines/noise */
body {
  position: relative;
  min-height: 100%;
  overflow-x: hidden;
  /* base background (under content) */
  background: linear-gradient(135deg, rgba(22,4,60,.95) 0%, rgba(9,3,26,.95) 60%, rgba(4,0,20,.95) 100%), 
              radial-gradient(circle at 20% 20%, rgba(120,0,180,.28) 0 180px, transparent 180px),
              radial-gradient(circle at 75% 35%, rgba(0,180,120,.20) 0 220px, transparent 220px),
              radial-gradient(circle at 40% 70%, rgba(0,0,0,.25) 0 260px, transparent 260px);
  background-blend-mode: screen, screen, screen, normal;
  isolation: isolate;
}

/* Lens-flare scatter: additional subtle glow bits */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 15% 85%, rgba(141, 92, 246, 0.25) 0 120px, transparent 120px),
    radial-gradient(circle at 70% 15%, rgba(106, 196, 0, 0.28) 0 140px, transparent 140px),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.15) 0 260px, transparent 260px),
    radial-gradient(circle at 28% 40%, rgba(120, 60, 255, 0.18) 0 170px, transparent 170px);
  background-repeat: no-repeat;
  mix-blend-mode: screen;
  filter: saturate(1.1);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  /* subtle scanlines */
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.04) 0 1px,
    transparent 1px 2px
  );
  mix-blend-mode: overlay;
  opacity: 0.55;
}

/* Global layout helpers (safe defaults) */
.header, .content, main, article, footer, aside, nav {
  /* ensure semantic containers respond consistently */
}

/* Centered content container with max-width clamp */
.container {
  width: 100%;
  max-width: clamp(720px, 90vw, 1100px);
  margin-inline: auto;
  padding-inline: 1rem;
}

/* Glass panels with backdrop-filter (fallback provided) */
.glass {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
@supports not (backdrop-filter: blur(12px)) {
  .glass {
    background: rgba(255, 255, 255, 0.18);
  }
}

/* Image frame handling (requires .image-frame in markup) */
.image-frame {
  aspect-ratio: 16 / 9;
  width: 100%;
  display: block;
  overflow: hidden;
  border-radius: calc(var(--radius) + 2px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 6px 24px rgba(0,0,0,.28);
}
.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(1.05);
  transition: transform .25s ease;
}
.image-frame:hover img {
  transform: scale(1.02);
}

/* Core typography hierarchy for hero (namespaced under header/main/article) */
header {
  padding: 2rem 1rem 1rem;
  text-align: center;
}
header h1 {
  font-size: clamp(1.75rem, 3.5vw + 0.5rem, 3.5rem);
  line-height: 1.08;
  margin: 0 0 .25rem;
  letter-spacing: .2px;
}
header .meta {
  font-size: clamp(0.9rem, 0.8vw + 0.2rem, 1.05rem);
  color: var(--muted);
  margin: 0;
}

/* Main and article layout */
main {
  padding: 1rem;
}
article {
  margin: 0 auto;
  padding: 1rem;
  display: block;
}
h2, h3, h4 {
  color: var(--text);
}
h2 {
  font-size: clamp(1.25rem, 2.6vw, 2rem);
  margin: 1.25rem 0 .5rem;
}
h3 {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  margin: 1rem 0;
}
p {
  margin: 0 0 1rem;
}
ol, ul {
  padding-left: 1.25rem;
  margin: 0 0 1rem;
}
li { margin-bottom: 0.5rem; }

/* Content helpers used in article sections */
.content { color: var(--text); }

/* Links and interactive controls (focus/hover accessibility) */
a, button, .btn, .cta {
  color: inherit;
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}
a { color: var(--accent-2); }
a:hover, a:focus-visible { text-decoration: underline; outline: 0; }

/* Button system: solid and outline variants, accessible focus ring, responsive sizing */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .75rem 1.25rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.35);
  background: rgba(255,255,255,.08);
  color: var(--text);
  font-weight: 600;
  transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
  text-shadow: 0 1px 0 rgba(0,0,0,.25);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.btn.primary {
  background: linear-gradient(135deg, rgba(107,142,35,1) 0%, rgba(120,160,0,0.95) 100%);
  border: 1px solid rgba(255,255,255,.5);
  color: #fff;
}
.btn.secondary {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.38);
  color: var(--text);
}
.btn.ghost {
  background: transparent;
  border: 1px solid rgba(255,255,255,.25);
  color: var(--text);
}
.cta { /* alias for emphasis */
  composes: btn;
}

/* Utility components for layout and cards */
.container + main { margin-top: 0.5rem; }

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: var(--shadow);
  transition: transform .25s ease, background .25s ease;
}
.card:hover { transform: translateY(-2px); }

/* Tags – small pill indicators */
.tag {
  display: inline-block;
  padding: .15em .6em;
  border-radius: 999px;
  font-size: .75rem;
  border: 1px solid rgba(255,255,255,.35);
  background: rgba(255,255,255,.12);
  color: var(--text);
}

/* Lists and content behavior for accessibility */
ul, ol { margin-left: 1.25rem; }

/* Product ad and footer styling (glass panels) */
.product-ad {
  margin: .75rem 0;
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(0,0,0,.25);
  text-align: center;
}
.product-ad a { text-decoration: none; }
.product-ad p { margin: 0; }

/* Footer defaults – keep legible on glass background */
footer {
  padding: 1.25rem;
  text-align: center;
  color: var(--muted);
}
footer p { margin: .5rem 0 0; color: var(--muted); }

/* Print-friendly readability (tiny footprint) */
@media print {
  body { background: #fff; color: #000; }
  a { text-decoration: underline; color: #00f; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
@media (min-width: 0) and (hover: hover) {
  /* Additional micro-interactions can live here if needed */
}

/* Layout selectors ensured by requirement */
html:focus-within, body:focus-within, header:focus-within, nav:focus-within, main:focus-within, article:focus-within, aside:focus-within, footer:focus-within { outline: none; }