/* 1. Tokens & Base */
:root{
  --bg: #120027;
  --bg-2: #2a0055;
  --text: #f4ebff;
  --muted: #c6b7ff;
  --accent: #8a5cff;
  --accent-2: #c57aff;
  --surface: rgba(12, 0, 40, 0.22);
  --panel: rgba(12, 0, 40, 0.28);
  --border: rgba(170, 130, 255, 0.4);
  --shadow: 0 8px 24px rgba(0,0,0,.25);
  --focus: 3px solid rgba(138, 92, 255, .95);
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; }
html { scroll-behavior: smooth; }

/* Layered background: gradient + subtle noise/scanlines (pure CSS) */
body {
  margin: 0;
  min-height: 100dvh;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  font-size: clamp(14px, 1.2vw + 8px, 18px);
  line-height: 1.5;
  background: linear-gradient(135deg, #120027 0%, #2a0055 60%, #0b0033 100%);
  background-attachment: fixed;
  position: relative;
  isolation: isolate;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Subtle scanline overlay + faint glow to simulate a neon grid */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px),
    radial-gradient(circle at 20% 10%, rgba(140,0,200,.15), transparent 40%);
  background-size: 100% 2px, 2px 100%, 1200px 1200px;
  background-repeat: repeat;
  mix-blend-mode: overlay;
  opacity: .5;
  z-index: 0;
  filter: saturate(110%);
}

/* 2. Layout utilities & typography */
.container {
  width: 100%;
  max-width: clamp(640px, 92vw, 1120px);
  margin-inline: auto;
  padding-inline: 1rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.card {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 12px;
  padding: .9rem;
  color: var(--text);
  box-shadow: var(--shadow);
}

.content { padding: 0.75rem 0; color: var(--text); }

/* 3. Glass-style panels (headers/sections) */
header, main, footer, aside {
  background: rgba(12, 0, 40, 0.18);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  box-shadow: 0 8px 26px rgba(0,0,0,.25);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  margin: 0.75rem auto;
  max-width: 1000px;
  z-index: 1;
}

@supports not (backdrop-filter: blur(12px)) {
  header, main, footer, aside { background: rgba(12, 0, 40, 0.66); }
}

/* 4. Image frame styling */
.image-frame {
  aspect-ratio: 16/9;
  width: 100%;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.25);
  box-shadow: 0 10px 28px rgba(0,0,0,.4);
}
.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(1.05);
}

/* 5. Typography & interactive elements */
h1, h2, h3, h4 { margin: .25rem 0; color: var(--text); }
h1 {
  font-size: clamp(1.75rem, 3vw + 0.5rem, 3.75rem);
  line-height: 1.05;
  letter-spacing: .2px;
  margin-bottom: .25rem;
}
p { margin: .25rem 0 0; color: var(--muted); }

a, button, .btn, .cta {
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}
ul { padding: 0; margin: 0; list-style: none; }

.tag {
  display: inline-block;
  padding: .15rem .5rem;
  font-size: .75rem;
  border-radius: 999px;
  background: rgba(140, 90, 255, .18);
  border: 1px solid rgba(140, 90, 255, .5);
  color: var(--text);
}

/* Buttons: solid and outline variants */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .65rem 1.05rem;
  border-radius: 999px;
  border: 1px solid rgba(180, 140, 255, .6);
  background: linear-gradient(135deg, rgba(138,92,255,.95) 0%, rgba(197,122,255,.95) 100%);
  color: #fff;
  font-weight: 600;
  transition: transform .15s ease, background .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

/* Outline variant for buttons/links */
.btn--outline, .cta {
  padding: .65rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(170,130,255,.7);
  background: transparent;
  color: #fff;
}
.btn--outline:hover, .cta:hover { background: rgba(170,130,255,.15); }

/* Focus ring for accessibility (focus-visible) */
:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(138, 92, 255, .63);
  border-radius: 6px;
}
a:focus-visible { text-decoration: underline; }

/* 6. Lists & utilities adjustments */
ul, ol { padding-left: 1rem; }
li { margin: .25rem 0; }

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

/* 8. Print styles (basic readability) */
@media print {
  body { background: #fff; color: #000; }
  header, main, footer { background: transparent; border: none; box-shadow: none; }
}
