:root {
  /* Palette tokens (purple + beige, glassy neutrals) */
  --bg: #0b0a14;
  --bg-2: #211625;
  --text: #e9dccb;
  --muted: #c9b89d;
  --accent: #8a5cff;
  --accent-2: #e6d1b0;

  --panel: rgba(255, 255, 255, 0.08);
  --panel-strong: rgba(255, 255, 255, 0.22);
  --radius: 12px;
  --shadow: 0 8px 28px rgba(0,0,0,.45);
  --gap: 1rem;
}

html, body {
  height: 100%;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  color-scheme: dark;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  /* Layered background: gradient + purple glow + grid paper */
  background-image:
    linear-gradient(135deg, rgba(100,0,120,.25), rgba(20,0,40,.25) 60%, rgba(0,0,0,0) 100%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.05) 0 1px, transparent 1px 24px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.05) 0 1px, transparent 1px 24px);
  background-size: auto, 100% 100%, 100% 100%;
  background-blend-mode: overlay;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f0e6;
    --bg-2: #efe6d0;
    --text: #171717;
    --muted: #545454;
    --accent: #5a4bdc;
    --accent-2: #8a6a3a;
  }
  body {
    background: var(--bg);
    background-image:
      linear-gradient(135deg, rgba(90, 75, 220, .15), rgba(255,255,255,0) 60%),
      repeating-linear-gradient(0deg, rgba(0,0,0,.04) 0 1px, transparent 1px 24px);
  }
}

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

/* Layout primitives */
html, header, nav, main, article, aside, footer {
  display: block;
}

.container {
  width: min(100%, 1100px);
  margin-inline: auto;
  padding-inline: 1rem;
}

.grid {
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.card {
  padding: 1rem;
  border-radius: 12px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
}

.tag {
  display: inline-block;
  padding: .25rem .6rem;
  font-size: .75rem;
  border-radius: 999px;
  background: rgba(138,92,255,.25);
  color: var(--text);
  border: 1px solid rgba(138,92,255,.6);
}

/* Glass panels (frosted) with graceful fallbacks */
.panel {
  background: var(--panel);
  border: 1px solid var(--panel-strong);
  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)) {
  .panel {
    background: rgba(255,255,255,.18);
  }
}

/* Structural sections */
header, main, aside, footer, article {
  width: 100%;
}
header {
  padding: 1.25rem 0;
  text-align: center;
}
header h1 {
  margin: 0;
  font-size: clamp(1.6rem, 4vw + .5rem, 2.6rem);
  line-height: 1.15;
  letter-spacing: .2px;
  color: var(--text);
}
main { padding: 1rem 0; display: grid; place-items: center; }
article { width: 100%; max-width: clamp(320px, 92vw, 900px); }

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

/* Content typography */
.content {
  color: var(--muted);
  font-size: clamp(1rem, 0.9vw + .9rem, 1.15rem);
  line-height: 1.6;
}

/* Interactive elements */
a, button, .btn, .cta {
  cursor: pointer;
  color: inherit;
  text-decoration: none;
}
a:hover, a:focus { text-decoration: underline; outline: none; }

/* Buttons (solid + outline) */
.btn {
  display: inline-block;
  padding: .65rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.5);
  background: linear-gradient(135deg, rgba(140,60,220,.95), rgba(60,20,120,.95));
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1;
  transition: transform .2s ease, box-shadow .2s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,.4);
}
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.btn:active { transform: translateY(0); box-shadow: 0 2px 8px rgba(0,0,0,.4); }

.btn--outline {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(180,150,100,.9);
}
.btn--outline:hover { background: rgba(255,255,255,.08); }

/* Utility helpers */
.container, .grid, .card, .tag { /* existing utility classes covered above */ }

/* Footer + ad blocks */
footer {
  padding: 1rem;
  display: grid;
  gap: .75rem;
  justify-items: center;
  text-align: center;
  color: var(--muted);
}
.product-ad a, .sponsored-page a { display: inline-block; padding: .5rem 1rem; border-radius: 999px; border: 1px solid rgba(255,255,255,.25); background: rgba(0,0,0,.15); }
.product-ad p, .sponsored-page p { margin: 0; }

/* Image note accessibility/contrast helpers for glass content over dark bg */
@media (prefers-color-scheme: light) {
  a, button, .btn, .cta { color: #111; }
  .panel { background: rgba(255,255,255,.9); }
}
@media print {
  html, body { background: #fff; color: #000; }
  a { text-decoration: underline; }
}
@media (max-width: 420px) {
  header { padding: .75rem 0; }
  .btn { width: max-content; }
}
