/* Tokens */
:root{
  --bg: #041f14;
  --bg-2: #062a17;
  --surface: rgba(8, 60, 48, 0.22);
  --surface-2: rgba(43, 212, 165, 0.18);
  --text: #eafff2;
  --muted: #b5f5e0;
  --accent: #2bd4a5;
  --accent-2: #0bd26a;
  --border: rgba(43, 212, 165, 0.4);
  --shadow: 0 8px 24px rgba(0,0,0,.25);
  --radius: 14px;
  --ring: 0 0 0 3px rgba(43,212,165,.75);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
  --line-height: 1.5;
  --gap: 1rem;
  --card: rgba(8, 60, 48, 0.24);
}

/* Layout primitives (mobile-first) */
html, body { height: 100%; }
html { color-scheme: dark; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  line-height: var(--line-height);
  background-color: var(--bg);
  /* Layered background: emerald/mint gradient + subtle scanlines + soft noise via gradients */
  background-image:
    linear-gradient(135deg, rgba(6, 60, 46, 0.90) 0%, rgba(3, 24, 12, 0.85) 60%, rgba(1, 12, 8, 0.88) 100%),
    repeating-linear-gradient(to bottom, rgba(255,255,255,0.04) 0 1px, rgba(0,0,0,0) 1px 2px),
    repeating-linear-gradient(to right, rgba(0,0,0,0.025) 0 1px, rgba(0,0,0,0) 1px 2px);
  background-blend-mode: overlay, overlay, overlay;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
header, nav, main, article, section, aside, footer { display: block; }

/* Glass panel base (fallback if backdrop-filter not supported) */
.glass {
  background: rgba(8, 60, 48, 0.22);
  border: 1px solid rgba(43, 212, 165, 0.35);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
@supports not ((backdrop-filter: blur(12px))) {
  .glass { background: rgba(8, 60, 48, 0.28); }
}

/* Containers & grids */
.container {
  width: 100%;
  max-width: clamp(320px, 90vw, 1100px);
  margin-inline: auto;
  padding: 0 1rem;
}
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--gap); }

/* Typographic scale (fluid typography) */
h1 { font-size: clamp(1.6rem, 1.2rem + 2vw, 3rem); line-height: 1.15; margin: 0.25rem 0 0.5rem; letter-spacing: .2px; }
p { font-size: clamp(0.95rem, 0.4vw + 0.9rem, 1.15rem); margin: 0.25rem 0 0.75rem; color: rgba(234, 255, 245, 0.95); }
small, .muted { color: var(--muted); font-size: .9em; }

/* Image frame styling */
.image-frame {
  aspect-ratio: 16 / 9;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(43, 212, 165, 0.55);
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  background: #061d15;
}
.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(1.05) contrast(1.05);
  transform: translateZ(0);
}

/* Structural selectors (as required) */
html, body, header, nav, main, article, footer, aside { }
.content { padding: 0.25rem; }

/* Links, buttons, and CTA variants (accessibility: focus/hover states) */
a, button, .btn, .cta {
  font: inherit;
  color: #eafff2;
  text-decoration: none;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
a:hover, a:focus { text-decoration: underline; color: var(--accent-2); outline: none; }
a:focus-visible, button:focus-visible, .btn:focus-visible, .cta:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  transform: translateY(-1px);
  z-index: 1;
}
.btn {
  display: inline-block;
  padding: 0.8rem 1.15rem;
  background: linear-gradient(#0b9b78, #0a7f63);
  color: #eafff2;
  border: 1px solid rgba(43,212,165,0.95);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn.outline {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(43,212,165,0.95);
}
.cta {
  display: inline-block;
  padding: 0.85rem 1.25rem;
  background: linear-gradient(#12d4a0, #0fbf92);
  color: #041e14;
  border: 1px solid rgba(42, 209, 164, 0.95);
}
.cta:hover { filter: brightness(1.05); }
.cta:focus-visible { outline: none; box-shadow: var(--ring); }

/* Utility & UI elements */
ul, li { margin: 0; padding: 0; list-style: none; }
.tag {
  display: inline-block;
  padding: .25rem .6rem;
  font-size: .75rem;
  border-radius: 999px;
  background: rgba(43,212,165,.15);
  border: 1px solid rgba(43,212,165,.45);
  color: #dffff7;
}
.card {
  background: rgba(8, 40, 34, 0.22);
  border: 1px solid rgba(43,212,165,.45);
  border-radius: 12px;
  padding: .75rem;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
}

/* Core page sections (styling for required selectors) */
header {
  padding: 1rem 0.75rem;
  display: block;
}
header h1 { font-weight: 700; margin: 0.25rem 0 0.5rem; color: var(--text); }
nav { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
nav a { color: var(--muted); padding: .25rem .5rem; border-radius: 6px; }
main { padding: 1rem 0; }
article { display: block; padding: 0; }
footer {
  padding: 1rem 0.75rem;
  margin-top: 1rem;
  border-top: 1px solid rgba(0,0,0,.25);
}
.product-ad, .sponsored-page {
  padding: 0.75rem;
  margin-bottom: .5rem;
}
.product-ad a, .sponsored-page a { text-decoration: none; display: block; padding: .5rem; border-radius: 8px; }
.product-ad a { background: rgba(8, 60, 48, 0.28); border: 1px solid rgba(43,212,165,0.45); color: #eafff2; }
.sponsored-page a { background: rgba(8, 60, 48, 0.18); border: 1px solid rgba(43,212,165,0.35); color: #eafff2; }

/* Print styles (basic readability) */
@media print {
  body { background: #fff; color: #000; }
  a, a:visited { text-decoration: underline; color: #000; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; transform: none !important; }
}