/* Section: Base tokens */
:root {
  --bg: #0a1020;
  --bg-2: #0b1a36;
  --surface: rgba(9, 12, 40, 0.6);
  --surface-2: rgba(12, 18, 40, 0.45);
  --text: #e8f0ff;
  --muted: #a6b6d4;
  --accent: #4f6bff;
  --accent-2: #7aa2ff;
  --glass: rgba(12, 18, 40, 0.28);
  --glass-border: rgba(100, 120, 255, 0.55);
  --shadow: 0 8px 24px rgba(0,0,0,.40);
  --radius: 12px;
}

/* Section: Layout & Background */
html, body {
  height: 100%;
}
html {
  color-scheme: dark;
}
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  color: var(--text);
  background:
    radial-gradient( circle at 20% -10%, rgba(60,120,255,.25), transparent 40% ),
    radial-gradient( circle at 80% 0%, rgba(0,60,140,.25), transparent 40% ),
    linear-gradient(135deg, #0a1020 0%, #0b1140 40%, #0b1a3a 100%);
  background-blend-mode: screen, overlay, normal;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  position: relative;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.04), rgba(255,255,255,.04)),
    repeating-linear-gradient(to bottom, rgba(0,0,0,.04) 0 1px, transparent 1px 2px);
  mix-blend-mode: overlay;
  opacity: .65;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce){
  body::before { display: none; }
}
a { color: var(--accent-2); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Section: Global helpers & utilities */
.container {
  width: 100%;
  max-width: clamp(320px, 90vw, 1120px);
  margin-inline: auto;
  padding-inline: 1rem;
}
.grid {
  display: grid;
  gap: 1rem;
}
.card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 0.9rem;
  color: var(--text);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
@supports not (backdrop-filter: blur(8px)) {
  .card { background: rgba(12,18,40,.66); backdrop-filter: none; }
}
.tag {
  display: inline-block;
  padding: .15em .5em;
  border-radius: 999px;
  font-size: .75rem;
  color: #d9e6ff;
  background: rgba(76, 95, 210, 0.25);
  border: 1px solid rgba(92,115,240,.55);
}
ul { margin: 0; padding-left: 1.25rem; }
li { margin: .25rem 0; }

/* Section: Typography & Hero */
header {
  padding: clamp(1rem, 4vw, 2rem) 0;
  text-align: center;
  background: rgba(6, 10, 28, 0.55);
  border-bottom: 1px solid rgba(90, 110, 210, 0.45);
}
header h1 {
  margin: 0;
  font-size: clamp(1.6rem, 2vw + 1rem, 3rem);
  line-height: 1.15;
  letter-spacing: .2px;
  color: #eaf1ff;
  text-shadow: 0 0 14px rgba(80,120,255,.25);
}
main {
  padding: 1rem;
}
.image-frame {
  width: min(100%, 980px);
  margin: 0 auto 1.5rem;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(120,140,255,.5);
  background: rgba(15,22,60,.6);
  box-shadow: 0 6px 20px rgba(0,100,255,.25);
}
.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(1.05);
}
.content { padding: .25rem 0; }

/* Section: Interactive elements */
a, button, .btn, .cta {
  font-family: inherit;
  font-weight: 600;
  border-radius: 999px;
  padding: .65rem 1rem;
  display: inline-block;
  border: 1px solid rgba(120,140,255,.75);
  color: #fff;
  background: linear-gradient(to bottom, rgba(60,90,210,1), rgba(40,60,160,1));
  cursor: pointer;
  text-decoration: none;
  transition: transform .15s ease, background .2s ease, border-color .2s ease;
}
.btn:hover, .cta:hover { transform: translateY(-1px); }
.btn:active, .cta:active { transform: translateY(0); }
.btn.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(120,140,255,.9);
}
a.btn.secondary { text-decoration: none; }

/* Focus & accessibility for controls */
button:focus-visible, a:focus-visible, .btn:focus-visible, .cta:focus-visible {
  outline: 3px solid var(--accent-2);
  outline-offset: 2px;
}
.cta { display:inline-flex; align-items:center; gap: .5rem; }

/* Section: Layout primitives */
.main-area { padding: 1rem 0; }
footer {
  padding: 1rem 0 2rem;
  margin-top: auto;
}
.product-ad, .sponsored-page {
  display: block;
  width: 100%;
  max-width: 720px;
  margin: .25rem auto;
  text-align: center;
}
.product-ad a, .sponsored-page a {
  text-decoration: none;
  display: block;
  padding: .85rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(120,140,255,.65);
  background: rgba(12,18,40,.28);
  color: var(--text);
}
.product-ad a:hover, .sponsored-page a:hover { background: rgba(12,18,40,.42); text-decoration: underline; }

/* Section: Theme scale for dark mode with light-scheme fallback */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f3f7ff;
    --bg-2: #e8eeff;
    --text: #0b1b36;
    --muted: #4b5a8a;
    --accent: #3554ff;
    --accent-2: #4f6aff;
    --glass: rgba(255,255,255,.72);
    --glass-border: rgba(60,90,210,.5);
  }
  body {
    background: linear-gradient(135deg, #f7fbff 0%, #eef4ff 60%, #e6f0ff 100%);
    color: var(--text);
  }
  header {
    background: rgba(255,255,255,.75);
    border-bottom-color: rgba(60,90,210,.4);
  }
  .card {
    background: rgba(255,255,255,.8);
    border: 1px solid rgba(60,90,210,.6);
  }
  a { color: var(--accent-2); }
  a:hover, a:focus { text-decoration: underline; }
}

/* Section: Print styles (basic readability) */
@media print {
  body { background: #fff; color: #000; }
  header, main, footer { page-break-inside: avoid; }
  a { text-decoration: underline; }
}
  
/* Section: Print & motion guard */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}