/* Palette */
:root {
  --bg: #0f1116;
  --bg-2: #1b1f25;
  --text: #e9f7d0;
  --muted: #b7c8a3;
  --surface: rgba(255,255,255,0.08);
  --surface-2: rgba(0,0,0,0.25);
  --accent: #a3ff3a;
  --accent-2: #6fff3a;
  --border: rgba(255,255,255,0.28);
  --shadow: 0 8px 28px rgba(0,0,0,.25);
}

/* 1. Base & Layered Background (gradient + pewter checkerboard + subtle scanlines) */
html, body {
  height: 100%;
}
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  color: var(--text);
  background-color: var(--bg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  isolation: isolate;
  /* Layered background: gradient + pewter checkerboard */
  background-image:
    linear-gradient(135deg, rgba(0,0,0,.25), rgba(0,0,0,.25)),
    linear-gradient(45deg, rgba(0,0,0,.08) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(0,0,0,.08) 25%, transparent 25%),
    linear-gradient(var(--bg), var(--bg));
  background-size: 100% 100%, 16px 16px, 16px 16px, 100% 100%;
  background-position: 0 0, 0 0, 0 0, 0 0;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  /* subtle noise/scanlines */
  background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 100% 2px;
  mix-blend-mode: overlay;
  opacity: 0.25;
}

/* 2. Layout primitives */
.container {
  width: 100%;
  max-width: clamp(720px, 88vw, 1120px);
  margin-inline: auto;
  padding: 1rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
@supports not (backdrop-filter: blur(12px)) {
  .card { background: rgba(255,255,255,0.16); }
}

.image-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.28);
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.content { font-size: clamp(15px, 1.9vw + 0.5rem, 18px); color: var(--text); }

/* 3. Typography helpers */
h1, h2, h3 { margin: .4rem 0; font-weight: 700; color: var(--text); }
h1 { font-size: clamp(1.8rem, 4vw, 2.75rem); line-height: 1.08; letter-spacing: .2px; }
h2 { font-size: clamp(1.25rem, 2.6vw, 1.6rem); line-height: 1.25; }
p { margin: 0 0 1rem; }
blockquote {
  margin: 1rem 0;
  padding: .75rem 1rem;
  border-left: 4px solid var(--accent);
  background: rgba(0,0,0,.15);
  border-radius: 6px;
}
ul, ol { margin: .5rem 0 1rem 1.25rem; padding: 0; }
li { margin: .25rem 0; }

/* 4. Image utility (for potential .image-frame usage) */
.image-frame { display: block; }

/* 5. The content region and article layout */
header, main, footer, aside { border-radius: 12px; padding: 1rem; }

/* Glass-like panels on key regions */
header, main, footer, aside {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.25);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 6px 22px rgba(0,0,0,.25);
}
@supports not (backdrop-filter: blur(12px)) {
  header, main, footer, aside { background: rgba(255,255,255,.18); }
}

/* 6. Product ad / footer blocks (glass panels) */
.product-ad, .sponsored-page {
  display: block;
  text-align: center;
  padding: .6rem;
  margin: .5rem 0;
  border-radius: 10px;
  background: rgba(0,0,0,.25);
  border: 1px solid rgba(255,255,255,.25);
}
.product-ad a, .sponsored-page a, footer a {
  color: var(--text);
  text-decoration: none;
  display: inline-block;
  width: 100%;
}
.product-ad p, .sponsored-page p { margin: 0; font-weight: 600; }

/* 7. Link and button treatments (focus states with WCAG AA) */
a, button, .btn, .cta {
  color: var(--text);
  text-decoration: none;
}
a:hover, a:focus-visible {
  text-decoration: underline;
  outline: none;
}
a:focus-visible, button:focus-visible, .btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .75rem 1.25rem;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,.25);
  background: linear-gradient(#b7ff6a, #86e635);
  color: #0a0a0a;
  font-weight: 700;
  text-shadow: none;
  text-decoration: none;
  transition: transform .15s ease, filter .15s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn:active { transform: translateY(0); }

.btn--outline {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}
.btn--outline:hover { background: rgba(163,255,58,.08); }

/* 8. Lists and misc helpers */
ul, li { color: var(--text); }
.tag {
  display: inline-block;
  padding: .15rem .5rem;
  font-size: .75rem;
  border-radius: 999px;
  background: rgba(0,0,0,.25);
  border: 1px solid rgba(255,255,255,.25);
  color: var(--text);
}

/* 9. Print styles (basic readability) */
@media print {
  body::after { display: none; }
  body { background: #fff; color: #000; }
  header, main, footer, aside { background: transparent; border: none; box-shadow: none; }
  a { text-decoration: underline; color: #000; }
}
  
/* 10. Accessibility and motion preferences */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}