/* Base */
:root {
  --bg: #0b0a15;
  --bg-2: #141321;
  --text: #e9e3ff;
  --muted: #b8b3d6;
  --accent: #6b7a3f;           /* olive */
  --accent-2: #c6b5dc;         /* soft lilac */
  --panel: rgba(15, 12, 28, 0.28);
}
html, body {
  height: 100%;
}
html, body, header, nav, main, article, footer, aside {
  box-sizing: border-box;
}
html, body {
  margin: 0;
  padding: 0;
  color: var(--text);
  background: linear-gradient(135deg, var(--bg-2) 0%, var(--bg) 60%, #0a0a14 100%);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  overflow-x: hidden;
}
html:focus-within { scroll-behavior: smooth; }

/* Layered background: gradient + subtle scanlines + noise-like speckles (pure CSS) */
body::before {
  content: "";
  position: fixed; inset: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(120,90,210,.15), transparent 40%),
    radial-gradient(circle at 80% 100%, rgba(80,120,60,.15), transparent 40%),
    linear-gradient(135deg, rgba(6,8,20,.0), rgba(6,8,20,.0) 60%, rgba(6,8,20,.15) 100%);
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.04), rgba(255,255,255,.04)),
    repeating-linear-gradient(to bottom, rgba(255,255,255,.04) 0 1px, transparent 1px 2px);
  mix-blend-mode: overlay;
  opacity: .25;
  z-index: 0;
}
@supports not (backdrop-filter: blur(10px)) and not (-webkit-backdrop-filter: blur(10px)) {
  body { background: linear-gradient(135deg, var(--bg-2), var(--bg)); }
}

/* Layout helpers */
.container {
  max-width: clamp(640px, 90vw, 1100px);
  margin-inline: auto;
  padding-inline: 1rem;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.card { padding: 1rem; border-radius: 14px; }

/* Glass panel (frosted) with graceful fallback */
.glass {
  background: rgba(12, 10, 20, 0.28);
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 14px;
  padding: 1rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 28px rgba(0,0,0,.25);
  color: var(--text);
}
@supports not (backdrop-filter: blur(12px)) and not (-webkit-backdrop-filter: blur(12px)) {
  .glass { background: rgba(12, 10, 20, 0.9); border-color: rgba(255,255,255,.5); }
}

/* Typography scales (fluid) */
h1, h2, h3 { line-height: 1.12; margin: .25rem 0; }
h1 { font-size: clamp(2rem, 3vw + 1.25rem, 3.5rem); font-weight: 700; letter-spacing: .2px; }
h2 { font-size: clamp(1.25rem, 2vw + .75rem, 2rem); font-weight: 700; margin-top: .25rem; color: var(--text); }
p { margin: 0 0 1rem; color: var(--text); }

/* Header, main, footer, aside foundations */
header, main, footer, aside { z-index: 1; }
header { padding: 1.25rem 0; }
main { padding: 1rem 0 2rem; }
footer { padding: 1rem 0; }

/* Image frame styling */
.image-frame {
  aspect-ratio: 16/9;
  width: 100%;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.25);
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
  background: #0b0a15;
}
.image-frame img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  image-rendering: auto;
  transform: scale(1.0);
  transition: transform .3s ease;
}
.image-frame:hover img { transform: scale(1.03); }

/* Content surface within article */
.content { padding: .25rem; }

/* Lists and inline items */
ul, li { margin: .25rem 0; padding: 0 0 0 1.25rem; }
li { color: var(--text); }

/* Product ad and inline links/buttons */
.product-ad, .sponsored-page { display: block; margin: .5rem 0; }
.product-ad a, .sponsored-page a {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .6rem 1rem; border-radius: 999px;
  text-decoration: none; color: #0a0a0a;
  background: linear-gradient(135deg, #d8e6c6, #b8caa0);
  font-weight: 700;
}
.product-ad a:hover, .sponsored-page a:hover { filter: brightness(0.98); transform: translateY(-1px); }

/* Generic interactive controls */
a, button, .btn, .cta {
  color: var(--text);
  text-decoration: none;
  outline: none;
}
a:focus-visible, button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 6px; }
a:hover { text-decoration: underline; color: var(--accent-2); }

.btn, .cta {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .6rem 1rem; border-radius: 999px; border: none;
  background: var(--accent); color: #f8f9f6; cursor: pointer;
  font-weight: 700; transition: transform .15s ease, box-shadow .2s ease;
  text-decoration: none;
}
.btn:hover, .cta:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(0,0,0,.25); }
.btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.btn--outline {
  background: transparent; color: var(--text);
  border: 1px solid rgba(255,255,255,.6);
}
.btn:active { transform: translateY(0); }

/* Utility-ish text accents (tags) */
.tag {
  display: inline-block; padding: .15rem .5rem; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.4);
  color: var(--text); background: rgba(108,118,58,.25);
  font-size: .75rem; margin-right: .25rem;
}

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

/* Print-friendly adaptations (basic) */
@media print {
  body { background: #fff; color: #000; }
  .glass { background: #fff; border: none; box-shadow: none; }
  a { color: #000; text-decoration: underline; }
}

/* Section headers (structure cues) */
.header-section { margin-bottom: .75rem; }
.main-section { margin-top: .75rem; }

/* Print-safe typography fallback for long quotes */
blockquote {
  margin: .75rem 0; padding: .5rem 1rem;
  border-left: 3px solid var(--accent-2);
  color: var(--muted);
  font-style: italic;
}
