/* Palette & Foundations */
:root {
  --bg: #0b0a14;
  --bg-2: #1a0f2a;
  --bg-3: #3a1450;
  --text: #f7f4ff;
  --muted: #cbb6d9;
  --accent: #e600ff;
  --accent-2: #a65cff;
  --panel: rgba(255,255,255,.08);
  --panel-2: rgba(255,255,255,.12);
  --border: rgba(255,255,255,.25);
  --shadow: 0 6px 20px rgba(0,0,0,.25);
  --radius: 14px;
  --radius-sm: 10px;
}

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

html, body, header, nav, main, article, footer, aside {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Mobile-first Layout & Layered Background */
html, body {
  height: 100%;
  margin: 0;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: linear-gradient(135deg, rgba(122,60,170,.25), rgba(40,0,60,.25)),
              repeating-linear-gradient(to bottom, rgba(255,255,255,.04) 0 1px, transparent 1px 2px),
              var(--bg);
  background-blend-mode: overlay;
  line-height: 1.55;
}

body {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Subtle glass panels with graceful fallbacks */
.header-glass,
.card,
footer .card,
section.glass {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background-clip: padding-box;
}

/* Layout helpers */
.container {
  width: 100%;
  max-width: 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 {
  padding: 1rem;
  border-radius: var(--radius);
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.25);
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
}
.tag {
  display: inline-block;
  font-size: .75rem;
  padding: .25em .6em;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(214,0,255,.75), rgba(160,0,255,.75));
  color: #fff;
  border: 1px solid rgba(255,255,255,.4);
  text-transform: uppercase;
  letter-spacing: .6px;
}

/* Header & Hero */
header {
  padding: clamp(1.25rem, 4vw, 2rem);
  text-align: center;
}
header h1 {
  font-size: clamp(1.6rem, 1.8vw + 1rem, 2.8rem);
  line-height: 1.15;
  margin: 0 0 .25rem;
  letter-spacing: .2px;
}
header .meta {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: .25rem;
}
header nav {
  margin-top: .75rem;
}
header nav a {
  color: var(--text);
  text-decoration: none;
  padding: .4rem .75rem;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.07);
  transition: transform .2s ease;
}
header nav a:hover { text-decoration: underline; text-underline-offset: 3px; transform: translateY(-1px); }

/* Main content */
main { padding: 0; }
article { padding: 0 0 1rem; }

/* Featured image with frame/ glow (image-frame targets) */
.image-frame,
.image-frame img {
  width: 100%;
  height: auto;
  display: block;
}
.image-frame {
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(0,0,0,.15);
  box-shadow: 0 8px 28px rgba(0,0,0,.25);
}
.image-frame img {
  width: 100%; height: 100%; object-fit: cover;
  image-rendering: auto;
  filter: saturate(1.05);
}
.featured-image { margin: .75rem 0 1rem; }

/* Typography throughout (fluid, accessible) */
h1, h2, h3 { color: var(--text); }
h1 { font-size: clamp(1.4rem, 1.2vw + 1.2rem, 2.2rem); margin: .25rem 0 0.5rem; }
h2 { font-size: clamp(1.15rem, 0.9vw + .9rem, 1.6rem); margin: .9rem 0 .45rem; }
h3 { font-size: clamp(1rem, 0.8vw + .8rem, 1.25rem); margin: .6rem 0; }
p { font-size: clamp(0.95rem, 0.6vw + 0.95rem, 1.05rem); color: #f5f2ff; margin: .6rem 0; }

/* Lists */
ul { padding-left: 1.25rem; margin: .4rem 0; }
li { margin: .25rem 0; }

/* Content wrapper (for potential .content usage) */
.content { color: var(--text); }

/* Links & buttons (interactive, accessible) */
a, button, .btn, .cta {
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
  font-weight: 600;
  text-decoration: none;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}
a:focus-visible, button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(230, 0, 255, 0.35);
  border-color: rgba(230,0,255,.8);
  transform: translateY(-0.5px);
}
a:hover, button:hover { text-decoration: underline; text-underline-offset: 3px; transform: translateY(-1px); }

/* Solid primary button */
.btn--solid {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: 1px solid rgba(255,255,255,.6);
  color: white;
  padding: .65rem 1.05rem;
}
.btn--solid:hover { filter: brightness(1.05); }
.btn--solid:active { transform: translateY(0); }

/* Outline button variant */
.btn--outline {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(230,0,255,.75);
  color: var(--text);
  padding: .6rem 1rem;
}
.btn--outline:hover { background: rgba(255,255,255,.12); }

/* Utility anchors used as CTA and links inside content */
.cta {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .65rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(230,0,255,.25);
  color: #fff;
}
.cta:hover { filter: brightness(1.05); }

/* Projects / Ad blocks in footer as glass panels */
footer {
  padding: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.75rem;
  background: rgba(0,0,0,.25);
  border-top: 1px solid rgba(255,255,255,.25);
}
footer .product-ad, footer .sponsored-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 64px;
  text-align: center;
}
footer p {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  margin: .25rem 0 0;
  font-size: .92rem;
}
footer a { color: var(--text); text-decoration: none; }

/* Print styles (basic readability) */
@media print {
  body { background: white; color: #000; }
  header, main, footer { background: none; box-shadow: none; }
  a, button { text-decoration: underline; }
}

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