/* Palette & Theme */
:root{
  --bg: #0b0a14;
  --bg-2: #1a0d38;
  --bg-3: #2a0d55;
  --text: #ffffff;
  --muted: #cbd5e1;
  --accent: #8a7dff;
  --accent-2: #4df0ff;
  --panel: rgba(255,255,255,.08);
  --panel-2: rgba(255,255,255,.14);
  --border: rgba(255,255,255,.28);
  --shadow: 0 6px 20px rgba(0,0,0,.25);
  --radius: 14px;
  --radius-sm: 10px;
  --focus-ring: 0 0 0 3px rgba(122, 110, 255, .8);
}

/* Reset & Base */
html, body {
  height: 100%;
}
* { box-sizing: border-box; }
html {
  color-scheme: dark;
}
body {
  margin: 0;
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  line-height: 1.55;
  background:
    radial-gradient(circle at 15% 10%, rgba(120,100,255,.12), transparent 25%),
    radial-gradient(circle at 85% 60%, rgba(0,255,255,.08), transparent 30%),
    linear-gradient(135deg, #140a22 0%, #0b0a14 60%, #1a0a2a 100%);
  background-blend-mode: screen, overlay, normal;
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  isolation: isolate;
  /* Subtle CSS scanlines (pure CSS) */
  background-image:
    linear-gradient(to bottom, rgba(255,255,255,.03) 0 1px, transparent 1px 2px),
    radial-gradient(circle at 0% 0%, transparent, transparent);
  /* Layered backgrounds: 1) galaxy gradient, 2) faint scanlines, 3+) existing gradient layers above */
}
@media (prefers-reduced-motion: reduce) {
  html { background-attachment: initial; }
  * { transition: none !important; animation: none !important; }
}

/* Layout */
.container {
  width: min(92%, 1100px);
  margin-inline: auto;
}
.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.header, header {
  text-align: center;
}
header {
  padding: 3rem 0 2rem;
  position: relative;
}
header h1 {
  font-size: clamp(1.8rem, 1.2rem + 3vw, 3rem);
  line-height: 1.15;
  margin: 0.25rem 0 0.5rem;
  font-weight: 800;
  letter-spacing: .2px;
  color: #fff;
}
.meta {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 0.25rem;
}
main {
  padding: 0 0 2rem;
}
.article {
  display: block;
}
.image-frame, .featured-image,
.image-frame img, .image-frame > img {
  display: block;
}
.image-frame, .featured-image {
  width: 100%;
  max-width: 860px;
  margin: 0.75rem auto 1.25rem;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.28);
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  background: #000;
}
.image-frame {
  aspect-ratio: 16 / 9;
}
.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.featured-image {
  display: block;
}
.featured-image img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}
h1, h2, h3 {
  color: #fff;
  margin: 1rem 0 .5rem;
}
h2 {
  font-size: clamp(1.15rem, 1vw + 1rem, 1.6rem);
  font-weight: 700;
}
h3 {
  font-size: 1.05rem;
  font-weight: 700;
}
p {
  color: #e6e6f5;
  margin: 0.5rem 0 1rem;
}
blockquote {
  border-left: 3px solid rgba(138,125,255,.6);
  padding: .5rem 1rem;
  margin: .5rem 0 1rem;
  color: #f6f6ff;
  background: rgba(255,255,255,.04);
  border-radius: 6px;
}
ul, ol {
  padding-left: 1.25rem;
  margin: .25rem 0 1rem;
  color: #e8e8ff;
}
li { margin: .25rem 0; }

/* Glass panels (with fallback) */
.glass {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 12px 28px rgba(0,0,0,.28);
}
.no-backdrop {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.32);
  box-shadow: 0 8px 24px rgba(0,0,0,.24);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* Image utilities (legacy selector support) */
.image-frame {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.28);
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
}
.image-frame img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Content block helpers */
.content { padding: 1rem 0; }

/* Links & Buttons */
a, button, .btn, .cta {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}
a { cursor: pointer; }
a:hover, a:focus { text-decoration: underline; color: var(--accent-2); }
a:focus-visible, button:focus-visible, .btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-color: rgba(255,255,255,.5);
}
.btn, .cta {
  display: inline-block;
  padding: .75rem 1.25rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.4);
  background: rgba(255,255,255,.12);
  color: #fff;
  cursor: pointer;
  transition: transform .15s ease, background .25s ease, border-color .25s ease;
}
.btn:focus-visible, .cta:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}
.btn:hover { transform: translateY(-1px); background: rgba(255,255,255,.18); }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: 0;
  box-shadow: 0 6px 18px rgba(141, 115, 255, .45);
}
.btn.secondary {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.35);
}
.cta {
  padding: .6rem 1rem;
  border: 1px solid rgba(255,255,255,.4);
  background: rgba(0,0,0,.18);
}
.ghost { background: transparent; border: 1px solid rgba(255,255,255,.35); }

/* Utilities */
ul, li { margin: 0; padding: 0; list-style: disc; margin-left: 1.25rem; }
.tag {
  display: inline-block;
  padding: .125em .5em;
  border-radius: 999px;
  font-size: .75rem;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.12);
  color: #fff;
}
.container--tight { padding: 0; }

/* Footer and ad sections */
footer {
  padding: 2rem 0;
  text-align: center;
  color: var(--muted);
}
.product-ad, .sponsored-page {
  display: inline-block;
  margin: .25rem;
  padding: .75rem 1rem;
  border-radius: 12px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.25);
}
.product-ad a, .sponsored-page a { color: #fff; }

/* Hero pattern tweaks for readability on glow */
@media (min-width: 720px) {
  main { padding: 2rem 0 3rem; }
  .container { padding: 0 1rem; }
}
@media (prefers-color-scheme: light) {
  :root { color-scheme: light; }
  body { background: #f6f7fb; color: #111; }
  header h1 { color: #111; }
  .glass { background: rgba(255,255,255,.75); backdrop-filter: blur(8px); }
  .image-frame, .product-ad, .sponsored-page { border-color: rgba(0,0,0,.15); }
}

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