/* Palette */
:root {
  --bg: #0b0f1a;
  --bg-2: #1b1740;
  --text: #e8f0ff;
  --muted: #a6b4a6;
  --olive: #6b8e2b;
  --olive-2: #93c05a;
  --glass: rgba(9, 14, 28, 0.22);
  --glass-soft: rgba(9, 14, 28, 0.14);
  --surface-border: rgba(255, 255, 255, 0.25);
  --surface: rgba(9, 14, 28, 0.28);
  --shadow: 0 8px 20px rgba(0,0,0,0.25);
}

/* Base & layout reset */
* { box-sizing: border-box; }
html, body { height: 100%; }
html { color-scheme: dark; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  min-height: 100dvh;
  padding: 0;
  /* Layered background: indigo gradient + subtle scanlines */
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-2) 60%, #0b1240 100%),
              repeating-linear-gradient(to bottom, rgba(255,255,255,0.04) 0, rgba(255,255,255,0.04) 1px, transparent 1px, transparent 2px);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f7fb;
    --bg-2: #e8ecf7;
    --text: #0b1220;
    --muted: #445;
    --olive: #4a6b2a;
    --olive-2: #7aa047;
    --glass: rgba(255, 255, 255, 0.88);
    --glass-soft: rgba(255, 255, 255, 0.72);
    --surface-border: rgba(0,0,0,0.08);
    --surface: rgba(255,255,255,0.92);
  }
  body {
    background: linear-gradient(135deg, var(--bg), var(--bg-2) 60%, #dfe6f6);
  }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* Sections as glass panels */
header, main, article, aside, footer {
  padding: 1rem;
  margin: 0.75rem auto;
  border-radius: 14px;
  border: 1px solid var(--surface-border);
  background: var(--glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  max-width: clamp(320px, 90vw, 1100px);
}
header { text-align: center; padding-top: 2rem; padding-bottom: 1rem; }
main { display: block; padding: 1rem; }
article { display: block; }
aside { padding: 0.75rem; }

/* Container & grid utilities */
.container { width: 100%; max-width: clamp(320px, 90vw, 1120px); margin-inline: auto; padding-inline: 1rem; }
.grid { display: grid; gap: 1rem; }
.card { background: var(--glass); border: 1px solid var(--surface-border); border-radius: 12px; padding: 1rem; box-shadow: var(--shadow); }

/* Hero / content typography */
h1 {
  font-size: clamp(1.6rem, 2.2vw + 1rem, 2.8rem);
  line-height: 1.15;
  margin: 0;
  letter-spacing: .2px;
}
.content { padding: 0.5rem 0; }

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

/* Product ad / sponsored blocks */
.product-ad, .sponsored-page {
  display: block;
  text-decoration: none;
}
.product-ad a, .sponsored-page a {
  display: block;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  text-align: center;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(135deg, #2a2f7a, #1a1d6b);
  border: 1px solid rgba(255,255,255,0.25);
  transition: transform 0.2s ease, background 0.2s ease;
}
.product-ad a:hover, .sponsored-page a:hover { transform: translateY(-1px); background: linear-gradient(135deg, #3b4390, #2b2f7f); }
.product-ad a:focus-visible, .sponsored-page a:focus-visible { outline: 2px solid var(--olive-2); outline-offset: 2px; }

/* Links & typography tweaks */
a { color: var(--text); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--olive-2); outline-offset: 2px; text-decoration: underline; }

/* Buttons & CTA variants */
.btn, .cta, button {
  display: inline-block;
  font-weight: 600;
  font-size: clamp(0.95rem, 0.5vw + 0.9rem, 1rem);
  padding: 0.75rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.15);
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  color: #fff;
  background: var(--olive);
  transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease;
}
.btn:hover, .cta:hover, button:hover { transform: translateY(-1px); }
.btn:active, .cta:active, button:active { transform: translateY(0); }
.btn:focus-visible, .cta:focus-visible, button:focus-visible { outline: 2px solid var(--olive-2); outline-offset: 2px; }
.btn--outline {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(106, 128, 52, 0.9);
}
.btn--outline:hover { background: rgba(106,128,52,0.08); }

/* Utility: tags */
.tag {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border-radius: 999px;
  color: #d7f5c3;
  background: rgba(107, 142, 43, 0.18);
  border: 1px solid rgba(107, 142, 43, 0.4);
}

/* List styling */
ul { margin: 0; padding-left: 1.25rem; }
li { margin: 0.25rem 0; }

/* Print styles */
@media print {
  body { background: white; color: black; }
  header, main, aside, footer { background: white; border: 1px solid #ccc; }
  a { color: #000; text-decoration: underline; }
}

/* Accessibility helpers */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--olive-2); outline-offset: 2px; }

/* Narrow and responsive tweaks */
@media (max-width: 700px) {
  header { padding: 1.25rem 0; }
  .image-frame { border-radius: 12px; }
}

/* Footer layout tweaks for content density */
footer { display: grid; gap: 0.75rem; align-content: center; }

/* Ensure prefers-color-scheme light fallbacks for glass panels when needed */
@supports not (backdrop-filter: blur(12px)) {
  header, main, aside, footer { background: var(--glass-soft); }
}
