/* Base palette tokens (scarlet + charcoal) */
:root{
  --bg: #0b0f14;
  --bg-2: #141a20;
  --text: #e9f0f7;
  --muted: #b5c5d4;
  --accent: #ff2a4a;
  --accent-2: #e0002a;
  --card: rgba(12,12,18,0.72);
  --glass-border: rgba(255,255,255,0.28);
  --shadow: 0 16px 40px rgba(0,0,0,0.5);
}

/* Global resets & base typography */
* { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-font-smoothing: antialiased; font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif; }
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  overflow-x: hidden;
  position: relative;
}

/* Layered, production-grade background: gradient + subtle noise/scanlines */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
}
body::before {
  /* starfield-ish speckles via subtle radial gradients + gradient wash */
  background-image:
    radial-gradient(circle at 15% 25%, rgba(255,255,255,0.18) 0 2px, transparent 2px),
    radial-gradient(circle at 70% 60%, rgba(255,0,60,0.14) 0 2px, transparent 2px),
    linear-gradient(135deg, rgba(10,10,12,0.9), rgba(20,20,22,0.92));
  background-size: 180px 180px, 160px 160px, cover;
  background-repeat: repeat;
  mix-blend-mode: screen;
  opacity: 0.95;
  filter: saturate(1.05);
}
body::after {
  /* subtle scanlines */
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,0.04) 0 1px, transparent 1px 2px);
  opacity: 0.25;
  z-index: -1;
}

/* Layout primitives (utilities) */
.container {
  width: 100%;
  max-width: clamp(680px, 90vw, 1100px);
  margin-inline: auto;
  padding-inline: 1rem;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.card {
  background: var(--card);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 0.75rem;
  box-shadow: var(--shadow);
  color: var(--text);
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255,255,255,0.34);
}

/* Core structural selectors with accessible styling */
html, body, header, nav, main, article, footer, aside {
  /* kept minimal base rules; specific styling follows below per section */
}
header {
  padding: 2rem 1rem;
  text-align: center;
  background: rgba(15,18,22,0.75);
  border-bottom: 1px solid rgba(255,255,255,0.15);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
header h1 {
  margin: 0 0 .35rem;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.05;
  letter-spacing: .3px;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0,0,0,.6);
}
header .meta {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

/* Main/article content as frosted glass panels with graceful fallbacks */
main {
  padding: 1rem;
}
article {
  max-width: clamp(680px, 90vw, 1100px);
  margin: 2rem auto;
  padding: 1rem;
  border-radius: 14px;
  background: rgba(10,12,18,0.68);
  border: 1px solid rgba(255,255,255,0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.45);
  color: var(--text);
}
@supports not (backdrop-filter: blur(12px)) {
  article { background: rgba(14,16,20,0.92); }
}
.featured-image {
  margin: 0 0 1rem;
}
.image-frame,
.featured-image {
  aspect-ratio: 16 / 9;
  width: 100%;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.25);
  box-shadow: 0 6px 16px rgba(0,0,0,0.4);
  background: #0b0b0f;
}
.image-frame img,
.featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  line-height: 1.08;
  margin: 0 0 .5rem;
}
h3 {
  font-size: clamp(1.25rem, 2.5vw, 1.8rem);
  margin: 1rem 0 .5rem;
}
p {
  font-size: clamp(1rem, 0.8vw + 0.9rem, 1.125rem);
  margin: 0 0 1rem;
}
ul {
  padding-left: 1.25rem;
  margin: 0 0 1rem;
}
li { margin: 0.25rem 0; }

/* Content helper (glass-like text blocks) */
.content {
  font-size: clamp(1rem, 0.8vw + 0.9rem, 1.125rem);
  line-height: 1.6;
  color: var(--text);
}

/* Product ad block (glass panel) */
.product-ad {
  margin: 1rem 0;
  padding: 0.75rem;
  border-radius: 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.28);
  display: block;
}
.product-ad h3 { margin: 0 0 .25rem; font-size: 1.05rem; }
.product-ad a {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: #fff;
  text-decoration: none;
  padding: .45rem .6rem;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.38);
  background: rgba(255,0,60,0.25);
}
.product-ad a:hover { background: rgba(255,0,60,0.34); outline: 2px solid rgba(255,255,255,0.8); outline-offset: 2px; }

/* Link and button styles (interactive states) */
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover, a:focus {
  text-decoration: underline;
}
a:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}
button, .btn, .cta {
  border: none;
  border-radius: 8px;
  padding: 0.65rem 1rem;
  font: inherit;
  color: #fff;
  cursor: pointer;
  background: var(--accent);
  border: 1px solid rgba(255,255,255,0.3);
  transition: transform 0.2s ease, background 0.2s ease;
}
button:hover, .btn:hover, .cta:hover {
  transform: translateY(-1px);
  background: var(--accent-2);
}
button:focus-visible, .btn:focus-visible, .cta:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
.btn {
  display: inline-block;
  text-decoration: none;
}
.btn.outline {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.6);
  color: var(--text);
}
.btn.secondary {
  background: rgba(0,0,0,0.25);
  border-color: rgba(255,255,255,0.4);
}

/* Utility for responsive layout (centered content + optional grids) */
@media (min-width: 760px) {
  main { padding: 1.25rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; transform: none !important; }
}

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