/* Theme Tokens */
:root {
  --bg: #062626;
  --bg-2: #0a3a3a;
  --text: #eaffff;
  --muted: #a9d6d6;
  --accent: #00e5ff;
  --accent-2: #7df6ff;
  --panel: rgba(5, 28, 40, 0.36);
  --panel-2: rgba(5, 28, 40, 0.28);
  --border: rgba(120,210,230,.45);
  --radius: 14px;
  --shadow: 0 6px 20px rgba(0,0,0,.28);
  --focus: 2px solid var(--accent);
  --soft-glow: 0 0 10px rgba(0, 229, 255, 0.35);
}

/* 1. Global Reset & Layout Helpers */
html, body { height: 100%; }
* { box-sizing: border-box; }
html { font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
body {
  margin: 0;
  color: var(--text);
  background-color: var(--bg);
  min-height: 100%;
  isolation: isolate;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Layered background: teal checkerboard + gradient overlay + subtle scanlines (pure CSS) */
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  /* Teal checkerboard */
  background-image:
    linear-gradient(45deg, rgba(0, 180, 180, .25) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(0, 180, 180, .25) 25%, transparent 25%);
  background-position: 0 0, 10px 10px;
  background-size: 20px 20px;
  pointer-events: none;
  mix-blend-mode: overlay;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  /* Subtle scanlines */
  background-image:
    linear-gradient(rgba(0,0,0,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,.04) 1px, transparent 1px);
  background-size: 100% 2px, 2px 100%;
  mix-blend-mode: overlay;
  opacity: .35;
  pointer-events: none;
}
main, header, footer, aside, article { position: relative; z-index: 1; }

/* 2. Layout primitives */
.container {
  width: 100%;
  padding: 0 1rem;
  margin-inline: auto;
  max-width: clamp(640px, 92vw, 1100px);
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.card {
  background: rgba(8, 28, 40, 0.28);
  border: 1px solid rgba(120,210,230,.40);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-1px); box-shadow: 0 8px 28px rgba(0,0,0,.32); }

/* 3. Content helpers */
.content { padding: .75rem 0; line-height: 1.6; color: var(--text); }
ul, li { margin: .25rem 0 0 1.25rem; padding: 0; }
blockquote {
  margin: .75rem 0;
  padding-left: .75rem;
  border-left: 3px solid var(--accent);
  color: var(--muted);
  font-style: italic;
}
.tag {
  display: inline-block;
  padding: .25em .6em;
  border-radius: 999px;
  font-size: .75rem;
  border: 1px solid rgba(0, 180, 240, .6);
  background: rgba(0,180,240,.15);
  color: var(--text);
}
h1, h2, h3 { margin: .4rem 0; line-height: 1.25; }
h1 { font-size: clamp(1.6rem, 2.8vw + 1rem, 3.25rem); letter-spacing: .2px; }
h2 { font-size: clamp(1.15rem, 1.5vw + .75rem, 1.75rem); color: #eaffff; }
h3 { font-size: clamp(1rem, 0.8vw + .9rem, 1.15rem); color: #e9feff; }

/* 4. Imagery */
.image-frame {
  aspect-ratio: 16 / 9;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(0, 180, 240, .5);
  box-shadow: 0 6px 16px rgba(0,0,0,.28);
  background: #000;
}
.image-frame img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  filter: saturate(1.05);
}
.featured-image { margin: .75rem 0 1rem; }

/* 5. Links & controls (buttons, CTAs) */
a, button, .btn, .cta {
  color: var(--text);
  text-decoration: none;
  border-radius: 8px;
  transition: opacity .2s ease, transform .2s ease;
}
a:hover { text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, .btn:focus-visible, .cta:focus-visible {
  outline: var(--focus);
  outline-offset: 2px;
}
.btn, .cta {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .65rem 1rem;
  border: 1px solid rgba(0, 180, 240, .7);
  border-radius: 999px;
  background: rgba(0, 180, 240, .28);
  color: #041d22;
  font-weight: 600;
  text-shadow: none;
  cursor: pointer;
}
.btn:hover, .cta:hover { transform: translateY(-1px); }
.btn.primary {
  background: linear-gradient(135deg, #00eaff 0%, #0077ff 100%);
  border-color: rgba(0, 115, 255, .9);
  color: #002228;
  box-shadow: var(--soft-glow);
}
.btn.ghost {
  background: rgba(0,0,0,.14);
  border-color: rgba(0, 170, 200, .6);
}
.btn:disabled { opacity: .6; cursor: not-allowed; }

/* 6. Typography & rhythm (mobile-first) */
h1, h2, h3 { word-wrap: break-word; }
p { margin: .5rem 0 1rem; }

/* 7. Sectioning elements (specific selectors) */
html, body, header, nav, main, article, footer, aside { /* structural intent kept minimal */ }
.content { font-size: clamp(0.95rem, 1vw + .75rem, 1.1rem); }

/* 8. Specific selectors from the HTML scaffold */
.image-frame, .image-frame img { }
.product-ad { padding: .75rem; text-align: center; border-radius: 12px; margin: .5rem 0; background: rgba(0, 0, 0, .15); border: 1px solid rgba(0, 180, 240, .5); }
.product-ad a { color: var(--text); }

/* 9. Print styles (basic readability) */
@media print {
  body { background: #fff; color: #000; }
  body::before, body::after { display: none; }
  .card { background: #f8f8f8; border: 1px solid #ddd; }
  a { text-decoration: underline; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* 10. Accessibility helpers (color tokens) */
@media (prefers-color-scheme: light) {
  :root {
    --text: #0b1b1f;
    --muted: #53656d;
  }
}