:root {
  /* Palette derived from purple + orange, with accessible contrasts */
  --bg: #0a0820;
  --bg-2: #1a0a38;
  --surface: rgba(18, 0, 60, 0.28);
  --glass-border: rgba(255, 255, 255, 0.20);
  --text: #e9e0ff;
  --muted: #b7a2d6;
  --accent: #ff7a18;
  --accent-2: #a55cff;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0,0,0,.5);
}

html, body {
  height: 100%;
}

* { box-sizing: border-box; }

html {
  color-scheme: dark;
}

body {
  margin: 0;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  /* Layered background: gradient + silhouettes + subtle scanlines/noise */
  background: linear-gradient(135deg, rgba(40,0,90,.75), rgba(20,0,40,.92) 60%, rgba(0,0,0,.95)),
              radial-gradient(circle at 15% 0%, rgba(255,122,24,.18), transparent 28%),
              radial-gradient(circle at 85% 0%, rgba(168,92,255,.18), transparent 28%),
              repeating-linear-gradient(to bottom, rgba(255,255,255,.04) 0 2px, transparent 2px 4px);
  background-blend-mode: overlay, lighten, lighten, normal;
  min-height: 100%;
}

header, main, footer, aside {
  padding: 0;
}

/* Glass panel utility with proper fallback */
.glass {
  background: rgba(18, 0, 60, 0.28);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 28px rgba(0,0,0,.5);
  color: var(--text);
}

/* Fallback if backdrop-filter is not supported */
@supports not (backdrop-filter: blur(12px)) {
  .glass {
    backdrop-filter: none;
    background: rgba(18, 0, 60, 0.75);
  }
}

/* Layout helpers */
.container {
  width: min(1120px, 92%);
  margin-inline: auto;
  padding-inline: 0.5rem;
}

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

.card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 12px;
  padding: 1rem;
  color: var(--text);
}

/* Image frame with aspect-ratio, object-fit, border/glow */
.image-frame {
  aspect-ratio: 16 / 9;
  width: min(720px, 92%);
  margin: 2rem auto;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(0,0,0,.25);
  box-shadow: 0 14px 40px rgba(0,0,0,.5);
  display: block;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(1.05);
  transition: transform .25s ease;
}
.image-frame:focus-within img { transform: scale(1.01); }

/* Typography rhythm & responsive type */
h1, h2, h3 { margin: 0 0 .5rem 0; font-weight: 700; }
p { margin: 0 0 1rem 0; color: var(--muted); }

header {
  padding: 1.25rem 0;
  text-align: center;
}

header h1 {
  font-size: clamp(1.6rem, 2.2vw + 1rem, 2.8rem);
  line-height: 1.15;
  letter-spacing: .2px;
  color: var(--text);
}

/* Core content area */
.content {
  display: block;
  gap: 1rem;
  color: var(--text);
}

/* Links and controls */
a, button, .btn, .cta {
  font-family: inherit;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
  border: none;
  outline: none;
  cursor: pointer;
  transition: transform .15s ease, background .2s ease, color .2s;
}

/* Primary + secondary CTA styles */
.btn {
  display: inline-block;
  padding: .75rem 1.15rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  box-shadow: 0 6px 14px rgba(255,122,24,.4);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(.98); }
.btn:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; }

/* Outline variant */
.btn.outline {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255,255,255,.45);
  box-shadow: none;
}
.btn.outline:hover { background: rgba(255,255,255,.04); }

/* Glass-styled content blocks (for product-ad, etc.) */
.product-ad, .sponsored-page {
  display: block;
  padding: 0.9rem;
  border-radius: 12px;
  text-align: left;
}
.product-ad { background: rgba(12,0,40,.40); border: 1px solid rgba(255,255,255,.20); }
.sponsored-page { background: rgba(0,0,0,.32); border: 1px solid rgba(255,255,255,.18); }

/* Utility components */
.tag {
  display: inline-block;
  padding: .15em .5em;
  border-radius: 999px;
  font-size: .75rem;
  border: 1px solid rgba(255, 122, 24, 0.4);
  background: rgba(255,122,24,.25);
  color: #ffd6b0;
}

/* Lists */
ul { margin: 0; padding: 0; list-style: none; display: flex; gap: .75rem; flex-wrap: wrap; }

/* Structural selectors (as requested) */
html, body, header, nav, main, article, footer, aside {
  /* keep these in sync with the rest of the styling; no extra rules here beyond defaults */
}

/* Specific components */
.content { max-width: 72ch; margin-inline: auto; }

/* Hero-like emphasis for accessibility on dark bg */
strong { color: #fff; }

/* Footer layout */
footer {
  padding: 1.25rem 0;
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  align-items: start;
  border-top: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.25);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
footer p { color: var(--muted); font-size: .9rem; margin: .25rem 0; }

/* Navigation (placeholder styling in case nav appears) */
nav {
  display: flex;
  justify-content: center;
  gap: 1rem;
  padding: .5rem 0;
}
nav a { color: var(--text); }

/* Accessibility: focus visibility on all interactive elements when navigated by keyboard */
:focus-visible {
  outline: 3px solid var(--accent-2);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Responsive tweaks */
@media (max-width: 800px) {
  .image-frame { margin: 1.25rem auto 1.75rem; }
  footer { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f4ff;
    --bg-2: #e2d6ff;
    --text: #1a0933;
    --muted: #5b3b80;
    --glass-border: rgba(0,0,0,.15);
  }
  body {
    background: linear-gradient(135deg, #f4f0ff, #e8e0ff 60%, #f7f7fb);
  }
  .glass, .product-ad, .sponsored-page { background: rgba(255,255,255,.85); color: #1a0933; }
  a { color: #5b3b80; }
}

