/* 1) Tokens & Theme */
:root {
  --bg: #000;
  --bg-2: #0a0a0a;
  --text: #f7f7f7;
  --muted: #b0b0b0;
  --accent: #2af1ff;
  --accent-2: #7d5cff;
  --card: rgba(255,255,255,0.08);
  --border: rgba(255,255,255,0.28);
  --shadow: 0 8px 24px rgba(0,0,0,.45);
  --radius: 12px;
  --gap: 1rem;
}

/* Dark mode default; light mode overrides below */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f7f7;
    --bg-2: #ffffff;
    --text: #111;
    --muted: #555;
    --accent: #0b6aff;
    --accent-2: #d4145a;
    --card: rgba(0,0,0,0.08);
    --border: rgba(0,0,0,0.15);
    --shadow: 0 6px 18px rgba(0,0,0,.15);
  }
}

/* 2) Base & Layout */
*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; }

html, body {
  margin: 0;
  color: var(--text);
  background-color: var(--bg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Layered dark checker + gradient + subtle scanlines (pure CSS) */
  background-image:
    linear-gradient(45deg, rgba(255,255,255,0.04) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255,255,255,0.04) 25%, transparent 25%),
    linear-gradient(#000, #000);
  background-size: 40px 40px;
  background-position: 0 0, 0 0, 0 0;
  position: relative;
  overflow-x: hidden;
}
body::before {
  /* subtle scanlines overlay (no images) */
  content: "";
  position: fixed;
  inset: 0;
  background-image: 
    repeating-linear-gradient(to bottom, rgba(255,255,255,0.04) 0 1px, transparent 1px 2px),
    repeating-linear-gradient(to right, rgba(255,255,255,0.04) 0 1px, transparent 1px 2px);
  mix-blend-mode: overlay;
  opacity: 0.25;
  pointer-events: none;
}
a, button, .btn, .cta {
  font-family: inherit;
  text-decoration: none;
}

/* 3) Global primitives & utilities */
header, nav, main, article, aside, footer { display: block; }

/* Centered container + grid helpers */
.container {
  width: 100%;
  max-width: clamp(860px, 92vw, 1200px);
  margin-inline: auto;
  padding-inline: 1rem;
}
.grid {
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
}
.tag {
  display: inline-block;
  padding: .25em .5em;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.08);
  color: var(--text);
}

/* 4) Typography & hero */
h1 {
  font-size: clamp(1.75rem, 4vw, 3rem);
  line-height: 1.15;
  margin: 0 0 .5rem;
  letter-spacing: .3px;
}
p { margin: 0 0 0.75rem; color: var(--muted); font-size: clamp(1rem, 1vw + 0.9rem, 1.125rem); }

/* 5) Glass panels (frosted) with fallbacks */
.glass, .product-ad, .sponsored-page {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 6px 18px rgba(0,0,0,.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
@supports not (backdrop-filter: blur(10px)) {
  .glass, .product-ad, .sponsored-page {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.4);
  }
}
.image-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.35);
  background: #000;
  display: block;
  box-shadow: 0 8px 28px rgba(0,0,0,.6);
}
.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.98);
}
.image-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.25);
  pointer-events: none;
}

/* 6) Interactive controls (CTAs) */
a, button, .btn, .cta {
  color: var(--text);
  border: 1px solid rgba(255,255,255,.28);
  background: rgba(255,255,255,.08);
  padding: .65rem 1rem;
  border-radius: 999px;
  display: inline-block;
  transition: transform .15s ease, background .2s ease, border-color .2s ease, color .2s;
}
a:hover, a:focus {
  text-decoration: underline;
  color: var(--accent-2);
}
button, .btn, .cta {
  cursor: pointer;
}
.btn:not(.outline) {
  background: rgba(42, 241, 255, 0.7);
  border: none;
  color: #00161a;
}
.btn:focus-visible, .cta:focus-visible, button:focus-visible {
  outline: 2px solid #6af;
  outline-offset: 2px;
}
.btn:hover, .cta:hover {
  transform: translateY(-1px);
}
.btn.outline {
  background: transparent;
  border: 1px solid rgba(255,255,255,.6);
  color: var(--text);
}
.btn.secondary {
  background: rgba(125,92,255,0.25);
  border-color: rgba(125,92,255,0.5);
  color: #eaffff;
}
ul { margin: 0; padding: 0; list-style: none; }

/* 7) Page sections styling (header/main/footer) */
header {
  padding: 2rem 1rem 0;
  display: flex;
  justify-content: center;
}
header h1 { text-align: center; }

/* Main content wraps image in a glass card for focus */
main {
  padding: 1rem;
}
main article {
  display: block;
  width: 100%;
  max-width: 1000px;
  margin-inline: auto;
}
.main-stack { display: grid; gap: var(--gap); }

/* Ensure accessible color contrast on glass panels contents */
.product-ad a, .sponsored-page a {
  color: var(--text);
}
.product-ad p, .sponsored-page p { margin: 0; }

/* 8) Footer layout & panels */
footer {
  padding: 1.25rem;
  display: grid;
  gap: .75rem;
  justify-items: center;
}
footer .product-ad, footer .sponsored-page { width: min(100%, 700px); }

/* 9) Responsiveness helpers (already mobile-first by nature) */
@media (min-width: 640px) {
  .container { padding-inline: 0; }
}
@media (max-width: 420px) {
  h1 { font-size: clamp(1.6rem, 7vw, 2.6rem); }
}

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

/* 11) Print (basic readability) */
@media print {
  body { background: #fff; color: #000; }
  .glass, .product-ad, .sponsored-page { background: #fff; border: 1px solid #ccc; }
}
