/* Base tokens */
:root{
  --bg: #0a0f2a;           /* deep blue/void base */
  --bg-2: #0b1a3a;
  --text: #e9f1ff;
  --muted: #a6b7d9;
  --accent: #3aa8ff;        /* cyber blue */
  --accent-2: #7a4bd8;      /* void purple accent */
  --glass: rgba(14, 20, 60, 0.22);
  --glass-border: rgba(120, 140, 255, 0.40);
  --shadow: 0 8px 24px rgba(0,0,0,.25);
  --radius: 14px;
}

html, body { height: 100%; }
* { box-sizing: border-box; }
html { font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial; }

/* Layered background: gradient + tile pattern + subtle scanlines */
body {
  margin: 0;
  color: var(--text);
  background-color: var(--bg);
  min-height: 100vh;
  position: relative;
  line-height: 1.55;
  background-image:
    linear-gradient(135deg, rgba(19,96,198,.40), rgba(60,18,80,.60)),
    linear-gradient(45deg, rgba(35, 70, 140, .25) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(35, 70, 140, .25) 25%, transparent 25%),
    repeating-linear-gradient(to bottom, rgba(255,255,255,.04) 0 1px, transparent 1px 2px);
  background-size: 60px 60px, 60px 60px, 60px 60px, auto;
  background-position: 0 0, 30px 30px, -30px -30px, 0 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image:
    repeating-linear-gradient(to bottom, rgba(255,255,255,.04) 0 1px, transparent 1px 2px);
  opacity: .25;
  mix-blend-mode: overlay;
}

/* Layout helpers */
.container {
  width: 100%;
  max-width: clamp(640px, 86vw, 1100px);
  margin-inline: auto;
  padding-inline: 1rem;
}

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

.card {
  background: rgba(14, 22, 60, 0.40);
  border: 1px solid rgba(120, 140, 255, 0.40);
  border-radius: 12px;
  padding: 0.75rem;
  box-shadow: var(--shadow);
}

/* Glass panels (frosted look) with fallback */
.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 1rem;
}
@supports not (backdrop-filter: blur(12px)) {
  .glass { background: rgba(14, 22, 60, 0.72); }
}

/* Typography scale (fluid) */
h1, h2, h3 {
  line-height: 1.15;
  margin: 0 0 .5rem;
}
h1 { font-size: clamp(1.75rem, 1.2rem + 2.5vw, 3.25rem); letter-spacing: .2px; }
h2 { font-size: clamp(1.25rem, 0.8vw + 1rem, 2.1rem); }
h3 { font-size: clamp(1.05rem, 0.6vw + .9rem, 1.4rem); color: #e7eaff; }

/* Core elements */
html, body, header, nav, main, article, footer, aside {
  /* structural selectors reset handled via layout rules below */
}
header, main, footer, aside {
  padding: 1rem;
}
nav { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }

/* Header / hero styling */
header {
  display: grid;
  gap: .5rem;
  align-items: start;
  justify-items: center;
  padding: 1.25rem;
  margin: 0 auto 1rem;
}
header h1 { text-align: center; margin-top: .25rem; }
header .meta { color: var(--muted); font-size: .95rem; }

/* Featured image frame */
.image-frame {
  aspect-ratio: 16 / 9;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(140, 160, 255, 0.45);
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  background: #0b0f1a;
}
.image-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Article content styling */
article {
  display: block;
  padding: 0.75rem;
}
article p { margin: .75rem 0; color: #eaf2ff; }
article ul { padding-left: 1.25rem; margin: .5rem 0 1rem; }
article li { margin: .25rem 0; }
blockquote {
  margin: .75rem 0; padding: .75rem 1rem;
  border-left: 4px solid var(--accent);
  color: #d7e4ff;
  background: rgba(18, 28, 64, 0.25);
  border-radius: 8px;
}
blockquote + p { margin-top: .25rem; }

/* Links and buttons */
a, button, .btn, .cta {
  text-decoration: none;
  color: var(--accent);
}
a:hover, a:focus { text-decoration: underline; color: var(--accent-2); }
a:focus-visible, button:focus-visible, .btn:focus-visible {
  outline: 3px solid rgba(120,160,255,.9);
  outline-offset: 2px;
}
.btn {
  display: inline-block;
  padding: .65rem .95rem;
  border-radius: 8px;
  border: 1px solid rgba(120,140,255,.6);
  background: linear-gradient(135deg, rgba(58,168,255,.95), rgba(122,75,216,.95));
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.btn--outline {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(120,140,255,.6);
}
.btn + .btn { margin-left: .5rem; }

/* Utility chips / tags */
.tag {
  display: inline-block;
  padding: .25em .6em;
  font-size: .75rem;
  border-radius: 999px;
  background: rgba(60,120,255,.25);
  border: 1px solid rgba(120,140,255,.5);
  color: var(--text);
}

/* Product ad / sponsored blocks in footer */
.product-ad, .sponsored-page {
  display: block;
  text-align: center;
}
.product-ad a, .sponsored-page a {
  display: block;
  padding: .75rem;
  border-radius: 10px;
  background: rgba(15, 26, 70, 0.5);
  border: 1px solid rgba(120, 140, 255, 0.5);
  color: var(--text);
}
.product-ad a:hover, .sponsored-page a:hover { text-decoration: underline; }

/* Footer layout (grid on wide viewports) */
footer {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  margin-top: 1rem;
}
@media (min-width: 720px) {
  footer { grid-template-columns: 1fr 1fr; align-items: stretch; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Content helpers (existing HTML may not use these, but included for completeness) */
.content { padding: .5rem 0; }

/* Print styles */
@media print {
  body { background: white; color: #000; }
  a { color: #00f; text-decoration: underline; }
}
