/* Section: Tokens */
:root {
  --bg: #0b001a;
  --bg-2: #1a0038;
  --text: #f7eaff;
  --muted: #c8b6e8;
  --accent: #ff2bdc;
  --accent-2: #9a4dff;
  --surface: rgba(255,255,255,0.08);
  --surface-2: rgba(255,255,255,0.12);
  --border: rgba(255,255,255,0.28);
  --shadow: 0 8px 24px rgba(0,0,0,.28);
  --glass: rgba(255,255,255,0.08);
  --glass-border: rgba(255,255,255,0.25);
  --focus-ring: 0 0 0 3px rgba(255, 0, 170, 0.6);
  --radius: 12px;
  --radius-lg: 14px;
}

/* Section: Layered background */
html, body { height: 100%; }
html { box-sizing: border-box; }
*, *::before, *::after { box-sizing: inherit; }

body {
  margin: 0;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  font-size: clamp(14px, 2.2vw, 18px);
  line-height: 1.5;
  background: linear-gradient(135deg, rgba(18,0,40,0.75), rgba(28,0,60,0.85) 60%, rgba(40,0,80,0.9)),
              #000;
  /* Contextual glass-friendly foreground glow */
  color-scheme: dark;
  min-height: 100%;
  position: relative;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  /* Layered pattern: subtle glow + scanlines + noise */
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255,0,180,.15), transparent 25%),
    radial-gradient(circle at 75% 60%, rgba(154,77,255,.15), transparent 25%),
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 180px 180px, 180px 180px, 4px 4px, 4px 4px;
  mix-blend-mode: overlay;
  opacity: 0.88;
  pointer-events: none;
  animation: drift 60s linear infinite;
}
@keyframes drift {
 0% { transform: translate(0,0); }
 100% { transform: translate(-10px, 8px); }
}
@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
}

/* Section: Layout primitives */
.container {
  width: 100%;
  max-width: clamp(320px, 92vw, 1150px);
  margin-inline: auto;
  padding: 0 1rem;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  color: var(--text);
  box-shadow: var(--shadow);
}
.tag {
  display: inline-block;
  padding: .25em .6em;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .2px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.header-cta { display: flex; gap: .75rem; justify-content: center; align-items: center; }

/* Section: Glass panels */
.product-ad, .sponsored-page {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: .75rem 1rem;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform .25s ease, background .25s ease;
}
.product-ad a, .sponsored-page a {
  display: inline-flex;
  align-items: center;
  gap: .5ch;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}
.product-ad:hover, .sponsored-page:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,.12);
}
@media (prefers-reduced-motion: reduce) {
  .product-ad, .sponsored-page { transition: none; }
}
html, body, header, nav, main, article, aside, footer { scroll-behavior: smooth; }

/* Section: Image frame */
.image-frame {
  aspect-ratio: 16/9;
  width: 100%;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.28);
  background: rgba(255,255,255,.08);
  box-shadow: 0 8px 26px rgba(0,0,0,.25);
}
.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(1.05);
  transition: transform .6s ease;
}
.image-frame:hover img {
  transform: scale(1.02);
}

/* Section: Content type */
.content { padding: 1rem 0; color: var(--text); }

/* Section: Typography (hero hierarchy) */
header, main, footer { width: 100%; }
header {
  padding: 1.25rem 0;
  text-align: center;
}
header h1 {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto;
  font-size: clamp(1.6rem, 4vw + 1rem, 3rem);
  line-height: 1.04;
  margin: 0;
  letter-spacing: .2px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 0 rgba(0,0,0,.25);
}
header p { margin: .25rem 0 0; color: var(--muted); }

/* Section: Buttons & links (interactive states) */
a, button, .btn, .cta {
  color: #fff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5ch;
  padding: .66em 1.2em;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.28);
  background: linear-gradient(135deg, rgba(255,255,255,.08), rgba(255,255,255,.04));
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}
a { cursor: pointer; }
.btn { background: linear-gradient(135deg, var(--accent-2), var(--accent)); border: none; }
.btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn:active { transform: translateY(0); }
.btn:focus-visible, a:focus-visible, button:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  outline-offset: 0;
}
.btn--outline {
  background: transparent;
  border: 1px solid rgba(255,255,255,.65);
}
.btn--outline:hover { background: rgba(255,255,255,.08); }

/* Section: Headlines & utilities */
ul, li { list-style: none; padding: 0; margin: 0; }
li + li { margin-top: .5rem; }

/* Section: Accessibility helpers */
a:focus-visible { outline: 3px solid color-m-mix(in srgb, var(--accent), white 60%); outline-offset: 2px; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Section: Layout helpers (screen readers / responsive) */
.main { display: block; }
footer { padding: 1rem 0; text-align: center; color: var(--muted); }

/* Section: Print styles */
@media print {
  body { background: #fff; color: #000; }
  .image-frame { break-inside: avoid; page-break-inside: avoid; }
  a, button { color: #000; text-decoration: underline; }
  .product-ad, .sponsored-page { background: #f6f6f6; border: 1px solid #ccc; }
}

/* Section: Reduced motion fallback */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}