/* Base Tokens */
:root {
  --bg: #0a0717;
  --bg-2: #130321;
  --text: #e9e1f7;
  --muted: #b59bd6;
  --accent: #a400e0;
  --accent-2: #7a0017;
  --glass: rgba(20,0,60,.22);
  --border: rgba(140,0,120,.4);
  --shadow: 0 8px 28px rgba(0,0,0,.45);
  --radius: 14px;
  --focus: #ffffff;
}

/* Layout Helpers */
* { box-sizing: border-box; }
html, body { height: 100%; }
html { color-scheme: dark; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Helvetica Neue";
  color: var(--text);
  background: linear-gradient(135deg, rgba(60,0,90,0.95) 0%, rgba(20,0,40,0.95) 60%, rgba(10,0,20,0.95) 100%);
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding: 0;
  margin: 0;
  /* Layered background: subtle noise/scanlines (pure CSS) */
}
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}
body::before {
  /* soft glow / ambient texture via radial blends */
  background-image:
    radial-gradient( circle at 20% 20%, rgba(170, 80, 255, .08) 0 20%, transparent 40% ),
    radial-gradient( circle at 80% 60%, rgba(120, 0, 120, .08) 0 25%, transparent 40%);
  mix-blend-mode: screen;
  opacity: .9;
}
body::after {
  /* subtle horizontal scanlines */
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,.04) 0 1px,
    transparent 1px 2px
  );
  mix-blend-mode: overlay;
  opacity: .25;
}
a { color: var(--accent); text-decoration: none; outline: none; }
a:hover, a:focus { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(170,0,170,.9); }

/* Section Headers */
header, nav, main, article, aside, footer {
  border-radius: var(--radius);
  padding: 1rem;
  margin: 0.5rem auto;
  width: min(1120px, 92%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: rgba(12,0,40,.22);
  border: 1px solid rgba(140,0,120,.38);
  box-shadow: var(--shadow);
}
header {
  text-align: center;
  padding: 2rem 1rem;
  background: rgba(20,0,55,.28);
  border: 1px solid rgba(170,0,170,.45);
}
header h1 {
  margin: 0;
  font-size: clamp(1.8rem, 1.2vw + 1rem, 3rem);
  line-height: 1.15;
  letter-spacing: .4px;
  color: #f8eaff;
  text-shadow: 0 0 8px rgba(170,0,170,.5);
}
header .meta {
  margin-top: .25rem;
  font-size: .92rem;
  color: var(--muted);
}
main { padding: 1rem 1rem 2rem; }
article { display: block; padding: 0; margin: 0; }

/* Image Presentation */
.featured-image { width: 100%; margin: 0 auto 1rem; }
.image-frame {
  aspect-ratio: 16 / 9;
  width: 100%;
  display: block;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(0,0,0,.15);
  box-shadow: 0 6px 18px rgba(0,0,0,.4);
}
.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  vertical-align: middle;
  border: 0;
}
.figure-caption { font-size: .9rem; color: var(--muted); text-align: center; margin-top: .25rem; }

/* Content & Typography */
.content { max-width: 60ch; color: #f6f0ff; }
h2 { font-size: clamp(1.4rem, 0.6vw + 1rem, 2rem); margin: .75rem 0 .5rem; color: #f2e7ff; }
p { margin: .75rem 0; color: rgba(230,230,255,.92); }
blockquote {
  margin: .75rem 0;
  padding: .5rem 1rem;
  border-left: 4px solid var(--accent);
  background: rgba(0,0,0,.15);
  border-radius: 8px;
  color: #f8e6ff;
}
ul { padding-left: 1.25rem; margin: .5rem 0 1rem; }
li { margin: .25rem 0; }

/* Product Ad / Footer items */
.product-ad, .sponsored-page {
  display: block;
  padding: .75rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(20,0,60,.22);
  text-align: center;
}
.product-ad a, .sponsored-page a { display: inline-block; color: var(--text); text-decoration: none; font-weight: 500; padding: .25rem .5rem; }
.product-ad a:hover, .sponsored-page a:hover { text-decoration: underline; text-decoration-color: rgba(170,0,170,.9); }

/* Utility Grid / Cards / Tags (ready for reuse) */
.container { 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: rgba(18,0,40,.22);
  border: 1px solid rgba(170,0,170,.35);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 6px 16px rgba(0,0,0,.3);
}
.tag {
  display: inline-block;
  padding: .15em .5em;
  font-size: .75rem;
  border-radius: 999px;
  background: rgba(170,0,170,.25);
  border: 1px solid rgba(255,255,255,.25);
  color: var(--text);
}

/* Form Elements (theme-consistent) */
button, .btn, .cta {
  font: inherit;
  padding: .6em 1em;
  border-radius: 10px;
  border: 1px solid rgba(180,0,140,.6);
  background: linear-gradient(135deg, rgba(110,0,140,.95), rgba(140,0,120,.95));
  color: #fff;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
}
.btn-outline {
  background: transparent;
  border: 1px solid rgba(180,0,140,.75);
  color: var(--text);
}
button:hover, .btn:hover, .cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0,0,0,.35);
}
button:focus-visible, .btn:focus-visible, .cta:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Print Styles */
@media print {
  body { background: #fff; color: #000; }
  a { text-decoration: underline; color: #000; }
  header, main, footer { box-shadow: none; border: 0; background: none; }
}
  
/* Responsive tweaks */
@media (max-width: 720px) {
  header { padding: 1.5rem; }
  .image-frame { border-radius: 10px; }
  .container { padding: 0 0.75rem; }
}
  
/* Accessibility: Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
  
/* Light mode variant for legibility */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f3ff;
    --bg-2: #efe8ff;
    --text: #1a0f26;
    --muted: #57425a;
    --accent: #6a2bd8;
    --accent-2: #8b1d1d;
    --glass: rgba(255,255,255,.7);
    --border: rgba(0,0,0,.15);
    --shadow: 0 6px 16px rgba(0,0,0,.15);
  }
  body {
    background: linear-gradient(135deg, rgba(240,235,255,.95) 0%, rgba(230,225,235,.95) 60%, rgba(240,235,255,.95) 100%);
    color: var(--text);
  }
  header, main, footer { background: rgba(255,255,255,.6); border: 1px solid rgba(0,0,0,.15); }
  a { color: #4b2bd8; }
}
