/* Section: Palette & Foundations */
:root{
  --bg: #0b0e12;           /* charcoal base */
  --bg-2: #141821;          /* deeper shade for depth */
  --panel: rgba(20, 20, 28, 0.62);
  --panel-solid: rgba(20, 20, 28, 0.72);
  --text: #eef0f6;           /* high-contrast on glass */
  --muted: #b4a9be;
  --accent: #b89cff;         /* soft lilac */
  --accent-2: #8e77e0;       /* deeper lilac for focus/accents */
  --border: rgba(255,255,255,0.28);
  --card: rgba(255,255,255,0.065);
  --shadow: 0 8px 28px rgba(0,0,0,.32);
  --radius: 12px;
  --radius-sm: 10px;
  --focus: 2px solid var(--accent-2);
}

/* Section: Base & Layered Background */
html, body {
  height: 100%;
}
* { box-sizing: border-box; }
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body {
  margin: 0;
  color: var(--text);
  background: linear-gradient(135deg, var(--bg-2), var(--bg));
  min-height: 100vh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  font-size: clamp(14px, 1.2vw + 12px, 18px);
  line-height: 1.5;
  position: relative;
  isolation: isolate;
}
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}
/* Subtle gradient veil for depth */
body::before {
  background: radial-gradient( circle at 20% 0%, rgba(176, 156, 255, .22) 0, rgba(176,156,255,0) 40% ),
              radial-gradient( circle at 80% 20%, rgba(80, 120, 200, .15) 0, rgba(80,120,200,0) 40% ),
              linear-gradient(135deg, rgba(8,8,12,.65), rgba(8,8,12,.75) 60%);
  mix-blend-mode: screen;
  z-index: -2;
  filter: saturate(105%);
}
/* Subtle scanline/noise overlay (pure CSS) */
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: 100% 2px, 2px 100%;
  opacity: .25;
  mix-blend-mode: overlay;
  z-index: -1;
}

/* Section: Layout Utilities */
.container {
  width: 100%;
  max-width: clamp(320px, 92vw, 1100px);
  margin-inline: auto;
  padding-inline: 1rem;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  transition: transform .2s ease, background-color .2s ease;
}
.card:hover { transform: translateY(-1px); background: rgba(255,255,255,.08); }

/* Section: Common Elements */
header, nav, main, article, footer, aside {
  display: block;
}
header {
  padding: 1.25rem 1rem;
  text-align: center;
}
header h1 {
  font-size: clamp(1.6rem, 2.2vw + 1rem, 3rem);
  margin: .15rem 0 .25rem;
  letter-spacing: .5px;
}
header .meta {
  color: var(--muted);
  font-size: clamp(0.8rem, 0.8vw + 0.6rem, 1rem);
}
nav {
  margin-top: .5rem;
}
nav a {
  display: inline-block;
  padding: .5rem 1rem;
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  border: 1px solid rgba(255,255,255,.28);
  background: rgba(255,255,255,.08);
  transition: background .2s ease, transform .2s;
}
nav a:hover { background: rgba(255,255,255,.14); text-decoration: none; }
nav a:focus-visible { outline: var(--focus); outline-offset: 2px; }

/* Section: Main Content & Typography */
main { padding: 1rem 0; }
article { margin: 0 auto; max-width: clamp(640px, 90vw, 980px); padding: 0 0.5rem; }
article h2 {
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  margin: 1.25rem 0 0.5rem;
  color: var(--text);
}
article p {
  color: var(--text);
  opacity: .95;
  font-size: clamp(0.95rem, 1.2vw, 1.05rem);
  line-height: 1.6;
}
blockquote {
  margin: .75rem 0;
  padding: .75rem 1rem;
  border-left: 4px solid var(--accent-2);
  background: rgba(255,255,255,.06);
  border-radius: 8px;
}
ul { margin: .5rem 0 1rem 1.1rem; padding: 0; }
li { margin: .25rem 0; }

.image-frame, .featured-image {
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.28);
  box-shadow: 0 6px 18px rgba(0,0,0,.28);
  background: #111;
}
.image-frame { aspect-ratio: 16/9; display: block; }
.image-frame img, .featured-image img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Helper: explicit content container for images if used */
.content { color: var(--text); }

/* Section: Product Ad & Footer blocks (glass panels) */
.product-ad, .sponsored-page {
  background: rgba(10, 10, 15, 0.62);
  border: 1px solid rgba(255,255,255,.28);
  border-radius: var(--radius);
  padding: .75rem;
  text-align: center;
}
.product-ad a, .sponsored-page a {
  color: var(--text);
  text-decoration: none;
  display: block;
}
.product-ad:hover, .sponsored-page:hover { background: rgba(10,10,15,0.72); }
footer {
  padding: 1rem;
  display: grid;
  gap: .75rem;
  grid-template-columns: 1fr;
}
footer p { text-align: center; color: var(--muted); margin: 0; }

/* Section: Utility UI Elements */
.tag {
  display: inline-block;
  font-size: .75rem;
  padding: .25rem .6rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.28);
  background: rgba(255,255,255,.08);
  color: var(--text);
}
a, button, .btn, .cta {
  transition: transform .2s ease, background-color .2s ease, color .2s ease;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: var(--focus); outline-offset: 2px; }
button, .btn, .cta {
  font: inherit;
  cursor: pointer;
  border-radius: 999px;
  border: none;
  padding: .65rem 1.1rem;
  background: var(--accent);
  color: #0b0611;
  font-weight: 700;
  line-height: 1;
}
.btn--outline {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255,255,255,.45);
}
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible { outline: var(--focus); outline-offset: 2px; }

/* Section: Layout helpers for responsive design */
@media (min-width: 720px) {
  footer { grid-template-columns: 1fr 1fr; align-items: start; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; transform: none !important; }
}

/* Section: Print styles (basic readability) */
@media print {
  body { background: white; color: black; }
  a { color: black; text-decoration: underline; }
  .image-frame, .featured-image { border: none; background: transparent; }
}