/* Base: token palette and resets */
:root {
  --bg: #0b0e1a;
  --bg-2: #1a0f2a;
  --surface: rgba(255, 255, 255, 0.08);
  --surface-2: rgba(255, 255, 255, 0.14);
  --text: #eaf6ff;
  --muted: #a5b6d9;
  --accent: #00e5ff;
  --accent-2: #7a5cff;
  --glass: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.25);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --radius: 14px;
  --focus: 2px solid var(--accent);
}

html, body, header, nav, main, article, footer, aside {
  box-sizing: border-box;
}

html, body { height: 100%; }
* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  line-height: 1.6;
  background: radial-gradient(circle at 20% 20%, rgba(0, 230, 255, 0.08) 0 40px, transparent 40px),
              radial-gradient(circle at 70% 60%, rgba(122, 92, 255, 0.08) 0 40px, transparent 40px),
              linear-gradient(135deg, #0b0b1a 0%, #0c0b1a 60%, #1a0f2a 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  position: relative;
}

/* Subtle layered starfield (pure CSS) with fallback for motion preference */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  /* star specks and glow layers */
  background-image:
    radial-gradient(circle at 15% 25%, rgba(0, 235, 255, 0.25) 0 1px, transparent 1px),
    radial-gradient(circle at 70% 60%, rgba(122, 60, 255, 0.25) 0 1px, transparent 1px),
    linear-gradient(135deg, rgba(8,6,20,.9), rgba(8,6,20,.6) 60%, rgba(0,0,0,.0) 100%);
  background-size: 100% 100%, 100% 100%, cover;
  background-blend-mode: screen, screen, normal;
  animation: starfield 60s linear infinite;
  filter: saturate(1.2);
}
@keyframes starfield {
  0% { transform: translate3d(0,0,0); background-position: 0 0, 0 0, 0 0; }
  100% { transform: translate3d(-40px, 0, 0); background-position: -200px 0, 150px 0, 0 0; }
}

/* Layout helpers */
.container {
  width: min(92%, 1100px);
  margin-inline: auto;
  padding-inline: 1rem;
}

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
@supports not (backdrop-filter: blur(12px)) {
  .card { background: rgba(255,255,255,.08); }
}

.image-frame {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.25);
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
  background: #000;
}
.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  aspect-ratio: 16 / 9;
  /* subtle glow edge */
  filter: saturate(1.05);
  outline: 1px solid rgba(0,0,0,0.0);
}
.content { padding: 0; color: var(--text); }

/* Typography scale (responsive, fluid) */
h1, h2, h3, h4 {
  line-height: 1.15;
  margin: 0 0 0.5rem;
  font-weight: 700;
}
h1 { font-size: clamp(1.75rem, 3vw + 1rem, 3rem); letter-spacing: .2px; }
h2 { font-size: clamp(1.25rem, 2.5vw + 0.5rem, 2.25rem); }
h3 { font-size: clamp(1.05rem, 2vw + 0.3rem, 1.4rem); color: #dfeaff; }

/* Structural sections */
header, main, footer, aside { padding: 1rem 0; }
header { padding-block: 1.25rem; }

.meta { color: var(--muted); font-size: clamp(0.8rem, 0.9vw, 0.95rem); margin: 0; }

/* Section-specific styling */
featured-image, .featured-image { display: block; width: 100%; margin: 0 0 1rem; }
.featured-image { border-radius: 12px; overflow: hidden; }

/* Glass panels for sections where applicable */
.product-ad {
  display: block;
  text-align: center;
  padding: .75rem;
  border-radius: 12px;
  background: rgba(0,0,0,.25);
  border: 1px solid rgba(255,255,255,.25);
  color: var(--text);
  text-decoration: none;
}
.product-ad a { color: var(--text); text-decoration: none; display: block; }

/* Links & typography accessibility */
a { color: var(--accent); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; outline: none; color: var(--accent-2); }
:focus-visible {
  outline: var(--focus);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Buttons and interactive controls */
button, .btn, .cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .6rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.35);
  background: rgba(0,0,0,.28);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
  font-family: inherit;
  transition: transform .15s ease, background .2s ease, border-color .2s;
}
button:where(:hover, :focus-visible),
.btn:where(:hover, :focus-visible),
a.btn:focus-visible, .cta:focus-visible {
  outline: none;
  transform: translateY(-1px);
}
.btn:hover { background: rgba(0,0,0,.38); }
.btn:active { transform: translateY(0); }
.btn--outline {
  background: transparent;
  border: 1px solid rgba(0, 235, 255, .8);
  color: var(--text);
}
.btn--outline:hover { background: rgba(0, 235, 255, .12); }

/* Compact focus ring for keyboard users on interactive elements */
:focus-visible { outline-offset: 2px; }

/* Lists and typography tweaks for lists */
ul, li { margin: 0.25rem 0; padding: 0 0 0 1.25rem; color: var(--muted); }
ol { padding-left: 1.25rem; margin: 0.25rem 0; }

/* Tag utility */
.tag {
  display: inline-block;
  padding: .15rem .55rem;
  font-size: .75rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(0,0,0,.25);
  color: var(--text);
}

/* Print styles: basic readability */
@media print {
  body { background: white; color: black; }
  a { color: black; text-decoration: underline; }
  .card { background: #fff; border: 1px solid #ddd; box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Sectioning content alignment on narrow screens */
main { padding: 0 0.5rem; }
@media (min-width: 768px) {
  main { padding-inline: 0; }
}
header h1 { max-width: 72ch; }

/* Ensure selectors in the spec are styled even if not present in markup */
.content, .product-ad, .image-frame, .image-frame img, ul, li, a, button, .btn, .cta, .container, .grid, .card, .tag {
  /* reserved for consistency across pages using these classes/selectors */
}