/* Section: Tokens & Foundation */
:root {
  --bg: #0b0b0f;
  --bg-2: #14161a;
  --bg-3: #1b0b0f;
  --text: #e9e9e9;
  --muted: #b5b5b5;
  --accent: #e23d3d;
  --accent-2: #8a0000;
  --card: rgba(18,18,24,0.38);
  --card-2: rgba(18,18,24,0.30);
  --border: rgba(255,255,255,0.28);
  --shadow: 0 6px 20px rgba(0,0,0,.35);
  --radius: 12px;
}
html, body { height: 100%; }
* { box-sizing: border-box; }
html { font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif; font-size: clamp(14px, 1.6vw, 17px); }
html, body { margin: 0; color: var(--text); }

/* Section: Layered background (gradient + subtle noise/scanlines) */
body {
  min-height: 100vh;
  background: 
    radial-gradient(circle at 20% 10%, rgba(226,61,61,.28) 0 30%, rgba(226,61,61,0) 40%),
    linear-gradient(#0b0b0f 0, #0b0b0f 60%, #0b0b0f 100%);
  background-attachment: fixed;
  position: relative;
  z-index: 0;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    repeating-linear-gradient(to bottom, rgba(0,0,0,.04) 0 1px, transparent 1px 2px),
    repeating-linear-gradient(to right, rgba(0,0,0,.04) 0 1px, transparent 1px 2px);
  mix-blend-mode: overlay;
  opacity: 0.25;
  pointer-events: none;
  z-index: 0;
}
body, #__next { /* ensure parents layer above background feel */
  position: relative;
  z-index: 1;
}
@media (prefers-reduced-motion: reduce) {
  body::before { display: none; }
}

/* Section: Layout primitives */
.container {
  width: min(1100px, 92%);
  margin-inline: auto;
  padding-block: 1rem;
}
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }

/* Section: Frosted glass panels (fallback included) */
.glass,
header, main, footer {
  background: rgba(8,8,14,.28);
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 1rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
@supports not (backdrop-filter: blur(12px)) {
  .glass, header, main, footer { background: rgba(8,8,14,.62); border-color: rgba(255,255,255,.45); }
}
header { text-align: center; padding: 1.5rem 1rem; margin: 0.75rem auto; }

/* Section: Typography & hierarchy (responsive typography) */
h1, h2, h3 { margin: .25rem 0; font-weight: 700; letter-spacing: .2px; }
h1 { font-size: clamp(1.6rem, 4.5vw, 3.25rem); line-height: 1.15; color: #fff; }
h2 { font-size: clamp(1.4rem, 3vw, 2.25rem); line-height: 1.25; color: #fff; }
h3 { font-size: clamp(1.05rem, 2vw, 1.25rem); color: #fff; }
p { color: var(--text); margin: .4rem 0 1rem; line-height: 1.5; }

/* Section: Images & media */
.image-frame,
.featured-image {
  width: 100%; display: block;
}
.image-frame {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.28);
  box-shadow: inset 0 0 12px rgba(0,0,0,.25);
}
.image-frame img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.featured-image { border-radius: 12px; overflow: hidden; }
.featured-image img { width: 100%; height: auto; display: block; }

/* Section: Content area (MUST style .content) */
.content { padding: .75rem; color: var(--text); }

/* Section: Articles, sections & blocks */
article { padding: 0; }
footer { padding: 1rem; margin-top: 1rem; }

/* Section: Product ad & sponsored panels (glass panels) */
.product-ad, .sponsored-page {
  background: rgba(8,8,14,.28);
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 12px;
  padding: .75rem;
  text-align: center;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.product-ad a, .sponsored-page a { color: #fff; text-decoration: none; display: inline-flex; align-items: center; gap: .5rem; }
.product-ad a:hover, .sponsored-page a:hover { text-decoration: underline; }

/* Section: Links, buttons, CTAs (base & variants) */
a, button, .btn, .cta {
  font-family: inherit; color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease, background .2s ease, color .2s ease;
}
a { color: var(--accent); }
a:hover, a:focus { text-decoration: underline; color: #ffd9d9; outline: none; }
a:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

.btn,
.cta {
  display: inline-block;
  padding: .55rem . nine 0.75rem?; /* placeholder to be corrected below */
}
.btn { 
  background: var(--accent);
  color: #fff;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 999px;
  padding: .55rem 1.1rem;
}
.btn:hover { background: #ff5757; transform: translateY(-1px); }
.btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.btn--outline {
  background: transparent;
  border: 1px solid rgba(255,255,255,.6);
  color: #fff;
}
.btn--outline:hover { background: rgba(255,255,255,.08); }

/* Section: Helpers & utilities */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .75rem;
  box-shadow: 0 6px 16px rgba(0,0,0,.2);
}
.tag {
  display: inline-block;
  padding: .15rem .5rem;
  font-size: .75rem;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
}

/* Section: Lists */
ul { padding-left: 1.25rem; margin: .25rem 0 .75rem; }
li { margin: .25rem 0; }

/* Section: Layout helpers (responsive utilities) */
@media (min-width: 700px) {
  header, main, footer { padding: 1.25rem; }
}
@media (max-width: 640px) {
  .container { width: 92%; }
  .glass { padding: .75rem; }
}

/* Section: Print styles (readability) */
@media print {
  body { background: #fff; color: #000; }
  header, main, footer { background: transparent; border: none; box-shadow: none; }
  a { text-decoration: underline; }
}

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