/* Section: Base */
:root {
  --bg: #0b0a14;
  --bg-2: #140521;
  --text: #e9e1ff;
  --muted: #c6b6e8;
  --surface: rgba(255, 255, 255, 0.08);
  --surface-2: rgba(255, 255, 255, 0.14);
  --border: rgba(160, 120, 210, 0.38);
  --accent: #8a5cff;
  --accent-2: #b26aff;
  --shadow: 0 8px 28px rgba(0,0,0,.45);
  --focus: #ffffff;
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
html, body {
  margin: 0;
  padding: 0;
  color: var(--text);
  font-family: var(--font);
  min-height: 100dvh;
  background-color: var(--bg);
  /* Layered violet galaxy плюс scanlines */
  background-image:
    radial-gradient(circle at 12% 18%, rgba(190,120,255,.55) 0 2px, transparent 2px),
    radial-gradient(circle at 75% 25%, rgba(110,60,230,.45) 0 2px, transparent 2px),
    radial-gradient(circle at 40% 70%, rgba(210,110,255,.35) 0 2px, transparent 2px),
    linear-gradient(135deg, rgba(90,0,140,.95) 0%, rgba(20,0,40,.95) 60%, rgba(12,0,40,.95) 100%),
    repeating-linear-gradient(to bottom, rgba(255,255,255,.04) 0 1px, transparent 1px 2px);
  background-blend-mode: overlay, overlay, overlay, normal, overlay;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body::before {
  /* Subtle grain/noise layer for depth (pure CSS) */
  content: "";
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle at 20% 80%, rgba(255,255,255,.04) 0 2px, transparent 2px),
                    radial-gradient(circle at 70% 40%, rgba(255,255,255,.04) 0 2px, transparent 2px);
  background-size: 200px 200px;
  opacity: .25;
  pointer-events: none;
  filter: saturate(1.05);
  mix-blend-mode: overlay;
  z-index: -1;
}
*, :before, :after { box-sizing: inherit; }

/* Section: Layout primitives */
.container {
  width: 100%;
  max-width: clamp(320px, 90vw, 1100px);
  margin-inline: auto;
  padding-inline: 1rem;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
}
.tag {
  display: inline-block;
  padding: .15em .5em;
  font-size: .75rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
  background: rgba(138,92,255,.25);
}
ul, li { margin: 0; padding: 0; list-style: none; }

/* Section: Glass panels (fallback if backdrop-filter unsupported) */
header, main, footer, aside, article {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(180,180,180,0.25);
  border-radius: 12px;
  padding: .75rem;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 28px rgba(0,0,0,.25);
}
@supports not (backdrop-filter: blur(10px)) {
  header, main, footer, aside, article { background: rgba(255,255,255,0.18); }
}

/* Section: Header / Hero */
header {
  text-align: center;
  padding: clamp(0.75rem, 2vw, 1.5rem);
  margin: 1rem auto;
}
header h1 {
  font-size: clamp(1.25rem, 2.2vw + 0.5rem, 2.25rem);
  line-height: 1.15;
  margin: 0;
  font-weight: 700;
  letter-spacing: .2px;
  color: var(--text);
}

/* Section: Media (image frame) */
.image-frame {
  width: min(100%, 720px);
  aspect-ratio: 16 / 9;
  margin: 1rem auto;
  padding: .5rem;
  border-radius: 14px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.25);
  display: grid;
  align-items: center;
  justify-items: center;
  overflow: hidden;
  box-shadow: inset 0 0 14px rgba(0,0,0,.25);
}
.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  display: block;
  filter: saturate(1.05);
  /* subtle glow to enhance "hacker" vibe without heavy bloat */
  box-shadow: 0 0 14px rgba(138,92,255,.6);
}

/* Section: Content helper (optional wrapper) */
.content {
  color: var(--text);
  line-height: 1.5;
  font-size: clamp(14px, 1vw + 12px, 16px);
  margin-top: .25rem;
  margin-bottom: .5rem;
}

/* Section: Product ad / links */
.product-ad, .sponsored-page {
  display: block;
  margin: .5rem 0;
}
.product-ad a, .sponsored-page a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  text-decoration: none;
  padding: .6rem 1rem;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  border: 0;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(0,0,0,.35);
}
.product-ad a:hover, .sponsored-page a:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(0,0,0,.4);
}
.product-ad a:focus-visible, .sponsored-page a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* Section: Interactive controls (buttons/links) */
a { color: var(--accent-2); text-decoration: none; }
a:focus-visible, a:hover { text-decoration: underline; text-decoration-color: color-m-mix(in oklab, var(--accent-2) 60%, white); }
button, .btn, .cta {
  font-family: inherit;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.08);
  color: var(--text);
  padding: .6rem 1rem;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.btn {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  border: 1px solid rgba(0,0,0,.15);
  color: #fff;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(0,0,0,.32); }
.cta {
  background: transparent;
  border: 1px solid rgba(138,92,255,.8);
}
.cta:hover { background: rgba(138,92,255,.15); }
:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Section: Typography helpers */
.hint { color: var(--muted); font-size: .9rem; }

/* Section: Dark mode fallback for accessibility */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f7ff;
    --bg-2: #e9e6ff;
    --text: #1b1740;
    --muted: #52427a;
    --surface: rgba(0,0,0,.08);
    --surface-2: rgba(0,0,0,.12);
    --border: rgba(100,60,180,.25);
    --accent: #5a2bd3;
    --accent-2: #7b57ff;
    --shadow: 0 6px 22px rgba(0,0,0,.08);
  }
  body { background-color: var(--bg); color: var(--text); }
  header, main, footer, aside, article { background: rgba(255,255,255,.75); border-color: rgba(0,0,0,.08); }
  a { color: #2a38ff; }
  .btn { background: linear-gradient(135deg, #6d4cff, #8e6aff); }
}
@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { animation: none !important; transition: none !important; }
}
@media print {
  :root { color: #000; background: #fff; }
  body { color: #000; background: #fff; -webkit-print-color-adjust: exact; }
  a { text-decoration: underline; color: #000; }
}
