/* Section: Base / Theme Tokens */
:root {
  --bg: #2b0a2e;           /* deep plum */
  --bg-2: #1a0720;         /* darker plum */
  --text: #eef6f0;          /* near-white for contrast on glass */
  --muted: #a8c7a6;         /* sage muted */
  --accent: #9bd29a;         /* sage green */
  --accent-2: #74b17a;       /* secondary sage */
  --card: rgba(255, 255, 255, 0.08);
  --card-2: rgba(255, 255, 255, 0.12);
  --border: rgba(120, 210, 170, 0.40);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  --focus: #9be58a;           /* focus ring color for accessibility */
  --focus-offset: 2px;
}

/* Section: Global Layout & Background (mobile-first, layered gradient + scanlines) */
html, body {
  height: 100%;
}
html, body {
  margin: 0;
  padding: 0;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(14px, 1.6vw, 16px);
  line-height: 1.5;
  /* Layered background: gradient base + subtle scanlines */
  background: 
    linear-gradient(135deg, var(--bg) 0%, var(--bg-2) 60%, #000 100%),
    repeating-linear-gradient(to bottom, rgba(0,0,0,.08) 0 2px, transparent 2px 4px);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body { min-height: 100%; }

/* Section: Layout helpers */
.container {
  width: 100%;
  max-width: clamp(640px, 86vw, 1120px);
  padding-inline: 1rem;
  margin-inline: auto;
}

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

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: var(--shadow);
}

/* Section: Typographic scale */
h1, h2, h3 {
  color: var(--text);
  line-height: 1.15;
  margin: 0.25rem 0;
}
h1 { font-size: clamp(1.75rem, 4vw, 3.5rem); }
h2 { font-size: clamp(1.25rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1rem, 2.6vw, 1.4rem); }

/* Section: Image framing and visuals */
.image-frame {
  aspect-ratio: 16 / 9;
  width: 100%;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}
.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.featured-image { margin: 1rem 0; }

/* Section: Glass panels (with fallback) */
article, .product-ad {
  background: rgba(13, 0, 40, 0.28);
  border: 1px solid rgba(120, 210, 170, 0.40);
  border-radius: 14px;
  padding: 1rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}
@supports not (backdrop-filter: blur(12px)) {
  article, .product-ad {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(13, 0, 40, 0.62);
    border-color: rgba(120, 210, 170, 0.62);
  }
}

/* Section: Links & Buttons (focus states & accessibility) */
a, button, .btn, .cta {
  font-family: inherit;
  color: var(--text);
  text-decoration: none;
  border-radius: 8px;
  padding: 0.5rem 0.9rem;
  display: inline-block;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
a:hover { text-decoration: underline; color: var(--accent-2); }
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: var(--focus-offset);
  border-radius: 6px;
}
.btn { background: rgba(149, 196, 171, 0.25); border-color: rgba(149, 196, 171, 0.6); color: var(--text); }
.btn:hover { background: rgba(149, 196, 171, 0.38); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--solid { background: rgba(149, 196, 171, 0.75); border-color: rgba(149, 196, 171, 0.95); color: #062; }
.btn--solid:hover { background: rgba(149, 196, 171, 0.9); }
.btn--outline { background: transparent; border-color: rgba(149, 196, 171, 0.8); color: var(--text); }
.cta { font-weight: 600; }

/* Section: Header / Hero */
header {
  padding: 2rem 1rem;
  text-align: center;
}
header h1 {
  font-size: clamp(1.75rem, 4vw, 3.5rem);
  line-height: 1.08;
  margin: 0.25rem 0;
}
header .meta {
  font-size: 0.95rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

/* Section: Main content area */
main { display: block; }

/* Section: Article content styling */
article {
  margin: 1rem auto;
  padding: 1rem;
  max-width: clamp(680px, 86vw, 980px);
}

/* Section: Footer & product ad area */
footer { padding: 1rem; }

/* Section: Print styles (basic readability) */
@media print {
  html, body { background: #fff; color: #000; }
  nav, header, footer { display: none; }
  article { margin: 0; padding: 0; }
  .image-frame, .featured-image { page-break-inside: avoid; }
}

/* Section: Motion preference */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; transform: none !important; }
}