/* Midnight Nebula - production-ready stylesheet (mobile-first) */

/* 1) Tokens / Palette */
:root{
  --bg: #0b1020;
  --bg-2: #0a1b2f;
  --text: #eaf5ff;
  --muted: #9dbbd6;
  --accent: #2ee6c8;        /* turquoise core */
  --accent-2: #4af0d9;       /* lighter turquoise for accents */
  --surface: rgba(9,12,30,.28);
  --surface-2: rgba(9,12,30,.18);
  --glass-border: rgba(110,240,230,.38);
  --card: rgba(255,255,255,.04);
  --shadow: 0 8px 28px rgba(0,0,0,.28);
}

/* 2) Base / Layered background (gradient + subtle noise/scanlines) */
html, body { height: 100%; }
* { box-sizing: border-box; }
html { font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif; }
body {
  margin: 0;
  color: var(--text);
  background: linear-gradient(135deg, #071022 0%, #0a1230 40%, #0b1020 100%), 
              radial-gradient(circle at 20% 20%, rgba(0,180,200,.15), transparent 25%),
              radial-gradient(circle at 80% 60%, rgba(0,80,120,.15), transparent 25%);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  position: relative;
}
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: 4px 4px, 4px 4px;
  pointer-events: none;
  mix-blend-mode: overlay;
  opacity: .65;
}

/* 3) Layout helpers */
.container {
  width: 100%;
  max-width: clamp(640px, 90vw, 1100px);
  margin-inline: auto;
  padding-inline: 1rem;
}
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card { background: var(--card); border: 1px solid rgba(255,255,255,.14); border-radius: 12px; padding: .75rem; }

/* 4) Glass panels (with backdrop-filter) + fallback */
.glass {
  background: rgba(8,12,28,.22);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 1rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px) saturate(1.05);
  -webkit-backdrop-filter: blur(12px) saturate(1.05);
}
@supports not (backdrop-filter: blur(12px)) {
  .glass { 
    background: rgba(8,12,28,.72);
    border-color: rgba(110,240,230,.55);
  }
}

/* 5) Typography scale (fluid) */
h1, h2, h3 { margin: .25rem 0; font-weight: 700; letter-spacing: .2px; color: var(--text); }
h1 { font-size: clamp(1.75rem, 1.2rem + 4vw, 3.25rem); line-height: 1.04; text-shadow: 0 1px 0 rgba(0,0,0,.25); }
h2 { font-size: clamp(1.25rem, 0.8rem + 1.5vw, 2rem); }
h3 { font-size: clamp(1.05rem, 0.75rem + .8vw, 1.5rem); }
p { margin: .5rem 0 1rem; line-height: 1.6; color: #e9f6ff; }

/* 6) Header / hero styling */
header {
  padding: 1.25rem;
  margin: 1rem auto;
  border-radius: 16px;
  border: 1px solid rgba(110,240,230,.38);
  background: rgba(6,10,28,.32);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
header h1 { text-align: center; }
header .meta { text-align: center; font-size: .85rem; color: var(--muted); }

/* 7) Navigation */
nav { display: flex; justify-content: center; gap: .5rem; flex-wrap: wrap; margin-top: .25rem; }
nav a {
  color: var(--accent-2);
  text-decoration: none;
  padding: .25rem .5rem;
  border-radius: 6px;
  border: 1px solid rgba(46,226,208,.5);
}
nav a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* 8) Images / .image-frame specifics */
.image-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(110,240,230,.5);
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
}
.image-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* 9) Content blocks / main layout */
main { padding: 1rem; }
article { display: grid; gap: 1rem; }
blockquote {
  margin: .5rem 0;
  padding: .75rem 1rem;
  border-left: 3px solid rgba(46,226,208,.7);
  color: #d9f7fb;
  background: rgba(0,0,0,.08);
  border-radius: 6px;
}
ul { margin: .25rem 0 1rem 1.25rem; padding: 0; }
li { margin: .25rem 0; }

/* 10) Utilities & components required by HTML classes */
.content { padding: .5rem; }
.product-ad { display: block; padding: .6rem; text-align: center; border-radius: 12px; background: rgba(8,12,28,.22); border: 1px solid rgba(110,240,230,.38); }
.sponsored-page { display: block; padding: .6rem; text-align: center; border-radius: 12px; background: rgba(8,12,28,.22); border: 1px solid rgba(110,240,230,.38); }
a, button, .btn, .cta {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  outline: none;
}
a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* 11) Buttons (solid + outline) */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .65rem 1.05rem; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; transition: transform .15s ease, background .2s ease, color .2s ease, border-color .2s;
}
.btn.primary {
  background: var(--accent);
  color: #021e1a;
  border-color: rgba(46,226,208,.6);
}
.btn.primary:hover { background: #1bd6c9; transform: translateY(-1px); }
.btn.primary:active { transform: translateY(0); }
.btn.outline {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(46,226,208,.6);
}
.btn.outline:hover { background: rgba(46,226,208,.08); }

/* Focus states (WCAG AA) */
a:focus-visible, button:focus-visible {
  outline: 3px solid #aee6ff;
  outline-offset: 2px;
  border-radius: 6px;
}
a:focus-visible { text-decoration: underline; text-underline-offset: 3px; }

/* 12) Links / text contrast in glass areas */
.glass a { color: var(--accent-2); }

/* 13) Images inside glass panels (if used elsewhere) */
img { max-width: 100%; height: auto; display: block; }

/* 14) Layout helpers for content sections */
.tag {
  display: inline-block;
  padding: .25rem .5rem;
  border-radius: 999px;
  font-size: .75rem;
  background: rgba(46,226,208,.15);
  color: #cafffa;
  border: 1px solid rgba(46,226,208,.4);
}

/* 15) Accessibility / prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; transform: none !important; }
}

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