/* Base & Tokens */
:root{
  --bg-1: #1b0f3e;       /* indigo baseline */
  --bg-2: #2a0f6b;       /* indigo sunset mid */
  --bg-3: #0f3a63;       /* cyan-tinted contrast shadow */
  --text: #e6f4ff;
  --muted: #a8b6cc;
  --accent: #2ff6ff;      /* cyan */
  --accent-2: #7c3aed;    /* indigo */
  --card: rgba(255,255,255,.08);
  --card-strong: rgba(255,255,255,.14);
  --border: rgba(255,255,255,.25);
  --shadow: 0 8px 28px rgba(0,0,0,.4);
  --radius: 14px;
  --focus: #6ef2ff;
}
html, body { height: 100%; }
* { box-sizing: border-box; }
html { font-family: system-ui, -apple-system, "Segoe UI", Roboto, Inter, Arial, sans-serif; font-synthesis: none; -webkit-font-smoothing: antialiased; }
body {
  margin: 0;
  color: var(--text);
  /* Layered background: gradient + subtle scanlines */
  background:
    linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 40%, var(--bg-3) 100%),
    repeating-linear-gradient(to bottom, rgba(255,255,255,.04) 0 1px, transparent 1px 2px);
  min-height: 100vh;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg-1: #e8ecff;
    --bg-2: #dbe4ff;
    --bg-3: #c9f0ff;
    --text: #0b1020;
    --muted: #4b566b;
    --card: rgba(0,0,0,.05);
    --card-strong: rgba(0,0,0,.08);
    --border: rgba(0,0,0,.15);
    --focus: #0a7c8b;
  }
  body {
    background: linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 60%, var(--bg-3) 100%);
  }
}

/* Layout Helpers */
.container {
  width: 100%;
  max-width: clamp(40rem, 88vw, 1100px);
  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);
}
.tag {
  display: inline-block;
  padding: .15rem .5rem;
  font-size: .75rem;
  border-radius: 999px;
  background: rgba(47,246,255,.15);
  color: var(--text);
  border: 1px solid rgba(47,246,255,.35);
}
ul { margin: 0 0 0.75rem 1.15rem; padding: 0; }
li { margin: .25rem 0; }

/* Core typographic scale (fluid) */
h1, h2 {
  line-height: 1.15;
  margin: .2rem 0;
}
h1 { font-size: clamp(2rem, 4vw + 1rem, 3.75rem); font-weight: 700; letter-spacing: .5px; }
h2 { font-size: clamp(1.25rem, 2.5vw, 2rem); font-weight: 700; color: var(--text); }
p { margin: .5rem 0 1rem; color: var(--text); }

/* Glass panels (frosted) with graceful fallback */
header, main, article, aside, footer, .product-ad, .image-frame, .featured-image {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: var(--radius);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  box-shadow: 0 8px 28px rgba(0,0,0,.28);
  padding: 1rem;
}
@supports not (backdrop-filter: blur(12px)) {
  header, main, article, aside, footer, .product-ad, .image-frame, .featured-image {
    background: rgba(255,255,255,.18);
  }
}
header { text-align: center; padding: 1.25rem 1rem; margin: 1rem auto; max-width: 1100px; }

/* Hero / typography emphasis within header */
header h1 { color: var(--text); margin-bottom: .25rem; }
header .meta { color: var(--muted); font-size: .875rem; }

/* Content area */
main { padding: .75rem 0; }
.content { padding: 0; }

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

/* Featured image fallback wrapper (also supports .image-frame-like styling) */
.featured-image { overflow: hidden; border-radius: 12px; }
.featured-image img { width: 100%; height: auto; display: block; border-radius: 8px; }

/* Content styling targets */
.content > p { max-width: 65ch; }

/* Product ad / footer panels (glass) */
.product-ad, .sponsored-page { display: block; text-align: left; text-decoration: none; color: inherit; margin: .5rem 0; }
.product-ad a, .sponsored-page a { text-decoration: none; color: inherit; display: block; padding: .5rem 0; }

/* Link & button styling (interactive states) */
a { color: var(--accent); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 2px; }

button, .btn, .cta {
  font-family: inherit;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid rgba(47,246,255,.65);
  padding: .75rem 1.25rem;
  cursor: pointer;
  color: #00101a;
  background: linear-gradient(135deg, rgba(47,246,255,.85), rgba(0,189,255,.95));
  color: #00131a;
  transition: transform .15s ease, opacity .3s ease;
  box-shadow: 0 6px 16px rgba(0,0,0,.25);
}
button:hover, .btn:hover, .cta:hover { transform: translateY(-1px); opacity: .98; }
button:active, .btn:active, .cta:active { transform: translateY(0); }
button.secondary, .btn.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(124,58,237,.8);
}
button:focus-visible, .btn:focus-visible, .cta:focus-visible, a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Footer row / content spacing */
footer { padding: 1rem; text-align: center; }

/* Accessibility helpers for focus visibility on keyboard nav */
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

/* Print styles (basic readability) */
@media print {
  body { background: #fff; color: #000; }
  header, main, article, aside, footer { background: transparent; border: none; box-shadow: none; }
  a { color: #000; text-decoration: underline; }
}
 
/* Animations (GPU-friendly) */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
header { animation: fadeInUp .6s ease-out; }

/* Section-specific minor tweaks for readability on small screens */
@media (max-width: 600px) {
  header { padding: 1rem; }
  .image-frame { border-radius: 10px; }
  .tag { display: inline-block; margin-right: .25rem; }
}