/* Base Tokens */
:root {
  --bg: #0a0a0f;
  --bg-2: #1a0b2b;
  --text: #f5f7ff;
  --muted: #cbd5e1;
  --accent: #e4c400;       /* mustard yellow */
  --accent-2: #7c5cff;     /* galaxy purple */
  --surface: rgba(255, 255, 255, 0.18);     /* frosted glass color */
  --surface-2: rgba(255, 255, 255, 0.28);
  --border: rgba(255, 255, 255, 0.28);
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  --radius: 12px;
  --container-max: clamp(320px, 88vw, 1100px);
}

/* Base + Utilities */
* { box-sizing: border-box; }
html, body { height: 100%; }
html, body { margin: 0; padding: 0; color: var(--text); background: 
  linear-gradient(135deg, #0a0a10 0%, #0b0b16 40%, #120e28 100%), 
  radial-gradient(circle at 70% -10%, rgba(124, 92, 255, 0.25), transparent 40%), 
  repeating-linear-gradient(to bottom, rgba(255, 214, 60, 0.04) 0 1px, transparent 1px 2px),
  repeating-linear-gradient(to right, rgba(124, 92, 255, 0.04) 0 1px, transparent 1px 2px);
  background-attachment: fixed;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans",
    "Liberation Sans", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
html { -webkit-text-size-adjust: 100%; }

html, body, header, nav, main, article, footer, aside {
  /* presentational reset targets; kept minimal for production */
  color: inherit;
}

/* Layered subtle "noise/scanline" overlay (pure CSS) on body via pseudo-element */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 60% 20%, rgba(255,255,255,0.04) 0 2px, transparent 2px),
    linear-gradient(to bottom, rgba(255,255,255,0.04) 0 1px, transparent 1px 2px);
  background-size: 100% 100%, 100% 2px;
  mix-blend-mode: overlay;
  opacity: 0.25;
  z-index: 0;
}

/* Glass panels (frosted glass) with fallback */
.glass {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius);
  padding: 0.75rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
@supports not (backdrop-filter: blur(12px)) {
  .glass { background: rgba(255, 255, 255, 0.28); }
}

/* Layout primitives */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: 1rem;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 1rem;
}
.card {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 12px;
  padding: 0.75rem;
}
.tag {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: rgba(124, 92, 255, 0.25);
  color: var(--text);
  border: 1px solid rgba(124, 92, 255, 0.6);
}

/* Typography */
h1 {
  font-size: clamp(1.8rem, 1.5rem + 4vw, 3rem);
  line-height: 1.15;
  margin: 0 0 .5rem;
  letter-spacing: .2px;
}
p { margin: 0 0 0.9rem; color: var(--muted); }
strong { color: var(--text); }

/* Core interactive elements */
a, button, .btn, .cta {
  color: var(--text);
  text-decoration: none;
  border: 0;
  background: none;
  cursor: pointer;
  font: inherit;
}
a { color: var(--accent-2); }
a:hover, a:focus { text-decoration: underline; outline: none; }
a:focus-visible, button:focus-visible, .btn:focus-visible, .cta:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
  border-radius: 6px;
}
.btn {
  display: inline-block;
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.38);
  background: var(--accent-2);
  color: #fff;
  font-weight: 600;
  transition: transform 0.2s ease, background 0.2s ease;
}
.btn:hover { transform: translateY(-1px); background: #6a45ff; }
.btn:active { transform: translateY(0); }
.btn-outline {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.6);
  color: var(--text);
}
.cta { display:inline-block; }

/* Image frame styling */
.image-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 8px 28px rgba(0,0,0,.5);
  background: #111;
}
.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(1.05) contrast(1.04);
  transform: translateZ(0); /* GPU hint for smoother rendering */
}
.image-frame { outline: 1px solid rgba(255,255,255,0.15); }

/* Screen structure styling (selectors required) */
html, body, header, nav, main, article, footer, aside { display: block; }

/* Header */
header {
  padding: 1rem;
  margin: 0 auto;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  width: min(100%, 1100px);
}
header h1 { color: #fff; font-weight: 700; }

/* Nav links inside header */
nav { margin-top: .25rem; }
nav a { color: var(--accent); }

/* Main content area */
main { padding: 0.75rem 0; }
.content { font-size: clamp(0.95rem, 0.4vw + 0.95rem, 1.05rem); line-height: 1.6; color: var(--muted); }

/* Article layout within main */
article { display: block; }

/* Footer and its glass panels */
footer {
  padding: 1rem;
  display: grid;
  gap: 0.75rem;
  align-items: start;
}
.product-ad,
.sponsored-page {
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 12px;
  padding: 0.75rem;
  text-align: center;
}
.product-ad a, .sponsored-page a { color: var(--text); }

/* Print styles (basic readability) */
@media print {
  body { color: #000; background: #fff; }
  a { text-decoration: underline; color: #000; }
}
@media (min-width: 600px) {
  .grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
}
@media (min-width: 860px) {
  header { padding: 1.25rem 1rem; }
  main { padding: 1.25rem 0; }
}
