/* Base tokens  */
:root {
  --bg: #0b0f14;
  --bg-2: #11161c;
  --bg-3: #1a232a;
  --text: #e8f4ff;
  --muted: #a7b2c0;
  --accent: #4af0ff;
  --accent-2: #66e0ff;
  --card: rgba(18,22,32,.6);
  --card-2: rgba(16,20,28,.5);
  --border: rgba(255,255,255,.28);
  --shadow: 0 8px 28px rgba(0,0,0,.35);
  --radius: 14px;
  --focus: 0 0 0 3px rgba(100, 240, 255, .65);
}

/* Global */
* { box-sizing: border-box; }
html { box-sizing: border-box; }
html, body { height: 100%; }
html { font-size: clamp(14px, 0.9vw + 12px, 18px); }
body {
  margin: 0;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Inter, Arial, sans-serif;
  line-height: 1.5;
  background: radial-gradient(circle at 20% 15%, rgba(20,24,32,.92) 0 22%, rgba(10,12,14,.96) 60%, rgba(4,6,8,.98) 100%), 
              linear-gradient(135deg, #0b0f14 0%, #0b0f14 60%, #111522 100%);
  background-attachment: fixed;
  isolation: isolate;
  overflow-x: hidden;
  z-index: 0;
}
html, body { -webkit-font-smoothing: antialiased; }

body:before {
  /* subtle scanlines / noise overlay (pure CSS) */
  content: "";
  position: fixed;
  inset: 0;
  background: 
    repeating-linear-gradient(to bottom, rgba(255,255,255,.04) 0 1px, transparent 1px 2px),
    radial-gradient(circle at 50% 0%, rgba(0,0,0,.0), rgba(0,0,0,.15) 60%);
  mix-blend-mode: overlay;
  opacity: .35;
  pointer-events: none;
  z-index: 0;
}
@media (prefers-reduced-motion: reduce) {
  body:before { display: none; }

  * { transition: none !important; animation: none !important; }
}

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

/* Glass panels (with fallback) */
.glass {
  background: rgba(12,16,22,.28);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  padding: 1rem;
}
@supports not (backdrop-filter: blur(10px)) {
  .glass { background: rgba(12,16,22,.6); border-color: rgba(255,255,255,.45); }
}

/* Page structure styling */
header, main, footer, aside {
  padding: 1rem;
}
header {
  text-align: center;
  padding-top: 1.5rem;
}
header h1 {
  font-size: clamp(1.6rem, 1.5vw + 1rem, 2.6rem);
  line-height: 1.08;
  margin: 0 0 .25rem;
}
header .meta {
  color: var(--muted);
  font-size: .95rem;
}
nav a {
  display: inline-block;
  padding: .5rem 1rem;
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.04);
}
nav a:focus-visible { outline: none; box-shadow: var(--focus); }

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

/* Image handling */
.image-frame, .featured-image {
  width: 100%;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.25);
  box-shadow: 0 6px 18px rgba(0,0,0,.28);
  background: #000;
}
.image-frame { aspect-ratio: 16 / 9; }
.image-frame img, .featured-image img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.featured-image { margin: .75rem 0 0; }

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

/* Text styles for content hierarchy */
h2 { font-size: clamp(1.4rem, 0.9vw + 1rem, 2.2rem); margin: .75rem 0; }
h3 { font-size: clamp(1.1rem, 0.8vw + .8rem, 1.5rem); margin: .75rem 0; }
p { color: var(--muted); margin: .5rem 0 1rem; }
blockquote {
  margin: 1rem 0;
  padding: .75rem 1rem;
  border-left: 3px solid rgba(100, 240, 255, .75);
  color: var(--text);
  background: rgba(2,6,12,.25);
  border-radius: 6px;
}
ul, ol { padding-left: 1.25rem; margin: .25rem 0 1rem; color: var(--muted); }
li { margin: .25rem 0; }

/* Glossary/inline accents */
.tag {
  display: inline-block;
  padding: .25em .5em;
  font-size: .75rem;
  border-radius: 999px;
  background: rgba(100, 240, 255, .15);
  color: var(--text);
  border: 1px solid rgba(100,240,255,.4);
}

/* Links & buttons (interactive) */
a, button, .btn, .cta {
  font-family: inherit;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}
a:focus-visible, button:focus-visible, .btn:focus-visible, .cta:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}
a { color: var(--accent-2); }
a:hover { text-decoration: underline; }

/* Buttons (solid and outline variants) */
.btn {
  display: inline-block;
  padding: .65rem 1.05rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.55);
  background: linear-gradient(135deg, rgba(0, 210, 255, .95), rgba(0, 130, 210, .95));
  color: #041018;
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 6px 14px rgba(0,0,0,.25);
  transition: transform .2s ease, box-shadow .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); box-shadow: 0 4px 10px rgba(0,0,0,.25); }
.btn.outline {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(125,235,255,.75);
}
.cta { /* alias for call-to-action semantics */ }

/* Utility grid & cards (responsive) */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.card {
  background: var(--card);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 12px;
  padding: 1rem;
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* Footer / ads sections (glass-like blocks) */
footer {
  padding-top: .75rem;
  display: grid;
  gap: .75rem;
  grid-template-columns: 1fr;
}
.product-ad, .sponsored-page {
  padding: 0;
}
.product-ad a, .sponsored-page a {
  display: block;
  padding: 1rem;
  border-radius: 12px;
  color: var(--text);
}
.product-ad {
  background: rgba(16,20,28,.28);
  border: 1px solid rgba(255,255,255,.25);
  text-align: center;
}
.sponsored-page {
  background: rgba(16,20,28,.28);
  border: 1px solid rgba(255,255,255,.25);
  text-align: center;
}
footer p { margin: .5rem 0 0; color: var(--muted); }

/* Print styles for readability */
@media print {
  body { background: white; color: black; }
  a { color: black; text-decoration: underline; }
  header, main, footer { padding: 0; }
  .glass, .product-ad, .sponsored-page { background: transparent; border: none; box-shadow: none; }
}

/* Accessibility/contrast helpers for glass content over dark backgrounds */
@media (prefers-contrast: more) {
  :root { --text: #eaf7ff; --muted: #c2d0e0; }
}
