/* Tokens */
:root{
  --bg: #0b0b14;
  --bg-2: #0f0b15;
  --surface: rgba(20, 9, 40, 0.28);
  --surface-2: rgba(20, 9, 40, 0.42);
  --text: #f6f5ff;
  --muted: #c9c0e0;
  --accent: #8a5cff;
  --accent-2: #b89aff;
  --border: rgba(122, 70, 255, 0.45);
  --shadow: 0 6px 20px rgba(0,0,0,.38);
  --ring: 0 0 0 3px rgba(138,92,246,.55);
  --glass-fg: rgba(255,255,255,.22);
  --glass-fg-strong: rgba(255,255,255,.32);
}

html, body, header, nav, main, article, footer, aside { scroll-behavior: smooth; }

/* Base / Layout */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans", sans-serif;
  line-height: 1.5;
  background:
    radial-gradient(circle at 20% 0%, rgba(138,92,246,.25), transparent 40%),
    radial-gradient(circle at 85% 15%, rgba(99,0,199,.25), transparent 40%),
    linear-gradient(135deg, #0b0b14 0%, #0e0b16 60%, #0b0b14 100%),
    repeating-linear-gradient(to bottom, rgba(255,255,255,.04) 0 1px, transparent 1px 2px);
  background-attachment: fixed;
  color-scheme: dark;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

header { text-align: center; padding: 1rem 1rem 0.25rem; position: relative; z-index: 1; }
header h1 { margin: 0; font-size: clamp(1.4rem, 2vw + 1rem, 2.4rem); font-weight: 700; letter-spacing: .2px; }
nav { margin-top: .25rem; }

main { padding: 1rem 1rem 2rem; }

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

/* Grid and Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.card { background: rgba(18,9,38,.28); border: 1px solid rgba(255,255,255,.25); border-radius: 12px; padding: 1rem; box-shadow: var(--shadow); }

/* Image frame */
.image-frame { width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; border: 1px solid rgba(255,255,255,.25); background: #000; display: block; box-shadow: inset 0 0 0 1px rgba(255,255,255,.05), 0 6px 20px rgba(0,0,0,.4); }
.image-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Content blocks (glass panels) */
.content { padding: 1rem; }

/* Glass panels (fallback if backdrop-filter unavailable) */
.card, .content, .product-ad, aside { background: rgba(20, 9, 40, 0.28); border: 1px solid rgba(255,255,255,0.25); border-radius: 12px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }

/* Fallback for environments without backdrop-filter */
@supports not (backdrop-filter: blur(8px)) {
  .card, .content, .product-ad, aside { background: rgba(20, 9, 40, 0.78); }
}

/* Product ad / footer blocks (glass panels) */
.product-ad, .sponsored-page {
  display: block;
  margin: .75rem 0;
  padding: .75rem;
  text-align: center;
  border-radius: 12px;
  background: rgba(20,12,40,.28);
  border: 1px solid rgba(255,255,255,.25);
}
.product-ad a, .sponsored-page a { color: #fff; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; }

/* Link / button styling (interactive) */
a, button, .btn, .cta {
  color: #fff;
  text-decoration: none;
  border: none;
  background: none;
  cursor: pointer;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}
a { transition: color .2s ease, text-decoration-color .2s ease; }
a:hover, a:focus { text-decoration: underline; text-decoration-color: currentColor; }
a:focus-visible, button:focus-visible { outline: 0; outline: none; box-shadow: none; }
a:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 6px; }

/* Button variants */
.btn, .cta {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .55rem 1rem; border-radius: 999px; font-weight: 600;
  transition: transform .15s ease, background .2s ease, color .2s ease, border-color .2s;
}
.btn { background: rgba(138,92,246,.45); border: 1px solid rgba(138,92,246,.65); color: #fff; }
.btn:hover { transform: translateY(-1px); background: rgba(138,92,246,.58); }
.btn:active { transform: translateY(0); }
.btn--outline { background: transparent; border: 1px solid rgba(138,92,246,.75); color: #fff; }
.btn--outline:hover { background: rgba(138,92,246,.25); }

/* Focus management for controls */
:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* Image caption styling convenience (if used) */
.figure-caption { font-size: .8rem; color: var(--muted); text-align: center; margin-top: .25rem; }

/* Typography */
h2, h3 { margin: .5rem 0; line-height: 1.25; }
p { margin: .75rem 0; color: var(--muted); }

/* List styling */
ul { padding-left: 1.25rem; margin: .5rem 0; }
li { margin: .25rem 0; }

/* Utility chips / tags */
.tag { display: inline-block; padding: .15em .5em; border-radius: 999px; background: rgba(138,92,246,.25); color: #fff; font-size: .75rem; border: 1px solid rgba(138,92,246,.45); }

/* Layout patterns for semantic sections (ensuring selectors exist) */
footer { padding: 1rem; text-align: center; color: var(--muted); }

/* Print styles */
@media print {
  body { background: #fff; color: #000; }
  header, nav, footer { display: none; }
  main { padding: 0; }
  .container { padding: 0; }
}

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

/* Responsive refinements */
@media (min-width: 640px) {
  header { padding: 1.25rem 1.25rem 0.5rem; }
  main { padding: 1.25rem 1.25rem 2rem; }
}
@media (min-width: 980px) {
  .grid { gap: 1.25rem; }
  .container { padding-inline: 0; }
}