:root {
  /* Palette: midnight blue base with retro teal accents */
  --bg: #0a1020;
  --bg-2: #0b1a2b;
  --bg-3: #0e2030;
  --surface: rgba(14, 26, 46, 0.42);
  --glass: rgba(12, 24, 44, 0.28);
  --glass-border: rgba(110, 240, 240, 0.42);
  --text: #eaffff;
  --muted: #9bd6d6;
  --accent: #14e3b0;
  --accent-2: #2ff0d9;
  --card: rgba(18, 28, 52, 0.42);
  --shadow: 0 6px 20px rgba(0,0,0,.25);
  --focus: 3px solid #a2fff0;
  --ink: #001212;
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; }
html { font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans", "Liberation Sans", sans-serif; }
body {
  margin: 0;
  color: var(--text);
  background: 
    linear-gradient(135deg, rgba(10,16,32,.95), rgba(10,16,32,.92) 60%, rgba(9,15,33,.95)),
    linear-gradient(to bottom, rgba(6,12,28,.25), rgba(6,12,28,.25)),
    var(--bg);
  /* Subtle CSS noise/scanline (pure CSS) */
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 100% 2px, 2px 100%;
  background-blend-mode: overlay;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  isolation: isolate;
}

/* Backdrop glass panels with fallback */
header,
main,
footer,
article,
aside {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 1rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
@supports not (backdrop-filter: blur(12px)) {
  header,
  main,
  footer,
  article,
  aside { background: rgba(8,16,32,0.72); }
}

/* Utilities */
.container {
  width: 100%;
  max-width: clamp(320px, 92vw, 1120px);
  margin-inline: auto;
  padding-inline: 1rem;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.card {
  background: rgba(0,0,0,0.15);
  border: 1px solid rgba(120,240,255,.35);
  border-radius: 12px;
  padding: 0.75rem;
}
.tag {
  display: inline-block;
  padding: 0.25em 0.5em;
  border-radius: 999px;
  font-size: 0.75rem;
  color: #05201a;
  background: rgba(20, 180, 160, 0.4);
  border: 1px solid rgba(120,240,255,0.5);
}

/* Image frame styling */
.image-frame {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(120,240,255,0.5);
  box-shadow: 0 8px 20px rgba(0,0,0,.25);
}
.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: translateZ(0);
}

/* Core typography and layout */
.content {
  color: #eaffff;
  max-width: 65ch;
  margin-inline: auto;
  padding: 0.75rem 0;
  line-height: 1.6;
}
h1, h2, h3 {
  line-height: 1.15;
  margin: 0.25rem 0 0.5rem;
  color: var(--text);
}
h1 { font-size: clamp(1.75rem, 2.2vw + 1rem, 3.25rem); letter-spacing: .2px; text-shadow: 0 0 8px rgba(20, 240, 180, .35); }
h2 { font-size: clamp(1.25rem, 1.4vw + .8rem, 2rem); margin-top: .75rem; }
h3 { font-size: 1.1rem; margin-top: .5rem; }

/* Hero pattern emphasis for header title area */
header {
  padding: 1.25rem;
  margin: 1rem auto;
  max-width: clamp(320px, 90vw, 1100px);
}
header h1 {
  font-weight: 700;
  font-size: clamp(1.8rem, 4vw + .6rem, 3.5rem);
  margin: .25rem 0 0.5rem;
}
.meta {
  color: var(--muted);
  font-size: clamp(0.9rem, 0.9vw, 1.05rem);
  margin-top: 0.25rem;
}

/* Main article styling */
main { padding: 0.5rem 0 1rem; }
article { display: block; padding: 0.75rem; }

/* Paragraphs and lists */
p {
  color: #e9feff;
  margin: 0.75rem 0;
}
ul {
  padding-left: 1.25rem;
  margin: 0.75rem 0;
}
li { margin: 0.4rem 0; }

/* Links and focus states (AA accessible) */
a {
  color: var(--accent-2);
  text-decoration: none;
}
a:hover, a:focus {
  text-decoration: underline;
}
a:focus-visible {
  outline: var(--focus);
  outline-offset: 4px;
  text-decoration: underline;
}
button,
.btn,
.cta {
  font: inherit;
  border: 1px solid rgba(110,240,240,0.6);
  background: rgba(20, 180, 160, 0.22);
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
  display: inline-block;
}
.btn { background: rgba(20, 180, 160, 0.28); color: #fff; border-color: rgba(110,240,240,0.6); }
.btn--solid { background: var(--accent); border-color: rgba(255,255,255,.25); color: #001312; text-shadow: 0 1px 0 rgba(0,0,0,.1); }
.btn--outline {
  background: transparent;
  border-color: rgba(120,240,255,0.8);
  color: #eaffff;
}
.cta { padding: 0.75rem 1.1rem; }
.btn:hover, .cta:hover { transform: translateY(-1px); background: rgba(20,180,160,0.34); }
.btn:active, .cta:active { transform: translateY(0); }

/* Focus visuals for keyboard users on interactive elements */
button:focus-visible,
a:focus-visible,
.btn:focus-visible,
.cta:focus-visible {
  outline: 3px solid #a2fff0;
  outline-offset: 2px;
  border-color: #a2fff0;
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Product ad block styling (footer) */
.product-ad {
  text-align: center;
  padding: 1rem;
  border-radius: 12px;
  background: rgba(12, 28, 52, 0.28);
  border: 1px solid rgba(120,240,255,0.45);
  margin: 0.5rem 0 1rem;
}
.product-ad p { margin: 0.25rem 0 0; }

/* Footer tweaks */
footer { padding: 1rem; text-align: center; color: var(--muted); }

/* Image fallback handling for environments without image support */
img { display: block; max-width: 100%; height: auto; }

/* Print styles for readability */
@media print {
  body { background: #fff; color: #000; }
  a { text-decoration: underline; color: #000; }
  header, main, footer { background: #fff; border: none; box-shadow: none; }
}
