/* Base tokens */
/* Layered backdrop */
/* Layout basics */
/* Glass panels */
/* Typography & helpers */
/* Media & image frame */
/* Links, buttons & CTAs */
/* Content blocks & utilities */
/* Responsive & accessibility */
/* Print */

:root {
  --bg: #0b1a38;
  --bg-2: #2a174a;
  --text: #eaf2ff;
  --muted: #aab6d9;
  --accent: #3b7bff;
  --accent-2: #7b4ad7;
  --glass: rgba(9, 6, 40, 0.22);
  --glass-border: rgba(255, 255, 255, 0.35);
  --radius: 14px;
  --shadow: 0 8px 26px rgba(0,0,0,.25);
  --dur: 220ms;
}

html, body {
  height: 100%;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-2) 60%, #0b0f24 100%);
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  overflow-x: hidden;
  line-height: 1.55;
}

/* Subtle layered backdrop: gradient + scanlines + noise-like texture (pure CSS) */
html::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 20px 40px, rgba(255,255,255,.08) 0 2px, transparent 3px),
    radial-gradient(circle at 60px 20px, rgba(255,255,255,.04) 0 2px, transparent 3px),
    repeating-linear-gradient(to bottom, rgba(255,255,255,.03) 0 1px, transparent 1px 2px);
  background-size: 100px 100px, 120px 90px, 2px 2px;
  mix-blend-mode: overlay;
  opacity: 0.6;
}
html::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,.06) 60%, rgba(0,0,0,0) 100%);
  mix-blend-mode: overlay;
  opacity: 0.4;
}

/* Layout helpers */
.container {
  width: 100%;
  max-width: clamp(640px, 90vw, 1100px);
  margin: 0 auto;
  padding: 0 1rem;
}
.grid { display: grid; gap: 1rem; }
.card {
  background: rgba(9,6,40,0.22);
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: var(--shadow);
}
.tag {
  display: inline-block;
  padding: .15rem .5rem;
  border-radius: 999px;
  font-size: .75rem;
  background: rgba(59,123,255,.25);
  color: var(--text);
}
.image-frame {
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.28);
  box-shadow: inset 0 0 12px rgba(0,0,0,.25);
}
.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.content { padding: .5rem 0; }

/* Glass panels with fallback */
.glass {
  background: rgba(9,6,40,0.22);
  border: 1px solid rgba(255,255,255,.35);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: 0 10px 28px rgba(0,0,0,.25);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
@supports not (backdrop-filter: blur(12px)) {
  .glass {
    background: rgba(9,6,40,0.42);
    border-color: rgba(255,255,255,.55);
  }
}

/* Typography */
h1, h2, h3 { line-height: 1.12; margin: .25rem 0; }
h1 { font-size: clamp(1.75rem, 5vw, 3rem); letter-spacing: .2px; }
h2 { font-size: clamp(1.25rem, 3vw, 1.75rem); margin-top: .4rem; color: var(--text); }
p { color: var(--muted); margin: .6rem 0; }
blockquote {
  margin: .6rem 0;
  padding: .6rem 1rem;
  border-left: 4px solid var(--accent);
  background: rgba(5,5,15,.28);
  border-radius: 6px;
  color: var(--text);
}
ul { margin: .6rem 0 1rem 1.25rem; color: var(--text); }

/* Links & CTAs */
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover, a:focus { text-decoration: underline; }
a:focus-visible, button:focus-visible {
  outline: 3px solid #a2d7ff;
  outline-offset: 2px;
  border-radius: 4px;
}
.btn {
  display: inline-block;
  padding: .8rem 1.05rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  letter-spacing: .2px;
  transition: transform var(--dur) ease, background-color var(--dur) ease, box-shadow var(--dur) ease;
}
.btn:hover { filter: brightness(0.95); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 3px solid #8bd0ff; outline-offset: 2px; }
.btn--outline {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}
.cta { /* alias for primary action if used on anchors/buttons */ }

/* Media & image frame usage */
.image-frame { overflow: hidden; }

/* Content blocks & sections */
header, main, footer, aside {
  display: block;
}
header {
  padding: 1rem 1rem;
  text-align: center;
  margin: 1rem auto;
  max-width: clamp(640px, 90vw, 1100px);
  border-radius: var(--radius);
  background: rgba(9,6,40,0.32);
  border: 1px solid rgba(255,255,255,.36);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
header h1 { margin: 0 0 .25rem; font-size: clamp(1.75rem, 4.5vw, 3rem); color: var(--text); }
header .meta { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; font-size: .92rem; margin-top: .25rem; }
nav { margin-top: .5rem; }
nav a { color: var(--accent); text-decoration: none; padding: .25rem .5rem; border-radius: 6px; border: 1px solid transparent; }
nav a:hover { text-decoration: underline; background: rgba(255,255,255,.04); }

/* Main article layout */
main { padding: 1rem 0; }
article { max-width: min(860px, 92vw); margin: 0 auto; padding: 0 0.5rem; }
.featured-image { margin: .75rem 0; }

/* Footer & product ads */
footer { padding: 1rem; text-align: center; color: var(--muted); }
.product-ad, .sponsored-page {
  display: block;
  margin: .5rem auto;
  padding: .75rem;
  border-radius: 12px;
  max-width: 720px;
  width: 100%;
  text-align: left;
  background: rgba(9,6,40,.28);
  border: 1px solid rgba(255,255,255,.35);
  box-shadow: var(--shadow);
}
.product-ad a, .sponsored-page a { color: var(--text); text-decoration: none; display: block; padding: .25rem 0; }
.product-ad:hover, .sponsored-page:hover { transform: translateY(-1px); transition: transform .2s ease; }

/* Print */
@media print {
  body { background: #fff; color: #000; }
  a { color: #000; text-decoration: underline; }
}

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

/* Responsive tweaks */
@media (min-width: 720px) {
  .grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
  article { padding: 1.5rem; }
}