/* Section: Base resets & tokens */
:root {
  --bg: #0a0a0f;
  --bg-2: #141421;
  --text: #e9e9f0;
  --muted: #a6a6a6;
  --accent: #ffd300;        /* cyber yellow (neon accent) */
  --accent-2: #ff2d2d;       /* crimson glow */
  --surface: rgba(255, 255, 255, 0.08);
  --surface-2: rgba(255, 255, 255, 0.14);
  --border: rgba(255, 255, 255, 0.25);
  --card: rgba(255, 255, 255, 0.08);
  --shadow: 0 6px 18px rgba(0,0,0,.4);
  --radius: 14px;
  --radius-sm: 12px;
  --focus: 0 0 0 3px rgba(255, 214, 0, 0.85);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
html, body { margin: 0; padding: 0; }

/* Section: Layout & background (mobile-first) */
/* Layered background: gradient + subtle scanlines/noise via CSS layers */
body {
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  line-height: 1.5;
  background-color: #050505;
  /* layered background: crimson hues with neon glow */
  background-image:
    radial-gradient(circle at 65% -10%, rgba(255,0,0,.25), transparent 40%),
    linear-gradient(135deg, rgba(20,0,0,.95), rgba(0,0,0,.95) 60%),
    repeating-linear-gradient(to bottom, rgba(0,0,0,.04) 0 1px, transparent 1px 3px),
    #050509;
  background-blend-mode: screen, normal, overlay, normal;
  min-height: 100vh;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  /* subtle scanlines overlay */
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,.04) 0 1px, transparent 1px 2px);
  mix-blend-mode: overlay;
  opacity: .25;
  z-index: 0;
}
@media (prefers-reduced-motion: reduce) {
  body::before { display: none; }
}
.container, .grid { z-index: 1; }

/* Section: Global helpers & components */
.image-frame, .featured-image {
  width: 100%;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.25);
  box-shadow: var(--shadow);
}
.image-frame { aspect-ratio: 16/9; }
.image-frame img, .featured-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.content { padding: 1rem; }

/* Glass panel (with fallback) */
.glass {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: 0 10px 28px rgba(0,0,0,.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
@supports ((backdrop-filter: blur(12px))) {
  .glass { backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
}
@supports not ((backdrop-filter: blur(12px))) {
  .glass { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.4); }
}

/* Section: Structural elements (HTML semantics) */
html, body, header, nav, main, article, footer, aside {
  /* ensure consistent rendering baseline */
  box-sizing: border-box;
}
header, main, footer, aside, article { display: block; }

/* Section: Typography & scales (fluid typography) */
h1 { font-size: clamp(1.4rem, 0.9rem + 2.5vw, 2.6rem); line-height: 1.08; margin: .25rem 0 0.5rem; color: #fff; text-shadow: 0 0 8px rgba(255,255,255,.25); }
h2 { font-size: clamp(1.2rem, 0.8rem + 1.5vw, 1.6rem); margin: .75rem 0 .5rem; color: #fff; }
h3 { font-size: clamp(1rem, 0.7rem + 1.2vw, 1.25rem); margin: .75rem 0; color: #fff; }
p { margin: .5rem 0 1rem; color: var(--text); }
ul, ol { padding-left: 1.25rem; margin: .5rem 0 1rem; }
li { margin: .25rem 0; color: var(--text); }

/* Section: Layout primitives (responsive utilities) */
.container { width: 100%; max-width: clamp(420px, 90vw, 1100px); margin-inline: auto; padding-inline: 1rem; }
.grid { display: grid; gap: 1rem; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }

/* Section: Nav & interactive elements */
nav { display: flex; justify-content: center; gap: .75rem; flex-wrap: wrap; padding: .25rem 0; }
nav a {
  color: var(--accent);
  text-decoration: none;
  padding: .4rem .75rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(0,0,0,.0);
  transition: transform .2s ease, text-decoration .2s ease;
}
nav a:hover { text-decoration: underline; text-underline-offset: 3px; transform: translateY(-1px); }

/* Section: Link & button styles (accessible focus) */
a, button, .btn, .cta {
  cursor: pointer;
  color: var(--text);
  text-decoration: none;
  display: inline-block;
  padding: .6rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.08);
  transition: transform .2s ease, background .2s ease, color .2s ease;
}
a:hover, a:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
.btn, .cta { background: var(--accent); color: #000; border: 1px solid rgba(0,0,0,.2); }
.btn:hover, .cta:hover { transform: translateY(-1px); }
.btn:active, .cta:active { transform: scale(0.98); }

/* Focus ring for keyboard users (visible) */
a:focus-visible, button:focus-visible, .btn:focus-visible, .cta:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  outline-offset: 2px;
}

/* Section: Utilities for content blocks used in the layout */
/* .container & .grid helpers already defined above; add a simple glassy section class if needed */
.section-glass { composes: glass; }

/* Section: Images & media tweaks (fallbacks included) */
.image-frame img, .featured-image img { display: block; width: 100%; height: 100%; object-fit: cover; }

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

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