:root {
  /* Palette tokens inspired by lavender + gray */
  --bg: #1a1740;
  --bg-2: #a08bdc;
  --text: #f6f7fb;
  --muted: #cbd5e1;
  --accent: #b097f0;
  --accent-2: #7a63cc;
  --glass: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.25);
  --glass-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; }

html, body, header, nav, main, article, aside, footer {
  /* Ensure predictable rendering order and stacking context if touched by glass panels */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  margin: 0;
  color: var(--text);
  /* Layered background: gradient + subtle scanlines/noise, with fallbacks */
  background-color: #0b0b12;
  background-image:
    linear-gradient(135deg, rgba(120, 90, 190, 0.92) 0%, rgba(140, 110, 190, 0.88) 60%, rgba(190, 172, 210, 0.92) 100%),
    repeating-linear-gradient(to bottom, rgba(255,255,255,0.04) 0 1px, transparent 1px 2px);
  background-blend-mode: overlay;
  min-height: 100dvh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Inter, Arial, "Helvetica Neue";
  line-height: 1.5;
}

/* Layout primitives */
.container {
  width: 100%;
  max-width: clamp(320px, 92vw, 1100px);
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 48px);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

@supports not (backdrop-filter: blur(12px)) {
  .card, .glass {
    background: rgba(255, 255, 255, 0.14);
  }
}

.tag {
  display: inline-block;
  padding: .25rem .6rem;
  border-radius: var(--radius-pill);
  font-size: .75rem;
  border: 1px solid rgba(255,255,255,.35);
  background: rgba(255,255,255,.08);
  color: var(--muted);
}

/* Glass panels (main aesthetic) */
.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

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

/* Typography & sections */
header {
  text-align: center;
  padding: 2.25rem 0 1.5rem;
}

header h1 {
  font-size: clamp(1.4rem, 2.5vw + 1rem, 2.6rem);
  line-height: 1.15;
  margin: 0 0 .5rem;
  font-weight: 700;
  letter-spacing: .2px;
  color: var(--text);
}

nav {
  display: inline-flex;
  gap: .5rem;
  margin-top: .25rem;
  flex-wrap: wrap;
}

nav a {
  color: var(--text);
  text-decoration: none;
  padding: .25rem .6rem;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.25);
  transition: color .2s ease, border-color .2s ease;
}

nav a:hover,
nav a:focus-visible {
  color: var(--accent-2);
  border-color: rgba(255,255,255,.6);
  text-decoration: underline;
  outline: none;
}

main {
  display: grid;
  place-items: center;
  padding: 1rem 0 2rem;
}

article {
  width: 100%;
  max-width: 900px;
  padding: 0 0.5rem;
  display: block;
}

.image-frame {
  aspect-ratio: 16 / 9;
  width: 100%;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.35);
  background: linear-gradient(135deg, rgba(255,255,255,.08), rgba(255,255,255,.18));
  box-shadow: 0 12px 28px rgba(0,0,0,.25);
}
.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(1.04);
  transition: transform .6s ease;
}
.image-frame:hover img {
  transform: scale(1.03);
}

footer {
  padding: 1.75rem 0 2.5rem;
  display: grid;
  gap: .75rem;
  justify-items: center;
  text-align: center;
  color: var(--muted);
}

/* Product ad blocks in footer */
.product-ad,
.sponsored-page {
  width: min(100%, 720px);
  padding: .75rem 1rem;
  border-radius: 12px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.28);
  transition: transform .2s ease;
}
.product-ad a,
.sponsored-page a { color: var(--text); text-decoration: none; display: block; font-weight: 600; }
.product-ad:hover,
.sponsored-page:hover { transform: translateY(-2px); }

/* Links & CTAs across the page */
a,
button,
.btn,
.cta {
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease;
}
a:hover,
a:focus-visible {
  text-decoration: underline;
  color: var(--accent-2);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .65rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.35);
  background: linear-gradient(135deg, rgba(176, 140, 255, 0.95), rgba(160, 110, 240, 0.95));
  color: #fff;
  font-weight: 700;
  font-size: .95rem;
  text-shadow: 0 1px 0 rgba(0,0,0,.15);
}
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible {
  outline: 3px solid var(--accent-2);
  outline-offset: 2px;
}
.btn.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255,255,255,.45);
  padding: .55rem .95rem;
}
.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .5rem 1rem;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.45);
  background: rgba(0,0,0,.18);
  color: var(--text);
  text-decoration: none;
}
.cta:hover { text-decoration: underline; }

/* Lists for navigation or product bullets */
ul, li {
  margin: 0;
  padding: 0;
  list-style: none;
}
li + li { margin-top: .5rem; }

/* Images: ensure frame-aspect, glow, and fallback-safe border-glow */
.image-frame { outline: none; }

/* Form elements (present if used) */
input,
textarea,
select,
label {
  font: inherit;
  color: var(--text);
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 6px;
  padding: .5rem .75rem;
}
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--accent-2);
  outline-offset: 2px;
  border-color: rgba(255,255,255,.8);
}
::placeholder { color: rgba(255,255,255,.6); }

/* Print styles for readability */
@media print {
  body { background: #fff; color: #000; }
  a { text-decoration: underline; }
}
