/* Tokens */
:root {
  --bg: #0b0f14;
  --bg-2: #141a1f;
  --sand: #d6c2a3;
  --sand-2: #c8a37b;
  --text: #e8fff0;
  --muted: #a4c8a0;
  --accent: #7ce4a7;
  --accent-2: #46d08a;
  --surface: rgba(255, 255, 255, 0.12);
  --surface-2: rgba(0, 0, 0, 0.22);
  --glass-border: rgba(255, 255, 255, 0.28);
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
  --radius: 14px;
  --text-contrast: #042411;
}

/* Layered background with gradient + CSS noise/scanlines */
html, body { height: 100%; }
html { box-sizing: border-box; }
*, *::before, *::after { box-sizing: inherit; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  color: var(--text);
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-2) 60%), 
              linear-gradient(to bottom, rgba(0,0,0,0.0), rgba(0,0,0,0.08) 60%, rgba(0,0,0,0.0) 100%);
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  isolation: isolate;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  /* subtle sand-like glow hints + scanlines */
  background-image:
    radial-gradient(circle at 20% 10%, rgba(120, 210, 170, 0.15), transparent 40%),
    radial-gradient(circle at 78% 22%, rgba(200, 240, 210, 0.10), transparent 40%),
    repeating-linear-gradient(to bottom, rgba(255,255,255,0.04) 0 1px, transparent 1px 2px);
  mix-blend-mode: overlay;
  opacity: 0.75;
  filter: saturate(1.05);
  z-index: 0;
}

/* Layout helpers */
.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(240px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text);
}

.tag {
  display: inline-block;
  padding: .25em .6em;
  font-size: 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(122, 255, 198, 0.4);
  background: rgba(122, 255, 198, 0.15);
  color: var(--text);
}

/* Image frame styling */
.image-frame {
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(0,0,0,0.25);
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
  background: #111;
}
.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  image-rendering: auto;
  filter: saturate(1.05);
}

/* Glass panels (frosted glass) with fallback if backdrop-filter unsupported */
.glass {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}
@supports not (backdrop-filter: blur(12px)) {
  .glass { background: rgba(255, 255, 255, 0.22); }
}

/* Typography scale (mobile-first) */
html { font-size: 16px; }
h1, h2, h3 { line-height: 1.15; font-weight: 700; margin: 0.4em 0; color: var(--text); }
h1 { font-size: clamp(1.75rem, 5vw, 2.75rem); letter-spacing: .2px; }
h2 { font-size: clamp(1.25rem, 4vw, 1.75rem); }
h3 { font-size: clamp(1.1rem, 3.5vw, 1.25rem); }

/* Base typography for content */
p { margin: 0.75rem 0; color: var(--text); }
em { font-style: italic; color: var(--muted); }

/* Links and interactive controls */
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 4px; }

/* Buttons and CTAs */
.btn, .cta, button {
  font-family: inherit;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.45);
  padding: 0.625rem 1.15rem;
  background: var(--accent);
  color: #06240d; /* high contrast text */
  cursor: pointer;
  transition: transform .2s ease, background .3s ease, box-shadow .2s ease;
  display: inline-block;
  text-decoration: none;
}
.btn:hover, .cta:hover, button:hover {
  transform: translateY(-1px);
  background: #8af5bf;
}
.btn:focus-visible, .cta:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}
.btn.outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn:disabled, .cta:disabled, button:disabled { opacity: 0.6; cursor: not-allowed; }

/* Lists */
ul { margin: 0.75rem 0; padding-left: 1.25rem; color: var(--text); }
li { margin: 0.25rem 0; }

/* Section elements (header, main, aside, footer) */
header, main, aside, footer {
  display: block;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius);
  padding: 1rem;
  margin: 0.75rem 0;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

/* Specific semantic element tweaks for readability on glass */
header { text-align: center; padding: 1.25rem 1rem; }
header h1 { margin-bottom: 0.25rem; color: var(--text); }
header .meta { font-size: 0.92rem; color: var(--muted); }

/* Featured image wrapper inside article area */
.featured-image { margin: 1rem 0; }

/* Content wrapper inside article if used by page scaffolding */
.content { padding: 0.5rem 0; }

/* Product ad styling in footer */
.product-ad {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.25);
  margin: .25rem;
}
.product-ad a { color: #fff; text-decoration: none; }

/* Print styles (basic readability) */
@media print {
  body { background: white; color: #000; }
  a { color: #00f; text-decoration: underline; }
  header, main, aside, footer { page-break-inside: avoid; }
  .glass { backdrop-filter: none; -webkit-backdrop-filter: none; }
}

/* Accessibility & motion preferences */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}