/* Token palette */
:root {
  --bg: #041f12;            /* deep green-black base */
  --bg-2: #07221a;          /* secondary layer
                                (slightly lighter green) */
  --text: #eafff4;           /* high-contrast text on dark/glass */
  --muted: #a8e5c9;          /* muted body copy */
  --accent: #20f07a;          /* cyber-green accent */
  --accent-2: #7a162a;        /* burgundy accent for emphasis
                                (burgundy) */
  --glass: rgba(8, 32, 24, 0.22);      /* glass panel background */
  --glass-2: rgba(8, 32, 24, 0.12);    /* fallback glass tint */
  --border: rgba(110, 255, 210, 0.4);  /* glass border glow */
  --shadow: 0 6px 18px rgba(0,0,0,.25);
  --radius: 14px;
}

/* General resets and performance */
* { box-sizing: border-box; }
html, body { height: 100%; }
html { color-scheme: dark; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI",
               Roboto, "Helvetica Neue", Arial;
  color: var(--text);
  background: var(--bg);
  /* Layered background: soft green gradient + subtle scanlines/noise */
  background-image:
    linear-gradient(135deg, rgba(0, 60, 40, 0.65) 0%, rgba(0, 20, 10, 0.65) 60%, rgba(0,0,0,0) 100%),
    repeating-linear-gradient(to bottom, rgba(255,255,255,0.04) 0 1px, transparent 1px 2px),
    linear-gradient(to bottom right, #0a3a22 0%, #062014 100%);
  background-blend-mode: overlay, overlay, normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  min-height: 100%;
}
a, button, .btn, .cta { cursor: pointer; }

/* Layout utilities and containers */
.container {
  max-width: clamp(320px, 90vw, 1100px);
  margin-inline: auto;
  padding-inline: 1rem;
}
.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.card {
  background: rgba(8, 32, 24, 0.28);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem;
  box-shadow: var(--shadow);
}
.image-frame {
  aspect-ratio: 16 / 9;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(110, 255, 210, 0.35);
  background: #0a1f12;
  display: block;
}
.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(1.05);
  transition: transform .3s ease;
}
.image-frame:hover img { transform: scale(1.02); }

header, main, footer, aside {
  padding: 1rem;
  margin: 0 auto;
}
header, main, footer { display: block; }

/* Glass panels with graceful fallback */
header, main, footer {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}
@supports not ((backdrop-filter: blur(12px)) or (-webkit-backdrop-filter: blur(12px))) {
  header, main, footer {
    background: var(--glass-2);
  }
}
.meta { color: var(--muted); font-size: 0.92rem; }

/* Typography and headings */
h1, h2, h3 { color: var(--text); margin: 0.4em 0; font-weight: 700; }
h1 { font-size: clamp(1.6rem, 1.2rem + 2.5vw, 2.6rem); line-height: 1.15; letter-spacing: .2px; }
h2, h3 { font-weight: 700; }
p { margin: 0.6em 0; color: var(--text); }
strong { color: color-m-mix(in oklab, var(--text), black 20%); }

/* Content flow and lists */
.content { padding: 0.75rem; color: var(--text); }
ul, ol { margin: 0.6em 0 1em 1.25em; padding: 0; }
li { margin: 0.25em 0; color: var(--text); }

/* Image area inside content (optional frame) */
.featured-image { margin: 0 0 0.75rem; }

/* Content blocks and sections */
.article { padding: 0; }

/* Links and interactive elements */
a, button, .btn, .cta {
  text-decoration: none;
  color: var(--accent);
  transition: color .2s ease, text-decoration .2s ease, transform .2s ease;
}
a:focus-visible, button:focus-visible, .btn:focus-visible, .cta:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
a:hover, a:focus-visible { text-decoration: underline; color: #9bffd0; }

/* Buttons: solid and outline variants */
.btn {
  display: inline-block;
  padding: 0.6em 1.05em;
  border-radius: 8px;
  border: 1px solid rgba(32, 240, 122, 0.6);
  background: linear-gradient(to bottom, rgba(32,240,122,1), rgba(16,180,110,0.95));
  color: #041f0d;
  font-weight: 700;
  line-height: 1;
}
.btn.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(122, 22, 42, 0.7);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

/* "Utility" chips/tags */
.tag {
  display: inline-block;
  padding: .15em .6em;
  font-size: .75rem;
  border-radius: 999px;
  border: 1px solid rgba(122, 22, 42, 0.6);
  background: rgba(122, 22, 42, 0.8);
  color: #fff;
}

/* Product ad / sponsor blocks */
.product-ad, .sponsored-page {
  display: block;
  text-align: center;
  padding: .6rem;
  margin: .5rem 0;
  background: rgba(8, 32, 24, 0.28);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.product-ad a, .sponsored-page a { display: inline-block; width: 100%; text-align: center; color: var(--text); text-decoration: none; padding: .4rem 0; }
.product-ad a:hover, .sponsored-page a:hover { text-decoration: underline; }

/* Layout specifics for semantic elements */
html, body, header, nav, main, article, aside, footer {
  scroll-behavior: smooth;
}
nav { padding-top: .25rem; padding-bottom: .25rem; }
nav a { color: var(--accent); }
nav a:hover { color: #9fffcc; }

/* Print styles for readability */
@media print {
  body { background: white; color: #000; }
  header, main, footer { background: white; border: none; box-shadow: none; border-radius: 0; }
  a { text-decoration: underline; color: #000; }
  .image-frame { border: 1px solid #ccc; }
}

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