/* Section: Token Palette */
:root {
  --bg: #0b0f14;
  --bg-2: #141821;
  --text: #e8eef8;
  --muted: #aab4c5;
  --accent: #cbd5e1;
  --accent-2: #94a3b8;
  --surface: rgba(255,255,255,0.08);
  --surface-2: rgba(255,255,255,0.18);
  --border: rgba(255,255,255,0.28);
  --shadow: 0 8px 24px rgba(0,0,0,.56);
  --radius: 14px;
  --focus-ring: 0 0 0 3px rgba(0,180,255,.65);
  --link: #cfe4ff;
  --link-hover: #ffffff;
  --frame: rgba(255,255,255,.15);
}

/* Section: Base & Accessibility */
*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; }
html {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans",
               "Liberation Sans", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f7fb;
    --bg-2: #ffffff;
    --text: #0a0a0a;
    --muted: #555d6a;
    --accent: #374151;
    --accent-2: #4b5563;
    --surface: rgba(0,0,0,.06);
    --surface-2: rgba(255,255,255,.88);
    --border: rgba(0,0,0,.15);
    --shadow: 0 6px 20px rgba(0,0,0,.15);
  }
}
* { -webkit-font-smoothing: antialiased; }

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--text);
  background-color: var(--bg);
  /* Layered background: gradient + subtle scanlines/noise (pure CSS) */
  background-image:
    linear-gradient(135deg, rgba(255,255,255,.04) 0%, rgba(255,255,255,.04) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.04) 50%, rgba(255,255,255,.04) 75%, transparent 75%, transparent 100%),
    repeating-linear-gradient(to bottom, rgba(255,255,255,.04) 0 1px, transparent 1px 2px);
  background-blend-mode: overlay, overlay;
  position: relative;
  overflow-x: hidden;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

/* Section: Layout primitives */
.container {
  width: 100%;
  max-width: clamp(320px, 86vw, 1100px);
  margin-inline: auto;
  padding-inline: 1rem;
}
.grid {
  display: grid;
  gap: 1rem;
}
.card {
  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)) {
  .card { background: rgba(255,255,255,.22); }
}
.tag {
  display: inline-block;
  padding: .15em .6em;
  font-size: .75rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.28);
  background: rgba(0,0,0,.15);
  color: var(--text);
}

/* Section: Typography & hero pattern */
header {
  text-align: center;
  padding: clamp(12px, 4vw, 28px) 0;
}
header h1 {
  font-size: clamp(1.6rem, 5vw, 2.6rem);
  line-height: 1.15;
  margin: 0;
  font-weight: 700;
  letter-spacing: .2px;
  color: var(--text);
  text-shadow: 0 1px 0 rgba(0,0,0,.25);
}
.main-strap {
  color: var(--muted);
  font-size: clamp(0.95rem, 2.5vw, 1.05rem);
  margin-top: .25rem;
}

/* Section: Image frame styling */
.image-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.28);
  display: grid;
  place-items: center;
  box-shadow: 0 10px 28px rgba(0,0,0,.45);
}
.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(1.05) contrast(1.02);
  transform: translateZ(0); /* GPU hint for smoother rendering */
}
@media (prefers-reduced-motion: reduce) {
  .image-frame img { transform: none; }
}

/* Section: Links & buttons */
a, button, .btn, .cta {
  -webkit-tap-highlight-color: transparent;
}
a {
  color: var(--link);
  text-decoration: none;
}
a:hover, a:focus {
  text-decoration: underline;
  color: var(--link-hover);
}
a:focus-visible, button:focus-visible, .btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  outline-offset: 2px;
  border-radius: 6px;
}
.btn, .cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5ch;
  padding: .75rem 1.25rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.35);
  color: #fff;
  background: linear-gradient(135deg, rgba(99,102,241,.95), rgba(14,159,255,.95));
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
  transition: transform .15s ease, background .25s ease, box-shadow .25s ease;
  user-select: none;
}
.btn:hover, .cta:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, rgba(99,102,241,.98), rgba(14,159,255,.98));
}
.btn:active, .cta:active {
  transform: translateY(0);
  filter: saturate(0.95);
}
.btn--outline {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255,255,255,.55);
}
.btn--outline:hover {
  background: rgba(255,255,255,.08);
}
.primary {
  background: linear-gradient(135deg, rgba(203,213,225,.95), rgba(158,166,177,.95));
  color: #0b1220;
  border: 1px solid rgba(255,255,255,.6);
}
.primary:hover {
  background: linear-gradient(135deg, rgba(235,245,255,.95), rgba(208,216,229,.95));
}
.secondary {
  background: rgba(255,255,255,.08);
  color: var(--text);
  border: 1px solid rgba(255,255,255,.25);
}
.secondary:hover {
  background: rgba(255,255,255,.14);
}

/* Section: Layout primitives (utilities) */
ul { margin: 0; padding-left: 1.25rem; }
li { margin: .25rem 0; }

/* Section: Page structure styling (selectors required) */
html, body, header, nav, main, article, footer, aside { /* structural reset hooks kept lean */ }

.content { padding: 1rem; }

/* Main page scaffolding */
main { padding: 1rem 0 2rem; display: grid; place-items: center; }

/* Footer sections styled as glass panels when possible */
footer {
  padding: 1rem;
  display: grid;
  gap: .75rem;
  justify-items: center;
  background: transparent;
}
.product-ad, .sponsored-page {
  width: min(680px, 100%);
}
.product-ad a, .sponsored-page a {
  text-decoration: none;
}
.product-ad, .sponsored-page, .sponsor {
  padding: .75rem;
}
.product-ad { backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.sponsored-page { backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }

/* Footer layout responsiveness */
@media (min-width: 640px) {
  footer {
    grid-template-columns: 1fr 1fr;
  }
}
@media (prefers-color-scheme: light) {
  header, .image-frame, .card, footer { box-shadow: none; }
  .card { border: 1px solid rgba(0,0,0,.15); }
}

/* Section: Print styles */
@media print {
  body { color: #000; background: #fff; }
  a { color: #00f; text-decoration: underline; }
}
