html, body, header, nav, main, article, footer, aside {
  /* base layout primitives to ensure predictable rendering */
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
  color: var(--text, #e8eaff);
  background: transparent;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  line-height: 1.6;
  scroll-behavior: smooth;
  background: 
    linear-gradient(135deg, rgba(8,8,20,.95) 0%, rgba(6,4,20,.95) 60%, rgba(8,0,20,.95) 100%),
    radial-gradient(circle at 25% 0%, rgba(70,0,140,.25), transparent 40%),
    radial-gradient(circle at 85% 25%, rgba(0,80,180,.25), transparent 40%);
  background-blend-mode: normal, overlay, overlay;
  position: relative;
}

:root {
  /* tokenized palette derived from indigo + maroon accents */
  --bg: #0b0b14;
  --bg-2: #0a0f1a;
  --text: #eaf0ff;
  --muted: #a6a6b6;
  --surface: rgba(18, 12, 40, 0.42);
  --card: rgba(18, 10, 40, 0.38);
  --card-strong: rgba(18, 10, 40, 0.58);
  --accent: #5b6bff;       /* indigo */
  --accent-2: #a4002b;     /* maroon accent for focus rings */
  --glow: 0 8px 24px rgba(0,0,0,.4);
  --shadow: 0 8px 28px rgba(0,0,0,.35);
}

html:focus-within { outline: none; }

body::before,
body::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; }

body::before {
  /* subtle CSS-only circuitry-like noise/scanlines */
  background-image:
    repeating-linear-gradient(to bottom, rgba(255,255,255,.04) 0 1px, transparent 1px 2px),
    repeating-linear-gradient(to right, rgba(255,255,255,.03) 0 1px, transparent 1px 2px);
  mix-blend-mode: overlay;
  opacity: .65;
  z-index: 0;
}

body::after {
  /* gentle vignette to deepen the cyberpunk mood */
  background: radial-gradient(circle at 50% 40%, rgba(0,0,0,.10), transparent 40%);
  mix-blend-mode: overlay;
  opacity: .6;
  z-index: 0;
}

header, main, footer, aside {
  position: relative;
  z-index: 1;
}

/* Glass panels with graceful fallback */
.glass {
  background: rgba(18, 12, 40, 0.28);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 14px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

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

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

.card {
  background: var(--card);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 6px 16px rgba(0,0,0,.25);
  transition: transform .15s ease, background .2s ease;
}
.card:hover { transform: translateY(-2px); background: var(--card-strong); }

/* Header styling with clear hierarchy */
header {
  padding: 1.25rem 1rem;
  text-align: center;
  background: linear-gradient(to bottom right, rgba(12,8,40,.55), rgba(8,6,28,.55));
  border-bottom: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
header h1 {
  font-size: clamp(1.4rem, 2.6vw, 2.25rem);
  line-height: 1.15;
  margin: .25rem 0 0.25rem;
  color: #f6f7ff;
  letter-spacing: .2px;
}
header .meta {
  color: var(--muted);
  font-size: clamp(0.9rem, 0.8vw, 1rem);
  margin-top: .25rem;
}
nav {
  margin-top: .6rem;
}
nav a {
  color: #eaf0ff;
  background: rgba(91,107,255,.25);
  border: 1px solid rgba(91,107,255,.4);
  padding: .35rem .75rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
}
nav a:hover, nav a:focus-visible {
  text-decoration: underline;
  outline: none;
  background: rgba(91,107,255,.35);
}
nav a:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
}

/* Main content)
*/ 
main {
  padding: 1rem 0 2rem;
}

article {
  max-width: clamp(320px, 90vw, 900px);
  margin-inline: auto;
  padding: 0 0.5rem;
  color: var(--text);
  line-height: 1.6;
}
.featured-image {
  margin: .75rem 0 1rem;
}
.image-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.28);
  background: rgba(0,0,0,.15);
  display: block;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04), var(--shadow);
}
.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .25s ease;
}
.image-frame:hover img {
  transform: scale(1.02);
}

h2 {
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  margin: 1.25rem 0 .5rem;
  color: #f6f6ff;
}
p { margin: .6rem 0 1rem; color: #e7eaff; }
ol, ul { margin: .5rem 0 1rem 1.25rem; padding: 0; }
li { margin: .25rem 0; }

/* Content area (class-based for API compatibility) */
.content { color: var(--text); }

/* Sections in footer as product-ad blocks and layout */
footer {
  padding: 1rem 0 2rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  align-items: stretch;
  place-items: stretch;
}
.product-ad, .sponsored-page {
  display: block;
}
.product-ad a, .sponsored-page a {
  display: block;
  text-decoration: none;
  color: #fff;
  padding: 1rem;
  border-radius: 12px;
  background: rgba(18, 12, 40, 0.38);
  border: 1px solid rgba(255,255,255,.25);
  text-align: center;
  transition: transform .15s ease, background .2s ease;
}
.product-ad a:hover { transform: translateY(-2px); background: rgba(18,12,40,.5); }
.product-ad a:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

/* Links, buttons, and CTAs styling */
a, button, .btn, .cta {
  color: var(--text);
  text-decoration: none;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(91,107,255,.25);
  padding: .5rem 0.9rem;
  font-weight: 600;
  display: inline-block;
  cursor: pointer;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; }

.btn, .cta {
  background: rgba(91,107,255,.25);
  border: 1px solid rgba(91,107,255,.5);
}
.btn:hover, .cta:hover { background: rgba(91,107,255,.45); transform: translateY(-1px); }
.btn:active, .cta:active { transform: translateY(0); }

/* Focus treatment for keyboard users on interactive elements */
:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
  border-radius: 10px;
}

/* Lists: ensure good contrast and readability on glass */
ul, ol {
  padding-left: 1.25rem;
}
li { margin: .25rem 0; }

/* Utility: subtle tag chips (for possible mentions) */
.tag {
  display:inline-block;
  padding: .15em .5em;
  border-radius: 999px;
  font-size: .8rem;
  background: rgba(91,107,255,.25);
  color: #eaf0ff;
  border: 1px solid rgba(91,107,255,.5);
}

/* Print-friendly adjustments */
@media print {
  body::before, body::after { display: none; }
  header, nav, footer { background: transparent; }
  .image-frame { page-break-inside: avoid; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { text-decoration: underline; }
  body { color: #000; background: #fff; }
}

/* Desktop refinements */
@media (min-width: 900px) {
  header { padding: 1.75rem 1.25rem; }
  article { padding: 0 0; }
  .container { padding-inline: 0; }
  footer { grid-template-columns: 1fr 1fr; }
}

/* Reduced motion accessibility */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .image-frame img { transform: none !important; }
}