/* Section: Base & Theme Tokens */
:root{
  --bg: #0b0f14;
  --bg-2: #111522;
  --text: #e9e6ff;
  --muted: #c4bfd6;
  --accent: #c9b6ea;
  --accent-2: #8a82c8;
  --glass-rgb: 20, 22, 28;
}

html, body, header, nav, main, article, footer, aside {
  /* Layout primitives will inherit defaults; nothing overrides here beyond global rules. */
}

/* Section: Global Box & Typography */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  color: var(--text);
  background-color: var(--bg);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Layered background: gradient + subtle scanlines + speckle-like noise via layered gradients */
  background-image:
    linear-gradient(135deg, rgba(20,24,32,.92), rgba(18,20,28,.92) 60%, rgba(22,23,32,.92)),
    linear-gradient(to bottom, rgba(12,12,20,.6), rgba(12,12,20,.6)),
    #0b0f14;
  background-blend-mode: normal, overlay, normal;
  position: relative;
  z-index: 0;
}
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
/* Subtle noise/speckle via radial gradients */
body::before {
  background:
    radial-gradient(circle at 20px 20px, rgba(255,255,255,.04) 0, rgba(255,255,255,0) 6px),
    radial-gradient(circle at 60px 90px, rgba(255,255,255,.025) 0, rgba(255,255,255,0) 6px);
  background-size: 120px 120px, 140px 140px;
  mix-blend-mode: overlay;
  opacity:.9;
}
body::after {
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,.025) 0 1px, transparent 1px 2px);
  mix-blend-mode: overlay;
  opacity:.65;
}

/* Section: Layout Helpers */
.container {
  max-width: clamp(320px, 92vw, 1100px);
  margin-inline: auto;
  padding-inline: 1rem;
}
.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.card {
  background: rgba(var(--glass-rgb), 0.22);
  border: 1px solid rgba(150, 140, 180, 0.38);
  border-radius: 12px;
  padding: 1rem;
  color: var(--text);
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
@supports not (backdrop-filter: blur(10px)) {
  .card { background: rgba(var(--glass-rgb), 0.34); }
}
.tag {
  display: inline-block;
  padding: .25em .6em;
  border-radius: 999px;
  font-size: .75rem;
  color: #fff;
  background: rgba(180,170,210,.28);
  border: 1px solid rgba(210,200,230,.4);
}

/* Section: Typographic Scale & Hero Feel */
h1, .title {
  font-family: ui-sans-serif, system-ui;
  font-weight: 700;
  margin: 0;
  line-height: 1.15;
  letter-spacing: .2px;
  font-size: clamp(1.4rem, 2.2vw + 1rem, 2.6rem);
  color: var(--text);
}
p { color: var(--muted); margin: .5rem 0 0; }

/* Section: Header & Nav */
header {
  padding: 1.25rem;
  text-align: center;
}
header h1 { margin: .25rem 0 0; font-size: clamp(1.3rem, 2.4vw + 1rem, 2.4rem); color: var(--text); }
nav { margin-top: .5rem; }
nav a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(201,182,234,.35);
  padding-bottom: 2px;
}
a { color: var(--accent); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; outline: none; }

/* Focus states for accessibility */
:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; }

/* Section: Main Content & Image Frame */
main { padding: 1rem 0 2rem; }
.image-frame {
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.22);
  box-shadow: 0 8px 26px rgba(0,0,0,.25);
  background: #000;
  display: block;
  margin-inline: auto;
  max-width: 900px;
}
.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(1.02);
  transition: transform .4s ease;
}
.image-frame:hover img { transform: scale(1.02); }

/* Section: Content & Text Styles (glass panels) */
.content { padding: .5rem 0; color: var(--text); }
section { margin: .75rem 0; }
ul, li { margin: 0; padding: 0; list-style-position: inside; }
ul { padding-left: 1rem; }

/* Section: Product Ad / Footer panels as glass panels */
.product-ad, .sponsored-page {
  display: block;
  margin: .5rem 0;
  padding: .85rem;
  border-radius: 12px;
  text-align: left;
  background: rgba(var(--glass-rgb), 0.22);
  border: 1px solid rgba(150,140,180,.38);
  box-shadow: 0 6px 22px rgba(0,0,0,.25);
  backdrop-filter: blur(10px);
}
.product-ad a, .sponsored-page a { color: var(--text); text-decoration: none; display: block; }
.product-ad a:hover, .sponsored-page a:hover { text-decoration: underline; }

/* Section: Controls (buttons/links) */
button, .btn, .cta {
  font: inherit;
  padding: .6em 1em;
  border-radius: 10px;
  border: 1px solid rgba(120,110,180,.4);
  background: rgba(200, 178, 238, 0.22);
  color: var(--text);
  cursor: pointer;
  transition: transform .2s ease, background .2s ease;
  display: inline-block;
}
button:hover, .btn:hover, .cta:hover { transform: translateY(-1px); background: rgba(210, 190, 250, .35); }
button:focus-visible, .btn:focus-visible, .cta:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; }

.btn.primary, .cta.primary {
  background: linear-gradient(135deg, var(--accent), #a08bdc);
  border: 1px solid rgba(255,255,255,.25);
  color: #0b0b12;
}
.btn.secondary {
  background: rgba(255,255,255,.08);
  color: var(--text);
}
.btn[disabled], .cta[disabled] { opacity:.6; cursor:not-allowed; }

/* Section: Lists & Links Accessibility */
li { line-height: 1.5; }

/* Section: Print Styles (basic readability) */
@media print {
  body { background: #fff; color: #000; }
  .glass { backdrop-filter: none; background: #fff; border: 1px solid #ccc; }
  a { text-decoration: underline; }
}

/* Section: Prefer Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
