/* Section: Tokens & Base Palette */
:root {
  --bg: #e6f2ff;
  --bg-2: #d2eaff;
  --text: #0b1020;
  --muted: #57607a;
  --accent: #ffd400;
  --accent-2: #fff056;
  --card: rgba(255, 255, 255, 0.08);
  --card-solid: rgba(0, 0, 0, 0.04);
  --radius: 14px;
  --shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

/* Section: Reset & Global */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  margin: 0;
  color: var(--text);
  background: transparent;
  min-height: 100%;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.5;
  /* Layered background: gradient + paper texture + subtle scanlines (pure CSS) */
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.08), transparent 25%),
    radial-gradient(circle at 80% 60%, rgba(255,255,255,0.04), transparent 25%),
    linear-gradient(135deg, rgba(135, 206, 250, 0.25), rgba(0,0,0,0) 40%),
    linear-gradient(#e6f4ff, #dbefff);
  background-blend-mode: normal, normal, normal, normal;
  background-size: auto, auto, auto, auto;
  position: relative;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  /* Subtle paper-noise / scanline overlay (pure CSS) */
  background-image:
    repeating-linear-gradient(to bottom, rgba(255,255,255,0.06) 0 1px, transparent 1px 2px),
    repeating-linear-gradient(to right, rgba(255,255,255,0.04) 0 1px, transparent 1px 2px);
  mix-blend-mode: overlay;
  opacity: 0.55;
}
@media (prefers-reduced-motion: reduce) {
  body::before { display: none; }
  * { transition: none !important; animation: none !important; }
}

/* Section: Layout Helpers */
.header, header, nav { /* semantic grouping friendliness */ }
.container { width: min(1200px, 92vw); margin-inline: auto; padding-inline: 0.5rem; }

/* Section: Structural Elements */
html, body, header, nav, main, article, footer, aside {
  /* ensure consistent rendering targets */
}
header {
  padding: 1.25rem 1rem;
  text-align: center;
}
header h1 {
  font-size: clamp(1.6rem, 3.5vw, 2.5rem);
  line-height: 1.08;
  margin: 0.25rem 0;
  letter-spacing: .2px;
  color: var(--text);
}
header .meta {
  color: var(--muted);
  font-size: clamp(0.8rem, 1.5vw, 0.95rem);
}
nav a {
  color: var(--text);
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
}
nav a:hover, nav a:focus-visible {
  text-decoration: underline;
}
main { padding: 1rem 1rem 1.25rem; }

/* Section: Content & Visual Panels */
.article, article { display: block; }
.image-frame {
  max-width: 100%;
  margin: 1rem auto;
  border-radius: 12px;
  padding: 0.25rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.25);
  box-shadow: var(--shadow);
  aspect-ratio: 16/9;
  overflow: hidden;
}
.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 8px;
}
.content { padding: 0.75rem 0; }

/* Section: Glass Panels (Card system) */
.card, .content, .product-ad, .section { background: var(--card); border: 1px solid rgba(255,255,255,0.28); 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)) {
  .card, .content, .product-ad, .section { background: rgba(255,255,255,0.18); }
}
section { margin: 0.75rem 0; }

/* Section: Typography & Lists */
h1, h2 { margin: 0.2em 0; color: var(--text); }
h2 { font-size: clamp(1.1rem, 2.5vw, 1.25rem); font-weight: 700; color: var(--text); }
p { margin: 0.5em 0; color: var(--text); }
ul, ol { padding-left: 1.5rem; margin: 0.5em 0; }
li { margin: 0.25em 0; }

/* Section: Utilities & Components */
.btn, .cta, button, .btn--outline, .cta-outline {
  font-family: inherit;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  padding: 0.65rem 0.95rem;
  display: inline-block;
  text-align: center;
  text-decoration: none;
  transition: transform .2s ease, background .2s ease, color .2s ease;
}
a, button, .btn, .cta { color: #000; }
.btn { background: var(--accent); color: #000; }
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn + .btn { margin-left: 0.5rem; }
.btn--outline {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(0,0,0,0.25);
}
.cta {
  background: var(--accent-2);
  color: #111;
}
.cta:focus-visible, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Section: Misc UI Elements */
.tag {
  display: inline-block;
  padding: 0.15em 0.45em;
  border-radius: 6px;
  font-size: 0.75rem;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.32);
  color: var(--text);
}
ul { list-style: disc; padding-left: 1.5rem; margin: 0.5rem 0; }
li { margin: 0.25rem 0; }

/* Section: Layout Helpers (Grid) */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }

/* Section: Product Ad (Footer use) */
.product-ad {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.28);
  color: var(--text);
  text-decoration: none;
}
.sponsored-page { display: inline-flex; align-items: center; justify-content: center; }

/* Section: Footer */
footer {
  padding: 1rem;
  text-align: center;
  color: var(--muted);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  align-items: center;
  justify-items: center;
}
footer p { margin: 0; }

/* Section: Print (basic readability) */
@media print {
  body::before { display: none; }
  body { background: white; color: black; }
  a { text-decoration: underline; }
}

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

/* Section: Structural helpers (aside styling placeholder) */
aside { display: none; }