/* Base / Theme Tokens */
:root {
  --bg: #0a1417;
  --bg-2: #0b2b2b;
  --text: #eaffff;
  --muted: #a6d6d6;
  --accent: #2ee6c3;
  --accent-2: #7ef0ff;
  --surface: rgba(255, 255, 255, 0.08);
  --surface-2: rgba(255, 255, 255, 0.14);
  --outline: rgba(255, 255, 255, 0.40);
  --shadow: 0 8px 28px rgba(0,0,0,.55);
  --radius: 14px;
  --card-gap: 1rem;
  --focus: 2px solid #fff;
}
html, body { height: 100%; }

/* Layered background (gradient + subtle noise/scanlines) + teal triangle overlay */
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: 
    /* deep teal gradient base */
    linear-gradient(135deg, rgba(6, 26, 25, 0.95) 0%, rgba(2, 28, 28, 0.95) 60%, rgba(2, 8, 8, 0.95) 100%);
  background-blend-mode: normal;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  /* Teal low-poly vibe (stylized triangles) */
  background-image:
    linear-gradient(135deg, rgba(46, 230, 195, 0.15) 25%, transparent 25% 50%, rgba(46, 230, 195, 0.15) 50% 75%, transparent 75% 100%),
    linear-gradient(45deg, rgba(0,0,0,0.15) 25%, transparent 25% 50%, rgba(0,0,0,0.15) 50% 75%, transparent 75% 100%);
  background-size: 120px 120px;
  opacity: 0.25;
  mix-blend-mode: overlay;
}
body {
  /* scanline texture */
  background-image:
    linear-gradient(to bottom, rgba(0,0,0,0) 0 75%, rgba(0,0,0,0.18) 75% 100%),
    repeating-linear-gradient(to bottom, rgba(255,255,255,0.04) 0 1px, transparent 1px 2px);
  background-blend-mode: overlay, overlay;
  background-size: auto, auto;
  isolation: isolate;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f9fa;
    --bg-2: #e9eef2;
    --text: #0b1b1f;
    --muted: #4b5b60;
    --surface: rgba(255,255,255,0.88);
    --surface-2: rgba(255,255,255,0.98);
    --outline: rgba(0,0,0,0.25);
  }
  body { background: linear-gradient(135deg, #f7fbfd 0%, #e8eef3 100%); color: var(--text); }
  body::before { opacity: 0.15; }
}

/* 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;
}
.card { 
  background: var(--surface);
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: var(--shadow);
}
.tag {
  display: inline-block;
  padding: .25rem .5rem;
  font-size: .75rem;
  border-radius: 999px;
  border: 1px solid rgba(46,230,195,.6);
  color: #eaffff;
  background: rgba(46,230,195,.08);
}
.image-frame, .image-frame img { display: block; }

/* Section: Base typography */
html, body, header, nav, main, article, footer, aside { 
  /* semantic reset is handled; keep minimal here */ 
}
h1, h2 { margin: 0.25rem 0; font-weight: 700; color: #fff; }
p { margin: 0.5rem 0; line-height: 1.5; color: #eafaff; }
ul { margin: .75rem 0 1rem; padding-left: 1.25rem; color: var(--muted); }
li { margin: .25rem 0; }

/* Header (hero) */
header {
  padding: clamp(1.25rem, 3vw, 2.5rem);
  text-align: center;
  border-radius: var(--radius);
  margin: 1rem auto 1.25rem;
  width: min(1100px, 92%);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255,255,255,.25);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px) saturate(1.15);
  -webkit-backdrop-filter: blur(12px) saturate(1.15);
}
@supports not (backdrop-filter: blur(12px)) {
  header { background: rgba(255,255,255,0.18); border-color: rgba(255,255,255,0.4); }
}
header h1 {
  font-size: clamp(2rem, 4vw + 1rem, 3.75rem);
  line-height: 1.04;
  margin: 0.25rem 0 0.25rem;
  letter-spacing: .5px;
  text-shadow: 0 1px 0 rgba(0,0,0,.25);
}
header .meta {
  margin-top: .25rem;
  font-size: clamp(0.8rem, 1vw + 0.4rem, 1rem);
  color: var(--muted);
}

/* Main content area */
main { padding: 1rem 0 2rem; }
article { margin: 0 auto; padding: 0; }

/* Featured image / image-frame styling */
.featured-image, .image-frame {
  width: 100%;
  max-width: 720px;
  margin: 0.5rem auto 1rem;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(46,230,195,.5);
  box-shadow: 0 8px 22px rgba(0,0,0,.45);
}
.image-frame { aspect-ratio: 16/9; }
.image-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Glass panels (content blocks) with fallback */
.glass {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 12px;
  padding: 1rem;
  backdrop-filter: blur(10px) saturate(1.1);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
}
@supports not (backdrop-filter: blur(10px)) {
  .glass { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.4); }
}
.content { padding: 0.5rem 0; }

/* Product advertisement blocks in footer */
.product-ad, .sponsored-page {
  display: block;
  text-align: center;
  padding: .75rem;
  border-radius: 12px;
  background: rgba(0,0,0,.25);
  border: 1px solid rgba(255,255,255,.25);
  margin: .5rem 0;
}
.product-ad a, .sponsored-page a { color: #fff; text-decoration: none; display: inline-block; padding: .25rem .75rem; border-radius: 999px; border: 1px solid rgba(255,255,255,.5); }
.product-ad a { background: linear-gradient(135deg, rgba(46,230,195,.9), rgba(0,180,170,.9)); }

/* Links & buttons (interactive states) */
a, button, .btn, .cta {
  color: #fff;
  text-decoration: none;
  display: inline-block;
  font-weight: 600;
  padding: .75rem 1.15rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.4);
  background: transparent;
  transition: transform .15s ease, background .2s ease, color .2s ease, border-color .2s ease;
  cursor: pointer;
  outline: none;
}
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: 4px;
}
.btn {
  display: inline-block;
  padding: .8rem 1.1rem;
  border-radius: 999px;
}
.btn--solid {
  background: linear-gradient(135deg, rgba(46,230,195,1) 0%, rgba(0,180,160,1) 100%);
  border: 1px solid rgba(255,255,255,.6);
  color: #042020;
  text-shadow: none;
}
.btn--solid:hover { transform: translateY(-1px); }
.btn--outline {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.65);
  color: #eaffff;
}
.cta { padding: .75rem 1rem; }

/* Typography rhythm helpers */
h2 { font-size: clamp(1.25rem, 1vw + 1rem, 2rem); margin-top: .75rem; color: #fff; }
p.lead { font-size: clamp(1rem, 1vw + 0.75rem, 1.125rem); color: var(--muted); }

/* Footer adjustments */
footer { padding: 1.5rem 0; text-align: center; }

/* Accessibility: motion preference */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .btn, .cta { transition: none; }
  .image-frame { will-change: auto; }
}

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