/* Section: Base */
:root {
  --bg: #2a1a0a;
  --bg-2: #4b2f1a;
  --surface: rgba(255, 255, 255, 0.08);
  --surface-strong: rgba(255, 255, 255, 0.18);
  --border: rgba(255, 255, 255, 0.28);
  --text: #eafbf0;
  --muted: #c0e6cd;
  --accent: #2bd96b;
  --accent-2: #9dffb0;
  --chip: rgba(43, 217, 107, 0.25);
  --card: rgba(255, 255, 255, 0.08);
  --ring: 0 0 0 3px rgba(43, 217, 107, 0.65);
  --font-stack: system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans", "Liberation Sans", sans-serif;
}
html, body {
  height: 100%;
}
html { box-sizing: border-box; }
*, *::before, *::after { box-sizing: inherit; }

/* Section: Layout & Theme Background (mobile-first) */
:where(body, html) {
  margin: 0;
  color: var(--text);
  background: 
    linear-gradient(135deg, #3a1f0f 0%, #2a1a0a 60%, #1e1209 100%), /* brown gradient base */
    linear-gradient(to bottom, rgba(0,0,0,0.08), rgba(0,0,0,0.08)); /* subtle overlay */
  background-blend-mode: multiply;
  font-family: var(--font-stack);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100%;
  isolation: isolate;
  /* Subtle CSS noise/scanlines (pure CSS) */
  position: relative;
}
html::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: 
    linear-gradient(to bottom, rgba(0,0,0,0) 0 98%, rgba(0,0,0,0.15) 98% 100%),
    radial-gradient(circle at 20% 0%, rgba(0,255,140,0.08), transparent 40%),
    radial-gradient(circle at 80% 20%, rgba(0,255,140,0.05), transparent 40%);
  mix-blend-mode: overlay;
  opacity: 0.25;
  mask-image: linear-gradient(to bottom, #000, rgba(0,0,0,0.6) 60%, transparent);
}
@media (prefers-color-scheme: light) {
  html, body { /* Light theme legibility tweak */ }
}
@media (prefers-reduced-motion: reduce) {
  html::after { display: none; }
}

/* Section: Basic typography & helpers */
h1, h2, h3 { margin: 0 0 .75rem; font-weight: 700; line-height: 1.15; }
p { margin: 0 0 1rem; }
a { color: var(--accent-2); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; outline: 0; }
ul { margin: 0.5rem 0 0 1.25rem; padding: 0; list-style: disc; }

/* Section: Utilities & primitives */
.container {
  width: min(1100px, 92vw);
  margin: 0 auto;
  padding: 0 0.5rem;
}
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1rem; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.tag { display: inline-block; padding: .25rem .5rem; border-radius: 999px; font-size: .75rem; background: var(--chip); color: #eafff5; }

/* Section: Glassmorphism panels (fallback + backdrop-filter) */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
@supports not (backdrop-filter: blur(12px)) {
  .panel { background: rgba(255,255,255,0.12); }
}

/* Section: Image frame styling */
.image-frame {
  aspect-ratio: 16 / 9;
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(0, 255, 140, 0.4);
  overflow: hidden;
  background: #000;
  box-shadow: 0 6px 20px rgba(0,0,0,.45);
}
.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: translateZ(0);
  filter: saturate(1.05);
}
@media (max-width: 640px) {
  .image-frame { border-radius: 10px; }

/* Section: Hero / header tweaks (responsive typography) */
}
header {
  padding: 2rem 1rem;
  text-align: center;
}
header h1 { 
  font-size: clamp(1.6rem, 4vw + 1rem, 2.6rem);
  line-height: 1.15;
  letter-spacing: .2px;
  color: var(--text);
  margin: 0;
}
main { padding: 1rem 0 2rem; }

/* Section: Page structure styling */
header, nav, main, article, aside, footer {
  display: block;
}
footer {
  padding: 1.25rem 1rem 2rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}
footer .product-ad,
footer .sponsored-page {
  display: block;
}
footer .product-ad a,
footer .sponsored-page a {
  display: block;
  text-align: center;
  padding: 0.9rem;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.28);
  transition: transform .2s ease, background .2s ease;
}
footer .product-ad a:hover,
footer .sponsored-page a:hover {
  background: rgba(0,0,0,0.08);
  transform: translateY(-1px);
}
footer p { text-align: center; color: var(--muted); }

/* Section: Interactive controls (buttons & links) */
.btn, .cta, .cta:focus-visible, button, a {
  font-family: inherit;
  font-weight: 600;
  border-radius: 8px;
  border: 0;
  padding: 0.8rem 1rem;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}
.btn {
  display: inline-block;
  color: #062b1a;
  background: linear-gradient(135deg, rgba(56,255,176,0.95), rgba(18,214,123,0.95));
  text-decoration: none;
  box-shadow: 0 2px 0 rgba(0,0,0,.15);
}
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}
.btn--outline {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(56,255,176,0.9);
}
.btn--outline:hover {
  background: rgba(56,255,176,0.08);
}
a.btn, a.cta {
  display: inline-block;
  text-decoration: none;
}
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }

/* Section: Accessibility & color contrast tweaks */
@media (prefers-color-scheme: light) {
  html, body {
    background: #f4efe5;
    color: #2c2c2c;
  }
  :root {
    --surface: rgba(0,0,0,0.05);
    --surface-strong: rgba(0,0,0,0.07);
    --border: rgba(0,0,0,0.15);
    --text: #1a1a1a;
    --muted: #525252;
  }
  a { color: #0a4f2a; }
  .panel { background: rgba(255,255,255,0.85); border: 1px solid rgba(0,0,0,0.1); }
}

/* Section: Print (readable) */
@media print {
  body { background: #fff; color: #000; }
  .image-frame { display: none; }
  a, .btn { text-decoration: underline; }
}

/* Section: Structural defaults for selectors listed */
html, body, header, nav, main, article, footer, aside {
  /* ensure baseline spacing consistency across sections */
  padding: 0;
  margin: 0;
}
.image-frame, .image-frame img { -webkit-tap-highlight-color: transparent; }

/* Section: Responsive helpers for layout components */
.container, .grid, .card {
  /* ensure these utilities exist and stay compact for production */
}
.container { max-width: clamp(280px, 90vw, 1100px); margin-left: auto; margin-right: auto; }

/* Section: Minor animation guard (GPU-friendly) */
@media (prefers-reduced-motion: no-preference) {
  body { will-change: transform; }
  .image-frame { transform: translateZ(0); opacity: 1; }
}
