/* Base tokens & theme */
:root {
  --bg: #0b0d14;
  --bg-2: #111522;
  --surface: rgba(255, 255, 255, 0.08);
  --surface-2: rgba(255, 255, 255, 0.12);
  --text: #f8fbff;
  --muted: #cbd5e1;
  --accent: #7bdcff;
  --accent-2: #ffffff;
  --border: rgba(255, 255, 255, 0.25);

  --shadow: 0 8px 28px rgba(0,0,0,.5);
  --radius: 14px;
  --radius-sm: 10px;
  --focus: 0 0 0 3px rgba(123, 223, 255, 0.75);
}

/* Layered background: gradient + subtle noise/scanlines */
html, body { height: 100%; }
html { color-scheme: dark; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Inter, Arial;
  color: var(--text);
  background: #0b0d14;
  background-image:
    linear-gradient(135deg, rgba(0,0,0,.75), rgba(0,0,0,.95)),
    radial-gradient(circle at 20% 0%, rgba(255,255,255,.05) 0 20px, transparent 20px 100%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.03) 0 1px, transparent 1px 2px),
    repeating-linear-gradient(0deg, rgba(255,255,255,.03) 0 1px, transparent 1px 2px);
  background-blend-mode: overlay;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(circle at 60% -10%, rgba(255,255,255,.08) 0 25%, transparent 25% 100%);
  mix-blend-mode: overlay;
  opacity: .6;
  animation: waves 60s linear infinite;
  filter: saturate(110%);
}
@keyframes waves { from { transform: translateY(0); } to { transform: translateY(-2px); } }

/* Layout helpers */
.container { max-width: clamp(320px, 88vw, 1100px); margin: 0 auto; padding: 0 1rem; }

/* Grid utilities */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }

/* Section primitives */
header { padding: 1.25rem 0; text-align: center; }
header h1 { font-size: clamp(1.25rem, 2.5vw + 1rem, 2.5rem); margin: 0.25rem 0 0; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.6); }

/* Content wrappers */
.content { padding: 1rem; }

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

/* Product advertisement blocks in footer */
.product-ad { display: block; padding: .75rem 1rem; border-radius: 12px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.25); text-align: center; min-width: 0; }
.product-ad a { color: #fff; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; padding: .5rem .75rem; border-radius: 999px; transition: transform .2s, background .2s; }
.product-ad a:hover { background: rgba(255,255,255,.14); transform: translateY(-1px); }
.product-ad p { margin: 0; font-weight: 600; }

/* Footer layout */
footer { padding: 1rem 0; display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); justify-items: center; }
footer p { margin: 0; color: var(--muted); font-size: .9rem; }

/* Glass panels with fallback */
.panel, .card { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.25); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); color: var(--text); }
@supports ((backdrop-filter: blur(8px)) or (-webkit-backdrop-filter: blur(8px))) {
  .panel, .card { backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.25); }
}

/* Interactive elements */
a, button, .btn, .cta { color: #fff; text-decoration: none; transition: color .2s, transform .2s, background .2s; }
a:hover, .btn:hover, .cta:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, .btn:focus-visible, .cta:focus-visible { outline: 0; box-shadow: 0 0 0 3px rgba(120,210,255,.8); }

/* Button variants */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: .65rem 1rem; border-radius: 999px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.12); color: #fff; cursor: pointer; }
.btn--outline { background: transparent; border: 1px solid rgba(255,255,255,.6); color: #fff; }
.btn + .btn { margin-left: .5rem; }

/* Typography scale */
h1, h2, h3 { line-height: 1.2; font-weight: 700; letter-spacing: .01em; }

/* Lists */
ul { list-style: none; padding: 0; margin: 0; }
li { padding: 0.15rem 0; }

/* Tags */
.tag { display:inline-block; padding: .25rem .5rem; font-size: .75rem; border-radius: 999px; border: 1px solid rgba(255,255,255,.4); color: #fff; background: rgba(0,0,0,.25); }

/* Focus accessibility baseline */
:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(124,210,255,.75); }

/* Light mode adjustments for legibility */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f7fb;
    --bg-2: #ffffff;
    --text: #0a0a0a;
    --muted: #555;
    --surface: rgba(0,0,0,.07);
    --border: rgba(0,0,0,.15);
  }
  body { background: linear-gradient(#fff, #f7f7fb); color: var(--text); }
  .image-frame { border-color: rgba(0,0,0,.15); }
  .panel, .card { background: rgba(255,255,255,.85); border: 1px solid rgba(0,0,0,.15); color: #0a0a0a; }
  a, .btn, .cta { color: #0a51a1; }
  a:hover { text-decoration: underline; }
}

/* Print readability */
@media print {
  body { background: #fff; color: #000; }
  a, button { text-decoration: underline; }
}

/* Motion preferences */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}