/* Section: Base & Palette */
:root {
  /* Olive parchment base + cobalt accents */
  --bg: #2f2e1a;
  --bg-2: #1a1a0f;
  --text: #eaf6e2;
  --muted: #b8c79b;
  --accent: #2b6cff;
  --accent-2: #7bd4ff;
  --surface: rgba(14, 20, 12, 0.28);
  --surface-2: rgba(14, 20, 12, 0.22);
  --card: rgba(18, 24, 12, 0.28);
  --card-border: rgba(255, 255, 255, 0.28);
  --shadow: 0 8px 24px rgba(0,0,0,0.28);
}

html, body { height: 100%; }
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

/* Section: Layered Background (gradient + noise/scanlines) */
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Inter, Arial, "Noto Sans", sans-serif;
  font-size: clamp(14px, 1.05vw + 12px, 18px);
  line-height: 1.6;
  color: var(--text);
  min-height: 100%;
  background-color: var(--bg);
  background-image:
    linear-gradient(to bottom, rgba(0,0,0,0.0), rgba(0,0,0,0.0)),
    repeating-linear-gradient(to bottom, rgba(0,0,0,0.04) 0 1px, transparent 1px 2px),
    linear-gradient(135deg, #5f5a2b 0%, #2b2b12 60%, #5f5a2b 100%);
  background-blend-mode: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Section: Layout Utilities */
.container { width: 100%; max-width: clamp(680px, 92vw, 1100px); margin-inline: auto; padding-inline: 1rem; }

/* Grid & Cards (responsive utilities) */
.grid { display: grid; grid-gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--card-border); border-radius: 12px; padding: 1rem; box-shadow: var(--shadow); }

/* Tags */
.tag { display: inline-block; padding: .25em .6em; font-size: .75rem; border-radius: 999px; background: rgba(43, 108, 255, 0.16); color: #eaf2ff; border: 1px solid rgba(66, 150, 255, 0.4); }

/* Section: Glass Panels (fallback included) */
header, main, footer, aside {
  background: rgba(12, 18, 12, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 14px;
  padding: 0.75rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  color: var(--text);
}
@supports not (backdrop-filter: blur(12px)) {
  header, main, footer, aside { background: rgba(12, 18, 12, 0.65); }
}

/* Section: Typography & Elements */
header { padding: 1.25rem 1rem; margin: 1rem auto; }
header h1 {
  font-size: clamp(1.8rem, 3vw + 1rem, 3rem);
  margin: 0 0 .25rem;
  line-height: 1.1;
  color: var(--text);
}
header .meta { color: var(--muted); font-size: 0.9rem; margin: 0; }

/* Nav styling */
nav { margin-top: 0.5rem; }
nav a {
  color: var(--muted);
  text-decoration: none;
  padding: .25rem .5rem;
  border-radius: 6px;
}
nav a:hover, nav a:focus-visible {
  color: var(--text);
  text-decoration: underline;
  outline: none;
}

/* Main content */
main { padding: 1rem; }
article { padding: 0; }

/* Image blocks */
.image-frame, .featured-image { border-radius: 12px; overflow: hidden; border: 1px solid rgba(255,255,255,0.28); }
.image-frame { aspect-ratio: 16/9; display: block; }
.image-frame img, .featured-image img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Content typography within article */
h2 { font-size: clamp(1.5rem, 1.6vw + 1rem, 2.4rem); margin: .75rem 0; color: var(--text); }
p { margin: .75rem 0; color: var(--text); }
ul { padding-inline-start: 1.25rem; margin: .5rem 0; }
li { margin: .25rem 0; }

/* Blockquotes */
blockquote {
  margin: 1rem 0;
  padding: .75rem 1rem;
  border-left: 4px solid var(--accent);
  color: var(--muted);
  background: rgba(0,0,0,0.15);
  border-radius: 6px;
}

/* Footer & product ad sections */
footer { padding: 1rem; margin: 1rem auto 0; display: grid; gap: .75rem; grid-template-columns: 1fr; align-items: center; justify-items: center; }
.product-ad, .sponsored-page {
  padding: .75rem;
  display: inline-block;
  border-radius: 10px;
  background: rgba(15, 22, 14, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.28);
}
.product-ad a, .sponsored-page a {
  color: var(--text);
  text-decoration: none;
  display: block;
  padding: .5rem 1rem;
}
.product-ad a:hover, .sponsored-page a:hover {
  text-decoration: underline;
}
.product-ad a { text-align: center; }
.sponsored-page { background: rgba(7, 12, 12, 0.28); }

/* Links & buttons (interactive states) */
a { color: var(--accent); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; color: var(--accent-2); }
button, .btn, .cta {
  font-family: inherit;
  border: 0;
  border-radius: 8px;
  padding: .6em 1em;
  cursor: pointer;
  background: var(--accent);
  color: white;
  transition: transform 0.15s ease, background 0.15s ease;
}
button:hover, .btn:hover, .cta:hover {
  background: var(--accent-2);
  transform: translateY(-1px);
}
button:focus-visible, .btn:focus-visible, .cta:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(43, 108, 255, 0.6);
  transform: translateY(-1px);
}
button.reset, .btn.reset { background: transparent; color: var(--text); }

/* Image frame accessibility helper (if used) */
.image-frame:focus-visible, .featured-image:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

/* Section: Print styles (basic readability) */
@media print {
  body { background: white; color: black; }
  a { color: black; text-decoration: underline; }
  header, main, footer { background: transparent; border: none; box-shadow: none; }
}

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