/* Base tokens */
:root {
  --bg: #0a0f14;
  --bg-2: #0e1a1d;
  --surface: rgba(12, 28, 28, 0.28);
  --surface-2: rgba(20, 40, 40, 0.42);
  --text: #e8fffe;
  --muted: #9bdadf;
  --accent: #19d3a5;       /* Teal */
  --accent-2: #ff3b3b;     /* Red accent */
  --border: rgba(120, 240, 230, 0.45);
  --shadow: 0 8px 28px rgba(0,0,0,.35);
  --radius: 14px;
  --focus: 0 0 0 3px rgba(25, 211, 165, .6);
  --gap: 1rem;
}

/* Global resets & typography */
*,
*::before,
*::after { box-sizing: border-box; }
html, body { height: 100%; }
html { font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial; line-height: 1.4; color-scheme: dark; }
body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  background-color: var(--bg);
  /* Layered background: red stripes + teal accents + subtle noise/scanline feel */
  background-image:
    linear-gradient(to bottom right, rgba(0,0,0,.55), rgba(0,0,0,.65)),
    repeating-linear-gradient(45deg, rgba(255,0,0,.22) 0 8px, rgba(0,0,0,0) 8px 16px),
    linear-gradient(to bottom right, rgba(0,128,128,.20), rgba(0,0,0,0)),
    linear-gradient(#0b0b0f, #0b0b0f);
  background-blend-mode: overlay, overlay, normal, normal;
  font-variant-ligatures: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  letter-spacing: .2px;
}

/* Layout primitives */
.container { max-width: clamp(320px, 90vw, 1100px); margin-inline: auto; padding-inline: 1rem; }
.grid { display: grid; gap: var(--gap); }

/* Global element styles */
header, nav, main, article, aside, footer { padding: 0; }
header { padding: 2rem 0 1rem; text-align: center; }
header h1 { font-size: clamp(1.75rem, 4vw, 3rem); margin: 0; letter-spacing: .4px; color: var(--text); }

main { display: grid; place-items: center; padding: 1rem 0 2rem; width: 100%; }
article { width: min(1100px, 92vw); }

/* Glass panels with fallback */
.glass {
  background: rgba(18, 34, 34, 0.28);
  border: 1px solid rgba(110, 240, 230, 0.45);
  border-radius: calc(var(--radius) + 2px);
  padding: 1rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  position: relative;
}
@supports not (backdrop-filter: blur(12px)) {
  .glass { background: rgba(18,34,34,.66); }
}

/* Image frame styling */
.image-frame {
  aspect-ratio: 16 / 9;
  width: 100%;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(120, 240, 230, 0.5);
  box-shadow: 0 6px 16px rgba(0,0,0,.4);
}
.image-frame img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transform: scale(1);
  transition: transform 0.4s ease;
  filter: saturate(1.05);
}
.image-frame:hover img { transform: scale(1.03); }

/* Content area */
.content { padding: 1rem; }

/* Typography helpers */
h1, h2, h3 { margin: .6rem 0; font-weight: 700; color: var(--text); }
p { margin: .4rem 0; color: var(--text); }
a { color: var(--accent); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; outline: none; }

/* Focus ring accessibility */
:focus-visible { outline: none; box-shadow: var(--focus); }

/* Button and link variants */
.btn, .cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .65rem 1rem;
  border-radius: 999px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, color .2s ease;
  border: 1px solid transparent;
  text-decoration: none;
  user-select: none;
}
.btn { border-radius: 999px; }
.btn.primary {
  background: var(--accent);
  color: #041414;
  border-color: rgba(25, 211, 165, 0.75);
}
.btn.primary:hover { transform: translateY(-1px); }
.btn.primary:active { transform: translateY(0); }

.btn.outline {
  background: transparent;
  color: var(--accent-2);
  border-color: rgba(255, 60, 60, 0.85);
}
.btn.outline:hover { background: rgba(255, 60, 60, .08); transform: translateY(-1px); }

/* Secondary and frosted actions */
.cta {
  background: rgba(25, 211, 165, 0.15);
  color: #d7fff5;
  border: 1px solid rgba(25, 211, 165, 0.4);
}
.cta:hover { background: rgba(25, 211, 165, 0.25); }

/* Link-like emphasis for accessibility on focus/hover */
a:focus-visible { outline: none; box-shadow: var(--focus); }

/* Lists and tags */
ul { margin: 0.5rem 0; padding-left: 1.25rem; }
li { margin: .25rem 0; }
.tag {
  display: inline-block;
  padding: .15em .6em;
  border-radius: 999px;
  font-size: .8em;
  background: rgba(0,0,0,.25);
  border: 1px solid rgba(120,240,230,.4);
  color: var(--text);
}

/* Footer */
footer { padding: 1.5rem 0; text-align: center; }
.product-ad, .sponsored-page { display: inline-block; margin: .25rem; }
.product-ad a, .sponsored-page a {
  color: var(--text);
  text-decoration: none;
  display: inline-block;
  padding: .5rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(120,240,230,.4);
  background: rgba(0,0,0,.25);
}
.product-ad a:hover, .sponsored-page a:hover { background: rgba(0,0,0,.4); text-decoration: underline; }

/* Helpers for layout and responsiveness */
.container, .grid { width: 100%; }
@media (min-width: 720px) {
  .grid.auto { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Print styles */
@media print {
  body { background: #fff; color: #000; }
  .glass { background: #fff; color: #000; border: 1px solid #ccc; }
}

/* Light-mode overrides for better legibility when requested */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f7f9;
    --bg-2: #eef2f4;
    --text: #0b1b1b;
    --muted: #4b5f63;
    --accent: #0b6a6a;
    --accent-2: #b01515;
    --surface: rgba(255,255,255,.8);
    --surface-2: rgba(255,255,255,.95);
    --border: rgba(0,0,0,.15);
    --shadow: 0 6px 20px rgba(0,0,0,.08);
  }
  body { background-image: linear-gradient(to bottom right, rgba(0,0,0,.08), rgba(0,0,0,.02)); }
  .glass { background: rgba(255,255,255,.9); border-color: rgba(0,0,0,.15); }
  a { color: var(--accent); }
  header h1 { color: var(--text); }
}