/* 1) Tokens & Theme */
:root{
  --bg: #050e12;
  --bg-2: #04141a;
  --text: #f7fffe;
  --muted: #a8f0ec;
  --accent: #2ee5d5;
  --accent-2: #7af4f0;
  --glass: rgba(255,255,255,0.08);
  --glass-strong: rgba(255,255,255,0.18);
  --border: rgba(255,255,255,0.25);
  --shadow: 0 10px 28px rgba(0,0,0,.25);
  --focus: 0 0 0 3px rgba(46,229,213,.65);
  --radius: 14px;
}

/* 2) Layered background (gradient + subtle scanlines/noise) */
html, body { height: 100%; }
html { background: linear-gradient(135deg, rgba(0,230,210,0.10), rgba(0,0,0,0.0) 40%), radial-gradient(circle at 60% -10%, rgba(32,230,222,0.25), transparent 40%), #030506; }
body {
  margin: 0;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  line-height: 1.5;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  z-index: 0;
  /* subtle glass-friendly backdrop across page */
  background-attachment: fixed;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  /* pure CSS noise/scanline texture */
  background:
    linear-gradient(0deg, rgba(0,0,0,0.04), rgba(0,0,0,0.04)),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.04) 0 1px, transparent 1px 2px),
    repeating-linear-gradient(90deg, rgba(0,0,0,0.04) 0 1px, transparent 1px 2px);
  mix-blend-mode: overlay;
  opacity: 0.25;
  z-index: -1;
}
@media (prefers-reduced-motion: reduce){
  body::before { display: none; }
}

/* 3) Base layout structures (targets per requirement) */
html, body, header, nav, main, article, footer, aside {
  /* ensure predictable rendering context across sections */
  box-sizing: border-box;
}
* { box-sizing: inherit; }

.container {
  width: 100%;
  max-width: clamp(680px, 90vw, 1140px);
  margin-inline: auto;
  padding-block: 0.75rem;
  padding-inline: 1rem;
}
.grid {
  display: grid;
  gap: 1rem;
}
.card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
@supports not (backdrop-filter: blur(12px)) {
  .card { background: rgba(255,255,255,0.08); }
}
.tag {
  display: inline-block;
  padding: .25rem .6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  border: 1px solid rgba(255,255,255,.45);
  color: #eaffff;
  background: rgba(0,0,0,.18);
}
a, button, .btn, .cta {
  font-family: inherit;
  font-weight: 600;
  border-radius: 999px;
  text-decoration: none;
  padding: .6rem 1rem;
  border: 1px solid rgba(255,255,255,.55);
  color: var(--text);
  background: transparent;
  cursor: pointer;
  transition: transform .15s ease, background .2s ease, border-color .2s ease;
}
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-color: rgba(46,229,213,0.95);
}
.btn {
  background: rgba(46,229,213,0.95);
  color: #062b2b;
  border: none;
}
.btn.secondary {
  background: transparent;
  color: var(--text);
  border-color: rgba(46,229,213,0.95);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

/* 4) Typography & responsive text scale (fluid typography) */
html { font-size: 16px; }
p, li, dd { color: var(--text); }
h1, h2, h3 { line-height: 1.15; margin: .25em 0; }
h1 { font-size: clamp(1.4rem, 1.6rem + 1.2vw, 2.4rem); }
h2 { font-size: clamp(1.15rem, 0.9rem + 1vw, 1.6rem); margin-top: .75rem; }
p { font-size: clamp(0.95rem, 0.8rem + .6vw, 1.1rem); color: var(--text); }
ol, ul { padding-left: 1.25rem; margin: .5rem 0 1rem 0; }
li { margin: .25rem 0; }

/* 5) Image framing rules (image-frame style + legacy featured-image) */
.image-frame, .featured-image {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.25);
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
  display: block;
}
.image-frame { aspect-ratio: 16/9; width: 100%; }
.image-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.featured-image img { display: block; width: 100%; height: auto; }

/* 6) Layout specifics for page sections (header, main, footer, aside) */
header {
  padding: 1.25rem 1rem;
  display: block;
  z-index: 1;
}
header h1 {
  font-size: clamp(1.6rem, 1.2rem + 2vw, 2.6rem);
  margin: 0 0 .25rem;
  line-height: 1.15;
}
header .meta {
  color: var(--muted);
  font-size: clamp(0.8rem, 0.6rem + 0.8vw, 0.95rem);
}
nav {
  margin-top: .5rem;
}
nav a {
  color: var(--text);
  text-decoration: none;
  padding: .4rem .75rem;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.25);
  display: inline-block;
}
nav a:hover { text-decoration: underline; }

/* Main content region with glass panel feel */
main {
  padding: 1rem 0;
}
article {
  max-width: clamp(720px, 90vw, 1040px);
  margin-inline: auto;
  padding: 1.25rem;
  border-radius: var(--radius);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.25);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text);
  position: relative;
  z-index: 1;
  animation: fadeIn 0.6s ease-out both;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.featured-image { margin: 0 0 1rem; }

/* 7) Footer & utilities treated as glass panels as well */
footer {
  padding: 1rem 1rem;
}
.product-ad, .sponsored-page {
  display: inline-block;
  margin-right: .5rem;
  margin-bottom: .5rem;
}
.product-ad a, .sponsored-page a {
  text-decoration: none;
}
footer p { margin: .25rem 0; color: var(--muted); }

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

/* 9) Print styles (basic readability) */
@media print {
  body { background: #fff; color: #000; }
  article { background: #fff; border: none; box-shadow: none; padding: 0.5in; }
  header, nav, footer { display: none; }
}
