/* Base tokens */
:root{
  --bg: #0b002b;
  --bg-2: #1a0033;
  --text: #e9e6ff;
  --muted: #c6b8ff;
  --accent: #ff4bd4;
  --accent-2: #a64dff;
  --surface: rgba(255,255,255,.12);
  --surface-2: rgba(255,255,255,.08);
  --ring: rgba(164,77,255,.9);
}

/* Layout helpers */
html, body { height: 100%; }
* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(135deg, var(--bg), var(--bg-2) 60%, #0a0024);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  isolation: isolate;
}
body::before, body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}
/* Subtle noise/scanline layer over gradient (pure CSS) */
body::before {
  background-image:
    linear-gradient(to bottom right, rgba(255,255,255,.04), rgba(255,255,255,.01)),
    repeating-linear-gradient(to bottom, rgba(255,255,255,.04) 0 1px, transparent 1px 2px);
  mix-blend-mode: overlay;
  opacity: .25;
}
body::after {
  background: radial-gradient(circle at 20% 0%, rgba(255,0,140,.08), transparent 40%);
  filter: saturate(110%);
  opacity: .25;
  mix-blend-mode: overlay;
}

/* Helper components */
.container {
  width: 100%;
  max-width: clamp(640px, 90vw, 1100px);
  margin-inline: auto;
  padding: 0 1rem;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.card {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 14px;
  padding: 1rem;
  box-shadow: 0 8px 26px rgba(0,0,0,.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
@supports not (backdrop-filter: blur(10px)) {
  .card { background: var(--surface-2); }
}
.tag {
  display: inline-block;
  padding: .25em .5em;
  font-size: .75rem;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.32);
  color: #fff;
}

/* Typography */
h1, h2, h3 { margin: .25rem 0; }
p { margin: .5rem 0 1rem; line-height: 1.5; }
ul { margin: .5rem 0 1rem 1.25rem; padding: 0; }
li { margin: .25rem 0; }

/* Section elements */
header, main, footer, nav, aside, article {
  display: block;
}
header, main, footer, aside {
  padding: 1rem;
}
header {
  text-align: center;
  padding-top: 2rem;
}
header h1 {
  font-size: clamp(2rem, 4vw + 1rem, 4rem);
  line-height: 1.04;
  margin: 0 0 .25rem;
  color: var(--text);
  text-shadow: 0 2px 14px rgba(0,0,0,.45);
}
header .meta {
  font-size: clamp(.8rem, 1.4vw, 1rem);
  color: var(--muted);
}

/* Glass panels (with graceful fallback) */
.glass {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(0,0,0,.25);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
@supports not (backdrop-filter: blur(12px)) {
  .glass { background: rgba(255,255,255,.14); }
}
.image-frame {
  margin: 1rem auto;
  width: min(100%, 720px);
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.28);
  background: #000;
  display: block;
}
.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); }

/* Content area styling */
.content { color: var(--text); line-height: 1.6; }

/* Hero/intro content area (within content) */
.hero {
  display: grid;
  gap: .75rem;
}
.hero h1 { margin: 0; }

/* Links & buttons (accessibility) */
a {
  color: var(--accent-2);
  text-decoration: none;
  transition: color .2s ease;
}
a:hover, a:focus { color: var(--accent); text-decoration: underline; outline: none; }
a:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 6px; }

/* Buttons & CTAs */
button, .btn, .cta {
  border: 1px solid rgba(255,255,255,.38);
  background: linear-gradient(to bottom right, rgba(255,0,180,.25), rgba(0,0,0,.15));
  color: var(--text);
  padding: .65rem 1.05rem;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease;
  display: inline-block;
  text-align: center;
}
button:hover, .btn:hover, .cta:hover { transform: translateY(-1px); }
button:focus-visible, .btn:focus-visible, .cta:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.btn.outline, .cta.outline {
  background: transparent;
  border-color: rgba(255,255,255,.6);
  color: var(--text);
}
.btn.primary {
  background: linear-gradient(to bottom right, rgba(255,0,180,.6), rgba(60,0,80,.6));
  border-color: rgba(255,255,255,.8);
}
.btn:active, .cta:active { transform: translateY(0); }

/* Image/visual section wrapper (if used) */
.featured-image { display: block; width: 100%; max-width: 720px; margin: 0 auto; }

/* Content area tweaks for accessibility */
@media (prefers-color-scheme: dark) {
  /* ensure good contrast in dark modes (if user toggles) */
  :root { color-scheme: dark; }
}

/* Main layout rules (mobile-first) */
main { padding: 0 0.5rem; }
main article { margin: 0 auto; padding: 0.5rem 0; }

/* Footer layout (compact ad blocks) */
footer {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  align-items: stretch;
  padding: 1rem;
}
.product-ad, .sponsored-page {
  display: block;
}
.product-ad a, .sponsored-page a {
  display: block; padding: 1rem; text-align: center;
  color: var(--text); text-decoration: none;
  border-radius: 12px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.25);
}
.product-ad a:hover, .sponsored-page a:hover { background: rgba(255,255,255,.14); text-decoration: none; }

/* Utilities (compact spacing) */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mr-1 { margin-right: .5rem; }

/* Print styles (basic readability) */
@media print {
  body { background: #fff; color: #000; }
  a { text-decoration: underline; color: #0000ee; }
  .glass { background: #fff; border: 1px solid #aaa; backdrop-filter: none; }
  .image-frame { page-break-inside: avoid; }
}

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