/* Base & Tokens */
:root {
  --bg: #0b0b14;
  --bg-2: #1a1430;
  --surface: rgba(255,255,255,0.08);
  --surface-2: rgba(255,255,255,0.12);
  --text: #eaeaf8;
  --muted: #a6a6af;
  --accent: #7a5cff;
  --accent-2: #9f5cff;
  --border: rgba(255,255,255,0.25);
  --shadow: 0 6px 20px rgba(0,0,0,.45);
  --radius: 14px;
  --focus: 0 0 0 3px rgba(124,78,255,.8);
  --chip: rgba(124,78,255,.25);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

html, body { margin: 0; }

body {
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  min-height: 100%;
  background-color: var(--bg);
  /* Layered background: gradient + faint noise/scanlines */
  background-image:
    linear-gradient(135deg, rgba(124,78,255,.20), rgba(0,0,0,.25)),
    repeating-linear-gradient(to bottom, rgba(255,255,255,.04) 0 1px, transparent 1px 2px),
    radial-gradient(circle at 15% 0%, rgba(120,72,226,.25), transparent 25%),
    radial-gradient(circle at 85% 5%, rgba(60,0,120,.15), transparent 25%);
  background-blend-mode: overlay, overlay, screen, normal;
  background-size: cover;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}

/* Layout helpers */
.container {
  width: 100%;
  max-width: clamp(320px, 90vw, 1100px);
  padding-inline: 1rem;
  margin-inline: auto;
}

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

.card {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: var(--shadow);
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: .25em .6em;
  border-radius: 999px;
  font-size: .75rem;
  background: var(--chip);
  color: #fff;
  border: 1px solid rgba(255,255,255,.4);
}

/* Core structure styles (must style these) */
header {
  text-align: center;
  padding: 2rem 1rem 1rem;
}

header h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw + 1rem, 3rem);
  letter-spacing: .4px;
  color: #fff;
  text-shadow: 0 0 12px rgba(124,78,255,.9);
}

/* Main content */
main { padding: 1rem; }

.image-frame {
  width: 100%;
  max-width: 900px;
  aspect-ratio: 16 / 9;
  margin: 1rem auto;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.12);
  box-shadow: 0 8px 28px rgba(0,0,0,.4);
  display: block;
}

.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Glass panel content area (fallback + blur) */
.content {
  padding: 1rem;
  max-width: 72ch;
  margin-inline: auto;
  color: var(--text);
}

/* Footer / product areas */
footer {
  padding: 1rem;
  margin-top: 1rem;
}

.product-ad,
.sponsored-page {
  display: block;
  text-align: center;
  padding: 0.75rem 1rem;
  margin: 0.75rem auto;
  border-radius: 12px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.25);
}

.product-ad a,
.sponsored-page a {
  color: #fff;
  text-decoration: none;
  display: inline-block;
  padding: .5rem 1rem;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(124,78,255,.95), rgba(69,15,108,.95));
  font-weight: 600;
}
.product-ad a:hover,
.sponsored-page a:hover { filter: brightness(1.05); }
.product-ad a:focus-visible,
.sponsored-page a:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(124,78,255,.8); }

/* Link/button styles */
a, button, .btn, .cta { color: var(--text); text-decoration: none; }

a:hover, a:focus-visible { text-decoration: underline; }

/* Buttons (solid + outline) */
.btn {
  display: inline-block;
  padding: .75em 1.25em;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.6);
  background: linear-gradient(135deg, rgba(124,78,255,.95), rgba(69,15,96,.95));
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(124,78,255,.6); }
.btn:active { transform: translateY(0); }

.btn--outline {
  background: rgba(0,0,0,.0);
  border: 1px solid rgba(124,78,255,.8);
  color: #fff;
}

/* Navigation / Aside defaults (per requirement to style these) */
nav { padding: 0.5rem 1rem; }
aside { padding: 0.5rem 1rem; }

/* Typography helpers */
ul { margin: 0.5rem 0; padding: 0 0 0 1.25rem; }
li { margin: 0.25rem 0; }

/* Responsive typography baseline */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f3ff;
    --bg-2: #e5e0ff;
    --text: #1b1234;
    --muted: #5b5560;
    --surface: rgba(255,255,255,.95);
    --border: rgba(0,0,0,.15);
  }
  body {
    background-color: var(--bg);
    color: var(--text);
    background-image:
      linear-gradient(to bottom right, rgba(120,0,180,.15), rgba(0,0,0,.05)),
      repeating-linear-gradient(to bottom, rgba(0,0,0,.03) 0 1px, transparent 1px 2px);
  }
  header h1 { color: #1a1030; text-shadow: 0 0 8px rgba(120,0,180,.5); }
  .image-frame { background: rgba(255,255,255,.9); border-color: rgba(0,0,0,.15); }
  .product-ad, .sponsored-page { background: rgba(255,255,255,.85); }
  a, .btn { color: #1a1030; }
  /* Ensure good contrast on light theme */
  .card { background: rgba(255,255,255,.92); }
  .tag { background: rgba(124,78,255,.25); }
}

/* Motion & print */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
  body { background: #fff; color: #000; }
  .image-frame { page-break-inside: avoid; }
}