/* Section: Base tokens and reset */
:root {
  --bg: 5, 13, 23;
  --bg-2: 0, 170, 190;
  --accent: 65, 105, 225;
  --accent-2: 0, 255, 255;
  --text: 232, 246, 255;
  --muted: 150, 190, 210;
  --glass-rgb: 255, 255, 255;
  --radius: 12px;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
html { color-scheme: dark; }

/* Section: Global typography and layout (mobile-first) */
html, body { margin: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  color: rgb(var(--text));
  background: rgb(var(--bg));
  min-height: 100%;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-image:
    linear-gradient(135deg, rgba(var(--bg-2), 0.25), rgba(var(--bg-2), 0.08) 60%),
    radial-gradient(circle at 20% -10%, rgba(0, 255, 235, 0.15), transparent 25%),
    radial-gradient(circle at 100% 0%, rgba(65,105,225,0.15), transparent 25%);
  background-blend-mode: screen, normal, normal;
  position: relative;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 4px 4px, 4px 4px;
  mix-blend-mode: overlay;
  opacity: .55;
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: "";
  position: fixed; inset: 0;
  background: radial-gradient(circle at 20% 0%, rgba(0,0,0,.15), transparent 40%),
              radial-gradient(circle at 80% 20%, rgba(0,0,0,.08), transparent 40%);
  mix-blend-mode: overlay;
  opacity: .45;
  pointer-events: none;
  z-index: 0;
}
@media (prefers-reduced-motion: reduce) {
  html, body { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

/* Section: Layout utilities */
.container { width: 100%; margin: 0 auto; padding: 0 1rem; max-width: clamp(320px, 92vw, 1100px); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.card { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.34); border-radius: var(--radius); padding: 1rem; box-shadow: 0 6px 18px rgba(0,0,0,.25); transition: transform .2s ease, opacity .2s ease; }
.tag { display: inline-block; padding: .15em .5em; font-size: .75rem; border-radius: 999px; color: rgb(var(--text)); background: rgba(var(--accent), .15); border: 1px solid rgba(var(--accent), .35); }

/* Section: Global element styling (semantic) */
html, body, header, nav, main, article, aside, footer { /* semantic placeholders; ready for refinement */ }
header { padding: 1.25rem 1rem; text-align: center; display: grid; gap: .25rem; justify-items: center; }
header h1 { font-size: clamp(1.6rem, 1.8vw + 1rem, 3rem); margin: 0; line-height: 1.15; color: rgb(var(--text)); }
header .meta { color: rgb(var(--muted)); font-size: clamp(0.8rem, 0.8vw, 1rem); }
nav { margin-top: .25rem; }
nav a { color: rgb(var(--text)); text-decoration: none; padding: .25rem .5rem; border-radius: 6px; }

/* Section: Hero and content presentation (glass panels) */
.glass { background: rgba(var(--glass-rgb), .18); border: 1px solid rgba(var(--glass-rgb), .32); border-radius: calc(var(--radius) + 2px); padding: 1rem; box-shadow: 0 10px 28px rgba(0,0,0,.25); }
@supports (backdrop-filter: blur(8px)) or (-webkit-backdrop-filter: blur(8px)) {
  .glass { background: rgba(var(--glass-rgb), .12); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
}
@supports not (backdrop-filter: blur(8px)) {
  .glass { background: rgba(var(--glass-rgb), .22); border: 1px solid rgba(var(--glass-rgb), .40); }
}
.image-frame { aspect-ratio: 16/9; width: 100%; overflow: hidden; border-radius: 12px; border: 1px solid rgba(var(--accent), .45); box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.image-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Section: Typography and readability */
h2, h3 { color: rgb(var(--text)); margin: .75rem 0 .5rem; }
p { color: rgb(var(--text)); margin: .5rem 0 1rem; }
ul, ol { padding-left: 1.25rem; margin: .25rem 0 1rem; color: rgb(var(--text)); }
li { margin: .25rem 0; }

/* Section: Link and button treatments (accessibility) */
a { color: rgb(var(--accent)); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; outline-offset: 2px; }
a:focus-visible { outline: 3px solid rgb(var(--accent)); outline-offset: 2px; border-radius: 4px; }

button, .btn, .cta {
  font: inherit; cursor: pointer;
  padding: .6rem 1rem; border-radius: 8px;
  border: 1px solid rgba(var(--accent), .6);
  background: rgba(var(--accent), .95);
  color: white; transition: transform .2s ease, background .2s ease;
}
button:hover, .btn:hover, .cta:hover { transform: translateY(-1px); }
button:focus-visible, .btn:focus-visible, .cta:focus-visible { outline: 3px solid rgb(var(--accent)); outline-offset: 2px; }

/* Secondary/outline variants */
.btn.secondary { background: rgba(0,0,0,.0); color: rgb(var(--accent)); border-color: rgba(var(--accent), .8); }

/* Section: Content areas (glass panels for main content) */
.content { padding: .5rem 0; }

/* Section: Specific page regions */
.product-ad { margin: 1rem 0; }
.product-ad a { display: block; text-align: center; padding: .75rem; border-radius: 10px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.34); color: rgb(var(--text)); text-decoration: none; }
.product-ad a:hover { transform: translateY(-1px); }

/* Footer section styling */
footer { padding: 1rem; text-align: center; color: rgb(var(--muted)); }

/* Section: Print styles (basic readability) */
@media print {
  body { background: white; color: #000; }
  a { text-decoration: underline; }
  .glass { background: rgba(255,255,255,0.98); border: 1px solid #ccc; }
}
  
/* Section: Responsiveness helpers for subtle tweaks (mobile-first) */
@media (min-width: 640px) {
  .container { padding: 0 1.25rem; }
}
@media (min-width: 900px) {
  .container { padding: 0 2rem; }
}