/* Tokens */
:root {
  --bg: #0b0b12;
  --bg-2: #1a1230;
  --bg-3: #2a1e4d;
  --text: #f5f7ff;
  --muted: #c8c6e6;
  --accent: #a68bff;
  --accent-2: #7c5cff;
  --glass: rgba(16, 9, 24, 0.22);
  --glass-2: rgba(16, 9, 24, 0.28);
  --border: rgba(255, 255, 255, 0.28);
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

/* Base */
* { box-sizing: border-box; }
html, body { height: 100%; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
  font-size: clamp(14px, 1.6vw, 18px);
  line-height: 1.5;
  color: var(--text);
  /* Layered background: gradient + soft lavender accents + scanlines */
  background-image:
    linear-gradient(135deg, #0b0b12 0%, #1a1130 60%, #0b0b12 100%),
    repeating-linear-gradient(0deg, rgba(140, 100, 255, 0.12) 0px, rgba(140, 100, 255, 0.12) 2px, transparent 2px, transparent 4px),
    linear-gradient(to bottom right, rgba(122, 84, 255, 0.25), rgba(0,0,0,0) 60%);
  background-blend-mode: overlay;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Helpers & utilities */
.image-frame, .image-frame img { display: block; }
.image-frame {
  aspect-ratio: 16 / 9;
  width: 100%;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}
.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(1.05);
}

.container {
  max-width: clamp(320px, 92vw, 1100px);
  margin-inline: auto;
  padding-inline: 1rem;
}

/* Glass panels (with fallback) */
.glass {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
@supports not (backdrop-filter: blur(10px)) {
  .glass { background: rgba(10, 8, 20, 0.38); }
}

/* Layout sections */
header, main, footer, aside {
  display: block;
}
header {
  width: min(1100px, 92%);
  margin: 1rem auto;
  padding: 1rem 1.25rem;
  border-radius: 14px;
  background: rgba(8, 6, 14, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 28px rgba(0,0,0,0.35);
}
header h1 {
  font-size: clamp(1.8rem, 5vw, 3.5rem);
  line-height: 1.05;
  margin: 0 0 0.25rem;
  color: var(--text);
}
header .meta {
  color: var(--muted);
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  font-size: 0.92rem;
  margin: 0;
}
header nav {
  margin-top: 0.5rem;
}
header nav a {
  display: inline-block;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text);
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.25);
  transition: background 0.25s ease, transform 0.2s ease;
}
header nav a:hover { background: rgba(0,0,0,0.35); transform: translateY(-1px); }
header nav a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  background: rgba(0,0,0,0.32);
}

/* Main content */
main { padding: 1rem 0 2rem; }
.article { width: min(1100px, 92%); margin-inline: auto; padding: 0 1rem; }
.featured-image { margin: 1rem 0; border-radius: 12px; overflow: hidden; border: 1px solid rgba(255,255,255,.25); box-shadow: 0 12px 28px rgba(0,0,0,.45); }
.featured-image img { width: 100%; height: auto; display: block; }

/* Typography & content */
h2 { font-size: clamp(1.5rem, 3.5vw, 2.25rem); margin: 0.75rem 0 0.5rem; color: var(--text); }
p { margin: 0 0 1rem; color: var(--text); opacity: 0.95; }
ul { padding-left: 1.25rem; margin: 0 0 1rem; }
li { margin: 0.25rem 0; }

/* Quote block */
blockquote {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--accent-2);
  color: var(--text);
  background: rgba(0,0,0,0.25);
  border-radius: 6px;
}

/* Footer ad blocks (grid) */
footer {
  width: min(1100px, 92%);
  margin: 2rem auto 1rem;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.product-ad, .sponsored-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 72px;
  padding: .75rem;
  border-radius: 12px;
  background: rgba(16,9,24,0.28);
  border: 1px solid rgba(255,255,255,0.28);
  color: var(--text);
  text-align: center;
  text-decoration: none;
}
.product-ad p, .sponsored-page p { margin: 0; }

/* Utility classes (interactive) */
a, button, .btn, .cta {
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}
.btn, .cta {
  display: inline-block;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.32);
  background: rgba(70, 60, 120, 0.25);
  transition: transform 0.2s ease, background 0.25s ease;
}
.btn:hover, .cta:hover { transform: translateY(-1px); background: rgba(70,60,120,0.35); }
.btn:focus-visible, .cta:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
a:hover { text-decoration: underline; }

/* Cards and tags (utilities) */
.card {
  background: rgba(15, 8, 24, 0.22);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 12px;
  padding: 0.75rem;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}
.tag {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  line-height: 1;
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(140,100,255,0.25);
  color: var(--text);
}

/* Grid utility (auto-fit) */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.content { max-width: 70ch; margin: 0 auto; }

/* Image frame fallback example (when used) */
.image-frame--fallback { /* kept for potential usage; uses same look as .image-frame by default */ }

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

/* Print styles */
@media print {
  body { background: #fff; color: #000; }
  header, main, footer { background: transparent; box-shadow: none; }
  a { text-decoration: underline; color: inherit; }
}
