/* Section: Tokens & Theme */
:root {
  --bg: #0b1020;
  --bg-2: #081428;
  --text: #eaf6ff;
  --muted: #a5c8e6;
  --accent: #00e5ff;
  --accent-2: #1bd7ff;
  --panel: rgba(6, 14, 28, 0.28);
  --panel-strong: rgba(6, 14, 28, 0.42);
  --border: rgba(120, 210, 255, 0.4);
  --shadow: 0 8px 20px rgba(0,0,0,.25);
  --radius: 14px;
  --text-on-glass: #e9f4ff;
}
html, body { height: 100%; }
* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  color: var(--text);
  background: transparent;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Inter", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Section: Layered galaxy background (gradient + subtle noise/scanlines) */
body {
  position: relative;
  min-height: 100%;
  background: linear-gradient(135deg, rgba(4,12,32,.95) 0%, rgba(6,12,28,.95) 60%, rgba(0,6,20,.95) 100%);
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  /* faint cyan starscape accents */
  background-image:
    radial-gradient(circle at 20px 40px, rgba(0, 210, 255, .25) 0 2px, transparent 3px),
    radial-gradient(circle at 120px 80px, rgba(0, 180, 255, .20) 0 2px, transparent 3px),
    radial-gradient(circle at 260px 120px, rgba(0, 200, 255, .18) 0 2px, transparent 3px);
  background-size: 60px 60px, 90px 90px, 120px 120px;
  mix-blend-mode: screen;
  opacity: .55;
  filter: saturate(120%);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  /* subtle scanlines to hint at a digital horizon */
  background-image:
    repeating-linear-gradient( transparent 0 1px, rgba(0,0,0,.08) 1px 2px ),
    repeating-linear-gradient( 90deg, transparent 0 2px, rgba(0,0,0,.04) 2px 4px );
  opacity: .25;
  pointer-events: none;
  mix-blend-mode: overlay;
  animation: scroll-lines 60s linear infinite;
}
@keyframes scroll-lines { to { transform: translateX(-2px); } }

/* Section: Layout primitives */
html, body, header, nav, main, article, aside, section, footer {
  display: block;
}
:where(*) { box-sizing: border-box; }

/* Section: Core layout helpers */
.container {
  max-width: clamp(320px, 70rem, 1100px);
  margin-inline: auto;
  padding-inline: 1rem;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem;
  box-shadow: var(--shadow);
}
.tag {
  display: inline-block;
  padding: .25rem .5rem;
  border-radius: 999px;
  font-size: .75rem;
  border: 1px solid rgba(120,210,255,.5);
  background: rgba(0, 170, 255, .15);
  color: var(--text);
}

/* Section: Glass panels (frosted glass) with fallback */
header, main, footer {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: 0 8px 28px rgba(0,0,0,.25);
  backdrop-filter: saturate(110%) blur(12px);
  -webkit-backdrop-filter: saturate(110%) blur(12px);
}
@supports not (backdrop-filter: blur(1px)) {
  header, main, footer {
    background: rgba(6,12,28,.55);
  }
}
header { text-align: center; }
header h1 { margin: .25rem 0 .25rem; font-size: clamp(1.75rem, 2.8vw + 1rem, 3.75rem); line-height: 1.05; letter-spacing: .5px; color: var(--text-on-glass); }
header .meta { margin: .25rem 0 0; color: var(--muted); font-size: .95rem; }

/* Section: Page typography & sections */
h1, h2 { color: var(--text); }
h2 { font-size: clamp(1.25rem, 2vw + .75rem, 2rem); margin: .75rem 0 .5rem; }
p { color: var(--text); margin: 0 0 1rem; font-size: clamp(0.95rem, 1.2vw + .6rem, 1.15rem); }
ul { margin: 0 0 1rem; padding-left: 1.25rem; }
ul li { margin: .25rem 0; }

/* Section: Media & visuals */
.image-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(120,210,255,.5);
  box-shadow: 0 6px 18px rgba(0,0,0,.28);
  margin: .25rem 0 1rem;
}
.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.0);
  transition: transform .3s ease;
}
.image-frame:hover img { transform: scale(1.03); }

/* Section: Content blocks */
.content { padding: 0.25rem 0 0.25rem; }

/* Section: Product/ad blocks in footer-like area */
.product-ad, .sponsored-page {
  display: inline-block;
  width: 48%;
  min-width: 210px;
  margin: .25rem;
  text-align: center;
}
.product-ad a, .sponsored-page a { color: var(--text); text-decoration: none; display: inline-block; padding: .6rem 0; width: 100%; border-radius: 999px; border: 1px solid rgba(120,210,255,.6); background: rgba(0, 200, 255, .18); }
.product-ad a:hover, .sponsored-page a:hover, .product-ad a:focus-visible, .sponsored-page a:focus-visible {
  text-decoration: underline;
  outline: 0;
}
@media (max-width: 700px) {
  .product-ad, .sponsored-page { width: 100%; display: block; }
}

/* Section: Interactive elements (buttons & links) */
a, button, .btn, .cta {
  color: var(--text);
  text-decoration: none;
  border: 1px solid rgba(0, 226, 255, .6);
  background: transparent;
  padding: .55rem .9rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}
.btn, .cta {
  background: rgba(0, 226, 255, .25);
}
a:hover, a:focus-visible { text-decoration: underline; outline: none; }
.btn:hover, .cta:hover { transform: translateY(-1px); }
.btn:focus-visible, .cta:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.btn:active, .cta:active {
  transform: translateY(0);
  background: rgba(0, 226, 255, .35);
}

/* Section: Accessibility & motion */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
::selection { background: rgba(0, 230, 255, .4); }

/* Section: Forms (basic) */
input, textarea {
  background: rgba(255,255,255,.04);
  color: var(--text);
  border: 1px solid rgba(120,210,255,.5);
  border-radius: 8px;
  padding: .5rem;
  font: inherit;
}
input::placeholder, textarea::placeholder { color: rgba(200,230,255,.75); }

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

/* Section: Dark-mode baseline (default to cyber dark) */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7fbff;
    --bg-2: #eef6ff;
    --text: #0b2540;
    --muted: #4f5b72;
    --panel: rgba(255, 255, 255, 0.85);
    --panel-strong: rgba(255, 255, 255, 0.95);
    --border: rgba(12, 80, 160, 0.25);
  }
  body {
    background: linear-gradient(135deg, #fbfbff 0%, #eef4ff 60%, #e8f1ff 100%);
    color: var(--text);
  }
  body::before { opacity: .45; }
  header, main, footer {
    border-color: rgba(12, 80, 160, .25);
  }
  a, .btn, .cta { color: #003c7a; border-color: rgba(0, 100, 180, .6); background: rgba(0, 132, 255, .12); }
}
