/* Base tokens */
:root{
  --bg: #0b0f14;
  --bg-2: #141922;
  --text: #f7f4e6;
  --muted: #cbd5e1;
  --accent: #f5d96d;      /* pastel mustard */
  --accent-2: #ffd96a;    /* lighter accent */
  --card: rgba(255,255,255,.08);
  --card-2: rgba(255,255,255,.14);
  --glass-border: rgba(255,255,255,.28);
  --radius: 12px;
  --shadow: 0 8px 22px rgba(0,0,0,.28);
  --focus: 2px solid var(--accent-2);
  --focus-offset: 2px;
}

/* Global resets & layout helpers */
* { box-sizing: border-box; }
html, body { height: 100%; }
html { font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial; }
body {
  margin: 0;
  color: var(--text);
  background: #0b0f14;
  min-height: 100%;
  overflow-x: hidden;
  position: relative;
  /* Layered backgrounds: gradient + pixel mosaic + subtle noise/scanlines (pure CSS) */
}
body::before, body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}
body::before {
  /* mustard-yellow pixel mosaic (soft, tiled) */
  background-image:
    linear-gradient(45deg, rgba(216,196,90,.25) 25%, rgba(216,196,90,0) 25%),
    linear-gradient(-45deg, rgba(232,214,102,.18) 25%, rgba(232,214,102,0) 25%);
  background-size: 40px 40px;
  background-position: 0 0, 0 0;
  mix-blend-mode: overlay;
  opacity: .25;
}
body::after {
  /* subtle noise + scanlines */
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0,0,0,.0) 0, rgba(0,0,0,.08) 2px);
  background-size: 2px 2px, 100% 4px;
  opacity: .28;
  mix-blend-mode: overlay;
  filter: saturate(1.05);
}

/* Sectioning elements styling (targets per requirements) */
html, body, header, nav, main, article, footer, aside { /* layout targets for clarity */ }
.image-frame, .image-frame img { /* image frame rules applied below globally via class usage */ }
.content { /* optional content wrapper styling hook */ }

/* Container, grid, card, tag utility classes */
.container {
  width: 100%;
  max-width: clamp(640px, 88vw, 1200px);
  margin-inline: auto;
  padding: 0 1rem;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.card {
  background: var(--card);
  border: 1px solid rgba(255,255,255,.28);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.tag {
  display: inline-block;
  padding: .15em .5em;
  border-radius: 999px;
  font-size: .75rem;
  color: #111;
  background: rgba(255,223,130,.9);
  border: 1px solid rgba(0,0,0,.08);
}
@supports not (backdrop-filter: blur(12px)) {
  .card { background: rgba(255,255,255,.16); }
  .tag { background: rgba(255,223,130,.95); }
}

/* Glass panels (must-have with fallback) */
.glass {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 8px 22px rgba(0,0,0,.28);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
@supports not (backdrop-filter: blur(12px)) {
  .glass { background: rgba(255,255,255,.18); }
}

/* Image framing rules */
.image-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.25);
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
  background: #111;
}
.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  image-rendering: -webkit-optimize-contrast;
}

/* Link, button, and CTA styling */
a { color: var(--accent-2); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; color: #fff; outline: none; }
button, .btn, .cta {
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.2;
  cursor: pointer;
}
.btn {
  display: inline-block;
  padding: .6rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.4);
  background: rgba(255,255,255,.15);
  color: #fff;
  text-decoration: none;
  transition: transform .15s ease, background .2s ease, color .2s ease;
}
.btn.primary {
  background: linear-gradient(135deg, rgba(253,213,110,.95), rgba(253,213,110,.75));
  border: 1px solid rgba(0,0,0,.15);
}
.btn.outline {
  background: transparent;
  border: 1px solid rgba(255,255,255,.5);
  color: #fff;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

/* Focus visibility for accessibility */
a:focus-visible, button:focus-visible {
  outline: var(--radius) solid transparent; /* keep shape for outline offset */
  outline-width: 2px;
  outline-color: var(--accent-2);
  outline-offset: var(--focus-offset);
  border-radius: 6px;
}
:focus-visible { outline-offset: var(--focus-offset); }

/* Typography (fluid, accessible) */
h1, h2, h3 {
  color: #fff;
  margin: 0 0 .5rem;
}
h1 {
  font-size: clamp(1.75rem, 1.6rem + 2vw, 3rem);
  line-height: 1.15;
}
h2 {
  font-size: clamp(1.15rem, 0.8vw + 0.9rem, 1.6rem);
  line-height: 1.25;
}
p { font-size: clamp(0.95rem, 0.8vw + 0.8rem, 1.15rem); color: var(--text); margin: .5rem 0 1rem; }

/* Layout of main sections to reflect content blocks */
header {
  padding: 2rem 1rem 1.25rem;
  text-align: center;
}
header h1 { margin-bottom: .25rem; }
header .meta { font-size: .92rem; color: var(--muted); }

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

/* Specific section targets for visuals */
section { margin: 1rem 0 1.25rem; }
section h2 { margin-bottom: .5rem; }

/* Paragraph and lists spacing */
ul, ol { padding-left: 1.25rem; margin: .5rem 0 1rem; }
li { margin: .25rem 0; }

/* Image/logo area within the footer-ad grid or similar sections */
.product-ad, .sponsored-page {
  display: block;
  padding: .75rem;
  text-align: center;
  margin: .5rem 0;
}
.product-ad a, .sponsored-page a { text-decoration: none; display: block; }

/* Footer styling */
footer {
  padding: 1.5rem 1rem;
  text-align: center;
}
footer p { color: var(--muted); font-size: .9rem; }

/* Print styles (basic readability) */
@media print {
  body { background: #fff; color: #000; }
  a { text-decoration: underline; color: #000; }
  .glass, .card { background: #fff; border: 1px solid #ccc; box-shadow: none; }
  header, main, footer { padding: 0.5in; }
}

/* Accessibility: respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}