:root {
  --bg: #1a0b14;
  --bg-2: #2a0b2b;
  --text: #f6f0f6;
  --muted: #c9b8cc;
  --accent: #8a5bd8;
  --accent-2: #c44df0;
  --glass: rgba(255, 255, 255, 0.08);
  --glass-2: rgba(255, 255, 255, 0.14);
  --border: rgba(255, 255, 255, 0.25);
  --shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  --radius: 14px;
  --radius-sm: 10px;
}

/* Base */
* { box-sizing: border-box; }
html, body { height: 100%; }
html { font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif; }
body {
  margin: 0;
  color: var(--text);
  font-size: clamp(14px, 0.4vw + 12px, 18px);
  line-height: 1.5;
  background: linear-gradient(135deg, rgba(138,0,120,0.95) 0%, rgba(60,0,70,0.95) 40%, rgba(18,0,24,0.95) 100%), 
              radial-gradient(circle at 20% -10%, rgba(160,32,200,.25), transparent 40%),
              radial-gradient(circle at 100% 0%, rgba(180,60,200,.18), transparent 40%);
  background-blend-mode: multiply, overlay, overlay;
  position: relative;
  min-height: 100%;
  isolation: isolate;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  /* Subtle scanline/noise texture (pure CSS) */
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 100% 2px, 2px 100%;
  mix-blend-mode: overlay;
  opacity: 0.25;
  z-index: 0;
}
@media (prefers-reduced-motion: reduce) {
  body::before { display: none; }
}

/* Layout helpers */
.container {
  width: 100%;
  max-width: clamp(320px, 86vw, 1100px);
  margin-inline: auto;
  padding: 1rem;
  z-index: 1;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(440px, 100%), 1fr));
  gap: 1rem;
}
.card { border-radius: var(--radius); padding: 1rem; background: var(--glass); border: 1px solid var(--border); box-shadow: var(--shadow); }

/* Glass panels with fallback */
header, main, footer, aside, .product-ad, .image-frame, .content {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
@supports not (backdrop-filter: blur(1px)) {
  header, main, footer, aside, .product-ad, .image-frame, .content {
    background: rgba(255,255,255,0.16);
  }
}
.content { padding: 1rem; color: var(--text); }

/* Typography */
h1, h2 { font-weight: 700; margin: .5rem 0; color: var(--text); }
h1 { font-size: clamp(1.6rem, 0.9rem + 2.5vw, 3rem); line-height: 1.04; text-shadow: 0 1px 0 rgba(0,0,0,.25); }
h2 { font-size: clamp(1.25rem, 0.6rem + 1.9vw, 1.75rem); }
p { margin: 0 0 1rem; color: var(--text); }
ul, ol { padding-left: 1.25rem; margin: .5rem 0 1rem; color: var(--text); }
li { margin: .25rem 0; }

/* Link styles */
a { color: var(--text); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; color: var(--accent-2); }
/* Focus ring for accessibility */
a:focus-visible, button:focus-visible, .btn:focus-visible, .cta:focus-visible {
  outline: 3px solid #a6e3ff; outline-offset: 2px; border-radius: 6px;
}

/* Header & navigation */
header { padding: 2rem 1rem; text-align: center; margin: 1rem auto; }
header h1 { margin-bottom: .25rem; font-size: clamp(1.8rem, 0.8vw + 1.6rem, 2.8rem); letter-spacing: .2px; }
header .meta { color: var(--muted); font-size: 0.85rem; }

/* Navigation styling */
nav { margin-top: .5rem; display: inline-block; padding: .25rem; border-radius: 8px; border: 1px solid var(--border); background: rgba(0,0,0,.15); }
nav a { display: inline-block; padding: .5rem 1rem; border-radius: 6px; text-decoration: none; color: var(--text); border: 1px solid rgba(255,255,255,.25); }

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

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

/* Utility / micro components */
.tag { display: inline-block; padding: .25em .5em; border-radius: 999px; background: rgba(138,90,216,.25); color: #fff; border: 1px solid rgba(138,90,216,.6); font-size: .75rem; }

/* Product ad / sponsorship blocks */
.product-ad, .sponsored-page { padding: .75rem; text-align: center; min-width: 0; }
.product-ad a, .sponsored-page a { text-decoration: none; display: inline-block; width: 100%; padding: .5rem 1rem; color: #fff; }
.product-ad { background: rgba(138, 90, 216, .25); border: 1px solid rgba(138,90,216,.6); }
.sponsored-page { background: rgba(0,0,0,.18); border: 1px solid rgba(255,255,255,.25); }

/* Buttons & CTAs */
.btn, a.btn, a.cta { display: inline-block; font-weight: 600; text-align: center; text-decoration: none; border-radius: 10px; padding: .7rem 1.1rem; border: 1px solid rgba(255,255,255,.25); transition: transform .2s ease, background .2s ease, border-color .2s ease; }
.btn { background: var(--accent); color: #fff; border-color: rgba(140,90,200,.9); }
.btn:hover { transform: translateY(-1px); background: #7a4bd0; }
.btn.outline { background: transparent; color: var(--text); border-color: rgba(139,91,216,.9); }
.cta { background: rgba(255,255,255,.12); color: var(--text); border-color: rgba(255,255,255,.25); }

/* Footer */
footer { padding: 1rem; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); align-items: center; }

/* Print styles */
@media print {
  body { background: #fff; color: #000; }
  a { color: #000; text-decoration: underline; }
  .image-frame { page-break-inside: avoid; }
}

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