:root {
  /* Palette (purple + white) */
  --bg: #0b061a;
  --bg-2: #1a0530;
  --text: #ffffff;
  --muted: #cbd5e1;
  --accent: #7b61ff;
  --accent-2: #a38aff;
  --surface: rgba(255,255,255,.08);
  --surface-2: rgba(255,255,255,.14);
  --border: rgba(255,255,255,.25);
  --shadow: 0 8px 28px rgba(0,0,0,.55);
  --radius: 12px;
  --focus: 0 0 0 3px rgba(255,255,255,.8);
  --focus-offset: 4px;
  --gap: 1rem;
  --container-max: clamp(320px, 90vw, 1100px);
}

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

html, body { height: 100%; }

html {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Inter, Arial;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(circle at 20% -10%, rgba(123,97,255,.25), transparent 40%),
    linear-gradient(135deg, rgba(18,0,60,.95) 0%, rgba(40,0,80,.95) 40%, rgba(10,0,40,.95) 100%),
    repeating-linear-gradient(to bottom, rgba(255,255,255,.04) 0 1px, transparent 1px 2px);
  background-blend-mode: overlay, overlay, normal;
  min-width: 320px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

:root { color-scheme: dark; }

/* Layout helpers */
.container { max-width: var(--container-max); margin-inline: auto; padding-inline: 1rem; }

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

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

.tag {
  display: inline-block;
  padding: .25rem .6rem;
  font-size: .75rem;
  border-radius: 999px;
  background: rgba(123,97,255,.25);
  color: #fff;
  border: 1px solid rgba(255,255,255,.35);
  line-height: 1;
}

/* Glass panels (fallback included) */
header,
main,
footer,
aside {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: var(--radius);
  padding: 0.75rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.image-frame {
  width: min(92vw, 720px);
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.28);
  box-shadow: 0 8px 24px rgba(0,0,0,.45);
  margin: 0 auto;
  background: rgba(0,0,0,.15);
}
.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: translateZ(0);
  filter: saturate(1.05);
}

/* Content area */
.content {
  color: var(--text);
  font-size: clamp(1rem, 0.55rem + 1vw, 1.125rem);
  line-height: 1.5;
  margin-block: 0.25rem;
}

/* Product ad block inside footer */
.product-ad {
  display: block;
  text-align: center;
  padding: 0.75rem;
  margin: 0.75rem 0;
  border-radius: 12px;
  background: rgba(123,97,255,.20);
  border: 1px solid rgba(255,255,255,.28);
}
.product-ad a { color: inherit; text-decoration: none; display: inline-block; padding: .6rem 1rem; border-radius: 999px; background: rgba(123,97,255,.28); border: 1px solid rgba(255,255,255,.32); }
.product-ad a:hover { text-decoration: none; transform: translateY(-1px); }

.sponsored-page {
  text-align: center;
  padding: 0.75rem;
  margin: 0.25rem 0;
  border-radius: 12px;
  background: rgba(0,0,0,.15);
  border: 1px solid rgba(255,255,255,.25);
}
.sponsored-page a { color: inherit; text-decoration: none; display: inline-block; padding: .6rem 1rem; border-radius: 999px; background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.32); }
.sponsored-page a:hover { text-decoration: none; }

/* Links & buttons */
a,
button,
 .btn,
 .cta {
  color: #fff;
  text-decoration: none;
  background: var(--accent);
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 999px;
  padding: .65rem 1.05rem;
  display: inline-block;
  font-weight: 600;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
  user-select: none;
}
a:hover, a:focus { text-decoration: underline; outline: none; }
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.cta:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}
.btn { background: var(--accent); }
.btn:hover { background: var(--accent-2); transform: translateY(-1px); }
.btn:active { transform: scale(0.98); }

.cta { background: transparent; color: var(--text); border: 1px solid rgba(255,255,255,.6); }

/* Lists (for potential nav or bullets) */
ul, li { margin: 0; padding: 0; list-style: none; }

/* Typography helpers */
h1, h2, h3 { margin: 0 0 .5rem 0; font-weight: 700; line-height: 1.1; letter-spacing: .2px; }
h1 { font-size: clamp(1.75rem, 4vw + 0.5rem, 3.5rem); }
p { margin: 0 0 0.75rem 0; color: var(--muted); }

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

/* Light mode adjustments for legibility */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f4ff;
    --bg-2: #ece6ff;
    --text: #1a1030;
    --muted: #4b4560;
    --surface: rgba(0,0,0,.08);
    --surface-2: rgba(0,0,0,.12);
    --border: rgba(0,0,0,.15);
    --shadow: 0 6px 18px rgba(0,0,0,.12);
    --accent: #6b4dff;
    --accent-2: #8a74ff;
  }
  body {
    background-image:
      radial-gradient(circle at 20% -10%, rgba(107,77,255,.25), transparent 40%),
      linear-gradient(135deg, rgba(225,214,255,.95) 0%, rgba(200,190,255,.95) 40%, rgba(210,204,255,.95) 100%);
    background-blend-mode: overlay, normal;
    color: var(--text);
  }
  header, main, footer, aside {
    background: rgba(255,255,255,.9);
    border: 1px solid rgba(0,0,0,.15);
  }
  .card { background: rgba(255,255,255,.92); border-color: rgba(0,0,0,.15); }
  .image-frame { border-color: rgba(0,0,0,.25); }
  a, button, .btn, .cta { color: #1a0a3a; }
  .tag { background: rgba(107,77,255,.28); color: #fff; }
}

/* Print-friendly (basic readability) */
@media print {
  body { background: #fff; color: #000; }
  header, main, footer { background: #fff; border: none; box-shadow: none; }
}
