/* Base tokens + layout primitives */
:root{
  --bg: #1a1c20;
  --bg-2: #0f111a;
  --text: #e8eaff;
  --muted: #a8afc9;
  --accent: #7b5cff;
  --accent-2: #9a7cff;
  --glass: rgba(255,255,255,.08);
  --glass-2: rgba(255,255,255,.14);
  --border: rgba(255,255,255,.28);
  --shadow: 0 8px 28px rgba(0,0,0,.35);
  --radius: 14px;
  --focus: 0 0 0 3px rgba(123,92,255,.6);
  --text-on-glass: #f6f8ff;
}
html, body, header, nav, main, article, footer, aside {
  box-sizing: border-box;
}
html, body {
  height: 100%;
}
* { box-sizing: border-box; }

/* Layered, mobile-first background (gradient + diagonal lines + subtle grain) */
html {
  --grain: rgba(255,255,255,.04);
}
body {
  margin: 0;
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Inter, Arial;
  line-height: 1.5;
  min-height: 100%;
  background-color: var(--bg);
  background-image:
    linear-gradient(135deg, rgba(123,92,255,.10) 0, rgba(0,0,0,0) 40%),
    repeating-linear-gradient(135deg, rgba(255,255,255,.04) 0 2px, rgba(0,0,0,0) 2px 4px),
    radial-gradient(circle at 0% 0%, rgba(0,0,0,.08) 0, rgba(0,0,0,0) 40px);
  background-blend-mode: overlay, overlay, normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Layout helpers */
.container {
  max-width: clamp(320px, 86vw, 1100px);
  margin-inline: auto;
  padding-inline: 1rem;
}
.grid {
  display: grid;
  gap: 1rem;
}
.grid.autofit {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* Typography */
h1, h2, h3, h4 { margin: .25rem 0 .5rem; font-weight: 700; color: var(--text); }
h1 { font-size: clamp(1.75rem, 2.6vw + 1rem, 3rem); line-height: 1.15; letter-spacing: .2px; }
h2 { font-size: clamp(1.25rem, 1.6vw + .8rem, 2rem); }
h3 { font-size: clamp(1.05rem, 1.2vw + .6rem, 1.4rem); color: #e9e6ff; }
p { font-size: clamp(0.95rem, 0.8vw + .9rem, 1.1rem); margin: .5rem 0 1rem; color: #e8eaff; }

/* Accessibility-friendly links & CTAs */
a, button, .btn, .cta {
  color: var(--text);
  text-decoration: none;
  background: transparent;
  border: 0;
  padding: .55em 1em;
  border-radius: 8px;
  cursor: pointer;
  transition: transform .15s ease, background .2s ease, color .2s ease;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; outline: none; color: #d9bfff; }
.btn, .cta {
  background: var(--accent);
  color: white;
  border: 1px solid rgba(0,0,0,.25);
}
.btn:hover, .cta:hover {
  background: #6b4af0;
  transform: translateY(-1px);
}
.btn.outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--accent);
}
.btn:focus-visible, .cta:focus-visible, a:focus-visible, button:focus-visible {
  outline: var(--focus);
  outline-offset: 2px;
  border-radius: 8px;
}
.outline { border: 1px solid rgba(255,255,255,.25); }

/* Sections polymorphic glass panels (fallback included) */
header, main, footer, aside, article {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin: .75rem 0;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}
@supports not (backdrop-filter: blur(12px)) {
  header, main, footer, aside, article {
    background: rgba(255,255,255,.12);
  }
}
meta { display: none; }

/* Header: title + meta + simple nav */
header {
  display: block;
  padding: 1.25rem;
  text-align: left;
}
header h1 { margin-bottom: .25rem; }
header .meta { color: var(--muted); font-size: .92rem; margin-top: .25rem; }

/* Navigation */
nav { margin-top: .5rem; }
nav a { color: var(--text); text-decoration: none; padding: .25rem .5rem; border-radius: 6px; }
nav a:hover { text-decoration: underline; }

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

/* Content wrapper for article text where useful */
.content { padding: .75rem 0; }

/* Article content styles */
article { padding: 1rem; }

/* Image fallback styling for non-frame usage (in case class not used) */
img { max-width: 100%; height: auto; display: block; }

/* Footer: multiple panels/ad placements */
footer {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  padding: 1rem;
}
footer .product-ad, footer .sponsored-page {
  display: block;
  text-align: left;
  text-decoration: none;
}
footer p { justify-self: start; }

/* Simple responsive tweaks */
@media (min-width: 640px) {
  main { padding: 1.25rem 0; }
  article { padding: 0; }
  .container { padding-inline: 0; }
  footer { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 639px) {
  header, main, footer { padding: .75rem; }
}
@media print {
  body { background: white; color: black; }
  header, main, footer { background: transparent; border: none; box-shadow: none; }
}
