/* Tokens */
/* Emerald green + brown themed palette with accessible contrasts */
:root{
  --bg: #062a17;          /* deep emerald base */
  --bg-2: #2b1f0b;        /* rich brown accent */
  --text: #eafaf0;          /* high-contrast light text */
  --muted: #b7a18c;         /* subtle brown/stone */
  --accent: #2bd56f;        /* emerald highlight */
  --accent-2: #8b5e32;      /* brown accent */
  --surface: rgba(8, 20, 16,.65);      /* frosted glass surface */
  --surface-2: rgba(255,255,255,.10); /* fallback surface */
  --ring: #ffffff;
  --shadow: 0 8px 28px rgba(0,0,0,.25);
}

/* Global reset and base styles */
/* Section: Global layout and typography */
html, body { height: 100%; }
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  color: var(--text);
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-2) 60%, #000 100%);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial;
  font-size: clamp(14px, 0.8rem + 1vw, 18px);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  isolation: isolate;
}
img { max-width: 100%; display: block; }

/* Section: Background layers (radar sweep + subtle scanlines) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  /* Subtle scanlines overlay (pure CSS) */
  background-image: linear-gradient(to bottom, rgba(0,0,0,.0) 0 1px, rgba(0,0,0,.04) 1px);
  background-size: 100% 2px;
  z-index: 0;
  mix-blend-mode: overlay;
}
body::after {
  content: "";
  position: fixed;
  left: 50%; top: 50%;
  width: 240vmax; height: 240vmax;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  /* Radar sweep: emerald arc with rotation animation */
  background: radial-gradient(circle at 50% 50%, rgba(0,0,0,0) 40%, rgba(0,255,140,.25) 41%, rgba(0,0,0,0) 42%),
              conic-gradient(from 0deg, rgba(40,210,120,.25) 0deg, rgba(0,0,0,0) 360deg);
  mix-blend-mode: screen;
  opacity: .4;
  animation: radarSweep 6s linear infinite;
  pointer-events: none;
  z-index: 0;
}
@keyframes radarSweep { to { transform: translate(-50%, -50%) rotate(360deg); } }

/* Section: Layout utilities */
.container {
  width: 100%;
  max-width: clamp(720px, 90vw, 1120px);
  margin-inline: auto;
  padding-inline: 1rem;
}
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }

/* Section: Glass / frosted panels with fallback */
.card, .product-ad, aside, header, main, footer { background: transparent; }
.card {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 14px;
  padding: 1rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
@supports not (backdrop-filter: blur(10px)) {
  .card { background: rgba(255,255,255,.10); border-color: rgba(255,255,255,.35); }
}
.product-ad {
  display: block;
  background: rgba(5,20,10,.32);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 12px;
  padding: .75rem 1rem;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  text-align: center;
}
.product-ad a { color: #eafff0; text-decoration: none; font-weight: 600; }
.product-ad a:hover, .product-ad a:focus-visible { text-decoration: underline; }

/* Section: Image frame styling */
.image-frame, .image-frame img {
  border-radius: 12px;
}
.image-frame {
  aspect-ratio: 16 / 9;
  width: 100%;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.25);
  box-shadow: 0 8px 18px rgba(0,0,0,.25);
  background: #0a0a0a;
}
.image-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Section: Typography and content roles */
.content { color: var(--text); }
h1, h2, h3, h4 { color: #f7fff7; margin: .25em 0 .5em; line-height: 1.25; }
h1 { font-size: clamp(1.8rem, 2.5vw, 3.5rem); letter-spacing: .5px; }
h2 { font-size: clamp(1.4rem, 2vw, 2.5rem); }
h3 { font-size: clamp(1.1rem, 1.6vw, 1.6rem); color: #eafff7; }
p { margin: .75em 0; color: #eafff0; }
blockquote { margin: 1em 0; padding: .75em 1em; border-left: 3px solid var(--accent); color: #eafff0; background: rgba(0,0,0,.15); border-radius: 6px; }

/* Lists styling for accessibility and readability */
ul, li {
  margin: 0.5em 0;
  padding: 0;
  color: #eafff0;
}
ul { padding-left: 1.25em; }
li { margin: .25em 0; }

/* Section: Links and interactive elements */
a, button, .btn, .cta {
  color: var(--text);
  text-decoration: none;
  outline: none;
}
a { color: var(--accent); }
a:hover, a:focus-visible { text-decoration: underline; outline: 2px solid rgba(255,255,255,.9); outline-offset: 3px; border-radius: 4px; }
button { font: inherit; cursor: pointer; background: transparent; border: none; padding: 0; }
.btn {
  display: inline-block;
  padding: .6rem 1rem;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.4);
  background: rgba(34, 139, 34, .95);
  color: white;
  font-weight: 600;
}
.btn:hover { background: #28a34a; transform: translateY(-1px); }
.btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Outline variant */
.btn--outline {
  background: rgba(0,0,0,.0);
  border: 1px solid rgba(255,255,255,.6);
  color: var(--text);
}
.cta {
  display: inline-block;
  padding: .6rem 1rem;
  border-radius: 6px;
  border: 1px solid rgba(123, 93, 60, .8);
  background: rgba(0,0,0,.15);
  color: var(--text);
}
.cta:hover { background: rgba(123, 93, 60, .25); }

/* Section: Page structure elements */
header, main, footer, aside { position: relative; z-index: 1; }

/* Section: Page scaffolding for semantic elements */
header { padding: clamp(1rem, 2vw, 2rem) 1rem; text-align: center; }
header h1 { font-weight: 700; letter-spacing: .2px; }

/* Main content area styling with container constraints */
main { padding: 1rem 0; }
article { padding: 0; }

/* Section: Print-friendly tweaks */
@media print {
  body { background: #fff; color: #000; }
  a { text-decoration: underline; color: #000; }
  .card, .product-ad { background: #fff; border: 1px solid #ddd; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
@media (min-width: 0px) {
  /* Structural helpers if a .container is used outside header/main/footer blocks */
  .container { padding: 0 0.25rem; }
}
