/* Section: Palette & Layout Tokens */
:root {
  --bg: #0a0a0f;
  --bg-2: #1a1020;
  --text: #e9e0f8;
  --muted: #c6bde0;
  --accent: #b88cff;
  --accent-2: #7e5bd8;
  --surface: rgba(18, 12, 28, 0.28);
  --surface-2: rgba(0, 0, 0, 0.25);
  --border: rgba(255, 255, 255, 0.25);
}

/* Section: Base & Background Layers */
html, body {
  height: 100%;
}
html, body {
  margin: 0;
  padding: 0;
  color-scheme: dark;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Inter", Arial, sans-serif;
}
body {
  line-height: 1.5;
  color: var(--text);
  /* Layered background: gradient + lilac accents + scanlines (noise) */
  background-image:
    linear-gradient(135deg, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.85) 60%, rgba(0,0,0,0.95) 100%),
    radial-gradient(circle at 15% 12%, rgba(180,120,240,0.25) 0%, rgba(180,120,240,0.0) 40%),
    radial-gradient(circle at 70% 22%, rgba(120,180,255,0.15) 0%, rgba(120,180,255,0.0) 40%),
    linear-gradient(135deg, #0a0a0f 0%, #14121e 40%, #0b0b15 100%);
  background-blend-mode: overlay, screen, overlay, normal;
  /* Subtle scanlines */
  background-image: 
    linear-gradient(135deg, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0.75) 60%, rgba(0,0,0,0.85) 100%),
    repeating-linear-gradient(to bottom, rgba(255,255,255,0.04) 0px, rgba(255,255,255,0.04) 1px, transparent 1px, transparent 2px),
    radial-gradient(circle at 15% 12%, rgba(180,120,240,0.25) 0%, rgba(180,120,240,0.0) 40%),
    radial-gradient(circle at 70% 22%, rgba(120,180,255,0.15) 0%, rgba(120,180,255,0.0) 40%),
    linear-gradient(135deg, #0a0a0f 0%, #14121e 40%, #0b0b15 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Section: Layout Foundations */
html, body, header, nav, main, article, footer, aside {
  display: block;
}
* { box-sizing: border-box; }

/* Section: Global Utilities */
.container {
  width: 100%;
  max-width: clamp(320px, 90vw, 1100px);
  margin-inline: auto;
  padding-inline: 1rem;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 1fr), 1fr));
  gap: 1rem;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 6px 24px rgba(0,0,0,0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.tag {
  display: inline-block;
  padding: .15em .5em;
  border-radius: 999px;
  font-size: .75rem;
  color: var(--text);
  background: rgba(176,114,255,0.25);
  border: 1px solid rgba(255,255,255,0.25);
}
a, button, .btn, .cta { cursor: pointer; color: var(--text); text-decoration: none; border-radius: 6px; }

/* Section: Typography & Elements */
header, nav, main, article, footer, aside { width: 100%; }

/* Section: Header & Nav */
header {
  padding: 1rem;
}
header h1 {
  margin: 0 0 .25rem;
  font-family: inherit;
  font-weight: 700;
  font-size: clamp(1.25rem, 4vw, 2.5rem);
  line-height: 1.15;
  color: var(--text);
}
nav {
  display: block;
}
nav a {
  color: var(--accent);
  text-decoration: none;
  padding: .25rem .5rem;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.25);
}
nav a:hover { text-decoration: underline; }

/* Section: Main Content & Glass Panels */
main {
  padding: 1rem;
}
.article { display: block; }

.image-frame {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  padding: 6px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.25);
  box-shadow: 0 12px 28px rgba(0,0,0,0.45);
  overflow: hidden;
  /* Glass surface fallback for older browsers without backdrop-filter */
}
.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 8px;
  filter: saturate(1.05);
  transform: translateZ(0); /* GPU hint */
}
@supports not (backdrop-filter: blur(8px)) {
  .image-frame {
    background: rgba(2,2,6,0.55);
    border: 1px solid rgba(255,255,255,0.35);
  }
}

.content {
  padding: 0.75rem 0;
  color: var(--muted);
  max-width: 60ch;
}
.content h2, .content p { margin: 0.25rem 0; }

/* Section: Interaction States  */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}
a:hover { text-decoration: underline; color: var(--accent-2); }

/* Button Variants */
.btn {
  display: inline-block;
  padding: .65rem 1rem;
  border: 1px solid rgba(255,255,255,.5);
  background: rgba(0,0,0,.25);
  color: var(--text);
  font-weight: 600;
  font-size: 1rem;
  transition: transform .15s ease, background-color .2s ease, color .2s ease;
}
.btn:hover { background: rgba(255,255,255,.08); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none;
  color: #fff;
}
.btn.outline {
  background: transparent;
  border: 1px solid rgba(255,255,255,.6);
}
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Section: Lists & Misc */
ul { padding-left: 1.2rem; margin: .5rem 0; }
li { margin: .25rem 0; }

/* Section: Print */
@media print {
  body { background: #fff; color: #000; }
  a { text-decoration: underline; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}