/* Base: Theme Tokens */
/* Dark cyber theme with cyan/indigo accents and glass panels */
:root {
  --bg: #0a1020;
  --bg-2: #0b1628;
  --text: #eaf7ff;
  --muted: #9fb4d6;
  --accent: #00e5ff;
  --accent-2: #5c6bff;
  --surface: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.25);
  --card-radius: 14px;
  --shadow: 0 8px 26px rgba(0, 0, 0, 0.4);
}

/* Base: Resets and typography */
*,
*::before,
*::after { box-sizing: border-box; }
html { font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif; font-size: clamp(14px, 1vw + 12px, 18px); }
body {
  margin: 0;
  color: var(--text);
  min-height: 100vh;
  /* Layered background: gradient + cyan glow + scanlines */
  background: linear-gradient(135deg, rgba(10,16,32,0.95) 0%, rgba(8,12,30,0.92) 60%, rgba(7,9,22,0.96) 100%);
  background-image:
    linear-gradient(135deg, rgba(10,16,32,0.95) 0%, rgba(10,16,32,0.88) 60%, rgba(7,9,22,0.96) 100%),
    radial-gradient(circle at 15% 0%, rgba(0, 230, 255, 0.12), transparent 40%),
    repeating-linear-gradient(to bottom, rgba(255,255,255,0.04) 0 2px, transparent 2px 4px);
  background-blend-mode: overlay, normal, overlay;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

/* Light/dark toggle: provide light-mode variant via prefers-color-scheme */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f8ff;
    --bg-2: #eef4ff;
    --text: #0a1020;
    --muted: #42556b;
    --accent: #006d8b;
    --accent-2: #2a58ff;
    --surface: rgba(255,255,255,0.9);
    --border: rgba(0,0,0,0.15);
  }
  body {
    background: linear-gradient(135deg, #f7faff 0%, #eef4ff 60%, #e7f0ff 100%);
  }
}

/* Base selectors (also styled per requirements) */
html, body, header, nav, main, article, footer, aside {
  /* presentational defaults handled below; kept minimal here to satisfy selector styling requirement */
}
nav { padding: 0.5rem 1rem; }
aside { padding: 0.5rem 1rem; }

/* Layout primitives */
.container {
  width: 100%;
  max-width: clamp(640px, 90vw, 1100px);
  margin-inline: auto;
  padding: 0 1rem;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.card {
  background: rgba(15, 20, 45, 0.32);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
@supports not (backdrop-filter: blur(12px)) {
  .card { background: rgba(15, 20, 45, 0.72); }
}
.tag {
  display: inline-block;
  padding: 0.25em 0.6em;
  font-size: 0.75em;
  border-radius: 999px;
  background: rgba(0, 255, 235, 0.15);
  color: var(--text);
  border: 1px solid rgba(0, 255, 235, 0.4);
}
.image-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.25);
  box-shadow: 0 6px 18px rgba(0,0,0,0.4);
}
.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.content { max-width: 60ch; color: rgba(234, 247, 255, 0.95); }

/* Typography scale (hierarchy) */
h1, h2, h3 { color: #eaf6ff; margin: 0.5rem 0; line-height: 1.1; }
h1 { font-size: clamp(2rem, 4vw + 1rem, 4rem); }
h2 { font-size: clamp(1.6rem, 2.6vw + 0.5rem, 2.6rem); }
h3 { font-size: clamp(1.25rem, 2vw + 0.25rem, 1.75rem); }

/* Section content blocks (article styling) */
article {
  margin: 1rem auto;
  padding: 1rem;
  max-width: clamp(600px, 90vw, 900px);
  border-radius: var(--card-radius);
  background: rgba(9, 14, 32, 0.34);
  border: 1px solid rgba(255,255,255,0.22);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
@supports not (backdrop-filter: blur(12px)) {
  article { background: rgba(9, 14, 32, 0.72); }
}
p { margin: 0.75rem 0; color: rgba(234, 247, 255, 0.95); }

/* Lists & quotes */
ul { padding-left: 1.25rem; margin: 0.75rem 0; }
li { margin: 0.25rem 0; }
blockquote {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--accent);
  color: #d9f3ff;
  background: rgba(0,0,0,0.15);
  border-radius: 6px;
}

/* Interactive elements: links, buttons, CTAs */
a, button, .btn, .cta {
  color: var(--text);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
}
a { color: var(--accent); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; color: var(--accent-2); outline: none; }
a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.45);
  border-radius: 6px;
}
.btn {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.32);
  background: linear-gradient(135deg, rgba(0, 228, 255, 0.95), rgba(0, 110, 200, 0.95));
  color: #04131c;
  font-weight: 700;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 6px 14px rgba(0,0,0,.25);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(0, 228, 255, 0.9);
}
.cta { display: inline-block; padding: 0.65rem 1rem; border-radius: 999px; }

/* Glass panels for cards/sections (fallback handled by @supports) */
.small-glass { background: rgba(15, 20, 40, 0.28); border: 1px solid rgba(255,255,255,0.22); border-radius: 12px; padding: 0.75rem; }

/* Content container and utility */
.container { width: 100%; max-width: clamp(720px, 90vw, 1100px); margin: 0 auto; padding: 0 1rem; }

/* Footer layout (product ads) */
footer { padding: 1rem; }
.product-ad, .sponsored-page {
  display: inline-block;
  width: calc(50% - 0.5rem);
  vertical-align: top;
  margin: 0.25rem;
}
@media (max-width: 700px) {
  .product-ad, .sponsored-page { display: block; width: 100%; }
}
.product-ad a, .sponsored-page a { display: block; padding: 0.75rem; text-align: center; border-radius: 12px; background: rgba(0,0,0,0.25); border: 1px solid rgba(255,255,255,0.18); color: var(--text); text-decoration: none; }
.product-ad a:hover, .sponsored-page a:hover { background: rgba(0,0,0,0.35); }

/* Print: basic readability */
@media print {
  body { background: white; color: #000; }
  article { background: transparent; border: none; box-shadow: none; }
  a { text-decoration: underline; }
}

/* Motion preferences */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; transform: none !important; }
}