:root {
  --bg: #0b0b14;
  --bg-2: #14101a;
  --text: #e9e6f0;
  --muted: #b7b4cb;
  --accent: #ff6f61;       /* coral */
  --accent-2: #8a2be2;     /* violet */
  --glass: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.25);
  --shadow: 0 8px 24px rgba(0,0,0,0.25);
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

html, body {
  margin: 0;
  padding: 0;
  color: var(--text);
  background: #000;
  /* Layered background: gradient + subtle noise/scanlines */
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px),
    radial-gradient(circle at 25% 0%, rgba(255,140,0,0.15), transparent 40%),
    radial-gradient(circle at 75% 40%, rgba(138,43,226,0.15), transparent 40%),
    linear-gradient(#0b0b12, #0b0b12);
  background-size:
    100% 2px,
    2px 100%,
    40% 40%,
    40% 40%,
    100% 100%;
  background-position: 0 0, 0 0, 0 0, 0 0, 0 0;
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, no-repeat;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans", "Liberation Sans", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100dvh;
  scroll-behavior: smooth;
  /* performance-friendly */
  text-rendering: optimizeLegibility;
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

header, nav, main, article, aside, footer { display: block; }

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

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

.card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1rem;
  color: var(--text);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
@supports not (backdrop-filter: blur(8px)) {
  .card { background: rgba(255,255,255,0.12); }
}
.card:hover { transform: translateY(-2px); }

.tag {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.25em 0.5em;
  border-radius: 0.5em;
  border: 1px solid rgba(255,255,255,0.25);
  color: var(--text);
  background: rgba(255,255,255,0.08);
}

/* Image frame specifics */
.image-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  padding: 0.25rem;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.25);
  box-shadow: 0 6px 20px rgba(0,0,0,0.45);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.image-frame:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0,0,0,0.55); }

/* Glass panels (fallback included) */
.content { padding: 1rem; color: var(--text); }

/* Specific sections */
.product-ad, .sponsored-page {
  display: block;
  text-align: center;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.25);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.25s ease;
}
.product-ad { grid-column: span 1; }
.product-ad a, .sponsored-page a { color: inherit; text-decoration: none; display: block; }
.product-ad:hover, .sponsored-page:hover { transform: translateY(-1px); }

/* Typography & utility elements */
ul, li { margin: 0; padding: 0; list-style: none; }
ul { padding-left: 1.25rem; }
li { margin: 0.25rem 0; }

/* Buttons and links (interactive states) */
a, button, .btn, .cta {
  color: var(--text);
  text-decoration: none;
  border: none;
  background: transparent;
  font: inherit;
  cursor: pointer;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px dashed var(--accent-2); outline-offset: 2px; border-radius: 6px; }

.btn {
  display: inline-block;
  padding: 0.75em 1.25em;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.08);
  color: var(--text);
  font-weight: 600;
  transition: transform 0.2s ease, background 0.2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); opacity: 0.95; }

.btn--solid {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #fff;
  border: 1px solid rgba(0,0,0,0.15);
  box-shadow: 0 6px 14px rgba(0,0,0,0.25);
}
.btn--outline {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.55);
  color: var(--text);
}
.btn--solid:hover { filter: brightness(1.05); }
.btn--outline:hover { background: rgba(255,255,255,0.12); }

/* Focus states for interactive elements (enhanced accessibility) */
.btn:focus-visible, a:focus-visible, .cta:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 8px;
}
.CTA { font-weight: 600; }

/* Layout-specific element tweaks */
header {
  padding: 1rem;
  text-align: center;
}
header h1 {
  font-size: clamp(1.6rem, 4vw + 1rem, 3rem);
  line-height: 1.15;
  margin: 0.25rem 0 0.25rem;
  letter-spacing: .2px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.6);
}
main { padding: 1rem 0; display: grid; place-items: center; }
article { width: 100%; max-width: clamp(420px, 90vw, 900px); }

/* Footer area as glassy panels area */
footer {
  padding: 1rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  justify-items: center;
}
@media (min-width: 600px) {
  footer { grid-template-columns: 1fr 1fr; justify-items: start; }
}
footer p { text-align: center; width: 100%; opacity: 0.85; }

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f6fb;
    --bg-2: #ffffff;
    --text: #111318;
    --muted: #525a6b;
    --accent: #e05643;
    --accent-2: #6a3bd9;
    --glass: rgba(255,255,255,0.75);
    --glass-border: rgba(0,0,0,0.08);
    --shadow: 0 6px 16px rgba(0,0,0,0.08);
  }
  body {
    background-image:
      linear-gradient(rgba(0,0,0,0.04) 1px, transparent 1px),
      linear-gradient(90deg, rgba(0,0,0,0.04) 1px, transparent 1px),
      radial-gradient(circle at 25% 0%, rgba(255,140,0,0.08), transparent 40%),
      radial-gradient(circle at 75% 40%, rgba(138,43,226,0.08), transparent 40%),
      linear-gradient(#f5f6fb, #f5f6fb);
    background-size: 100% 2px, 2px 100%, 40% 40%, 40% 40%, 100% 100%;
  }
  a { color: var(--accent-2); }
  .card { border: 1px solid rgba(0,0,0,0.08); background: rgba(255,255,255,0.75); }
}

/* Reduce motion preference */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .image-frame { transform: none !important; }
}

/* Print styles (basic readability) */
@media print {
  body { background: #fff; color: #000; }
  a, .btn, .cta { text-decoration: underline; color: inherit; }
}
