/* 01 - Palette & Foundations */
:root{
  --bg: #ffd200;            /* yellow base */
  --bg-2: #6a5cff;          /* galaxy purple */
  --bg-3: #8b6aff;          /* lighter purple accent */
  --text: #0b0b0b;
  --muted: #555;
  --surface: rgba(255,255,255,0.14);
  --surface-strong: rgba(255,255,255,0.22);
  --border: rgba(255,255,255,0.28);
  --radius: 14px;
  --shadow: 0 6px 20px rgba(0,0,0,.15);
  --focus: 0 0 0 3px rgba(255,235,0,.85);
  --container-w: clamp(320px, 92vw, 1200px);
  --text-on-surface: #0b0b0b;
}
html, body { height: 100%; }
html, body { margin: 0; padding: 0; }

/* 02 - Layered background (gradient + subtle scanlines) */
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  color: var(--text);
  background: 
    linear-gradient(135deg, var(--bg) 0%, #ffd600 40%, rgba(106,92,255,.28) 70%, rgba(0,0,0,0) 100%),
    linear-gradient(to bottom right, rgba(255,255,255,.15), rgba(255,255,255,.04)),
    #ffd200;
  background-blend-mode: normal, overlay, normal;
  min-height: 100%;
  position: relative;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  /* subtle noise/scanline texture */
  background-image:
    linear-gradient(rgba(0,0,0,.04), rgba(0,0,0,.04)),
    repeating-linear-gradient(to bottom, rgba(255,255,255,.05) 0 1px, transparent 1px 2px);
  opacity: .25;
  mix-blend-mode: overlay;
  z-index: 0;
}

/* 03 - Layout helpers */
.container { width: 100%; max-width: var(--container-w); margin-inline: auto; padding-inline: 1rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.card { background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28); border-radius: var(--radius);
  padding: 1rem; box-shadow: var(--shadow); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
@supports not (backdrop-filter: blur(12px)) { .card { background: rgba(255,255,255,.28); } }

/* 04 - Core sections & panels */
header, nav, main, article, section, aside, footer { display: block; }
header { text-align: center; padding: 2rem 1rem 1rem; }
header h1 { font-size: clamp(1.8rem, 4vw + 0.5rem, 3.5rem); margin: 0.25rem auto 0.5rem; color: #1a1130; }
header .meta { color: var(--muted); font-size: clamp(0.8rem, 1.4vw, 0.95rem); margin-top: .25rem; }

/* 05 - Typography scale (responsive) */
h1, h2, h3, h4 { margin: .5em 0; line-height: 1.25; font-weight: 700; }
h1 { font-size: clamp(2rem, 4vw + 1rem, 3.5rem); color: #1b1136; text-shadow: 0 1px 0 rgba(255,255,255,.6); }
h2 { font-size: clamp(1.5rem, 3vw + .5rem, 2.25rem); color: var(--bg-2); }
h3 { font-size: clamp(1.25rem, 2.5vw + .5rem, 1.75rem); color: var(--bg-3); }
h4 { font-size: clamp(1.1rem, 2vw + .4rem, 1.3rem); }

/* 06 - Content blocks & media */
.image-frame { width: 100%; aspect-ratio: 16/9; border-radius: 12px; overflow: hidden;
  border: 1px solid rgba(255,255,255,.6); box-shadow: 0 6px 18px rgba(0,0,0,.15) inset; }
.image-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* 07 - Content area (glass panels with fallback) */
.content { padding: 1rem; border-radius: var(--radius); background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.28); box-shadow: var(--shadow);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); color: var(--text-on-surface); }
@supports not (backdrop-filter: blur(12px)) {
  .content { background: rgba(255,255,255,.26); }
}
.product-ad { padding: .75rem; margin: .5rem 0; border-radius: 12px;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28); display: inline-block; }

/* 08 - Lists & inline helpers */
ul { padding-left: 1.25rem; margin: .75rem 0; }
li { margin: .25rem 0; }
.tag { display:inline-block; padding: .15em .6em; border-radius: 999px; font-size: .75rem;
  background: rgba(255,255,255,.28); color: #111; border: 1px solid rgba(255,255,255,.5); }

/* 09 - Links & buttons (interactive states) */
a, button, .btn, .cta { font-family: inherit; font-weight: 600; letter-spacing: .2px; cursor: pointer; transition: transform .15s ease, background-color .2s ease, color .2s ease; text-decoration: none; color: inherit; }
a { color: var(--bg-2); }
a:hover, a:focus-visible { text-decoration: underline; }
.btn, .cta { display: inline-flex; align-items: center; justify-content: center; padding: .75rem 1.25rem; border-radius: 999px; border: 1px solid rgba(255,255,255,.6);
  background: var(--bg-2); color: white; }
.btn { background: var(--bg-2); }
.btn.secondary, .cta { background: transparent; color: var(--bg-2); border: 1px solid rgba(107, 61, 240, .6); }
.btn:hover { background: #4a2dbf; transform: translateY(-1px); }
.cta { padding-inline: 1.15rem; }

/* Focus visibility for accessibility */
:focus-visible { outline: none; box-shadow: var(--focus); border: 0; }

/* 10 - Layout helpers for content positioning */
main { padding: 1rem; }
footer { padding: 1.5rem; text-align: center; color: #222; }

/* 11 - Aside (responsive placeholder) */
aside { display: none; }

/* 12 - Print styles */
@media print {
  body { background: white; color: #000; }
  a, button { color: #000; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
@supports (backdrop-filter: blur(12px)) {
  .content { backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
}
@supports not (backdrop-filter: blur(12px)) {
  .content { background: rgba(255,255,255,.28); }
}