/* Palette & Foundations */
:root {
  --bg: #050812;
  --bg-2: #0b1220;
  --text: #e8fbff;
  --muted: #86f2c7;
  --accent: #00e5ff;
  --accent-2: #7cffb2;
  --glass: rgba(10, 14, 28, 0.22);
  --glass-strong: rgba(10, 14, 28, 0.28);
  --glass-border: rgba(110, 255, 230, 0.28);
  --shadow: 0 10px 28px rgba(0,0,0,.28);
  --radius: 14px;
  --container: clamp(320px, 88vw, 1100px);
  --focus: 2px solid var(--accent);
}

html, body {
  height: 100%;
  color: var(--text);
  background: linear-gradient(135deg, rgba(0, 140, 255, 0.14), rgba(0, 255, 170, 0.14) 60%), linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  isolation: isolate;
  line-height: 1.5;
}

/* Layered background: subtle noise/scanlines */
html, body {
  background-image:
    radial-gradient(circle at 20% -10%, rgba(0, 230, 255, 0.08), transparent 25%),
    repeating-linear-gradient(to bottom, rgba(255,255,255,0.04) 0 1px, transparent 1px 2px);
  background-blend-mode: screen, overlay;
  background-size: cover;
}

/* Scanline overlay for neon cyberpunk vibe */
body::before {
  content: "";
  position: fixed;
  z-index: -1;
  left: 0; right: 0; top: 0; bottom: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.08) 2px,
    rgba(0, 0, 0, 0.08) 4px
  );
  pointer-events: none;
  mix-blend-mode: overlay;
  opacity: 0.25;
}

@media (prefers-reduced-motion: reduce) {
  html, body {
    background-attachment: scroll;
  }
  body::before { display: none; }
}

/* Layout primitives */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 1rem;
}

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

.card {
  background: rgba(15, 20, 40, 0.28);
  border: 1px solid rgba(110, 255, 230, 0.28);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.tag {
  display: inline-block;
  padding: 0.15em 0.5em;
  font-size: 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 230, 255, 0.6);
  color: var(--text);
  background: rgba(0, 230, 255, 0.15);
}

/* Typography scale (responsive, fluid) */
h1, h2, h3, h4 {
  margin: 0.25rem 0 0.25rem;
  line-height: 1.15;
  font-weight: 700;
  color: var(--text);
}
h1 {
  font-size: clamp(1.75rem, 2.6vw + 1rem, 3.25rem);
  text-shadow: 0 0 16px rgba(0, 229, 255, 0.35);
}
h2 {
  font-size: clamp(1.15rem, 1.6vw + 0.6rem, 1.8rem);
  color: var(--accent);
}
p, li {
  font-size: clamp(14px, 1.2vw + 0.5rem, 18px);
  color: #eafcff;
}
ol { padding-left: 1.25rem; margin: 0.5rem 0; }
ul { padding-left: 1.25rem; margin: 0.25rem 0 0.75rem; }

/* Section content layout */
main {
  display: block;
}
article {
  padding: 1rem;
  margin: 0 auto;
  max-width: calc(var(--container) + 0px);
}
.featured-image {
  margin: 0.75rem 0 1rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(110, 255, 230, 0.32);
  box-shadow: 0 6px 22px rgba(0,0,0,.25);
}
.image-frame {
  aspect-ratio: 16 / 9;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(120, 255, 230, 0.4);
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
}
.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(1.05);
}
.meta {
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
  margin-top: 0.25rem;
}

/* Glass panels (with fallback) */
.glass {
  background: rgba(15, 20, 40, 0.2);
  border: 1px solid rgba(110, 255, 230, 0.28);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 6px 22px rgba(0,0,0,.25);
}
@supports (backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px)) {
  .glass {
    background: rgba(15, 20, 40, 0.14);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
}
@supports not ((backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px))) {
  .glass {
    background: rgba(15, 20, 40, 0.24);
  }
}

/* Links, buttons, CTA variants (focus/hover states) */
a, button, .btn, .cta {
  color: var(--text);
  text-decoration: none;
  border: 1px solid rgba(0, 230, 255, 0.6);
  padding: 0.55em 1em;
  border-radius: 999px;
  display: inline-block;
  transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s;
}
a:hover, a:focus {
  text-decoration: underline;
  color: #eaffff;
  border-color: rgba(0, 255, 230, 0.9);
}
button, .btn, .cta {
  background: var(--accent);
  border: none;
  color: #001018;
  font-weight: 600;
  cursor: pointer;
}
.btn.secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn:hover, .cta:hover {
  transform: translateY(-1px);
}
:focus-visible {
  outline: 3px solid rgba(0, 229, 255, 0.9);
  outline-offset: 2px;
  border-radius: 6px;
}
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
}
nav a {
  color: var(--text);
}
header {
  padding: 1.25rem;
  text-align: center;
}
header h1 {
  font-size: clamp(1.4rem, 2.8vw + 0.8rem, 2.6rem);
  margin: 0.25rem 0 0.25rem;
}
header .meta {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.9rem;
  letter-spacing: .04em;
  color: #b8fff0;
  opacity: .95;
}

/* Footer & sponsor blocks */
footer {
  margin-top: 2rem;
  padding: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  align-items: stretch;
}
.product-ad, .sponsored-page {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.75rem;
}
.product-ad a, .sponsored-page a {
  color: var(--text);
  text-decoration: none;
}
.product-ad {
  background: rgba(6, 14, 32, 0.34);
  border: 1px solid rgba(120, 255, 230, 0.28);
  border-radius: 12px;
}
.sponsored-page {
  background: rgba(6, 14, 32, 0.28);
  border: 1px solid rgba(110, 255, 230, 0.28);
  border-radius: 12px;
}
footer p {
  margin: 0;
  text-align: center;
  width: 100%;
  grid-column: 1 / -1;
  color: #b9f6ff;
  font-size: 0.92rem;
  opacity: 0.95;
}

/* Print accessibility (basic readability) */
@media print {
  html, body {
    background: #fff;
    color: #000;
  }
  a, a:visited { color: #000; text-decoration: underline; }
  .glass { background: #fff; border: 1px solid #ccc; }
  footer { display: none; }
}
