/* Base tokens */
:root {
  --bg: #0a0f15;
  --bg-2: #0b1a28;
  --text: #eaf6ff;
  --muted: #a9c6ff;
  --accent: #4aa3ff;       /* blue accent */
  --accent-2: #ff7a1a;     /* orange accent */
  --surface: rgba(255, 255, 255, 0.08);
  --surface-2: rgba(255, 255, 255, 0.12);
  --border: rgba(255, 255, 255, 0.25);
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.32);
  --shadow-soft: 0 6px 20px rgba(0, 0, 0, 0.25);
  --focus: 2px solid rgba(74, 163, 255, 0.95);
  --focus-offset: 2px;
}

/* Light mode tweaks for readability */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f9ff;
    --bg-2: #eef4ff;
    --text: #0b1020;
    --muted: #3b4a8a;
    --surface: rgba(0, 0, 0, 0.08);
    --surface-2: rgba(0, 0, 0, 0.1);
    --border: rgba(0, 0, 0, 0.12);
  }
  body {
    background: linear-gradient(135deg, #f8faff 0%, #eef4ff 60%), #fff;
  }
  body::before { opacity: 0.25; }
}

/* Layered background: gradient + subtle scanlines/noise (CSS) */
html, body { height: 100%; }
html, body, header, nav, main, article, aside, section, footer { display: block; }
html, body {
  box-sizing: border-box;
}
*, *::before, *::after { box-sizing: inherit; }

html, body {
  margin: 0;
  padding: 0;
  color: var(--text);
  background: linear-gradient(135deg, rgba(10,12,18,.95) 0%, rgba(8,14,28,.95) 60%), 
              radial-gradient(circle at 20% 0%, rgba(74,163,255,.15), transparent 40%), 
              radial-gradient(circle at 80% 10%, rgba(255,122,26,.15), transparent 40%), 
              var(--bg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100dvh;
  position: relative;
  isolation: isolate;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,.04) 0 2px, transparent 2px 4px);
  pointer-events: none;
  mix-blend-mode: overlay;
  opacity: 0.6;
  z-index: 0;
}
@media (prefers-color-scheme: light) {
  body::before { opacity: 0.25; }
}

/* Glass panel (frosted glass) with fallback */
.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
}
@supports not (backdrop-filter: blur(12px)) {
  .glass { background: rgba(255,255,255,.14); }
}

/* Layout primitives */
html, body, header, nav, main, article, aside, footer {
  scroll-margin-top: 0;
}
.container {
  width: 100%;
  max-width: clamp(320px, 92vw, 1100px);
  margin-inline: auto;
  padding-inline: 1rem;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: var(--shadow);
}
.tag {
  display: inline-block;
  font-size: .75rem;
  padding: .15rem .5rem;
  border-radius: 999px;
  background: rgba(74,163,255,.25);
  color: #e8f2ff;
  border: 1px solid rgba(74,163,255,.5);
}

/* Core page structure styling */
header {
  padding: 2rem 1rem;
  text-align: center;
  position: relative;
  z-index: 1;
}
header h1 {
  margin: 0 0 .25rem;
  font-family: inherit;
  font-weight: 800;
  font-size: clamp(2rem, 4vw + 1rem, 3.5rem);
  line-height: 1.05;
  letter-spacing: .2px;
  color: var(--text);
}
header .meta {
  margin: 0;
  font-size: clamp(0.95rem, 0.6vw + 0.6rem, 1.05rem);
  color: var(--muted);
}
main {
  padding: 0 0 2rem;
}
article {
  padding: 0;
  max-width: clamp(420px, 90vw, 760px);
  margin-inline: auto;
}
.featured-image { margin: 1rem 0 0; }
.image-frame {
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.25);
  box-shadow: 0 12px 28px rgba(0,0,0,.25);
}
.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(1.05);
}
h2 {
  font-size: clamp(1.5rem, 2.5vw + 1rem, 2.5rem);
  margin: 1rem 0 0.25rem;
  color: var(--text);
}
p {
  color: var(--muted);
  font-size: clamp(1rem, 1vw + .65rem, 1.125rem);
  line-height: 1.55;
  margin: 0 0 1rem;
}
ul {
  padding-left: 1.25rem;
  margin: .75rem 0;
  color: var(--text);
}
li { margin: .25rem 0; }

/* Section styling (glass panels for content blocks) */
.product-ad, .sponsored-page {
  display: inline-block;
  padding: .75rem 1rem;
  text-align: center;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 12px;
  transition: transform .2s ease;
}
.product-ad a, .sponsored-page a { color: var(--text); text-decoration: none; display: inline-block; width: 100%; }
.product-ad:hover, .sponsored-page:hover { transform: translateY(-2px); }

/* Typography and links */
a, button, .btn, .cta {
  font-family: inherit;
  color: #eaffff;
  text-decoration: none;
  border: 0;
  background: none;
  cursor: pointer;
}
a { color: var(--accent); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; color: var(--accent-2); }
a:focus-visible, button:focus-visible, .btn:focus-visible, .cta:focus-visible {
  outline: none;
  outline: var(--focus);
  outline-offset: var(--focus-offset);
}
.btn {
  display: inline-block;
  padding: .75rem 1.25rem;
  border-radius: 999px;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,.3);
  background: linear-gradient(135deg, var(--accent) 0%, #1a7bd6 100%);
  color: #061224;
  transition: transform .15s ease, background .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary {
  /* explicit class for clarity if used in markup */
}
.cta {
  display: inline-block;
  padding: .65rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(74,163,255,.6);
  color: var(--text);
  background: rgba(74,163,255,.15);
}
.cta:hover { background: rgba(74,163,255,.25); }

/* Image treatment for accessibility / contrast on glass */
img[alt] {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Layout helpers */
@media (min-width: 768px) {
  main { padding: 1rem 0 2rem; }
}
@media (prefers-color-scheme: dark) {
  /* Ensure high contrast in dark contexts (additional tweaks if needed) */
  :root { --border: rgba(255,255,255,.28); }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .btn, .cta { transition: none; }
}

/* Print styles (basic readability) */
@media print {
  body { background: #fff; color: #000; }
  .glass, .product-ad, .sponsored-page { background: #fff !important; border: none; box-shadow: none; }
}
