:root {
  /* Palette: navy base + sage green accents with glassy surfaces */
  --bg: #0b1220;
  --bg-2: #0a1b2b;
  --text: #e8f7f3;
  --muted: #a5b8c4;
  --accent: #6bd98a;        /* sage green */
  --accent-2: #1e4a7a;      /* navy-leaning for links */
  --surface: rgba(14, 24, 40, 0.28);
  --surface-2: rgba(8, 14, 28, 0.40);
  --glass-border: rgba(255, 255, 255, 0.28);
  --shadow: 0 12px 28px rgba(0,0,0,0.28);
  --focus: 3px solid rgba(107, 217, 138, 0.95);
  --radius: 14px;
}

html, body {
  height: 100%;
}

html {
  color-scheme: dark;
}

:where(html, body) {
  /* Layered, mobile-friendly rendering base */
  margin: 0;
  padding: 0;
  background:
    /* subtle scanlines */
    repeating-linear-gradient(to bottom,
      rgba(255,255,255,0.04) 0 1px,
      transparent 1px 3px),
    /* soft sage glow over navy */
    radial-gradient(circle at 20% 0%, rgba(107,217,138,0.08), transparent 40%),
    linear-gradient(135deg, #0b1020 0%, #0a1730 40%, #041028 100%);
  color: var(--text);
  min-height: 100dvh;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

header, nav, main, article, aside, footer {
  /* base stacking context for glass panels */
  display: block;
}

/* Layout helpers */
.container {
  width: min(92vw, 1200px);
  margin-inline: auto;
  padding: 1rem;
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.a11y {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Glass panels (fallback if backdrop-filter not supported) */
@supports not (backdrop-filter: blur(1px)) {
  .card,
  header,
  footer,
  .product-ad,
  .sponsored-page,
  .image-frame {
    background: rgba(14, 24, 40, 0.62);
    border: 1px solid rgba(255,255,255,0.42);
  }
}

header {
  text-align: center;
  padding: 1.75rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  background: rgba(6, 12, 28, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: relative;
  z-index: 2;
  margin-bottom: 1rem;
}

header h1 {
  font-size: clamp(1.25rem, 1.5rem + 1.5vw, 2.25rem);
  margin: 0.25rem 0 0.5rem;
  letter-spacing: .2px;
}

nav {
  margin-top: 0.25rem;
}

nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  border: 1px solid transparent;
}
nav a:hover,
nav a:focus-visible {
  text-decoration: underline;
  outline: none;
  background: rgba(255,255,255,0.08);
}
nav a:focus-visible {
  outline: var(--focus);
  outline-offset: 2px;
}

/* Main content */
main {
  padding: 0 1rem 1.5rem;
}

.image-frame {
  width: min(100%, 960px);
  aspect-ratio: 16 / 9;
  margin: 2rem auto;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.28);
  background: rgba(0,0,0,0.15);
  box-shadow: var(--shadow);
  display: block;
}

.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(1.05) contrast(1.02);
}

.content {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 0.5rem;
  color: var(--text);
  font-size: clamp(0.95rem, 0.9rem + 0.5vw, 1.05rem);
  line-height: 1.5;
  text-align: left;
}

/* Product/ad sections (footer) with glassy panels */
.product-ad, .sponsored-page {
  display: inline-block;
  width: calc(50% - 0.5rem);
  min-width: 240px;
  margin: 0.25rem;
  padding: 0.75rem;
  text-align: center;
  border-radius: 12px;
  background: rgba(14, 24, 40, 0.28);
  border: 1px solid rgba(255,255,255,0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.product-ad a, .sponsored-page a { color: var(--text); text-decoration: none; display: block; }
.product-ad p, .sponsored-page p { margin: 0; font-weight: 700; }

footer {
  padding: 1rem;
  text-align: center;
}

/* Links, buttons, CTAs */
a, button, .btn, .cta {
  color: inherit;
  text-decoration: none;
  font-family: inherit;
  font-weight: 600;
  border-radius: 999px;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
}
a.btn, a.cta, .btn, .cta { display: inline-flex; align-items: center; justify-content: center; padding: 0.75em 1.25em; border: 1px solid rgba(255,255,255,0.4); background: rgba(107,217,138,0.22); color: #eafaf1; }
a.btn:hover, a.cta:hover, .btn:hover, .cta:hover { transform: translateY(-1px); background: rgba(107,217,138,0.32); }
a.btn:focus-visible, a.cta:focus-visible, .btn:focus-visible, .cta:focus-visible {
  outline: var(--focus);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(107, 217, 138, 0.25) inset;
}
a { color: var(--accent-2); }
a:focus-visible { text-decoration: underline; }

/* Tags */
.tag {
  display: inline-block;
  padding: 0.25em 0.6em;
  border-radius: 999px;
  font-size: 0.75rem;
  line-height: 1;
  background: rgba(107, 217, 138, 0.25);
  border: 1px solid rgba(107, 217, 138, 0.6);
  color: var(--text);
}

/* Lists */
ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
li { margin: 0; }

/* Print tweaks (basic readability) */
@media print {
  html, body {
    background: #fff;
    color: #000;
  }
  header, nav, main, footer {
    background: transparent !important;
  }
  .image-frame {
    page-break-inside: avoid;
  }
}

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