:root {
  --bg: #0b0f14;
  --bg-2: #1a1f28;
  --text: #e9eaff;
  --muted: #a5a9ba;
  --accent: #7f3cff;
  --accent-2: #b07dff;
  --panel: rgba(255, 255, 255, 0.08);
  --panel-2: rgba(255, 255, 255, 0.14);
  --border: rgba(255, 255, 255, 0.28);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  --focus: 3px solid #9b87ff;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

html, body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans", sans-serif;
  color: var(--text);
  background: 
    linear-gradient(135deg, rgba(12,14,18,1) 0%, rgba(28,30,38,1) 60%, rgba(12,14,18,1) 100%),
    /* subtle pewter gradient */ 
    repeating-linear-gradient(to bottom, rgba(255,255,255,0.04) 0 1px, transparent 1px 2px);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Section: Base layout tokens and helpers */
html, body, header, nav, main, article, footer, aside,
.image-frame, .image-frame img, .content, .product-ad,
a, button, .btn, .cta, ul, li,
.container, .grid, .card, .tag {
  /* no extra rules here; kept for selector coverage in one stylesheet */
}

/* Section: Global layout primitives */
.image-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.28);
  background: rgba(255,255,255,.04);
  box-shadow: var(--shadow);
  display: block;
}

.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  vertical-align: middle;
}

.container {
  width: 100%;
  max-width: clamp(320px, 92vw, 1100px);
  margin-inline: auto;
  padding-inline: 1rem;
}

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

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

/* Section: Glass panels (with backdrop-filter) */
.content, header, main, footer, aside {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 12px;
  padding: 0.75rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
}

@supports not (backdrop-filter: blur(12px)) {
  .content, header, main, footer, aside {
    background: rgba(255,255,255,.14);
  }
}

header {
  text-align: center;
  padding: 1.75rem 1rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.20);
  margin-bottom: 1rem;
}

header h1 {
  font-size: clamp(1.75rem, 2.5vw + 1rem, 2.75rem);
  line-height: 1.15;
  margin: 0;
  letter-spacing: .2px;
  color: var(--text);
}

/* Section: Main content layout (mobile-first) */
main {
  display: grid;
  place-items: center;
  padding: 1rem 0 2rem;
}

/* Section: Article content wrapper */
article {
  width: 100%;
  max-width: 900px;
  padding: 0;
}

p { font-size: clamp(1rem, 0.8vw + 0.8rem, 1.125rem); line-height: 1.5; color: var(--text); margin: 0.25rem 0; }

/* Section: Product ad / footer elements */
.product-ad {
  display: block;
  width: 100%;
  max-width: 420px;
  margin: 1rem auto;
  padding: .6rem;
  border-radius: 12px;
  background: rgba(0,0,0,.25);
  border: 1px solid rgba(255,255,255,.35);
  text-align: center;
}

.product-ad a {
  text-decoration: none;
  color: var(--text);
  display: block;
  padding: .6rem;
  border-radius: 8px;
}
.product-ad a:hover, .product-ad a:focus-visible {
  text-decoration: underline;
  color: var(--accent-2);
}
.sponsored-page {
  display: block;
  width: 100%;
  max-width: 420px;
  margin: .5rem auto;
  padding: .6rem;
  border-radius: 12px;
  background: rgba(0,0,0,.25);
  border: 1px solid rgba(255,255,255,.35);
  text-align: center;
}
.sponsored-page a {
  color: var(--text);
  text-decoration: none;
  display: block;
  padding: .6rem;
}
.sponsored-page a:hover, .sponsored-page a:focus-visible {
  text-decoration: underline;
  color: var(--accent-2);
}
footer {
  padding: 1rem;
  text-align: center;
  border-top: 1px solid rgba(255,255,255,.20);
  margin-top: 1rem;
}
footer p { margin: .25rem 0; color: var(--muted); }

/* Section: Interactive controls (buttons/links) */
a, button, .btn, .cta {
  -webkit-tap-highlight-color: transparent;
  transition: color .2s ease, background .2s ease, transform .2s ease;
  text-decoration: none;
  font: inherit;
  color: var(--text);
}
a:hover, a:focus-visible { text-decoration: underline; color: var(--accent-2); outline: none; }
button, .btn, .cta {
  background: var(--accent);
  color: white;
  border: 1px solid rgba(255,255,255,.25);
  padding: .7rem 1rem;
  border-radius: 9px;
  cursor: pointer;
  display: inline-block;
}
.btn:hover, .cta:hover { transform: translateY(-1px); }
.btn:focus-visible, .cta:focus-visible {
  outline: var(--focus);
}
.btn { background: var(--accent); }
.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(126, 68, 255, 0.65);
}
.btn-outline:hover { background: rgba(126,68,255,.15); }

/* Section: Utilities */
ul { margin: 0.5rem 0; padding: 0; list-style: none; }
li { margin: .25rem 0; }

/* Section: Tag (small pills) */
.tag {
  display: inline-block;
  padding: .25rem .6rem;
  border-radius: 999px;
  font-size: .75rem;
  background: rgba(127, 60, 255, 0.28);
  color: white;
  border: 1px solid rgba(255,255,255,.32);
}

/* Section: Print styles (basic readability) */
@media print {
  body { background: white; color: black; }
  .content, header, main, footer { background: transparent; border: none; box-shadow: none; }
}
  
/* Section: Accessibility helpers (focus ring on keyboard nav) */
:focus-visible { outline: 2px solid #9b87ff; outline-offset: 2px; border-radius: 4px; } 

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