/* Palette & Foundations */
:root {
  --bg: #0b0f12;
  --bg-2: #141923;
  --text: #e9f2ff;
  --muted: #a4b7d4;
  --accent: #4ea8ff;
  --accent-2: #7bd0ff;
  --glass: rgba(255,255,255,0.08);
  --glass-2: rgba(100,150,230,0.18);
  --border: rgba(255,255,255,0.25);
  --shadow: 0 6px 22px rgba(0,0,0,.45);
  --radius: 12px;
  --radius-sm: 8px;
}

html, body, header, nav, main, article, aside, footer {
  box-sizing: border-box;
}
html, body { height: 100%; }
html, body {
  margin: 0;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.55;
  /* Layered background: gradient + beige texture + scanlines + subtle blue glow */
  background:
    radial-gradient(circle at 70% 0%, rgba(70,140,240,.15), transparent 40%),
    linear-gradient(#0b0f12 0%, #0a0d12 60%, #0b0f12 100%),
    linear-gradient(135deg, rgba(180,210,240,.10), rgba(240,210,180,.08) 60%, rgba(0,0,0,0) 100%),
    repeating-linear-gradient(to bottom, rgba(255,255,255,.04) 0 2px, transparent 2px 4px),
    linear-gradient(to right, rgba(255,255,255,.03), rgba(255,255,255,0) 30%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/*  Layout & Background Layering (responsive container) */
.container {
  width: min(92%, 1100px);
  margin: 0 auto;
  padding: 0 1rem;
}
.grid { display: grid; gap: 1rem; }

/*  Typography helpers (fluid) */
h1, h2, h3 { margin: 0 0 .5rem; font-weight: 700; }
p { margin: 0 0 0.75rem; }
.tag { display: inline-block; padding: .15rem .5rem; border-radius: .5rem; font-size: .75rem; background: rgba(78,168,255,.18); color: #eaf4ff; border: 1px solid rgba(78,168,255,.45); }

/*  Section headers (for clarity in large CSS files) */
.header {}

/*  Required selectors baseline */
html, body, header, nav, main, article, aside, footer { scroll-behavior: smooth; }

/*  Accessibility helpers */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/*  Image frame styling */
.image-frame {
  aspect-ratio: 16/9;
  width: min(100%, 860px);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.25);
  background: #111;
  box-shadow: var(--shadow);
}
.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(1.05);
  transform: translateZ(0); /* GPU hint for smoother rendering */
}

/*  Glass panel (frosted) with fallback */
.card, .product-ad, .sponsored-page {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .75rem 1rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
@supports not (backdrop-filter: blur(8px)) {
  .card, .product-ad, .sponsored-page {
    background: rgba(255,255,255,.10);
  }
}
.product-ad a, .sponsored-page a { color: var(--text); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; padding: .4rem .6rem; border-radius: .6rem; }
.product-ad { text-align: center; }
.sponsored-page { text-align: center; }

/*  Header & main layout */
header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 1rem 0;
  background: rgba(12,14,22,.60);
  border-bottom: 1px solid rgba(120,180,240,.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
header h1 {
  font-size: clamp(1.4rem, 2.4vw + 1rem, 2.8rem);
  text-align: center;
  margin: 0;
  color: var(--text);
  letter-spacing: .2px;
}
main { padding: 1rem 0; }

/*  Content area (optional helper) */
.content { padding: 1rem 0; color: var(--text); }

/*  Footer / ad sections grid */
footer {
  padding: 1rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  footer { grid-template-columns: 1fr 1fr; }
}
.product-ad, .sponsored-page { display: block; text-align: center; }

/*  Button & link styles (solid and outline variants) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .75rem 1.15rem;
  border-radius: 999px;
  border: 1px solid rgba(124,180,255,.9);
  background: linear-gradient(to bottom right, rgba(60,120,240,.95), rgba(24,90,160,.95));
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease;
}
.btn.secondary {
  background: rgba(111,170,255,.22);
  border-color: rgba(120,200,255,.6);
  color: #eaf4ff;
}
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/*  Link baseline tweaks for accessibility */
a { color: #cfe2ff; text-decoration: none; }
a:hover { text-decoration: underline; }

/*  List basics */
ul { padding: 0; margin: 0; list-style: none; }
li { margin: .25rem 0; }

/*  Glass card grid helpers (if used) */
.card { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.25); border-radius: var(--radius); padding: .75rem; }

/*  Print styles (basic readability) */
@media print {
  body { background: #fff; color: #000; }
  header, main, footer { page-break-inside: avoid; }
  .image-frame { page-break-inside: avoid; }
}

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

/*  Light mode variants for legibility on demand */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f2ed;
    --bg-2: #ffffff;
    --text: #101820;
    --muted: #4b5563;
    --glass: rgba(0,0,0,.04);
    --border: rgba(0,0,0,.12);
  }
  html, body {
    background:
      linear-gradient(#f9f7f0 0%, #f7f4ed 60%, #f9f7f0 100%),
      repeating-linear-gradient(to bottom, rgba(0,0,0,.04) 0 2px, transparent 2px 4px);
  }
  header {
    background: rgba(255,255,255,.88);
    border-bottom: 1px solid rgba(0,0,0,.08);
  }
  header h1 { color: #111; }
  .product-ad, .sponsored-page { background: rgba(255,255,255,.92); border-color: rgba(0,0,0,.08); }
  a { color: #0b4a8a; }
  .btn { background: linear-gradient(to bottom right, rgba(40,120,210,.95), rgba(20,90,140,.95)); }
}
