/* Base / Palette */
:root {
  --bg: #0a1020;
  --bg-2: #0a162a;
  --text: #eafff4;
  --muted: #a5f08a;
  --accent: #b9ff3f;
  --accent-2: #7dff4f;
  --surface: rgba(14, 20, 40, 0.28);
  --surface-2: rgba(14, 20, 40, 0.18);
  --border: rgba(120, 255, 180, 0.38);
  --shadow: 0 8px 28px rgba(0,0,0,.45);
  --radius: 14px;
}

/* Layered Background (gradient + scanlines + subtle noise-esque accents) */
html, body { height: 100%; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans", sans-serif;
  line-height: 1.5;
  background:
    radial-gradient(circle at 20% -10%, rgba(0,255,128,.08), transparent 40%),
    radial-gradient(circle at 90% 0%, rgba(0,255,128,.07), transparent 40%),
    linear-gradient(135deg, #0a1020 0%, #0a1120 60%, #0a0f1e 100%),
    repeating-linear-gradient(
      0deg,
      rgba(0,0,0,.04) 0px,
      rgba(0,0,0,.04) 1px,
      transparent 1px,
      transparent 2px
    );
  background-blend-mode: overlay, overlay, normal, overlay;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
}

/* Layout helpers (utility) */
.container { width: 100%; max-width: clamp(320px, 85vw, 1120px); margin-inline: auto; padding-inline: 1rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }

/* Glass panel (frosted glass) */
.glass {
  background: rgba(14, 20, 40, 0.28);
  border: 1px solid rgba(120, 255, 180, 0.38);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
@supports not ((backdrop-filter: blur(12px)) or (-webkit-backdrop-filter: blur(12px))) {
  .glass { background: rgba(14, 20, 40, 0.72); border-color: rgba(120, 255, 180, 0.55); }
}

/* Structure styling as requested selectors */
html, body, header, nav, main, article, footer, aside {
  /* ensure these exist in layout ranges; no extra default stacking */
  min-block-size: 0;
}

/* Header / Hero */
header {
  padding: clamp(14px, 4vw, 28px);
  text-align: center;
}
header h1 {
  margin: 0;
  font: clamp(1.6rem, 3vw + 1rem, 2.6rem) / 1.2 system-ui, -apple-system, "Segoe UI", Roboto, Arial;
  letter-spacing: .2px;
  color: var(--text);
  text-shadow: 0 1px 0 rgba(0,0,0,.25);
}
@media (prefers-color-scheme: light) {
  header h1 { color: #0b1020; text-shadow: none; }
}

/* Main content area */
main { padding: 0 clamp(16px, 4vw, 40px); flex: 1 1 auto; display: block; }

/* Article / Image frame styling */
.image-frame {
  width: min(92vw, 720px);
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(120, 255, 180, 0.38);
  background: rgba(2,6,20,0.25);
  box-shadow: 0 8px 26px rgba(0,0,0,.35);
}
.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(1.05);
  transform: translateZ(0); /* GPU hint for smoothness */
}
@media (max-width: 640px) {
  .image-frame { width: 94vw; aspect-ratio: 4 / 3; }
}

/* Product ad / footer sections as glass panels */
.product-ad, .sponsored-page {
  display: block;
  width: min(720px, 92%);
  margin: 1rem auto;
  text-align: center;
}
.product-ad a, .sponsored-page a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .9rem 1.2rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--text);
  background: linear-gradient(135deg, rgba(0,0,0,.25), rgba(0,0,0,.05));
  border: 1px solid rgba(120, 255, 180, 0.48);
  transition: transform .25s ease, background .25s ease;
}
.product-ad a:hover, .sponsored-page a:hover { transform: translateY(-1px); background: rgba(120,255,180,.25); }
.product-ad p, .sponsored-page p { margin: 0; font-weight: 600; }

/* Content area inside sections (for consistency) */
.content { padding: 0.75rem 0; color: var(--text); }

/* Link and button styling (accessibility: focus-visible) */
a, button, .btn, .cta {
  outline: none;
  color: var(--text);
  text-decoration: none;
  transition: color .2s ease, background .2s ease, transform .2s ease;
}
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, .btn:focus-visible, .cta:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}
button, .btn, .cta {
  font: inherit;
  background: rgba(0,0,0,.15);
  border: 1px solid rgba(120, 255, 180, 0.45);
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
}
.btn, .cta { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; }
.btn.primary {
  background: linear-gradient(135deg, rgba(0,0,0,.0), rgba(0,0,0,.0)),
              rgba(0, 0, 0, 0.0);
  color: var(--text);
  border-color: rgba(170, 255, 180, 0.9);
  padding: 12px 18px;
  border-radius: 999px;
}
.btn:hover { transform: translateY(-1px); }
.cta {
  padding: 10px 16px;
  border: 1px solid rgba(170, 255, 180, 0.65);
  background: rgba(0,0,0,.15);
  border-radius: 999px;
}
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* List styling (ul / li) */
ul { padding-left: 1.25rem; margin: .5rem 0; }
li { margin: .25rem 0; }

/* Card / Tag utilities */
.card {
  background: rgba(14, 20, 40, 0.28);
  border: 1px solid rgba(120, 255, 180, 0.38);
  border-radius: 12px;
  padding: 12px;
}
.tag {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  color: #041012;
  background: linear-gradient(135deg, rgba(170,255,210,.95), rgba(0,0,0,.0));
  border: 1px solid rgba(170,255,210,.8);
}

/* Responsive typography (fluid scale) */
h1, h2, h3, h4 { line-height: 1.25; }

/* Print styles (basic readability) */
@media print {
  body { background: #fff; color: #000; }
  a { color: #000; text-decoration: underline; }
  .glass { background: #fff; border: 1px solid #000; }
  .image-frame { border: 1px solid #000; }
}

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

/* Light-mode variant for legibility when user prefers light schemes */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f8fb;
    --bg-2: #eef4ee;
    --text: #0b1020;
    --muted: #2b5a2b;
    --surface: rgba(255,255,255,0.88);
    --surface-2: rgba(255,255,255,0.72);
    --border: rgba(60, 120, 60, 0.25);
  }
  body {
    background:
      linear-gradient(#f7f9f7 0%, #eef4ee 100%);
    color: var(--text);
  }
  .glass {
    background: rgba(255,255,255,.92);
    border-color: rgba(0,0,0,.12);
    box-shadow: 0 6px 18px rgba(0,0,0,.08);
    backdrop-filter: blur(6px);
  }
}