/* Section: Tokens & Palette */
:root {
  --bg: #0f1117;
  --bg-2: #141923;
  --text: #eef0f7;
  --muted: #a5a8b8;
  --accent: #8a2be2;
  --accent-2: #6d28d9;
  --glass: rgba(18, 20, 28, 0.22);
  --glass-border: rgba(255, 255, 255, 0.28);
  --radius: 14px;
  --shadow: 0 8px 24px rgba(0,0,0,.35);
  --focus: 0 0 0 4px rgba(138,43,226,.55);
}

/* Section: Base reset & layout */
*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; }

html { font-size: 16px; }

body {
  margin: 0;
  color: var(--text);
  background: linear-gradient(135deg, #0f1117 0%, #171a23 60%, #0f0f14 100%);
  min-height: 100%;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Helvetica Neue";
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 6px 6px;
  opacity: 0.25;
  pointer-events: none;
  z-index: 0;
}
main, header, footer, aside { position: relative; z-index: 1; }

/* Section: Glass panels & helpers */
.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.no-backdrop {
  background: rgba(20,20,28,.28);
  border-color: rgba(255,255,255,.42);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.section-glass { background: rgba(9,9,14,.28); border: 1px solid rgba(255,255,255,.28); border-radius: var(--radius); padding: .9rem; }

/* Section: Layout utilities */
.container {
  width: 100%;
  max-width: clamp(320px, 92vw, 1100px);
  margin-inline: auto;
  padding-inline: 1rem;
}
.grid {
  display: grid;
  gap: 1rem;
}
.card {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 12px;
  padding: 1rem;
  transition: transform .2s ease;
}
.card:hover { transform: translateY(-1px); }

/* Section: Typography */
h1, h2, h3, h4 { margin: 0 0 .5rem; font-weight: 700; letter-spacing: .2px; }
h1 { font-size: clamp(1.75rem, 2vw + 1rem, 3.75rem); line-height: 1.08; color: #fff; text-shadow: 0 0 8px rgba(138,43,226,.9); }
h2 { font-size: clamp(1.25rem, 1.4vw + .8rem, 2.4rem); color: #fff; }
h3 { font-size: clamp(1.05rem, .8vw + .9rem, 1.6rem); color: #fff; }
h4 { font-size: clamp(1rem, .8vw + .8rem, 1.25rem); color: #fff; }

/* Section: Typography (body) */
p { font-size: clamp(1rem, .8vw + .9rem, 1.15rem); color: #e8e8f5; margin: .5rem 0 1rem; }
blockquote {
  margin: .5rem 0 1rem;
  padding-left: 1rem;
  border-left: 4px solid var(--accent-2);
  color: #f1f0fb;
  opacity: .95;
  font-style: italic;
}
ul { margin: .25rem 0 1rem 1.2em; padding: 0; }

/* Section: Links & interactive elements */
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }

/* Section: Buttons & CTAs */
.btn, .cta, button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .75rem 1.125rem;
  border-radius: 999px;
  border: 1px solid rgba(138,43,226,.6);
  background: linear-gradient(#7c3aed, #4c1d95);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}
.btn:hover, .cta:hover { transform: translateY(-1px); }
.btn.secondary {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
}
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }

/* Section: Image frame & media */
.image-frame {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(0,0,0,.15);
  width: 100%;
  max-width: 860px;
  margin: 1rem auto;
}
.image-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Section: Media-agnostic content helpers */
.content { display: block; }

/* Section: Specific selectors required by HTML */
header, nav, main, article, footer, aside {
  /* semantic hooks kept visually cohesive with glass panels below */
}
.product-ad { text-align: center; padding: .75rem; }

/* Section: Layout primitives for content rhythm */
ul, li { margin: 0; padding: 0; list-style: disc; margin-left: 1.25em; }
li { margin: .25rem 0; }

/* Section: Print styles (basic readability) */
@media print {
  body { background: #fff; color: #000; }
  a { color: #00f; text-decoration: underline; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Section: Responsive primitives (mobile-first) */
@media (min-width: 640px) {
  .container { padding-inline: 1.25rem; }
}
@media (min-width: 960px) {
  .grid-auto { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
  header { padding: 1.75rem 1rem; }
}
