/* 01. Base tokens */
:root {
  --bg: #021717;
  --bg-2: #041e1d;
  --text: #eafff4;
  --muted: #a8efe8;
  --accent: #00f5b2;
  --accent-2: #2fffbf;
  --glass: rgba(6, 60, 60, 0.22);
  --glass-2: rgba(6, 60, 60, 0.12);
  --border: rgba(0, 255, 214, 0.38);
  --radius: 14px;
  --shadow: 0 8px 28px rgba(0,0,0,.35);
  --focus: 0 0 0 3px rgba(0,255,214,.6);
  --heading: #eafff4;
  --code: #a6f0d5;
}

/* 02. Global resets & background */
* { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans", sans-serif;
  line-height: 1.5;
  min-height: 100%;
  background:
    radial-gradient(circle at 22% -8%, rgba(0,255,214,.15), transparent 40%),
    repeating-linear-gradient(0deg, rgba(0,255,214,.05) 0 2px, transparent 2px 4px),
    linear-gradient(135deg, rgba(4,28,28,.88), rgba(0,0,0,.65)),
    var(--bg);
  background-blend-mode: overlay, overlay, normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
@supports not (backdrop-filter: blur(12px)) {
  body { background: linear-gradient(135deg, rgba(0,30,30,.95), rgba(0,0,0,.65)); }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
@media print {
  body { background: #fff; color: #000; }
  a { color: #000; text-decoration: underline; }
}

/* 03. 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; }

/* 04. Typography */
h1, h2, h3 { color: var(--heading); margin: .5rem 0 0.25rem; line-height: 1.15; }
h1 { font-size: clamp(1.8rem, 4vw + .5rem, 3rem); letter-spacing: .2px; text-wrap: balance; }
h2 { font-size: clamp(1.25rem, 1.8vw + .6rem, 1.6rem); }
h3 { font-size: clamp(.95rem, 1.2vw + .5rem, 1.15rem); }
p { color: var(--muted); margin: .5rem 0 1rem; }
ul { margin: .5rem 0 1rem 1.25rem; padding: 0; }
li { margin: .35rem 0; }

/* 05. Glass panels (fallback-ready) */
.glass {
  background: rgba(6, 60, 60, 0.22);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
@supports not ((backdrop-filter: blur(12px)) ) {
  .glass { background: rgba(6, 60, 60, 0.34); }
}
.section { padding: 1rem 0; }

/* 06. Media / image framing */
.image-frame {
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(0, 255, 214, 0.5);
  box-shadow: inset 0 0 12px rgba(0, 255, 214, 0.25);
}
.image-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* 07. Core page elements (styling must apply to selectors) */
html, body, header, nav, main, article, footer, aside { }
header, main, footer { display: block; }

/* 08. Header / hero styles */
header {
  padding: 1rem;
  margin: 1rem auto;
  max-width: 1100px;
  border-radius: 16px;
  background: rgba(2, 40, 40, 0.28);
  border: 1px solid rgba(0, 255, 214, 0.38);
  text-align: center;
  box-shadow: var(--shadow);
}
header h1 { font-size: clamp(1.4rem, 3.6vw, 2.4rem); margin: .25rem 0 .5rem; color: var(--heading); text-shadow: 0 0 12px rgba(0,255,214,.6); }
header .meta { color: var(--muted); font-size: .92rem; }

/* 09. Navigation */
nav { margin-top: .5rem; }
nav a {
  color: var(--accent);
  text-decoration: none;
  padding: .25rem .6rem;
  border-radius: 999px;
  border: 1px solid rgba(0,255,214,.28);
}
nav a:hover, nav a:focus-visible { text-decoration: underline; color: var(--accent-2); outline: none; }

/* 10. Main content */
main { padding: 1rem; }
article { max-width: 900px; margin: 0 auto; padding: 0; }
.article-content { padding: 1rem; }

/* 11. Media assets in content */
.featured-image { margin: 1rem 0; border-radius: 12px; overflow: hidden; border: 1px solid rgba(0,255,214,.5); box-shadow: 0 8px 28px rgba(0,0,0,.35); }
.featured-image img { width: 100%; height: auto; display: block; }

/* 12. Content blocks with glass panels (example sections) */
.content { padding: 1rem; }

/* 13. Product ad / footer blocks */
.product-ad, .sponsored-page {
  display: inline-block;
  vertical-align: middle;
  border-radius: 12px;
  padding: 0.5rem 0.75rem;
  margin: .25rem;
  background: rgba(6,60,60,0.28);
  border: 1px solid rgba(0,255,214,.35);
}
.product-ad a, .sponsored-page a { color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: .5rem; padding: .25rem 0.5rem; }
.product-ad a:hover, .sponsored-page a:hover { text-decoration: underline; }

/* 14. Links & interactive controls */
a { color: var(--accent); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; color: var(--accent-2); }
a:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; }

/* 15. Buttons (solid & outline variants) */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .75rem 1.25rem; border-radius: 999px;
  border: 1px solid rgba(0,255,214,.45);
  background: var(--accent);
  color: #01261a; font-weight: 700;
  text-decoration: none; cursor: pointer;
  transition: transform .15s ease, background .2s ease, box-shadow .2s;
}
.btn:hover { transform: translateY(-1px); background: #00e6a0; }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

/* Outline variant */
.btn--outline {
  background: transparent; color: var(--accent);
  border: 1px solid rgba(0,255,214,.6);
}
.btn--outline:hover { background: rgba(0,255,214,.08); color: var(--text); }

/* 16. Utility primitives */
.card { background: rgba(0,0,0,.22); border: 1px solid rgba(0,255,214,.32); border-radius: 12px; padding: 1rem; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.tag {
  display: inline-block; padding: .15rem .5rem; border-radius: 999px;
  font-size: .75rem; background: rgba(0,255,214,.22);
  color: #eafff1; border: 1px solid rgba(0,255,214,.42);
}

/* 17. Aside (styling hook; not required by content) */
aside { display: none; }

/* 18. Accessibility helpers for motion & contrast */
:focus { outline: none; } /* keep focus ring via :focus-visible */
@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
}
