/* Base Tokens */
:root{
  --bg: #060b14;
  --bg-2: #0b1320;
  --surface: rgba(9, 22, 32, 0.6);
  --surface-2: rgba(9, 22, 32, 0.28);
  --text: #e9fff8;
  --muted: #b5d6d0;
  --accent: #2FFFBF;      /* seafoam */
  --accent-2: #FF4D4D;     /* red/red-pink accent */
  --border: rgba(255,255,255,0.28);
  --shadow: 0 6px 20px rgba(0,0,0,.25);
  --radius: 14px;
  --radius-sm: 10px;
  --focus: 3px solid var(--accent-2);
}

/* Global / Reset */
* { box-sizing: border-box; }
html, body { height: 100%; }
html { font-size: 16px; }
body {
  margin: 0;
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial;
  line-height: 1.5;
  background: linear-gradient(135deg, #071019 0%, #0a1220 60%, #0a1220 100%);
  position: relative;
  isolation: isolate;
  min-height: 100%;
}
body::before {
  /* subtle galaxy starscape glow */
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 15% 20%, rgba(40,255,210,.15) 0 8%, transparent 25%),
              radial-gradient(circle at 75% 50%, rgba(255,40,60,.10) 0 8%, transparent 25%),
              radial-gradient(circle at 50% 0%, rgba(0,0,0,.0) 0 60%, rgba(0,0,0,.25) 60% 100%);
  z-index: 0;
  pointer-events: none;
  mix-blend-mode: screen;
}
body::after {
  /* CSS scanlines for subtle texture */
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    repeating-linear-gradient(to bottom, rgba(255,255,255,.05) 0 1px, transparent 1px 2px);
  background-size: 100% 2px;
  opacity: .25;
  pointer-events: none;
  z-index: 0;
  mix-blend-mode: overlay;
}

/* Layout helpers */
.container {
  width: 100%;
  max-width: clamp(28rem, 78vw, 1100px);
  padding-inline: 1rem;
  margin-inline: auto;
  position: relative;
  z-index: 1;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255,255,255,.28);
  border-radius: var(--radius);
  padding: 1rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0,0,0,.28); }

/* Glass surfaces with fallback */
.glass {
  background: rgba(9, 20, 28, 0.22);
  border: 1px solid rgba(255,255,255,.28);
  border-radius: var(--radius);
  padding: 1rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
@supports not ((backdrop-filter: blur(12px)) or (-webkit-backdrop-filter: blur(12px))) {
  .glass { background: rgba(9,20,28,0.42); }
}

/* Structure selectors (required) */
html, body, header, nav, main, article, footer, aside {
  /* ensure baseline behavior; use to anchor theme */
  color-scheme: dark;
}
header {
  padding: 1.25rem;
  margin: 1rem auto;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(6,20,28,.50), rgba(6,20,28,.28) 60%);
  border: 1px solid rgba(255,255,255,.28);
  text-align: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
}
header h1 {
  margin: 0 0 .25rem;
  font-size: clamp(1.6rem, 3vw + 1rem, 2.8rem);
  line-height: 1.04;
  letter-spacing: .2px;
}
header .meta {
  margin: 0;
  font-size: clamp(0.75rem, 1.2vw, 0. nine?); /* fallback-safe value */
}
main { padding: 1rem 0 2rem; }

/* Featured image framing (support both provided and common variants) */
.image-frame,
.featured-image {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.28);
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
  display: block;
}
.image-frame img,
.featured-image img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}
.image-frame { aspect-ratio: 16 / 9; }

/* Content areas */
.content {
  color: var(--text);
  padding: 0.5rem 0;
}
h2, h3 { color: #eaffff; }

/* Article body typography (fluid, accessible) */
p, li, blockquote {
  font-size: clamp(1rem, 0.6vw + 0.9rem, 1.125rem);
  line-height: 1.5;
  margin: 0 0 0.9rem;
}
ul, ol { padding-left: 1.25rem; margin: 0.75rem 0; }
li { margin: 0.25rem 0; }

/* Inline emphasis & blocks */
blockquote {
  margin: .75rem 0;
  padding: .5rem 1rem;
  border-left: 3px solid var(--accent);
  background: rgba(46, 94, 88, 0.25);
  border-radius: 6px;
}
.subtle { color: var(--muted); }

/* Links and buttons (interactive states) */
a, button, .btn, .cta {
  cursor: pointer;
  text-decoration: none;
  color: #fff;
  transition: transform .2s ease, background-color .2s ease, color .2s ease;
}
a { color: var(--accent); }
a:hover, a:focus { text-decoration: underline; text-underline-offset: 3px; color: #cafff0; }
:focus-visible { outline: var(--focus); outline-offset: 2px; border-radius: 6px; }

/* Button variants */
.btn {
  display: inline-block;
  padding: .65rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.5);
  background: linear-gradient(135deg, rgba(0,255,190,.95), rgba(0,180,140,.95));
  color: #041f15;
  font-weight: 600;
  text-shadow: 0 1px 0 rgba(255,255,255,.25);
}
.btn.secondary {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.45);
  color: #eaffff;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
}

/* Glassy CTAs in hero-like section and within layout */
.cta {
  display: inline-block;
  padding: .75rem 1.25rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.5);
  background: linear-gradient(135deg, rgba(255,77,77,.95), rgba(255,0,0,.95));
  color: #fff;
  font-weight: 700;
}
.cta.secondary {
  background: rgba(255,255,255,.12);
  color: #eaffff;
}
.cta:focus-visible { outline-offset: 2px; }

/* Product ad / sponsored blocks */
.product-ad, .sponsored-page {
  display: block;
  text-align: center;
  padding: .75rem;
}
.product-ad a, .sponsored-page a { display: block; text-decoration: none; padding: .5rem 0; color: #eaffff; }
.product-ad { background: rgba(8, 28, 34, 0.36); border: 1px solid rgba(255,255,255,.28); border-radius: var(--radius-sm); }

/* Footer layout for ads + copyright text */
footer { padding: 1rem 0; }
footer p { margin: .25rem 0; color: var(--muted); font-size: .92rem; text-align: center; }

/* Content grid utilities (compact) */
@media (min-width: 860px) {
  main { padding: 1.25rem 0; }
}
@media (prefers-color-scheme: light) {
  /* gentle light-mode fallback if user prefers it; maintains contrast */
  :root { --text: #072019; --muted: #526b7a; }
  body { background: #f7f7f7; }
}

/* Print styles (basic readability) */
@media print {
  body { background: #fff; color: #000; }
  a, a:link { text-decoration: underline; color: #000; }
  header, footer { display: none; }
  .container { max-width: 100%; padding: 0; }
  .card, .glass { background: #fff; border: 1px solid #ccc; }
}
  
/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}