/* Base tokens */
:root{
  --bg: #0b1020;
  --bg-2: #040817;
  --text: #e8f4ff;
  --muted: #a8b8d6;
  --accent: #00e5ff;
  --accent-2: #7df9ff;
  --surface: rgba(255,255,255,.08);
  --surface-2: rgba(255,255,255,.12);
  --border: rgba(255,255,255,.28);
  --shadow: 0 8px 24px rgba(0,0,0,.35);
  --radius: 14px;
  --focus: #8af2ff;
}

/* Layered, future-cyber background (gradient + subtle scanlines/noise) */
html, body { height: 100%; }
html { font-size: 16px; }
body {
  margin: 0;
  color: var(--text);
  background: 
    linear-gradient(135deg, rgba(0,235,255,.08), rgba(0,0,0,.25) 60%),
    radial-gradient(circle at 20% -10%, rgba(0, 200, 255, .25), transparent 40%),
    linear-gradient(180deg, var(--bg), var(--bg-2) 60%, #000);
  background-attachment: fixed;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Helvetica Neue", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  /* Subtle CSS noise/scanlines overlay */
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: 
    linear-gradient(rgba(255,255,255,.04), rgba(255,255,255,.04)),
    repeating-linear-gradient(to bottom, rgba(0,0,0,.04) 0 1px, transparent 1px 2px);
  mix-blend-mode: overlay;
  z-index: 0;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.8), rgba(0,0,0,0.2) 70%, rgba(0,0,0,0));
}
@media (prefers-reduced-motion: reduce) {
  body::before { display: none; }
}

/* Layout containers (mobile-first) */
.container {
  width: min(100%, 1100px);
  margin-inline: auto;
  padding-inline: 1rem;
}
.grid { display: grid; gap: 1rem; }

/* Structural selectors */
html, body, header, nav, main, article, footer, aside {
  /* Ensure predictable rendering across sections */
}
header {
  padding-block: 2rem;
  padding-inline: 1rem;
  text-align: center;
  position: relative;
  z-index: 1;
}
main { padding: 1rem; }
article { max-width: 1000px; margin-inline: auto; }
footer {
  padding: 1.25rem;
  margin-top: 2rem;
  border-top: 1px solid rgba(255,255,255,.15);
  background: rgba(0,0,0,.15);
  position: relative;
  z-index: 1;
}
aside { display: none; }

/* Typography / headings */
h1, h2, h3 { margin: .75rem 0 .5rem; font-weight: 700; color: var(--text); }
h1 { font-size: clamp(1.75rem, 4.5vw, 3rem); line-height: 1.08; letter-spacing: .4px;
     text-shadow: 0 0 8px rgba(0, 235, 255, .6); }
h2 { font-size: clamp(1.25rem, 2.8vw, 1.75rem); color: #e7fbff; }
h3 { font-size: clamp(1rem, 2vw, 1.25rem); }

/* Content helpers (glass panels) */
.content, .product-ad, .card, header, main, article {
  /* Glass panel appearance when used as blocks */
}
.content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
@supports not (backdrop-filter: blur(10px)) {
  .content { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.38); }
}

.card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  padding: 1rem;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
@supports not (backdrop-filter: blur(8px)) {
  .card { background: rgba(255,255,255,.16); }
}

.product-ad {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  padding: .75rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,.25);
  text-align: center;
}
.product-ad a { color: var(--text); text-decoration: none; display: block; padding: .5rem 0; }
.product-ad p { margin: 0; font-weight: 600; }

/* Glass-like utility classes */
.tag {
  display: inline-block;
  padding: .15em .5em;
  font-size: .75rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(0,0,0,.25);
  color: #eaffff;
}
.btn, .cta, a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .75rem 1.25rem;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid rgba(0,0,0,.25);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #05131a; }
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible, .cta:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}
.btn:active, .cta:active { transform: translateY(0); }

/* Outline variant */
.btn.outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--accent);
}
a { color: #dff2ff; text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Image frame styling */
.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 18px rgba(0,0,0,.25);
  background: #111;
}
.image-frame img {
  width: 100%; height: 100%; object-fit: cover;
  display: block;
  filter: saturate(1.05) contrast(1.05);
}
@media (prefers-reduced-motion: reduce) {
  .image-frame { transition: none; }
}

/* Content layout tweaks */
.content p { font-size: clamp(15px, 1.6vw, 18px); color: #eaf6ff; margin: .5rem 0; }
.content ul, .content ol { padding-left: 1.25rem; margin: .5rem 0; }
.content li { margin: .25rem 0; }

/* Lists and navigation helpers */
ul, li { margin: 0; padding: 0; list-style-position: inside; }
ul { padding-left: 1rem; }
li { padding-left: .25rem; }

/* Header / Nav styling (compact, high contrast) */
header { background: rgba(0,0,0,.25); border-bottom: 1px solid rgba(255,255,255,.15); }
header h1 { margin: 0; font-size: clamp(1.75rem, 5vw, 2.75rem); line-height: 1.15; }
header .meta { color: var(--muted); font-size: .92rem; margin-top: .25rem; }

nav { margin-top: .75rem; display: flex; justify-content: center; gap: .75rem; flex-wrap: wrap; }
nav a { padding: .5rem 0.75rem; border-radius: 999px; color: var(--text); border: 1px solid rgba(255,255,255,.25); }

/* Footer layout: product-ad blocks + simple credits */
footer { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); align-items: stretch; }
footer p { margin: 0; text-align: center; color: var(--muted); font-size: .9rem; }

/* Print-friendly */
@media print {
  body { background: #fff; color: #000; }
  nav, .image-frame, .product-ad { display: none; }
  * { -webkit-print-color-adjust: exact; color-adjust: exact; }
}
@media (min-width: 720px) {
  /* Wider layouts: tighten content width for readability on larger screens */
  .container { padding-inline: 1.25rem; }
  main { padding-top: 1rem; }
}
@media (prefers-color-scheme: dark) {
  /* preserve strong contrast on dark schemes; already tuned but keep explicit override if needed */
}

/* Focus management for accessibility (keyboard users) */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* Utility helpers (compact) */
.container.grid { display: grid; grid-template-columns: 1fr; }
.grid.auto { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
@media (min-width: 700px) {
  .container.grid { grid-template-columns: 1fr 1fr; gap: 1rem; }
}
