:root{
  --bg: #0b0510;
  --bg-2: #12101c;
  --text: #e8e8f7;
  --muted: #b5b8cc;
  --accent: #4e3fbf;      /* indigo */
  --accent-2: #e21b1b;    /* red */
  --card: rgba(18, 6, 20, 0.28);
  --border: rgba(255,255,255,0.28);
  --shadow: 0 8px 22px rgba(0,0,0,.45);
  --radius: 14px;
  --radius-sm: 10px;
  --focus-ring: 2px solid rgba(91, 214, 255, 0.9);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

html, body, header, nav, main, article, aside, footer {
  margin: 0;
  padding: 0;
}

html, body {
  color-scheme: dark;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Inter, Arial, sans-serif;
  background-color: var(--bg);
  /* Layered background: gradient + scanlines + subtle noise-like stripes */
  background-image:
    linear-gradient(135deg, rgba(32,0,24,.75), rgba(6,0,10,.65) 60%),
    repeating-linear-gradient(to bottom, rgba(255,255,255,.04) 0 1px, transparent 1px 2px),
    repeating-linear-gradient(to right, rgba(255,255,255,.04) 0 1px, transparent 1px 2px);
  background-blend-mode: overlay, overlay, overlay;
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

/* Layout utilities */
.container {
  max-width: clamp(320px, 90vw, 1100px);
  margin-inline: auto;
  padding-inline: 1rem;
}

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

.card {
  border-radius: var(--radius);
  background: rgba(18,6,20,.28);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 1rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform .2s ease, background .3s ease;
}
@supports not (backdrop-filter: blur(10px)) {
  .card { backdrop-filter: none; background: rgba(18,6,20,.62); }
}
.tag {
  display: inline-block;
  padding: .15rem .5rem;
  border-radius: 999px;
  font-size: .75rem;
  line-height: 1;
  color: #fff;
  background: rgba(78, 47, 175, 0.36);
  border: 1px solid rgba(255,255,255,.28);
  vertical-align: middle;
}

/* Glass panels (with fallback) */
.section-glass, .card, header, footer, aside {
  background: rgba(18,6,20,0.22);
  border: 1px solid rgba(255,255,255,.28);
  border-radius: var(--radius);
  box-shadow: 0 6px 18px rgba(0,0,0,.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
@supports not (backdrop-filter: blur(12px)) {
  .section-glass, .card, header, footer, aside {
    background: rgba(18,6,20,0.75);
  }
}

/* Structure selectors to style per requirements */
html, body, header, nav, main, article, footer, aside { /* layout primitives via defaults */ }

/* Header (hero) */
header {
  padding: 2rem 1rem;
  text-align: center;
  display: grid;
  gap: .5rem;
  place-items: center;
  position: relative;
  z-index: 1;
  margin-bottom: 1rem;
  background: rgba(10,0,20,.28);
  border-bottom: 1px solid rgba(255,255,255,.25);
  border-radius: 0;
}
header h1 {
  font-size: clamp(2rem, 4vw + 1rem, 3.25rem);
  line-height: 1.05;
  margin: 0;
  font-weight: 700;
  letter-spacing: .3px;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0,0,0,.6);
}
header .meta {
  font-size: .95rem;
  color: var(--muted);
  margin: 0;
}

/* Nav (presentational) */
nav {
  display: flex;
  justify-content: center;
  gap: .75rem;
  padding: .25rem 0;
}
nav a { color: var(--text); text-decoration: none; padding: .25rem .5rem; border-radius: 6px; }
nav a:hover, nav a:focus-visible { text-decoration: underline; }

/* Main + Article layout */
main {
  padding: 0 1rem 2rem;
}
article {
  display: grid;
  gap: 1rem;
}
.featured-image {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.28);
  box-shadow: 0 8px 22px rgba(0,0,0,.45);
}
.image-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.28);
  box-shadow: 0 6px 14px rgba(0,0,0,.35);
}
.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s ease;
}
.image-frame:hover img { transform: scale(1.03); }

/* Content area */
.content { padding: .25rem 0 0; color: var(--text); }
.content p { color: var(--muted); margin: .75rem 0; }
.content ul { padding-left: 1.25rem; margin: .75rem 0; }
.content li { margin: .25rem 0; }

/* Blockquote styling */
blockquote {
  margin: .75rem 0;
  padding: .75rem 1rem;
  border-left: 3px solid var(--accent);
  background: rgba(78, 40, 110, .25);
  border-radius: 6px;
  color: #fff;
}

/* Footer + product ad sections */
footer {
  padding: 1rem;
  display: grid;
  gap: .75rem;
  justify-items: center;
  text-align: center;
  background: rgba(10,0,20,.28);
  border-top: 1px solid rgba(255,255,255,.25);
}
.product-ad, .sponsored-page {
  width: min(780px, 92%);
}
.product-ad a, .sponsored-page a {
  display: block;
  padding: .9rem 1.1rem;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(78,39,160,.9), rgba(30,10,40,.9));
  color: #fff;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,.3);
  box-shadow: 0 6px 18px rgba(0,0,0,.4);
}
.product-ad a:hover, .sponsored-page a:hover { filter: brightness(1.05); text-decoration: underline; }

/* CTA and links styling (solid + outline variants) */
a, button, .btn, .cta {
  font-family: inherit;
  font-size: 1rem;
  color: #fff;
  text-decoration: none;
  background: transparent;
  border: 0;
  padding: .75rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: transform .15s ease, background .2s ease, color .2s ease;
}
a:hover, .btn:hover, .cta:hover { text-decoration: underline; }
.btn, .cta { 
  background: linear-gradient(135deg, var(--accent), #2b1a7a);
  border: 1px solid rgba(255,255,255,.28);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.15);
}
.btn:active, .cta:active { transform: translateY(1px) scale(0.99); }
.btn.secondary {
  background: rgba(255,255,255,.08);
  color: #fff;
  border: 1px solid rgba(255,255,255,.28);
}
.btn:focus-visible, .cta:focus-visible, a:focus-visible, button:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 3px;
}

/* Utility elements */
ul { margin: 0; padding-left: 1.25rem; }
li { margin: .25rem 0; }

/* Image frame utility (for any .image-frame usage) */
.image-frame {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.28);
  background: #000;
  box-shadow: 0 6px 16px rgba(0,0,0,.4);
}
.image-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Forms (basic) */
input, textarea, select {
  width: 100%;
  padding: .55rem .75rem;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(0,0,0,.28);
  color: var(--text);
  outline: none;
}
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid rgba(91,214,255,.9);
  outline-offset: 2px;
}

/* Print styles (basic readability) */
@media print {
  html, body { background: #fff; color: #000; }
  .section-glass, .card, header, footer { background: #fff; border: none; box-shadow: none; }
  a { text-decoration: underline; }
}
  
/* Light mode variant for readability when user prefers light scheme */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f7fb;
    --bg-2: #ffffff;
    --text: #0b1020;
    --muted: #555a78;
    --accent: #4e3fbf;
    --accent-2: #b01515;
    --card: rgba(255,255,255,.9);
    --border: rgba(0,0,0,.08);
    --shadow: 0 6px 14px rgba(0,0,0,.08);
  }
  body { background: var(--bg); color: var(--text); }
  header, .card, footer { background: rgba(255,255,255,.75); border: 1px solid rgba(0,0,0,.08); }
  a, .btn, .cta { color: #111; }
}
