/* Base Tokens */
:root {
  --bg: #0a0f1a;
  --bg-2: #0b1a30;
  --text: #e8f0ff;
  --muted: #a8c3ff;
  --surface: rgba(12, 18, 40, 0.22);
  --surface-2: rgba(12, 18, 40, 0.28);
  --accent: #2ea6ff;
  --accent-2: #5bd6ff;
  --border: rgba(100, 170, 255, 0.38);
  --glass-shadow: 0 6px 20px rgba(0,0,0,0.4);
  --shadow-soft: 0 8px 28px rgba(0,0,0,0.4);
}

/* Light mode variant */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f9ff;
    --bg-2: #e8f0ff;
    --text: #0b1a2a;
    --muted: #2c4a8c;
    --surface: rgba(255, 255, 255, 0.75);
    --surface-2: rgba(255, 255, 255, 0.85);
    --border: rgba(20, 80, 180, 0.55);
    --glass-shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-soft: 0 4px 14px rgba(0,0,0,0.08);
  }
}

/* Base resets & layout helpers */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
html { font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial; }
body {
  margin: 0;
  color: var(--text);
  min-height: 100dvh;
  line-height: 1.5;
  /* Layered background: gradient + subtle scanlines + vignette */
  background-color: var(--bg);
  background-image:
    linear-gradient(135deg, rgba(6,12,32,0.92) 0%, rgba(6,12,32,0.92) 60%, rgba(0,0,0,0.95) 100%),
    repeating-linear-gradient(to bottom, rgba(255,255,255,0.04) 0 1px, transparent 1px 2px),
    radial-gradient(circle at 20% 0%, rgba(0,120,255,0.12), transparent 30%);
  background-blend-mode: normal, overlay, normal;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Containers & helpers */
.container { width: 100%; max-width: clamp(320px, 92vw, 1100px); margin-inline: auto; padding-inline: 1rem; }

/* Section wrappers */
header, main, footer { padding: 1rem; }
header { text-align: center; padding-block: 2rem; }
header h1 { font-size: clamp(1.75rem, 3vw + 1rem, 3rem); margin: 0 0 .25rem; letter-spacing: .4px; }
header .meta { color: var(--muted); font-size: clamp(0.9rem, 1vw + 0.4rem, 1.05rem); }

/* Hero / content layout */
main { padding: 0; }
article { padding: 0; }

/* Glass panels (fallbacks included) */
article section {
  background: rgba(12,18,40,0.22);
  border: 1px solid rgba(100,170,255,0.38);
  border-radius: 12px;
  padding: 1rem;
  margin: .75rem 0;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--glass-shadow);
}
@supports not (backdrop-filter: blur(12px)) {
  article section { background: rgba(12,18,40,0.75); border-color: rgba(100,170,255,0.6); }
}
.image-frame { /* dedicated frame utility for images */ 
  width: 100%; 
  aspect-ratio: 16/9; 
  overflow: hidden; 
  border-radius: 12px; 
  border: 1px solid rgba(120,170,255,0.38);
  box-shadow: 0 6px 18px rgba(0,120,255,0.25);
}
.image-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Featured image fallback container (matches usage in HTML) */
.featured-image { width: 100%; max-width: 900px; margin: 1rem auto; }

/* Typography rhythm */
h2 { font-size: clamp(1.4rem, 2.5vw + 1rem, 2.2rem); margin: .75rem 0; }

/* Lists */
ul { padding-left: 1.25rem; margin: .5rem 0; }
li { margin: .25rem 0; color: var(--muted); }

/* Content text styling within sections */
section p { margin: .5rem 0; color: var(--text); }

/* Links & CTAs */
a, button, .btn, .cta {
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, color .2s ease;
}
a { color: var(--accent); }
a:hover { text-decoration: underline; text-decoration-color: var(--accent-2); }
a:focus-visible, button:focus-visible, .btn:focus-visible, .cta:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Button variants */
.btn, .cta {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  border: 1px solid rgba(60,180,255,0.9);
  background: linear-gradient(to bottom right, rgba(50,120,255,0.95), rgba(20,60,150,0.95));
  font-weight: 600;
}
.btn.outline, .cta.outline {
  background: transparent;
  border: 1px solid rgba(60,180,255,0.95);
  color: var(--accent);
}
.btn:active, .cta:active { transform: translateY(1px) scale(0.99); }

/* Grid & utility cards */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.card {
  background: rgba(12,18,40,0.22);
  border: 1px solid rgba(100,170,255,0.38);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: var(--shadow-soft);
}
.tag {
  display: inline-block;
  padding: .25em .6em;
  font-size: .8em;
  border-radius: 999px;
  border: 1px solid rgba(100,170,255,0.6);
  color: var(--text);
  background: rgba(20,60,120,0.28);
}

/* Image & media tweaks */
.image-frame, .featured-image { margin: 0 auto; }

/* Footer product ads (glass panels) */
.product-ad, .sponsored-page {
  margin: .5rem 0;
  padding: .75rem;
  text-align: center;
}
.product-ad a, .sponsored-page a { display: block; color: var(--text); }

/* Lists & decorative separators on sections if needed */
section + section { border-top: 1px solid rgba(100,170,255,0.25); padding-top: 1rem; }

/* Print styles (basic readability) */
@media print {
  body { background: #fff; color: #000; }
  a { text-decoration: underline; color: #000; }
}
  
/* Motion preferences */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; transform: none !important; }
}