/* Section: Base tokens */
:root {
  --bg: #0a0a1f;
  --bg-2: #141027;
  --text: #e9f0ff;
  --muted: #a7b6d6;
  --accent: #2ee3a9;      /* seafoam */
  --accent-2: #7a5cff;    /* ultraviolet */
  --panel: rgba(16, 22, 44, 0.65);
  --panel-2: rgba(18, 28, 60, 0.58);
  --border: rgba(120, 180, 255, 0.45);
  --shadow: 0 8px 24px rgba(0,0,0,.34);
  --radius: 14px;
  --focus: 0 0 0 3px rgba(46, 227, 160, 0.9);
}

/* Section: Base layout & background (mobile-first) */
html, body {
  height: 100%;
}
html, body {
  box-sizing: border-box;
}
*, *::before, *::after { box-sizing: inherit; }

html, body {
  margin: 0;
  padding: 0;
  color: var(--text);
  background-color: #000;
  /* Layered background: gradient + ultraviolet/seafoam polka dots + subtle scanlines/noise */
  background-image:
    /* ultraviolet polka dots */
    radial-gradient(circle at 25px 25px, rgba(120,0,180,.25) 2px, transparent 3px),
    radial-gradient(circle at 65px 60px, rgba(0,255,170,.25) 2px, transparent 3px),
    /* gradient base */
    linear-gradient(135deg, #060821 0%, #0a0a2a 55%, #0a0d2a 100%),
    /* subtle scanlines */
    repeating-linear-gradient(to bottom, rgba(255,255,255,.04) 0 1px, transparent 1px 2px);
  background-blend-mode: normal, normal, normal, overlay;
  min-height: 100%;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Helvetica Neue", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

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

/* Section: Global typography helpers */
html { font-size: 16px; }
body { color: var(--text); }

h1, h2, h3, h4, h5, h6 {
  margin: 0.25rem 0 0.375rem;
  color: #f4f7ff;
}
p { margin: 0 0 1rem; color: rgba(233,240,255,.92); }

/* Section: Structural elements (semantic targets) */
header, nav, main, article, aside, footer {
  display: block;
}
header { padding: 1.75rem 1rem 0.75rem; text-align: center; }
main { padding: 0.75rem 1rem 2rem; }
footer { padding: 1rem; display: grid; gap: 1rem; place-items: center; }

/* Section: Container & layout utilities */
.container {
  width: 100%;
  max-width: clamp(680px, 88vw, 1100px);
  margin: 0 auto;
  padding-inline: 1rem;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.card {
  background: rgba(10, 12, 28, 0.55);
  border: 1px solid rgba(140,170,255,.40);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text);
}
.tag {
  display: inline-block;
  font-size: .75rem;
  padding: .25rem .5rem;
  border-radius: 999px;
  background: rgba(46, 227, 169, .28);
  color: #eafff6;
  border: 1px solid rgba(46, 227, 169, .65);
}

/* Section: Image frame styling */
.image-frame {
  aspect-ratio: 16 / 9;
  width: 100%;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.25);
  box-shadow: 0 6px 18px rgba(0,0,0,.35), inset 0 0 14px rgba(46,230,169,.25);
  background: #000;
}
.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.0);
  transition: transform 500ms ease;
}
.image-frame:hover img { transform: scale(1.05); }

/* Section: Glass panels (content blocks) */
.glass {
  background: rgba(16, 22, 50, 0.55);
  border: 1px solid rgba(120, 180, 255, 0.45);
  border-radius: 12px;
  padding: 1rem;
  color: var(--text);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
@supports not (backdrop-filter: blur(12px)) {
  .glass {
    background: rgba(16, 22, 50, 0.88);
    border-color: rgba(120,180,255,.65);
  }
}
.content { padding: 0.25rem 0 0.75rem; }

/* Section: Product ad / sponsor blocks within footer */
.product-ad, .sponsored-page {
  display: block;
  width: min(100%, 720px);
  padding: 0.75rem 1rem;
  text-align: center;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
}
.product-ad { background: rgba(0,0,0,.25); border: 1px solid rgba(120,180,255,.45); }

/* Section: Links & interactive controls */
a, button, .btn, .cta {
  font: inherit;
  color: #eaffff;
  text-decoration: none;
  cursor: pointer;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease, color 120ms ease;
}
a { color: var(--accent-2); }
a:hover, a:focus { text-decoration: underline; outline: none; }
a:focus-visible, button:focus-visible, .btn:focus-visible, .cta:focus-visible {
  outline: none;
  outline: none;
  box-shadow: var(--focus);
  outline-offset: 0;
}
.btn, .cta {
  padding: .6rem .92rem;
  border-radius: 10px;
  border: 1px solid rgba(120,180,255,.6);
  background: linear-gradient(135deg, rgba(46,227,169,.8), rgba(46,227,169,.5));
  color: #041b0a;
  font-weight: 600;
}
.btn:hover, .cta:hover {
  transform: translateY(-1px);
}
.btn:active, .cta:active {
  transform: translateY(1px) scale(0.995);
}
.btn--outline {
  background: transparent;
  color: var(--text);
  border-color: rgba(120,180,255,.65);
}
.btn--outline:hover {
  background: rgba(120,180,255,.15);
}
.cta {
  background: linear-gradient(135deg, rgba(122,92,255,.92), rgba(46,227,169,.92));
  color: #041b0a;
  border: 1px solid rgba(120,180,255,.8);
}
.cta:hover { filter: saturate(1.1); }

/* Section: Typography helpers for responsive sizing */
h1 { font-size: clamp(1.6rem, 3vw + 1rem, 2.8rem); line-height: 1.15; letter-spacing: .2px; }
h2 { font-size: clamp(1.25rem, 2.4vw, 1.75rem); }
h3 { font-size: clamp(1.05rem, 1.8vw, 1.25rem); }

/* Section: Accessibility & color contrast improvements for inline text over glass */
.main-content {
  color: var(--text);
}
@media (prefers-color-scheme: dark) {
  :root { --text: #eaf2ff; }
}

/* Section: Print styles (basic readability) */
@media print {
  body { background: white; color: black; }
  a { color: black; text-decoration: underline; }
  .glass { background: white; border: 1px solid #ccc; }
}
