/* Core palette & tokens */
:root {
  --bg: #0b0f1a;
  --bg-2: #0a1020;
  --text: #eaf3ff;
  --muted: #aabaf2;
  --accent: #d4a017;       /* gold */
  --accent-2: #4cc9f0;      /* cosmic blue */
  --card: rgba(18, 22, 40, 0.40);
  --card-2: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.25);
  --shadow: 0 8px 28px rgba(0,0,0,.32);
  --focus-ring: 0 0 0 3px rgba(100, 235, 255, 0.75);
  --radius: 12px;
  --radius-sm: 10px;
  --maxw: 1100px;
}

/* Global resets & accessibility */
*,
*::before,
*::after { box-sizing: border-box; }
html, body { height: 100%; }
html { font-size: 16px; }
body {
  margin: 0;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.5;
  background:
    radial-gradient(circle at 20% -10%, rgba(212,160,0,.15), transparent 40%),
    linear-gradient(135deg, rgba(212,160,0,.08), rgba(76,156,255,.08) 60%, rgba(0,0,0,.0) 100%),
    #0b0f1a;
  background-blend-mode: overlay, overlay, normal;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  isolation: isolate;
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Layered noise/scanlines (pure CSS) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to bottom, rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(to right, rgba(0,0,0,.04) 1px, transparent 1px);
  background-size: 100% 2px, 2px 100%;
  mix-blend-mode: overlay;
  opacity: .65;
}

/* Layout helpers (responsive) */
.container {
  width: 92%;
  max-width: clamp(320px, 90vw, var(--maxw));
  margin-inline: auto;
}
.grid {
  display: grid;
  gap: 1rem;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px) saturate(1.15);
}

/* Page structure styling */
html, body, header, nav, main, article, footer, aside {
  /* ensure structural selectors are styled for consistency */
}
header {
  text-align: center;
  padding: 2rem 0 1rem;
}
header h1 {
  margin: 0.25rem 0 0.5rem;
  font-weight: 700;
  font-size: clamp(1.8rem, 1.2rem + 2.5vw, 3.2rem);
  line-height: 1.05;
  letter-spacing: .3px;
}
header .meta {
  color: var(--muted);
  font-size: 0.92rem;
}
nav {
  margin-top: .5rem;
}
nav a {
  color: var(--accent-2);
  text-decoration: none;
  padding: .35rem .6rem;
  border-radius: 6px;
}
nav a:hover { text-decoration: underline; }

/* Featured image (legacy class names also supported) */
.image-frame,
.featured-image {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(0,0,0,.25);
}
.image-frame { aspect-ratio: 16/9; }
.image-frame img,
.featured-image img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
main {
  padding: 0 0 2rem;
}
article {
  display: block;
  padding: 0;
}
.content { padding: 0; }

/* Text content & typography */
h2 { font-size: clamp(1.4rem, 0.8rem + 1.4vw, 2.2rem); margin: .75rem 0 0.5rem; }
h3 { font-size: clamp(1.125rem, 0.6rem + .9vw, 1.5rem); margin: .75rem 0 .5rem; }
p { margin: .5rem 0 1rem; color: #eaf3ffcc; }
ul { margin: .5rem 0 1rem 1.25rem; padding: 0; }
li { margin: .25rem 0; }
blockquote {
  margin: 1rem 0; padding: .75rem 1rem;
  border-left: 4px solid var(--accent-2);
  background: rgba(9,12,22,.45);
  border-radius: 8px;
  color: #eaf3ff;
}
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.cta:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-color: rgba(255,255,255,.8);
}
a:hover { text-decoration: underline; }

/* Utility & interactive controls */
.content a, .content button, .content .btn, .content .cta {
  transition: transform .15s ease, background .15s ease, color .15s ease;
}
a, button, .btn, .cta {
  cursor: pointer;
}
a {
  color: var(--accent-2);
}
.btn,
.cta {
  display: inline-block;
  padding: .65rem 1rem;
  border-radius: 9px;
  border: 1px solid rgba(255,255,255,.4);
  text-decoration: none;
  color: #00131a;
  background: linear-gradient(135deg, rgba(255,255,255,.9), rgba(255,255,255,.75));
  font-weight: 600;
}
.btn:hover,
.cta:hover { transform: translateY(-1px); }
.btn.primary {
  color: #021018;
  background: linear-gradient(135deg, #4cc9f0 0%, #0b3d63 100%);
  border: 1px solid rgba(255,255,255,.6);
}
.btn.outline {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.4);
  color: var(--text);
}
.btn:focus-visible,
.cta:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* Product-ad blocks in footer (glass panels) */
.product-ad,
.sponsored-page {
  display: block;
  padding: .5rem 0;
}
.product-ad a,
.sponsored-page a {
  text-decoration: none;
}
.product-ad p,
.sponsored-page p {
  margin: 0;
  padding: .5rem 0;
}
footer {
  padding: 1.5rem 0 2rem;
  text-align: center;
  background: rgba(2,6,23,.25);
  border-top: 1px solid rgba(255,255,255,.08);
}
footer p { color: var(--muted); }

/* Layout helpers for sections that use grid/cols (where relevant) */
.grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.tag {
  display: inline-block;
  padding: .2em .5em;
  border-radius: 999px;
  font-size: .8rem;
  border: 1px solid rgba(255,255,255,.4);
  background: rgba(255,255,255,.08);
  color: var(--text);
}

/* Print styles (basic readability) */
@media print {
  body { background: #fff; color: #000; }
  a { color: #000; text-decoration: underline; }
}
