/* Base tokens & global styles */
:root {
  --bg: #0a0f14;
  --bg-2: #0d1a2a;
  --text: #eaf6ff;
  --muted: #b8c9e8;
  --accent: #4ba3ff;
  --accent-2: #c9b66a;
  --card: rgba(255, 255, 255, 0.08);
  --card-solid: rgba(255, 255, 255, 0.14);
  --border: rgba(255, 255, 255, 0.28);
  --focus: 0 0 0 3px rgba(75, 163, 255, 0.9);
  --radius: 12px;
}

html, body { height: 100%; }
html { font-size: 16px; }
body {
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(to bottom right, rgba(75,163,255,0.08), rgba(198,179,93,0.08)),
    repeating-linear-gradient(45deg, rgba(194,176,90,0.07) 0 2px, transparent 2px 4px),
    repeating-linear-gradient(-45deg, rgba(194,176,90,0.07) 0 2px, transparent 2px 4px),
    var(--bg);
  background-blend-mode: overlay, overlay, normal;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  color-scheme: dark;
  -webkit-font-smoothing: antialiased;
}

/* Glass panel helpers (with fallback) */
.glass {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 28px rgba(0,0,0,0.25);
  overflow: hidden;
}
@supports ((backdrop-filter: blur(8px)) or (-webkit-backdrop-filter: blur(8px))) {
  .glass { backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
}
@supports not ((backdrop-filter: blur(8px)) or (-webkit-backdrop-filter: blur(8px))) {
  .glass { background: rgba(255,255,255,0.18); }
}

/* Layout primitives */
.container { width: 100%; max-width: clamp(640px, 90vw, 1100px); margin: 0 auto; padding: 0 1rem; }

/* Section elements (required selectors) */
html, body, header, nav, main, article, footer, aside {
  box-sizing: border-box;
}

header { padding: 2rem 1rem 1.25rem; text-align: center; }
header h1 {
  margin: 0.25rem auto 0.5rem;
  font-size: clamp(1.75rem, 4vw + 0.5rem, 3rem);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: .2px;
}
header .meta {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.92rem;
}

/* Main content */
main { padding: 1rem 1rem 2rem; }
article { display: block; }

/* Featured image framing with aspect ratio and glow */
.image-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.25);
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
  margin: 0.75rem 0 1rem;
}
.image-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Content area inside article (glass panel vibe) */
.content {
  padding: 0.75rem 0 1rem;
}
.content h2 { font-size: clamp(1.4rem, 2vw + 1rem, 2.2rem); margin: 0.25rem 0 0.5rem; }
.content h3 { font-size: 1.1rem; margin: 0.75rem 0 0.25rem; color: var(--muted); }
.content p, .content li { color: #eaf6ff; }
.content ol, .content ul { padding-left: 1.25rem; margin: 0.25rem 0 0.75rem; }

/* Lists for accessibility and spacing */
ul, li { margin: 0; padding: 0; }
li { margin: 0.25rem 0; }

/* Blockquote styling */
blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 0.75rem;
  color: var(--muted);
  margin: 0.75rem 0;
}

/* Footer sections acting as "ads" / panels */
.product-ad, .sponsored-page {
  display: block;
  margin: 0.5rem 0;
  padding: 0.75rem;
  text-align: center;
}
.product-ad a, .sponsored-page a { color: var(--text); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; padding: 0.6rem 1rem; border-radius: 999px; border: 1px solid rgba(255,255,255,0.25); background: rgba(0,0,0,0.15); }

/* Content & utility classes required by the spec */
.content { max-width: none; }

/* CTA / button styling (solid and outline) */
a, button, .btn, .cta {
  cursor: pointer;
  color: #001b32;
  text-decoration: none;
}
a { color: var(--accent); }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, .btn:focus-visible, .cta:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}
.btn, .cta {
  display: inline-block;
  padding: 0.66rem 1.1rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.25);
  background: var(--accent);
  color: #061e32;
  font-weight: 600;
  transition: transform 0.15s ease, background 0.2s ease;
}
.btn.secondary, .cta.secondary {
  background: transparent;
  color: var(--text);
}
.btn:hover, .cta:hover { transform: translateY(-1px); text-decoration: underline; }
.btn:active, .cta:active { transform: translateY(0); }

/* Cards and grid utilities */
.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: 0 6px 20px rgba(0,0,0,0.25);
}
.tag {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  color: #041a2b;
  background: rgba(75, 163, 255, 0.9);
  border: 1px solid rgba(255,255,255,0.4);
  margin-right: 0.5rem;
}

/* Image frame fallback handling for environments without border-glow */
.image-frame, .image-frame img { backface-visibility: hidden; }

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

/* Print styles for basic readability */
@media print {
  body { background: #fff; color: #000; }
  a { text-decoration: underline; }
  .glass { background: #fff; border: 1px solid #aaa; }
}
