/* Section: Tokens & Base */
:root {
  --bg: #0b002b;
  --bg-2: #210042;
  --text: #e9e0ff;
  --muted: #c9b6e8;
  --accent: #7c3aed;
  --accent-2: #a78bfa;
  --surface: rgba(255,255,255,.08);
  --surface-2: rgba(255,255,255,.14);
  --border: rgba(124,58,237,.45);
  --shadow: 0 6px 18px rgba(0,0,0,.5);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
html { color-scheme: dark, light; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  color: var(--text);
  min-height: 100vh;
  background: 
    linear-gradient(to bottom right, rgba(125,0,255,.22), rgba(20,0,60,.60)),
    linear-gradient(#0b071a 0%, #0a0a14 60%, #09040f 100%);
  position: relative;
  overflow-x: hidden;
}
body:focus-visible { outline: 0; }

/* Subtle layered noise/scanline texture (pure CSS) */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}
body::before {
  background: radial-gradient(circle at 20% -10%, rgba(138,43,226,.25), transparent 40%),
              radial-gradient(circle at 70% 0%, rgba(60,0,180,.15), transparent 40%),
              linear-gradient(to bottom, rgba(0,0,0,.0), rgba(0,0,0,.25) 60%);
  mix-blend-mode: screen;
  opacity: .5;
}
body::after {
  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: 4px 4px, 4px 4px;
  opacity: .15;
  mix-blend-mode: overlay;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f0ff;
    --bg-2: #e9d7ff;
    --text: #1a1130;
    --muted: #5a4f7a;
    --surface: rgba(0,0,0,.08);
    --surface-2: rgba(0,0,0,.12);
    --border: rgba(120,0,120,.25);
  }
  body {
    background: linear-gradient(to bottom right, rgba(140,0,180,.12), rgba(10,10,20,.08));
  }
  body::before { opacity: .4; }
  body::after { opacity: .08; }
}

/* Section: Layout primitives */
.container {
  width: 100%;
  max-width: clamp(320px, 90vw, 1100px);
  margin: 0 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 var(--border); border-radius: 12px; padding: 1rem; box-shadow: var(--shadow); }

/* Glass panels (fallback-friendly) */
.glass {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 6px 18px rgba(0,0,0,.4);
}
@supports (backdrop-filter: blur(8px)) or (-webkit-backdrop-filter: blur(8px)) {
  .glass { backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); background: rgba(255,255,255,.08); }
}
@supports not (backdrop-filter: blur(8px)) {
  .glass { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.4); }
}

/* Section: Typography & content helpers */
.content { padding: 1rem; }
.image-frame { aspect-ratio: 16 / 9; overflow: hidden; border-radius: 12px; border: 1px solid rgba(255,255,255,.25); background: #000; box-shadow: 0 6px 18px rgba(0,0,0,.5); }
.image-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Section: Typography scale (system-ui stack, fluid) */
h1, h2, h3 { margin: 0.25rem 0; font-weight: 700; line-height: 1.08; }
h1 { font-size: clamp(1.6rem, 2.6vw, 3.5rem); letter-spacing: .4px; }
h2 { font-size: clamp(1.4rem, 1.8vw, 2.6rem); color: var(--text); }
h3 { font-size: clamp(1.1rem, 1.2vw, 1.5rem); color: var(--text); }

/* Text & links */
p { color: var(--muted); margin: .75rem 0; line-height: 1.6; }
blockquote {
  margin: .75rem 0; padding: .75rem 1rem;
  border-left: 3px solid var(--accent);
  color: #e9e0ff;
  background: rgba(0,0,0,.15);
  border-radius: 6px;
}

/* Lists */
ul { margin: .75rem 0 1rem 1.25rem; color: var(--muted); }
li { margin: .25rem 0; }

/* Section: Header & main layout */
header {
  text-align: center;
  padding: 1.75rem 1rem;
}
header h1 { font-size: clamp(1.8rem, 3vw + 1rem, 3.6rem); margin: .25rem 0 0; }
header .meta { color: var(--muted); font-size: .92rem; margin-top: .25rem; }

/* Main content flow */
main { padding: 0 0 1rem; }
.featured-image { margin: 1rem 0; }

/* Section: Footer & CTAs */
footer {
  padding: 1rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: .75rem;
  text-align: center;
}
@media (min-width: 640px) {
  footer { grid-template-columns: repeat(3, 1fr); text-align: left; align-items: stretch; }
}
.product-ad a, .sponsored-page a {
  display: block;
  padding: .85rem 1rem;
  border-radius: 12px;
  text-decoration: none;
  color: #fff;
  background: rgba(124,58,237,.35);
  border: 1px solid rgba(124,58,237,.7);
  transition: transform .2s ease, background .2s ease;
}
.product-ad a:hover { transform: translateY(-1px); background: rgba(124,58,237,.5); }
.product-ad a:focus-visible, .sponsored-page a:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}
footer p { color: var(--muted); font-size: .92rem; }

/* Links & buttons */
a { color: var(--accent); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; color: var(--accent-2); outline: none; }
.btn, .cta { cursor: pointer; text-decoration: none; display: inline-block; }
.btn {
  padding: .75rem 1.15rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.25);
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  text-align: center;
  transition: transform .2s ease, box-shadow .2s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(0,0,0,.35); }
.btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.btn--outline {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(124,58,237,.7);
}
.cta { padding: .75rem 1.1rem; border-radius: 999px; }

/* Section: Utility components */
.content .tag { display: inline-block; padding: .25rem .5rem; border-radius: 999px; font-size: .75rem; background: rgba(124,58,237,.25); color: #e8e0ff; }

/* Section: Accessibility helpers */
:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

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

/* Section: Print (basic readability) */
@media print {
  body { background: #fff; color: #000; }
  a { text-decoration: underline; }
}
