:root {
  --bg: #0b0f14;
  --bg-2: #0a1117;
  --text: #e9f3ff;
  --muted: #a8c3d8;
  --accent: #6ec8ff;
  --accent-2: #b6e0ff;
  --glass: rgba(255, 255, 255, 0.08);
  --glass-strong: rgba(255, 255, 255, 0.14);
  --border: rgba(255, 255, 255, 0.25);
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  --radius: 12px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; }

html {
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans", sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100%;
  background-image:
    linear-gradient(to bottom right, rgba(255,255,255,0.04), rgba(255,255,255,0.01)),
    repeating-linear-gradient(to bottom, rgba(255,255,255,0.04) 0 1px, transparent 1px 2px),
    radial-gradient(circle at 20% 10%, rgba(180,210,230,0.12) 0 60px, transparent 61px),
    linear-gradient(to bottom, var(--bg), var(--bg-2));
  background-attachment: scroll;
  background-size: cover;
  isolation: isolate;
  scroll-behavior: smooth;
  animation: none;
}

@media (prefers-reduced-motion: reduce) {
  html, body {
    background-attachment: scroll;
  }
}

/* Subtle animated glow for hero elements (GPU-friendly) */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: no-preference) {
  header h1 { animation: fadeUp 0.6s ease-out both; }
  header .meta { animation: fadeUp 0.9s ease-out both; }
  .image-frame { animation: fadeUp 0.6s ease-out both; }
  .card { animation: fadeUp 0.8s ease-out both; }
}

/* Layout primitives */
.container {
  width: 100%;
  max-width: clamp(860px, 90vw, 1200px);
  margin: 0 auto;
  padding: 0 1rem;
}

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

.card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.2s ease, background 0.2s ease;
}
@supports not (backdrop-filter: blur(12px)) {
  .card { background: rgba(255,255,255,0.08); }
}
.tag {
  display: inline-block;
  padding: .15em .6em;
  font-size: 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(110,200,255,0.4);
  color: var(--text);
  background: rgba(110,200,255,0.15);
}

.image-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.28);
  box-shadow: 0 8px 28px rgba(0,0,0,0.35);
  background: #0b0f14;
}
.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(1.05) contrast(1.02);
}

/* Glass panels (with fallback) */
.glass {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
@supports not (backdrop-filter: blur(12px)) {
  .glass { background: rgba(255,255,255,0.08); }
}

/* Typography scale (system UI) */
h1, h2, h3, h4 { margin: 0 0 .5rem; }
h1 {
  font-size: clamp(2rem, 4vw + 1rem, 4rem);
  line-height: 1.0;
  letter-spacing: .2px;
}
h2 {
  font-size: clamp(1.25rem, 2.6vw + .5rem, 2.1rem);
  line-height: 1.25;
}
p { margin: 0.75rem 0; color: var(--text); }

/* Content wrapper */
.content { padding: 0.75rem 0 1rem; }

/* Nav and header styles */
header {
  padding: 1rem 0;
}
header h1 {
  font-weight: 700;
  color: var(--text);
  text-shadow: 0 1px 0 rgba(0,0,0,.15);
}
header .meta {
  color: var(--muted);
  font-size: clamp(0.85rem, 0.9vw + 0.4rem, 1rem);
}
nav {
  margin-top: .5rem;
}
nav a {
  color: var(--accent);
  text-decoration: none;
  padding: .25rem .5rem;
  border-radius: 6px;
  border: 1px solid rgba(110,200,255,0.4);
  background: rgba(110,200,255,0.08);
}
nav a:hover { text-decoration: underline; }

/* Article styling within main */
main { padding: 0; }
article { padding: 1rem 0; }

/* Blocks & lists */
blockquote {
  border-left: 3px solid rgba(110,200,255,0.8);
  padding-left: .75rem;
  margin: .75rem 0;
  color: var(--muted);
  font-style: italic;
  background: rgba(255,255,255,0.04);
  border-radius: 6px;
}
ul { padding-left: 1.25rem; margin: .5rem 0; }
li { margin: .25rem 0; }

/* Footer & ads */
footer { padding: 1rem 0; text-align: center; color: var(--muted); }
.product-ad, .sponsored-page { display: inline-block; margin: 0 .5rem 0 0; padding: 0; min-width: 180px; }
.product-ad a, .sponsored-page a {
  display: block;
  padding: .75rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.25);
  transition: transform .2s ease, background .2s ease;
}
.product-ad a:hover, .sponsored-page a:hover { background: rgba(110,200,255,0.20); transform: translateY(-1px); }

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

/* Buttons (solid and outline) */
.btn {
  display: inline-block;
  padding: .75rem 1.25rem;
  border-radius: 8px;
  border: 1px solid rgba(110,200,255,0.6);
  background: linear-gradient(to bottom, rgba(110,200,255,1), rgba(100,170,240,0.95));
  color: #002033;
  font-weight: 700;
  text-decoration: none;
  transition: transform .2s ease, filter .2s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.02); }
.btn:active { transform: translateY(0); }
.btn--outline {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(110,200,255,0.8);
}
.btn + .btn { margin-left: .5rem; }

/* Small helpers */
.container + main { padding-top: 0.25rem; }

/* Print styles */
@media print {
  body { color: #000; background: #fff; }
  a { color: #00f; text-decoration: underline; }
}
@media (max-width: 700px) {
  .image-frame { border-radius: 10px; }
}
@media (min-width: 960px) {
  header { padding: 1rem 0; }
}
aside { display: none; }

/* Accessibility helpers for high contrast in glass areas */
@media (prefers-contrast: more) {
  :root { --text: #f9fbff; --muted: #cbdff2; }
  .glass, .card { border-color: rgba(255,255,255,0.5); }
}
