/* Base & Palette */
:root {
  --bg: #0a1020;
  --bg-2: #0b1a2b;
  --text: #eaffff;
  --muted: #9bd3de;
  --accent: #2ee4c9;
  --accent-2: #58e1ff;
  --surface: rgba(8, 20, 40, 0.28);
  --surface-2: rgba(12, 40, 60, 0.30);
  --border: rgba(255, 255, 255, 0.28);
  --shadow: 0 8px 28px rgba(0,0,0,0.45);
  --focus: 0 0 0 3px rgba(46, 228, 201, 0.65);
}
:root, html, body { height: 100%; }

/* Accessibility & the base */
* { box-sizing: border-box; }
html { font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue"; line-height: 1.5; }
body {
  margin: 0;
  color: var(--text);
  background: 
    linear-gradient(135deg, #0a1020 0%, #0b1a2b 60%, #0a1020 100%),
    repeating-linear-gradient(to bottom, rgba(255,255,255,0.04) 0 1px, rgba(0,0,0,0) 1px 2px);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-y: auto;
}
img { max-width: 100%; display: block; }

/* Layout helpers */
.container { width: 100%; max-width: clamp(640px, 90vw, 1100px); margin-inline: auto; padding: 0 1rem; }

/* Section headers (used as dividers in code) */
header, nav, main, article, aside, footer { display: block; }

/* Header */
header {
  text-align: center;
  padding: 1.25rem 1rem;
  margin: 0;
}
header h1 {
  margin: 0.25rem 0 0.25rem;
  font-size: clamp(1.8rem, 1.2rem + 3vw, 3rem);
  line-height: 1.1;
  letter-spacing: .2px;
  color: var(--text);
}
header .meta {
  font-size: clamp(0.8rem, 0.6vw + 0.8rem, 1rem);
  color: var(--muted);
  margin-top: .25rem;
}

/* Main article area */
main {
  padding: 0.75rem 1rem 1.25rem;
}
article {
  max-width: clamp(640px, 90vw, 860px);
  margin: 0 auto;
  padding: 0;
}
.featured-image { margin: 0.75rem 0 1rem; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow); }
.featured-image img { width: 100%; height: auto; display: block; object-fit: cover; aspect-ratio: 16/9; }

/* Content styling (glass panels where text sits) */
.content { 
  background: rgba(8,12,28,0.22);
  border: 1px solid rgba(120, 240, 255, 0.40);
  border-radius: 12px;
  padding: 1rem;
  backdrop-filter: blur(12px) saturate(1.05);
  -webkit-backdrop-filter: blur(12px) saturate(1.05);
  box-shadow: var(--shadow);
}
@supports not (backdrop-filter: blur(12px)) {
  .content { background: rgba(8,12,28,0.32); }
}
h2 { font-size: clamp(1.4rem, 1vw + 1.2rem, 2.2rem); margin: .75rem 0 .5rem; color: var(--text); }
p, li { color: var(--text); opacity: 0.95; font-size: clamp(0.95rem, 0.9vw + 0.8rem, 1.1rem); line-height: 1.6; }
ul { padding-left: 1.25rem; margin: .5rem 0 1rem; }

/* Blockquote styling */
blockquote {
  margin: .75rem 0; padding: .75rem 1rem; border-left: 4px solid var(--accent);
  background: rgba(46, 228, 201, 0.12);
  border-radius: 6px;
  color: var(--text);
}

/* Image frame utility */
.image-frame {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.28);
  box-shadow: 0 6px 18px rgba(0,0,0,0.4);
}
.image-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Footer / product ads (glass panels) */
footer {
  padding: 1rem 1rem 2rem;
  display: grid;
  gap: .75rem;
  justify-items: center;
}
.product-ad, .sponsored-page {
  width: min(100%, 680px);
  padding: 0.9rem 1rem;
  border-radius: 12px;
  background: rgba(8, 12, 28, 0.28);
  border: 1px solid rgba(120, 240, 255, 0.40);
  text-align: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}
.product-ad a, .sponsored-page a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}
.product-ad:hover, .sponsored-page:hover { transform: translateY(-1px); transition: transform 0.15s ease; }

/* Primary and secondary CTAs (buttons) */
a, button, .btn, .cta {
  font-family: inherit;
  font-size: 1rem;
  color: #041f1e;
  text-decoration: none;
}
.btn {
  display: inline-block;
  padding: .65em 1.15em;
  border-radius: 8px;
  background: linear-gradient(135deg, #2ee4c9 0%, #15b8a5 100%);
  color: #041f1e;
  border: 1px solid rgba(0,0,0,.15);
  cursor: pointer;
  font-weight: 700;
  transition: transform .15s ease, background .2s ease;
}
.btn:hover { transform: translateY(-1px); background: linear-gradient(135deg, #31e0c3 0%, #17b8a1 100%); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 0; outline: var(--focus); outline-offset: 2px; border: 1px solid rgba(46,228,201,0.9); }

.btn.outline {
  background: transparent;
  color: var(--text);
  border: 2px solid var(--accent);
}
.btn.outline:hover { background: rgba(46,228,201,0.08); }

/* Link hover/focus states for accessibility */
a:focus-visible, a:hover { text-decoration: underline; color: var(--accent-2); }

/* Glassy content cards (utility) */
.card {
  background: rgba(8,12,28,0.28);
  border: 1px solid rgba(120, 240, 255, 0.40);
  border-radius: 12px;
  padding: 1rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
}

/* Grids and layout utilities (responsive) */
.grid {
  display: grid;
  gap: 1rem;
}
.grid.auto-fit {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.card, .grid > * { min-width: 0; }

/* Typography helpers (system UI with responsive scale) */
.tags { display: inline-flex; gap: .25rem; flex-wrap: wrap; }
.tag {
  font-size: .75rem;
  padding: .15rem .5rem;
  border-radius: 999px;
  background: rgba(46, 228, 201, 0.15);
  border: 1px solid rgba(46,228,201,0.5);
  color: var(--text);
}

/* Forms (basic) */
input, textarea, select {
  font: inherit;
  color: var(--text);
  background: rgba(8,12,28,0.25);
  border: 1px solid rgba(120, 240, 255, 0.40);
  border-radius: 6px;
  padding: .5em .75em;
}
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: none; box-shadow: var(--focus);
}

/* Print styles (basic readability) */
@media print {
  body { background: #fff; color: #000; }
  .content, .card, .product-ad, .sponsored-page { background: #fff; border: none; box-shadow: none; }
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7fbff;
    --bg-2: #eaf2f9;
    --text: #0b1b2a;
    --muted: #4a647a;
    --surface: rgba(180, 210, 230, 0.28);
    --surface-2: rgba(200, 230, 250, 0.28);
    --border: rgba(0,0,0,0.15);
  }
  body {
    background: linear-gradient(135deg, #f7fbff 0%, #eaf2f9 60%, #f7fbff 100%), 
                repeating-linear-gradient(to bottom, rgba(0,0,0,0.03) 0 1px, transparent 1px 2px);
    color: var(--text);
  }
  .product-ad, .sponsored-page { background: rgba(255,255,255,0.9); border: 1px solid rgba(0,0,0,0.08); }
  .card { background: rgba(255,255,255,0.92); border-color: rgba(0,0,0,0.08); }
}
