/* Layout tokens */
:root {
  --bg: #041027;
  --bg-2: #0b1b2b;
  --surface: rgba(7, 14, 28, 0.72);
  --surface-2: rgba(7, 14, 28, 0.50);
  --text: #e9fbff;
  --muted: #a6b8c9;
  --accent: #2ee6d6;
  --accent-2: #1bd4c8;
  --card: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.25);
  --shadow: 0 12px 28px rgba(0,0,0,.38);
  --radius: 14px;
  --focus: 2px solid var(--accent);
}

/* Global resets and base typography (mobile-first) */
* { box-sizing: border-box; }
html, body { height: 100%; }
html { font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
body {
  margin: 0;
  color: var(--text);
  background: 
    /* teal starfield hints */
    radial-gradient(circle at 15% 35%, rgba(0, 255, 210, .40) 0 2px, transparent 2px),
    radial-gradient(circle at 70% 60%, rgba(0, 255, 200, .35) 0 2px, transparent 2px),
    linear-gradient(135deg, #041027 0%, #051428 60%, #041b2b 100%);
  background-size: 60px 60px, 70px 70px, cover;
  background-attachment: fixed;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Subtle CSS noise/scanlines */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}
body::before {
  /* faint stars */
  background-image:
    radial-gradient(circle at 1px 1px, rgba(0,255,210,.9) 1px, transparent 1px),
    radial-gradient(circle at 20px 40px, rgba(0,255,210,.6) 1px, transparent 1px);
  background-size: 2px 2px, 40px 40px;
  opacity: .9;
  mix-blend-mode: screen;
}
body::after {
  /* subtle scanlines */
  background: repeating-linear-gradient(to bottom,
    rgba(255,255,255,.04) 0 1px,
    transparent 1px 2px);
  opacity: .6;
  mix-blend-mode: overlay;
}

/* Global helpers / utilities */
.container {
  width: 100%;
  max-width: clamp(320px, 90vw, 1100px);
  margin-inline: auto;
  padding-inline: 1rem;
}
.grid { display: grid; gap: 1rem; }
.card { padding: 1rem; border-radius: var(--radius); background: var(--card);
  border: 1px solid var(--border); box-shadow: var(--shadow); }
.tag {
  display: inline-block;
  font-size: .75rem;
  padding: .15em .6em;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.25);
  color: var(--text);
  background: rgba(2,6,23,.32);
}
.content { max-width: 900px; margin: 0 auto; padding: 0 1rem; }

/* Glass panel fallback strategy */
.glass {
  background: rgba(6, 12, 28, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 8px 28px rgba(0,0,0,.25);
  border-radius: 14px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
@supports not (backdrop-filter: blur(12px)) {
  .glass { background: rgba(6,12,28,0.32); }
}

/* Global typography scale (fluid) */
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5rem; color: var(--text); }
h1 { font-size: clamp(1.6rem, 1.6rem + 2vw, 3.4rem); }
h2 { font-size: clamp(1.25rem, 1.25rem + 1vw, 1.75rem); }
h3 { font-size: clamp(1rem, 0.9rem + .5vw, 1.2rem); }
p { font-size: clamp(0.95rem, 0.9rem + .4vw, 1.15rem); line-height: 1.6; color: var(--text); margin: .5rem 0 1rem; }

/* Links and buttons (AA accessible focus) */
a, button, .btn, .cta {
  transition: color .15s ease, background .15s ease, transform .15s ease;
  text-decoration: none; color: var(--accent);
}
a:hover, a:focus { text-decoration: underline; color: var(--accent-2); outline: none; }
button, .btn, .cta {
  border: 0;
  border-radius: 999px;
  padding: .65rem 1rem;
  cursor: pointer;
}
:focus-visible { outline: var(--focus); outline-offset: 2px; border-radius: 8px; }

/* Button variants */
.btn { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #04161a; font-weight: 600; }
.btn.secondary { background: rgba(255,255,255,.08); color: var(--text); border: 1px solid rgba(255,255,255,.25); }

/* Layout for header / nav / main / article / footer */
header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .6rem;
  padding: 2rem 1rem;
  margin: 1rem auto;
  width: min(1100px, 92vw);
  border-radius: 16px;
  background: rgba(5, 10, 28, 0.6);
  border: 1px solid rgba(255,255,255,.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
header nav {
  display: flex;
  gap: .5rem;
}
header nav a {
  color: var(--accent);
  padding: .4rem .75rem;
  border-radius: 999px;
  border: 1px solid rgba(46,230,216,.5);
  background: rgba(2,6,23,.25);
}
header nav a:hover { text-decoration: none; }

/* Main content area */
main { padding: 1.5rem 1rem; }
article { max-width: 900px; margin: 0 auto; }

/* Image frame styling (supporting class) */
.image-frame, .featured-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.25);
  box-shadow: 0 8px 20px rgba(0,0,0,.25);
  background: #06121e;
}
.image-frame img, .featured-image img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Footer / ad sections */
footer {
  padding: 1.5rem;
  text-align: center;
  color: var(--muted);
  background: rgba(4, 8, 20, 0.6);
  border-top: 1px solid rgba(255, 255, 255, .15);
  backdrop-filter: blur(6px);
}
footer .product-ad, footer .sponsored-page { margin: .25rem 0; }
footer .product-ad a, footer .sponsored-page a {
  display: block;
  padding: .9rem;
  border-radius: 10px;
  background: rgba(2,6,23,.42);
  color: var(--text);
  border: 1px solid rgba(46,230,216,.6);
  text-align: left;
}
footer p { margin: .5rem 0 0; }

/* Utility layout helpers for content sections */
@media (min-width: 640px) {
  .grid.cols-2 { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 900px) {
  main { padding: 2rem 1.25rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Print styles (basic readability) */
@media print {
  body { background: #fff; color: #000; }
  header, nav, footer { display: none; }
  article { display: block; width: 100%; }
}
