/* Base tokens */
:root {
  --bg: #062b23;
  --bg-2: #0a3b2b;
  --surface: rgba(8, 20, 15, 0.22);
  --text: #eafff4;
  --muted: #b5d8c0;
  --accent: #7a0f0f;
  --accent-2: #d04646;
  --card: rgba(255, 255, 255, 0.08);
  --card-border: rgba(255, 255, 255, 0.28);
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
  --radius: 14px;
}

/* Layout reset */
*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; }

html { color-scheme: dark; }

body {
  margin: 0;
  font-family: system-ui, -ui-system, "Segoe UI", Roboto, Inter, Arial, "Helvetica Neue", sans-serif;
  color: var(--text);
  background: linear-gradient(135deg, rgba(4, 46, 34, 0.9) 0%, rgba(6, 20, 18, 0.95) 60%, rgba(1, 10, 10, 0.92) 100%), #001e15;
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  overflow-x: hidden;
  isolation: isolate;
  scroll-behavior: smooth;
}

/* Jade snowfall pattern + subtle scanlines (pure CSS) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 2px 2px, rgba(180, 255, 230, 0.9) 1px, transparent 2px),
    radial-gradient(circle at 14px 28px, rgba(150, 255, 210, 0.7) 1px, transparent 2px);
  background-size: 22px 22px, 28px 28px;
  background-repeat: repeat;
  opacity: 0.25;
  mix-blend-mode: overlay;
  animation: fall-snow 60s linear infinite;
  transform: translateZ(0);
}
@keyframes fall-snow {
  0% { background-position: 0 0, 0 0; }
  100% { background-position: 0 160px, 0 120px; }
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.04) 0 1px,
    transparent 1px 2px
  );
  opacity: 0.15;
  mix-blend-mode: overlay;
}

/* Accessibility: respects prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  body::before, body::after { animation: none; }
}

/* Core helpers */
.container {
  width: 100%;
  max-width: clamp(720px, 92vw, 1100px);
  margin-inline: auto;
  padding: 1rem;
  position: relative;
  z-index: 1;
}

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform .2s ease, background .2s ease;
}
@supports not (backdrop-filter: blur(10px)) {
  .card { background: rgba(255, 255, 255, 0.08); }
}
.card:hover { transform: translateY(-1px); }

/* Glass panels for key sections (fallback-safe) */
header, footer, main, article, aside {
  background: rgba(0, 0, 0, 0.0);
  border-radius: 0;
  border: 0;
}

header {
  text-align: center;
  padding: 1.5rem 1rem;
  margin: 0 0 1rem;
  /* Glassy look with fallback */
  background: rgba(8, 22, 18, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 14px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
@supports not (backdrop-filter: blur(12px)) {
  header { background: rgba(6, 22, 18, 0.9); }
}
header h1 { font-size: clamp(1.6rem, 0.6rem + 2.5vw, 3.2rem); line-height: 1.15; margin: 0.15rem 0 0.5rem; letter-spacing: .2px; }

header .meta { color: var(--muted); font-size: clamp(0.8rem, 0.5vw + 0.8rem, 0.95rem); }

/* Simple navigation pill */
nav { display: inline-block; margin-top: .5rem; }
nav a {
  color: var(--text);
  text-decoration: none;
  padding: .5rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.28);
  transition: transform .2s ease, background .2s ease;
}
nav a:hover { transform: translateY(-1px); text-decoration: underline; }

/* Main/article content */
main {
  padding: 0;
}
article {
  padding: 0; /* let inner content manage spacing */
  display: block;
}
.featured-image { margin: 1rem 0; border-radius: 12px; overflow: hidden; }
.image-frame {
  aspect-ratio: 16/9;
  width: 100%;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.25);
  box-shadow: inset 0 0 12px rgba(0,0,0,.25);
}
.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.01);
  transition: transform .3s ease;
}
.image-frame:hover img { transform: scale(1.04); }

/* Typography */
h2 { font-size: clamp(1.4rem, 0.8rem + 1.8vw, 2.4rem); margin: .75rem 0 0.25rem; color: var(--text); }
h3 { font-size: clamp(1.05rem, 0.8vw + 0.9rem, 1.4rem); margin: .6rem 0 0.3rem; color: var(--text); }
p { font-size: clamp(0.95rem, 0.4vw + 0.95rem, 1.125rem); color: var(--text); margin: .5rem 0 1rem; }
blockquote {
  margin: 1rem 0;
  padding: .5rem 1rem;
  border-left: 4px solid var(--accent-2);
  color: var(--muted);
  background: rgba(255,255,255,0.04);
  border-radius: 6px;
}
ul { padding-left: 1.25rem; margin: .25rem 0 1rem; }
li { margin: .25rem 0; }

/* Links and CTAs */
a { color: var(--text); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, .btn:focus-visible, .cta:focus-visible {
  outline: 3px solid var(--accent-2);
  outline-offset: 2px;
  border-radius: 6px;
}
.btn, button, .cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .75rem 1.25rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.45);
  background: var(--accent);
  color: white;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease;
}
.btn.secondary, a.btn-secondary {
  background: transparent;
  color: var(--text);
}
.btn:hover { transform: translateY(-1px); background: #9a1c1c; }
.btn:active { transform: translateY(0); }

/* Footer / ad zones as glass panels where possible */
footer {
  padding: 1rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.product-ad, .sponsored-page {
  background: rgba(8, 24, 18, 0.28);
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 12px;
  padding: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  text-align: center;
}
.product-ad a, .sponsored-page a { color: var(--text); text-decoration: none; font-weight: 600; }
footer p { text-align: center; color: var(--muted); opacity: 0.95; }

/* Utilities (semantic) */
ul, li { margin-block: 0.4rem; padding: 0; }
.tag {
  display: inline-block;
  padding: 0.25em 0.5em;
  font-size: 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.28);
  background: rgba(0,0,0,0.25);
  color: var(--text);
}
.container + main { margin-top: -0.5rem; }

/* Print styles (basic readability) */
@media print {
  body::before, body::after { display: none; }
  header, main, footer { background: transparent; border: none; }
  a { text-decoration: underline; color: #000; }
}
