/* Theme & Tokens */
:root {
  --bg: #0a0f1a;
  --bg-2: #14182a;
  --text: #e9e6f7;
  --muted: #b7b4cc;
  --accent: #c6a6f8;
  --accent-2: #a78bfa;
  --glass: rgba(255, 255, 255, 0.08);
  --glass-2: rgba(255, 255, 255, 0.14);
  --border: rgba(255, 255, 255, 0.28);
  --shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  --focus: 0 0 0 4px rgba(167, 139, 250, 0.6);
}

/* 01. Global & Layout Primitives */
* { box-sizing: border-box; }
html, body { height: 100%; }
html { color-scheme: dark; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans", "Liberation Sans", sans-serif;
  color: var(--text);
  background: linear-gradient(135deg, #0b0e15 0%, #141a2b 60%, #0b0e15 100%);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(to bottom, rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(to right, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 100% 2px, 2px 100%;
  mix-blend-mode: overlay;
  opacity: 0.22;
  pointer-events: none;
}
body::after {
  content: "";
  position: fixed;
  inset: -10vmin;
  background:
    radial-gradient(circle at 20% 20%, rgba(199, 171, 252, 0.14), transparent 40%),
    radial-gradient(circle at 70% 60%, rgba(167, 139, 250, 0.12), transparent 40%);
  filter: saturate(110%);
  opacity: 0.25;
  pointer-events: none;
}

/* 02. Helpers & Utilities */
.container {
  max-width: clamp(320px, 86vw, 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(--border);
  border-radius: 12px;
  padding: 1rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
}
.tag {
  display: inline-block;
  padding: .25em .55em;
  font-size: .75rem;
  border-radius: 999px;
  background: rgba(198, 166, 248, 0.22);
  color: #f5f2ff;
  border: 1px solid rgba(198, 166, 248, 0.4);
}
a, button, .btn, .cta {
  cursor: default;
}
ul, li {
  margin: 0;
  padding: 0;
  list-style-position: outside;
}
ol { margin: 0 0 1rem 1.25rem; padding: 0; }

/* 03. Typography & Baseline Styles */
h1, h2, h3 { margin: 0.25rem 0; font-weight: 700; }
h1 { font-size: clamp(1.75rem, 1.2rem + 3vw, 3rem); line-height: 1.1; letter-spacing: .2px; }
h2 { font-size: clamp(1.25rem, 0.8vw + 1.25rem, 2rem); }
p { font-size: clamp(1rem, 0.8vw + 0.9rem, 1.125rem); color: rgba(233,230,247,0.95); }

/* 04. Core Layout Elements (HTML Semantics) */
header, nav, main, article, footer, aside {
  display: block;
}
header {
  padding: 1rem;
  margin: 1rem auto;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
header h1 { color: #f8f6ff; font-weight: 800; }
header .meta { font-size: 0.85rem; color: var(--muted); margin-top: .25rem; }
nav { margin-top: .25rem; display: flex; gap: .5rem; align-items: center; }
nav a {
  color: var(--accent-2);
  text-decoration: none;
  padding: .25rem .5rem;
  border-radius: 6px;
  border: 1px solid rgba(167,139,250,.4);
  background: rgba(167,139,250,.15);
}
main { padding: 0; }
article { padding: 0; }

/* 05. Media & Imagery */
.featured-image { margin: 0 0 1rem; }
.featured-image img {
  width: 100%; height: auto; display: block; border-radius: 12px;
  border: 1px solid rgba(255,255,255,.25);
  box-shadow: 0 8px 22px rgba(0,0,0,.32);
}
.image-frame {
  aspect-ratio: 16 / 9;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.25);
  background: #111;
  box-shadow: 0 6px 18px rgba(0,0,0,.35);
}
.image-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* 06. Content Panels & Glassy UI */
.content {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.product-ad { background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.25); border-radius: 12px; padding: 0.75rem; text-align: center; }
.product-ad a { color: #fff; text-decoration: none; display: block; padding: .25rem; }
.product-ad p { margin: 0; }

/* 07. Interactive Elements (Buttons & Links) */
a, button, .btn, .cta {
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
a:focus-visible, button:focus-visible, .btn:focus-visible, .cta:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
a.btn, button.btn, .cta {
  display: inline-block;
  padding: .75rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.25);
  background: linear-gradient(135deg, rgba(198,167,248,0.95), rgba(160,120,255,0.95));
  color: #fff;
  text-decoration: none;
  font-weight: 700;
}
a.btn:hover, button.btn:hover, .cta:hover { transform: translateY(-1px); }
a.btn.secondary, .cta.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255,255,255,.4);
}
a.btn:focus-visible, button:focus-visible, .cta:focus-visible { outline-color: #fff; }

/* 08. Lists & Typography Nuance */
ol { padding-left: 1rem; }
li { margin: .6rem 0; }

/* 09. Print Styles (basic readability) */
@media print {
  body { background: #fff; color: #000; }
  a { color: #00f; text-decoration: underline; }
  header, nav, main, article, aside, footer { display: block; }
  .card { background: #fff; color: #000; border: 1px solid #000; }
}

/* 10. Responsiveness & Motion Preferences */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
@media (max-width: 700px) {
  header { padding: .75rem; }
  .container { padding-inline: .75rem; }
}
