/* Tokens & Mode */
:root {
  --bg: #0a1117;
  --bg-2: #0b1620;
  --surface: rgba(14, 28, 40, 0.68);
  --text: #e9fffb;
  --muted: #a6f0d4;
  --accent: #4bd1ff;      /* sky blue */
  --accent-2: #1ee290;    /* iridescent green */
  --panel: rgba(12, 28, 40, 0.66);
  --border: rgba(255, 255, 255, 0.25);
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
  --radius: 14px;
  --focus: #7af0ff;
  --link: #86f2ff;
}

/* Base & Layout Initialization */
*,
*::before,
*::after { box-sizing: border-box; }
html, body { height: 100%; }
html { font-family: system-ui, -apple-system, "Segoe UI", Roboto, Inter, Arial, "Helvetica Neue", sans-serif; }
body {
  margin: 0;
  color: var(--text);
  background-color: var(--bg);
  /* Layered background: gradient + iridescent green checkerboard overlay + subtle gradient */
  background-image:
    linear-gradient(135deg, rgba(0, 80, 60, 0.70) 0%, rgba(0, 40, 60, 0.70) 100%),
    linear-gradient(45deg, rgba(0, 210, 120, 0.20) 25%, rgba(0,0,0,0) 25%),
    linear-gradient(-45deg, rgba(0, 210, 120, 0.20) 25%, rgba(0,0,0,0) 25%);
  background-size: 100% 100%, 40px 40px, 40px 40px;
  background-position: 0 0, 0 0, 0 0;
  background-blend-mode: overlay, overlay, overlay;
  min-height: 100vh;
  position: relative;
  isolation: isolate;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}
body::before {
  /* subtle scanlines / noise-like texture (pure CSS) */
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(to bottom, rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(to right, rgba(0,0,0,.04) 1px, transparent 1px);
  background-size: 100% 2px, 2px 100%;
  mix-blend-mode: overlay;
  opacity: 0.25;
}
@media (prefers-reduced-motion: reduce) {
  body::before { display: none; }
  * { transition: none !important; animation: none !important; }
}
#root { isolation: isolate; }

/* Section: Structural Elements */
html, body, header, nav, main, article, aside, footer { margin: 0; padding: 0; }
header, main, footer { padding: 1rem; }

/* Glass panels baseline (fallback handled via rgba) */
.glass {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Header / Nav / Hero */
header {
  display: block;
  margin-inline: auto;
  max-width: clamp(320px, 92vw, 1100px);
  padding: 1.25rem;
  /* Glass header */
  background: rgba(9, 20, 30, 0.60);
  border: 1px solid rgba(120, 240, 255, 0.25);
  border-radius: calc(var(--radius) + 4px);
  backdrop-filter: blur(12px);
}
header h1 {
  font-size: clamp(1.4rem, 2.5vw + 1rem, 2.4rem);
  line-height: 1.15;
  margin: 0 0 0.25rem;
  color: var(--text);
}
header .meta {
  font-size: 0.875rem;
  color: #b9f5e5;
  opacity: 0.95;
  margin: 0;
}
nav {
  margin-top: .5rem;
}
nav a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
nav a:hover,
nav a:focus-visible {
  color: #b3f0ff;
  border-bottom-color: var(--accent);
  outline: none;
}
main {
  display: grid;
  place-items: start center;
}
article {
  width: 100%;
  max-width: clamp(420px, 90vw, 900px);
  padding: 1rem;
}
.featured-image { width: 100%; margin: .5rem 0 1rem; border-radius: 12px; overflow: hidden; }
.featured-image img { width: 100%; height: auto; display: block; border: 1px solid rgba(255,255,255,.25); box-shadow: 0 6px 18px rgba(0,0,0,.3); }

/* Content & Typography */
.content { color: var(--text); font-size: clamp(0.95rem, 0.8vw + 0.9rem, 1.125rem); line-height: 1.6; }
h1 + .content { margin-top: .5rem; }
h2 { font-size: clamp(1.1rem, 2vw + 0.6rem, 1.5rem); margin-top: 1.25rem; color: #eaffff; }
p { margin: .5rem 0 1rem; color: #eaffff; }
ol, ul { margin: .75rem 0 1rem 1.25rem; padding: 0; }
li { margin: .25rem 0; }

/* Image frame utility (as required) */
.image-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.25);
  box-shadow: 0 6px 14px rgba(0,0,0,.25);
  background: #0b1b1f;
}
.image-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Content helpers / utilities */
.container {
  width: 100%;
  max-width: clamp(320px, 92vw, 1100px);
  margin-inline: auto;
  padding-inline: 1rem;
}
.grid {
  display: grid;
  gap: 1rem;
}
.card {
  padding: 1rem;
  border-radius: var(--radius);
  background: rgba(12, 28, 40, 0.66);
  border: 1px solid rgba(255,255,255,.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
}
.tag {
  display: inline-block;
  font-size: 0.75rem;
  padding: .25em .6em;
  border-radius: 999px;
  background: rgba(70, 230, 190, 0.25);
  color: var(--text);
  border: 1px solid rgba(140, 255, 230, 0.4);
}

/* Content section helper to ensure readability on glass */
.product-ad {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  justify-items: center;
  text-align: center;
  padding: 0.75rem;
  border-radius: var(--radius);
  background: rgba(8, 20, 28, 0.65);
  border: 1px solid rgba(120, 240, 255, 0.25);
  box-shadow: var(--shadow);
}
.product-ad a { color: var(--text); text-decoration: none; }
.product-ad a:hover { text-decoration: underline; }

/* Interactive Elements: Buttons & Links */
a, button, .btn, .cta {
  text-decoration: none;
  color: var(--text);
}
a:focus-visible, button:focus-visible, .btn:focus-visible, .cta:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}
a:hover { text-decoration: underline; }

/* Buttons: solid and outline variants */
.btn, .cta {
  display: inline-block;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.25);
  background: linear-gradient(#0a9bd8, #0a72bd);
  color: #fff;
  cursor: pointer;
  transition: transform .15s ease, background .2s ease;
}
.btn:hover, .cta:hover { transform: translateY(-1px); }
.btn:active, .cta:active { transform: translateY(0); }
.btn-outline {
  background: rgba(10, 30, 40, 0.6);
  border: 1px solid rgba(110, 210, 255, 0.75);
  color: var(--text);
}
.btn-outline:hover {
  background: rgba(10, 30, 40, 0.8);
}
.btn + .btn { margin-left: .5rem; }

/* Lists & inline content adjustments */
ul, ol { padding-left: 1.25rem; }
li { line-height: 1.6; }

/* Footer & regions */
footer {
  padding-top: 1rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 720px) {
  footer { grid-template-columns: repeat(3, 1fr); align-items: start; }
  .product-ad { justify-self: center; min-width: 220px; }
}
footer p { text-align: center; color: #bfeae2; margin: .5rem 0; }

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