/* Core Theme Tokens */
:root{
  --bg: #0a1f16;
  --emerald: #0a7a57;
  --emerald-dark: #054734;
  --beige: #e9dcc2;
  --beige-dark: #d9c6aa;
  --text: #eaf7ee;
  --muted: #cbd9c4;
  --accent: #a6d6a0;     /* soft emerald accent for UI elements */
  --accent-2: #e8dcb9;   /* beige accent for highlights */
  --focus: #fffbd0;
  --shadow: 0 6px 16px rgba(0,0,0,.25);
  --radius: 12px;
}

html, body {
  height: 100%;
  margin: 0;
}

html, body, header, nav, main, article, footer, aside {
  box-sizing: border-box;
}

html {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans";
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Layered emerald checkerboard + beige gradient background */
body {
  min-height: 100%;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    /* emerald checkerboard (two-angle layers) */
    linear-gradient(45deg, var(--emerald) 25%, var(--emerald-dark) 25%, var(--emerald-dark) 50%, var(--emerald) 50%, var(--emerald) 75%, var(--emerald-dark) 75%, var(--emerald-dark) 100%),
    linear-gradient(-45deg, var(--emerald) 25%, var(--emerald-dark) 25%, var(--emerald-dark) 50%, var(--emerald) 50%, var(--emerald) 75%, var(--emerald-dark) 75%, var(--emerald-dark) 100%),
    linear-gradient(to bottom, var(--beige) 0%, var(--beige) 100%);
  background-size: 40px 40px, 40px 40px, 100% 100%;
  background-position: 0 0, 0 0, 0 0;
  background-attachment: fixed;
  isolation: isolate;
  position: relative;
  overflow-x: hidden;
}

/* Subtle scanline/noise overlay (pure CSS) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, rgba(0,0,0,.04) 0 1px, transparent 1px 2px),
    repeating-linear-gradient(to right, rgba(0,0,0,.03) 0 1px, transparent 1px 2px);
  mix-blend-mode: overlay;
  opacity: 0.25;
}
@media (prefers-reduced-motion: reduce) {
  body::before { display: none; }
}

/* Print-friendly basics (small) */
@media print {
  body { background: white; color: black; }
  a { text-decoration: underline; }
}

/* Layout helpers */
.container {
  width: min(100%, 1200px);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.card {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
@supports not ((backdrop-filter: blur(8px))) {
  .card { background: rgba(255,255,255,.18); }
}
.tag {
  display: inline-block;
  padding: .25em .6em;
  font-size: .75rem;
  border-radius: 999px;
  background: rgba(166,214,160,.25);
  border: 1px solid rgba(166,214,160,.5);
  color: #eafff0;
}

/* Glass panel aesthetic (frosted glass) */
.header-glass, .main-glass, .footer-glass, .article-glass, .aside-glass {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 12px;
  padding: 1rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
@supports not (backdrop-filter: blur(12px)) {
  .header-glass, .main-glass, .footer-glass, .article-glass, .aside-glass {
    background: rgba(248,246,238,.85);
  }
}

/* Core structural elements */
html, body {
  color-scheme: dark;
}
header, main, footer, aside, article {
  padding: 1rem;
}
header {
  text-align: center;
  padding: 2rem 1rem;
}
main {
  padding: 1.25rem;
}
footer {
  padding: 1rem;
  display: grid;
  gap: .75rem;
}
.image-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.25);
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
  margin: .5rem 0 1rem;
}
.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.content { padding: .5rem 0; }

/* Typography (fluid) */
h1, h2, h3 {
  margin: .25rem 0;
  line-height: 1.15;
}
h1 {
  font-size: clamp(1.75rem, 2.8vw + 1rem, 3.25rem);
  letter-spacing: .2px;
}
h2 {
  font-size: clamp(1.25rem, 1.6vw + .75rem, 2rem);
}
p {
  font-size: clamp(0.95rem, 0.8vw + .8rem, 1.15rem);
  color: var(--text);
  margin: .5rem 0;
  line-height: 1.55;
}
blockquote {
  margin: .75rem 0;
  padding: .5rem 1rem;
  border-left: 3px solid var(--accent);
  background: rgba(0,0,0,.15);
  border-radius: 6px;
}
ul {
  list-style: disc;
  padding-left: 1.5rem;
  margin: .5rem 0;
}
li { margin: .25rem 0; }

/* Hero content / CTAs */
a, button, .btn, .cta {
  text-decoration: none;
  color: var(--text);
}
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.btn {
  display: inline-block;
  padding: .6em .95em;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,.15);
  background: var(--accent);
  color: #0b2b1a;
  font-weight: 600;
  transition: transform .15s ease, background-color .15s ease;
}
.btn:hover { transform: translateY(-1px); background: #8bd79e; }
.btn:active { transform: translateY(0); }
.cta {
  padding: .55em .9em;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.5);
  background: rgba(255,255,255,.15);
  color: var(--text);
}
.cta:hover { text-decoration: underline; }

/* Product/ad sections in footer */
.product-ad, .sponsored-page {
  display: block;
  padding: .75rem;
  border-radius: 12px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.25);
  text-align: center;
}
.product-ad a, .sponsored-page a { color: var(--text); }

/* Lists and navigation tweaks */
ul, li { font-size: 1rem; }

/* Responsive helpers for layout */
@media (min-width: 900px) {
  main { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* Small utility tools for potential forms (themed) */
input, textarea, select {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.25);
  color: var(--text);
  padding: .5em .6em;
  border-radius: 6px;
  outline: 0;
}
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
::placeholder { color: rgba(235,235,235,.6); }