:root {
  --bg: #0b0f14;
  --bg-2: #11161c;
  --text: #e8f0f5;
  --muted: #a9b5c3;
  --accent: #ff6b61;
  --accent-2: #ff9670;
  --glass: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.25);
  --shadow: 0 6px 20px rgba(0,0,0,.45);
  --card: rgba(0,0,0,.25);
}
html, body, header, nav, main, article, aside, footer {
  height: auto;
}
html, body {
  height: 100%;
}
html {
  color-scheme: dark;
}
* { box-sizing: border-box; }

:root {
  /* Core palette tokens for easy theme tuning */
  --bg: #0b0f14;
  --bg-2: #11161c;
  --text: #e8f0f5;
  --muted: #a9b5c3;
  --accent: #ff6b61;
  --accent-2: #ff9670;
}

body {
  margin: 0;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans", "Liberation Sans", sans-serif;
  font-size: clamp(14px, 0.9rem + 0.6vw, 18px);
  line-height: 1.55;
  min-height: 100dvh;
  background-image:
    linear-gradient(135deg, var(--bg) 0%, var(--bg-2) 60%, var(--bg) 100%),
    repeating-linear-gradient(to bottom, rgba(255,255,255,.04) 0 1px, rgba(0,0,0,.04) 1px 2px);
  background-blend-mode: overlay;
  color-scheme: dark;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Glass-panel utility that degrades gracefully */
.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 0.75rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
@supports not ((backdrop-filter: blur(8px)) or (-webkit-backdrop-filter: blur(8px))) {
  .glass {
    background: rgba(255,255,255,.18);
  }
}

/* Layout primitives */
.container {
  width: 100%;
  max-width: clamp(320px, 90vw, 1100px);
  margin-inline: auto;
  padding: 0 1rem;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.card {
  padding: .75rem;
  border-radius: 12px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.25);
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
}
.tag {
  display: inline-block;
  padding: .15em .5em;
  font-size: .75rem;
  line-height: 1;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.08);
  color: var(--muted);
}
a, button, .btn, .cta {
  text-decoration: none;
  color: var(--text);
  outline: none;
}
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .6rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,107,97,.95);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s ease, background .2s ease, box-shadow .2s ease;
}
.btn.secondary {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.25);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

/* Image frame styling */
.image-frame {
  width: min(100%, 900px);
  aspect-ratio: 16/9;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.25);
  background: #0b0f14;
  box-shadow: 0 6px 20px rgba(0,0,0,.4);
}
.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  image-rendering: auto;
  filter: saturate(1.05);
}

/* Structural elements */
header, nav, main, article, aside, footer {
  width: 100%;
}
header {
  padding: 1.25rem 0;
  display: flex;
  justify-content: center;
  align-items: center;
}
header h1 {
  font-size: clamp(1.5rem, 1.2rem + 2vw, 2.4rem);
  margin: 0;
  text-align: center;
}
main {
  display: block;
  padding: 1rem 0;
}
article { display: block; padding: 0; }

/* Footer sections */
footer {
  padding: 1rem 0;
}
.product-ad, .sponsored-page {
  margin: .5rem 0;
  padding: .75rem;
  border-radius: 12px;
  text-align: center;
}
.product-ad a, .sponsored-page a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .5rem 1rem;
}
.product-ad { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.25); }
.sponsored-page { background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.25); }

/* Light-mode niceties (accessible in prefers-color-scheme: light) */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f7fb;
    --bg-2: #eef2f7;
    --text: #111;
    --muted: #465367;
    --glass: rgba(255,255,255,.95);
    --glass-border: rgba(0,0,0,.15);
  }
  body {
    background-image: linear-gradient(135deg, var(--bg) 0%, var(--bg-2) 60%, var(--bg) 100%), 
      repeating-linear-gradient(to bottom, rgba(0,0,0,.04) 0 1px, rgba(0,0,0,.02) 1px 2px);
  }
  .image-frame { border-color: rgba(0,0,0,.15); }
  .product-ad, .sponsored-page { background: rgba(255,255,255,.98); border-color: rgba(0,0,0,.15); }
}

/* Print styles (basic readability) */
@media print {
  body { background: #fff; color: #000; }
  header, main, footer { background: transparent; }
  .image-frame { border: none; box-shadow: none; }
  a, button { color: #000; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}