/* Tokens */
:root {
  --bg: #0b002a;
  --bg-2: #160a34;
  --text: #eaf6ff;
  --muted: #a9b8d4;
  --accent: #4cc3ff;
  --accent-2: #7c5cff;
  --glass: rgba(18, 14, 34, 0.28);
  --glass-border: rgba(255, 255, 255, 0.28);
  --glass-opaque: rgba(18, 14, 34, 0.75);
  --shadow: 0 8px 28px rgba(0,0,0,.45);
  --radius: 14px;
  --radius-sm: 10px;
  --tag: rgba(0,0,0,0.25);
}

/* Layout primitives */
html, body, header, nav, main, article, footer, aside {
  box-sizing: border-box;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
html { color-scheme: dark; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI",
               Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  font-size: clamp(14px, 1.6vw, 18px);
  line-height: 1.5;
  color: var(--text);
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-2) 60%, #140a2a 100%);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  position: relative;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed; inset: 0;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.04) 0 1px, transparent 1px 2px),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.04) 0 1px, transparent 1px 2px),
    radial-gradient(circle at 20% -10%, rgba(76,195,255,0.15), transparent 40%);
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
}
body::after {
  content:"";
  position: fixed; inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(0,0,0,0.0), rgba(0,0,0,0.12) 60%),
              repeating-linear-gradient(0deg, rgba(0,0,0,0.04) 0 2px, transparent 2px 4px);
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 0;
  opacity: 0.25;
}

/* Container + utilities */
.container {
  width: min(1100px, 92%);
  margin-inline: auto;
  padding-block: 1rem;
}
.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.card {
  background: rgba(18,14,34,0.28);
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.card--opaque {
  background: rgba(18,14,34,0.75);
}
.tag {
  display: inline-block;
  padding: 0.15em 0.6em;
  border-radius: 999px;
  background: var(--tag);
  border: 1px solid rgba(255,255,255,0.25);
  color: var(--text);
  font-size: 0.75rem;
  line-height: 1;
}

/* Glass panels with fallback */
.content {
  padding: 1rem;
  background: rgba(18,14,34,0.28);
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 6px 20px rgba(0,0,0,.35);
}
@supports not (backdrop-filter: blur(12px)) {
  .content { background: rgba(18,14,34,0.75); }
}
.image-frame {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.28);
  box-shadow: 0 6px 20px rgba(0,0,0,.4);
  aspect-ratio: 16/9;
  background: #111;
}
.image-frame img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  image-rendering: auto;
  filter: saturate(1.05);
}
header {
  padding: 1rem 0;
}
header h1 {
  margin: 0 0 0.25rem;
  font-size: clamp(1.75rem, 3vw + 1rem, 3.25rem);
  letter-spacing: .5px;
}
header .meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}
main { padding: 1rem 0; position: relative; z-index: 1; }
footer {
  padding: 1rem 0;
  margin-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.15);
}
.product-ad {
  display: inline-block;
  margin: .25rem 0;
  padding: .75rem 1rem;
  border-radius: 999px;
  background: rgba(76,195,255,0.18);
  border: 1px solid rgba(76,195,255,0.6);
  transition: transform .2s ease;
}
.product-ad a {
  text-decoration: none; color: inherit;
  display: block;
}
.product-ad:hover { transform: translateY(-1px); }
.sponsored-page { display: inline-block; margin: .25rem 0; padding: .75rem 1rem;
  border-radius: 999px; background: rgba(124,92,255,0.18);
  border: 1px solid rgba(124,92,255,0.6); }
.sponsored-page a { text-decoration: none; color: inherit; }

/* Typography */
h2 {
  font-size: clamp(1.25rem, 2.2vw + 0.5rem, 2rem);
  margin: 0.75rem 0 0.5rem;
  color: var(--text);
}
p { margin: 0.5rem 0 1rem; color: var(--text); }

/* Lists */
ul { padding-left: 1.25rem; margin: 0.5rem 0 1rem; }
li { margin: 0.25rem 0; color: var(--text); }

/* Links & buttons (interactive states) */
a, button, .btn, .cta {
  color: var(--text);
  text-decoration: none;
  outline: none;
}
a { color: var(--accent); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; color: var(--accent-2); }
button { background: transparent; border: 0; padding: 0; font: inherit; cursor: pointer; }

/* Button variants */
.btn, .cta {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid rgba(120,180,255,0.75);
  background: linear-gradient(135deg, rgba(68,160,255,1) 0%, rgba(0,180,255,1) 100%);
  color: #041226;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}
.btn:hover, .cta:hover { transform: translateY(-1px); }
.btn:active, .cta:active { transform: translateY(0); }
.btn--outline {
  background: transparent;
  border: 1px solid rgba(120,180,255,0.9);
  color: var(--text);
}
.btn--outline:hover { background: rgba(120,180,255,0.15); }

/* Focus visibility */
:focus-visible {
  outline: 3px solid #7af;
  outline-offset: 2px;
  border-radius: 6px;
}
a:focus-visible, button:focus-visible {
  outline-offset: 2px;
  outline: 2px solid #7af;
  border-radius: 6px;
}

/* Layout helpers for responsive sections */
@media (min-width: 720px) {
  .container { padding-inline: 0; }
  header { padding: 1.5rem 0; }
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f5fb;
    --bg-2: #e9e6f5;
    --text: #0b1020;
    --muted: #515464;
    --glass: rgba(255,255,255,0.75);
    --glass-border: rgba(0,0,0,0.15);
    --shadow: 0 6px 18px rgba(0,0,0,0.08);
  }
  body {
    background: linear-gradient(135deg, #f9f6ff 0%, #f0f2ff 60%, #e7eaff 100%);
    color: var(--text);
  }
  body::before, body::after { opacity: 0.25; }
  a { color: #2a6de6; }
  .card { background: rgba(255,255,255,0.85); border: 1px solid rgba(0,0,0,0.08); }
  .image-frame { border-color: rgba(0,0,0,0.15); }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .btn, .cta { transition: none; }
}

/* Print styles */
@media print {
  body { background: white; color: black; }
  .content, .image-frame, .card, .btn { background: transparent !important; color: black !important; border: none !important; box-shadow: none !important; }
}
