/* Base system & tokens */
:root {
  --bg: #0b002b;
  --bg-2: #1a0033;
  --text: #f5f7ff;
  --muted: #e0c84f;
  --accent: #e6b300;
  --accent-2: #ffd74a;
}
*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; }
html { font-family: system-ui, -apple-system, "Segoe UI", Roboto, Inter, Arial, sans-serif; }
body {
  margin: 0;
  color: var(--text);
  min-height: 100vh;
  background-color: var(--bg);
  /* Layered background: gradient + subtle scanlines + soft glow to evoke cyberpunk neural network */
  background-image:
    radial-gradient(circle at 25% -10%, rgba(180,150,255,.12), transparent 40%),
    linear-gradient(135deg, rgba(18,0,60,.98), rgba(12,0,28,.98) 60%, rgba(18,0,60,.98)),
    repeating-linear-gradient(to bottom, rgba(255,255,255,.04) 0 1px, transparent 1px 2px);
  background-blend-mode: overlay, normal, normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

/* Layout primitives */
html, body, header, nav, main, article, footer, aside {
  /* Ensures predictable stacking and defaults across sections */
}
.container {
  width: 100%;
  max-width: clamp(640px, 90vw, 1100px);
  margin-inline: auto;
  padding-inline: 1rem;
}
.grid { display: grid; gap: 1rem; }
.card {
  padding: .75rem;
  border-radius: 12px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.25);
}
.tag {
  display: inline-block;
  padding: .15em .5em;
  font-size: .75rem;
  border-radius: 999px;
  background: rgba(230,180,0,.25);
  border: 1px solid rgba(230,180,0,.55);
  color: var(--text);
}

/* Glass panels (with fallback) */
.glass {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: 0 8px 32px rgba(0,0,0,.25);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
@supports not (backdrop-filter: blur(12px)) {
  .glass { background: rgba(255,255,255,.15); }
}

/* Typography scale (mobile-first, fluid) */
h1 { font-size: clamp(2rem, 3.5vw + 1rem, 3.75rem); line-height: 1.04; margin: .25rem 0 0; letter-spacing: .2px; }
h2 { font-size: clamp(1.5rem, 2.5vw + .5rem, 2.6rem); margin: .5rem 0; }
h3 { font-size: clamp(1.25rem, 1.6vw + .5rem, 1.75rem); margin: .5rem 0; }
p { font-size: clamp(1rem, 1.2vw + .4rem, 1.125rem); margin: .5rem 0 1rem; color: var(--text); }
blockquote {
  margin: .75rem 0;
  padding-left: 1rem;
  border-left: 4px solid var(--accent);
  color: var(--muted);
  font-style: italic;
}
a { color: var(--accent-2); text-decoration: none; outline: none; }
a:hover, a:focus { text-decoration: underline; color: var(--accent); }
a:focus-visible { outline: 3px solid rgba(255,255,255,.9); outline-offset: 3px; border-radius: 4px; }

/* Links & controls accessibility */
ul { padding-left: 1.25rem; margin: .25rem 0 1rem; }
li { margin: .25rem 0; }

/* Structural selectors (the HTML uses these) */
html, body { padding: 0; }
header {
  width: min(1100px, 92%);
  margin: 1rem auto;
  text-align: center;
}
nav { margin-top: .25rem; }
main { padding: 0; }
article { margin: 0 auto; padding: 0; max-width: clamp(640px, 90vw, 980px); }
aside { display: none; } /* not used in page, kept for accessibility */

footer {
  padding: 1rem;
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
.image-frame {
  width: 100%;
  max-width: 800px;
  aspect-ratio: 16 / 9;
  margin: 1rem auto;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.25);
  box-shadow: 0 6px 20px rgba(0,0,0,.4);
  background: #111;
}
.image-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Content area (optional class for sections) */
.content { max-width: 70ch; margin: 0 auto; padding: 0 1rem; }

/* Product ad section in footer */
.product-ad {
  text-align: center;
  padding: .75rem;
  border-radius: 12px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.25);
}
.product-ad a { display: block; padding: .5rem; color: var(--text); text-decoration: none; }

/* Button primitives (solid and outline variants) */
button, .btn, .cta {
  display: inline-block;
  padding: .65rem 1rem;
  border-radius: 9px;
  border: 1px solid rgba(255,255,255,.35);
  background: var(--accent);
  color: #111;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: transform .15s ease, background .2s ease;
}
.btn { background: var(--accent); }
.btn:hover { transform: translateY(-1px); background: #d6a600; }
.btn:focus-visible { outline: 3px solid rgba(255,255,255,.9); outline-offset: 2px; }
.btn.outline, .cta.outline { background: transparent; color: var(--text); border-color: rgba(232,178,0,.9); }

/* Image frame helper for consistent look in content */
.muted { color: var(--muted); }

/* Print styles (basic readability) */
@media print {
  body { background: #fff; color: #000; }
  a { color: #00f; text-decoration: underline; }
  .glass { backdrop-filter: none; -webkit-backdrop-filter: none; }
  header, footer { border: none; box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}