/* Theme & Tokens */
:root{
  --bg: #0a0a12;
  --bg-2: #0b0b1a;
  --text: #e7e0ff;
  --muted: #b6a8d6;
  --accent: #D4AF37;       /* gold */
  --accent-2: #B5A3FF;     /* lavender */
  --surface: rgba(255,255,255,0.10);
  --surface-2: rgba(255,255,255,0.14);
  --radius: 12px;
  --shadow: 0 8px 28px rgba(0,0,0,.25);
}

/* Layered background: gradient + subtle noise/scanlines + gold stream hints */
html, body {
  height: 100%;
}
html {
  background: linear-gradient(135deg, rgba(10,10,22,.95), rgba(4,4,20,.95) 60%),
              radial-gradient(circle at 20% 0%, rgba(180, 140, 0, .15), transparent 40%),
              rgba(0,0,0,0);
}
body {
  margin: 0;
  color: var(--text);
  font-family: ui-system, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  line-height: 1.5;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  /* Gold binary stream + scanlines (pure CSS) */
  background-image:
    linear-gradient(135deg, rgba(0,0,0,.25), rgba(0,0,0,.25)),
    repeating-linear-gradient(0deg, rgba(212,175,55,.08) 0 1px, transparent 1px 2px),
    repeating-linear-gradient(90deg, rgba(180,140,0,.06) 0 2px, transparent 2px 4px);
  background-blend-mode: overlay;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-y: auto;
  scroll-behavior: smooth;
  isolation: isolate;
  /* Subtle glow glow behind content on dark bg for depth */
  position: relative;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 60% 10%, rgba(180,130,255,.15), transparent 40%),
              radial-gradient(circle at 20% 60%, rgba(212,175,55,.12), transparent 40%);
  mix-blend-mode: screen;
  filter: blur(0.5px);
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 4px; }

/* Layout helpers */
.container {
  width: 100%;
  max-width: clamp(680px, 92vw, 1100px);
  margin-inline: auto;
  padding-inline: 1rem;
}
.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.card {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
}
.section {
  margin: 0;
}
.content { padding: 0.5rem 0; }

/* Glass panels with fallback */
.glass {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: calc(var(--radius) + 2px);
  padding: 0;
  box-shadow: var(--shadow);
  overflow: hidden;
}
@supports (backdrop-filter: blur(8px)) or (-webkit-backdrop-filter: blur(8px)) {
  .glass {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: rgba(255,255,255,0.12);
  }
}
.aside { display: none; }

/* Hero, header, and typography */
header {
  padding: 1.25rem 0;
}
header h1 {
  font-size: clamp(1.4rem, 1.2rem + 2.2vw, 2.6rem);
  line-height: 1.08;
  margin: 0;
  letter-spacing: .2px;
  text-align: center;
}
header .meta {
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: .25rem;
}
nav { text-align: center; margin-top: .5rem; }
nav a { padding: .5rem 0.75rem; border-radius: 999px; border: 1px solid rgba(255,255,255,.25); color: var(--text); }

/* Featured image frame */
.image-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.25);
  box-shadow: 0 8px 22px rgba(0,0,0,.25);
  background: #111;
}
.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(1.02);
  transition: transform .6s ease;
}
.image-frame:hover img { transform: scale(1.03); }

/* Content typography tweaks for accessibility & rhythm */
h2 {
  font-size: clamp(1.1rem, 0.8rem + 1.6vw, 1.6rem);
  color: #fff;
  margin: 1.25rem 0 0.5rem;
}
p { color: #e9e1ff; opacity: 0.95; margin: .5rem 0 1rem; }
blockquote {
  border-left: 3px solid var(--accent-2);
  padding-left: .75rem;
  color: #f2e8ff;
  margin: .5rem 0 1rem;
  font-style: italic;
}
ol, ul {
  margin: .25rem 0 1rem 1.25rem;
  padding: 0;
}
li { margin: .25rem 0; }

/* Images, content panels, and ads */
.product-ad {
  display: block;
  padding: .75rem;
  border-radius: 12px;
  background: rgba(212,175,55,.15);
  border: 1px solid rgba(212,175,55,.35);
  text-align: center;
}
.product-ad a { display: block; color: var(--text); text-decoration: none; padding: .25rem 0; }
.product-ad a:hover { text-decoration: underline; }

/* Utility elements */
.tag {
  display: inline-block;
  padding: .2em .6em;
  font-size: .75rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.35);
  background: rgba(180,140,0,.18);
  color: #ffd87a;
}
a, button, .btn, .cta {
  font-weight: 600;
  letter-spacing: .2px;
}
.btn, .cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .75rem 1.25rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.4);
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, rgba(212,175,55,.25), rgba(176,132,255,.25));
  transition: transform .15s ease, background .25s ease, box-shadow .25s ease;
  text-decoration: none;
  text-shadow: 0 1px 0 rgba(0,0,0,.25);
}
.btn:hover, .cta:hover { transform: translateY(-1px); }
.btn:focus-visible, .cta:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}
.btn.primary {
  background: linear-gradient(135deg, rgba(212,175,55,.35), rgba(160,128,255,.35));
  border-color: rgba(180,180,255,.55);
}
.btn.primary:hover {
  background: linear-gradient(135deg, rgba(212,175,55,.6), rgba(160,128,255,.6));
}

/* Focus enhancements for keyboard users outside links */
:focus {
  outline: none;
}
:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Print styles: basic readability */
@media print {
  body { background: #fff; color: #000; }
  a { text-decoration: underline; color: #000; }
  .glass { background: #f6f6f6; border: 1px solid #ddd; }
  header, main, footer { box-shadow: none; }
}

/* Responsive defaults for all sections to be compact on mobile */
main { padding: 1rem 0; }
header { position: relative; z-index: 1; }

/* Typography scale helpers (optional micro-typography) */
@media (min-width: 720px) {
  .content { font-size: clamp(0.95rem, 0.9vw + 0.8rem, 1.1rem); }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}