/* Tokens */
:root {
  --bg: #0b1220;
  --bg-2: #0a1b2a;
  --text: #e8f1ff;
  --muted: #a4b4c8;
  --accent: #6b8e23;      /* olive */
  --accent-2: #1c3a90;     /* midnight blue */
  --card: rgba(255,255,255,.08);
  --border: rgba(255,255,255,.25);
  --shadow: 0 8px 28px rgba(0,0,0,.35);
  --radius: 14px;
}

/* Base & Reset */
*,
*::before,
*::after { box-sizing: border-box; }
html, body { height: 100%; }
html { color-scheme: dark; }
body {
  margin: 0;
  font-family: ui-system, -apple-system, "Segoe UI", Roboto, Inter, Arial, "Noto Sans", "Liberation Sans", sans-serif;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(circle at 10px 10px, rgba(107,142,35,.25) 2px, transparent 3px),
    radial-gradient(circle at 60px 40px, rgba(107,142,35,.15) 2px, transparent 3px),
    linear-gradient(135deg, rgba(3,7,20,.95) 0%, rgba(10,20,40,.95) 60%, rgba(6,10,25,.95) 100%),
    repeating-linear-gradient(to bottom, rgba(0,0,0,.04) 0 1px, transparent 1px 2px),
    repeating-linear-gradient(to right, rgba(0,0,0,.04) 0 1px, transparent 1px 2px);
  background-blend-mode: overlay, overlay, normal, overlay, overlay;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }

/* Layout Utilities */
.container { width: min(1100px, 92%); margin: 0 auto; padding: 1rem; }

/* Glass Panels (with fallback) */
header, main, footer {
  background: rgba(4,8,20,.28);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
@supports not ((backdrop-filter: blur(12px)) or (-webkit-backdrop-filter: blur(12px))) {
  header, main, footer { background: rgba(4,8,20,.66); }
}
.image-frame { aspect-ratio: 16/9; width: 100%; border-radius: 12px; overflow: hidden; border: 1px solid rgba(255,255,255,.25); box-shadow: 0 6px 20px rgba(0,0,0,.35); background: #111; }
.image-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Header / Hero */
header { text-align: center; padding: 1.25rem 1rem 1.25rem; margin: 1rem auto; }
header h1 { font-size: clamp(1.8rem, 4vw, 3rem); margin: .25rem 0 .25rem; color: var(--text); text-shadow: 0 2px 12px rgba(0,0,0,.4); }
header .meta { font-size: clamp(.9rem, 2.5vw, 1.05rem); color: var(--muted); margin: .25rem 0 0; }

/* Main & Article Structure */
main { padding: 0; }
article { max-width: clamp(320px, 92vw, 860px); margin: 0 auto; padding: 0.5rem; }
.featured-image { margin: 0.75rem 0 1rem; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); margin: .25rem 0 .5rem; color: var(--text); }

/* Article content */
section { padding: 0.25rem 0 0.25rem; }
.content { padding: .5rem; color: var(--text); line-height: 1.6; }
.content p { color: var(--muted); margin: .5rem 0; font-size: clamp(1rem, 2vw, 1.125rem); }
.content ul { margin: .5rem 0; padding-left: 1.25rem; }
.content li { margin: .25rem 0; }

/* Quotes / Visual accents */
blockquote { margin: .5rem 0; padding-left: .75rem; border-left: 3px solid var(--accent-2); color: var(--muted); font-style: italic; }

/* Image caption helper (if needed) */
.caption { font-size: .9rem; color: var(--muted); }

/* Footer & Ad Sections */
footer { display: grid; gap: .75rem; justify-items: center; padding-top: 1rem; padding-bottom: 1rem; }
.product-ad, .sponsored-page { width: min(520px, 90%); padding: .75rem; border-radius: 12px; border: 1px solid rgba(255,255,255,.25); background: rgba(15,24,40,.22); text-align: center; box-shadow: 0 6px 20px rgba(0,0,0,.3); }
.product-ad a, .sponsored-page a { color: #fff; text-decoration: none; display: block; padding: .5rem; }
.product-ad p, .sponsored-page p { margin: 0; font-weight: 600; }

/* Link & Button Styles */
a { color: var(--accent-2); text-decoration: none; outline: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 2px solid #9bd8ff; outline-offset: 3px; border-radius: 6px; }
button, .btn, .cta { font: inherit; cursor: pointer; }

/* Button variants (compact presets) */
.btn { display: inline-block; padding: .6rem .95rem; border-radius: 999px; border: 1px solid rgba(255,255,255,.25); color: #fff; background: rgba(28,58,144,.9); text-align: center; transition: transform .15s ease, background .2s ease; }
.btn:hover { transform: translateY(-1px); background: rgba(28,58,144,.98); }
.btn:active { transform: translateY(0); }
.btn--outline { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.6); }

/* Utility & small components */
.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: .75rem; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }

/* Image helpers for potential extra frames */
.utility-image { width: 100%; height: auto; border-radius: 10px; border: 1px solid rgba(255,255,255,.25); }

/* Content defaults (generic) */
.content, .image-frame, .card { will-change: transform, opacity; }

/* Typography scaling */
p, li { line-height: 1.6; }

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

/* Layout adjustments for larger viewports */
@media (min-width: 640px) {
  .container { padding: 1.5rem; }
  article { padding: 0; }
  .grid { gap: 1.25rem; }
}

/* Light mode adjustments (better legibility when user prefers light) */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f7fb;
    --bg-2: #ffffff;
    --text: #0b1a30;
    --muted: #4b5563;
    --accent: #4a7c2e;
    --accent-2: #1a4f96;
  }
  body {
    background-image:
      radial-gradient(circle at 10px 10px, rgba(107,142,35,.25) 2px, transparent 3px),
      radial-gradient(circle at 60px 40px, rgba(107,142,35,.15) 2px, transparent 3px),
      linear-gradient(135deg, #f6f7fb 0%, #e9eefb 60%, #e9eefb 100%);
    background-blend-mode: normal;
  }
  header, main, footer { background: rgba(255,255,255,.9); border-color: rgba(0,0,0,.15); color: #0b1a30; }
  .image-frame { border-color: rgba(0,0,0,.15); }
  .product-ad, .sponsored-page { background: rgba(255,255,255,.92); border-color: rgba(0,0,0,.15); }
  a { color: #1a4f96; }
}

/* Print friendliness */
@media print {
  body { background: white; color: black; }
  header, main, footer { background: none; border: none; box-shadow: none; }
  .image-frame { border: none; }
}