/* Section: Tokens */
:root{
  --bg: #0b1020;
  --bg-2: #4a001a;
  --text: #e8eaf6;
  --muted: #a7b3d1;
  --accent: #2bd4ff;
  --accent-2: #ff4d6a;
  --glass: rgba(9,12,28,0.22);
  --glass-soft: rgba(9,12,28,0.14);
  --glass-border: rgba(255,255,255,0.28);
  --shadow: 0 8px 28px rgba(0,0,0,0.45);
  --radius: 14px;
  --focus: 3px solid #fff;
}

/* Section: Reset & Base layout */
html, body { height: 100%; }
*, *::before, *::after { box-sizing: border-box; }
html { font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Helvetica Neue", sans-serif; }
body {
  margin: 0;
  color: var(--text);
  min-height: 100%;
  background: linear-gradient(135deg, rgba(74,0,26,0.95) 0%, rgba(10,16,32,0.95) 60%, rgba(74,0,26,0.95) 100%),
              repeating-linear-gradient(to bottom, rgba(255,255,255,0.03) 0 1px, transparent 1px 2px);
  background-blend-mode: overlay;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  isolation: isolate;
}

/* Section: Layout helpers */
.container{ max-width: clamp(320px, 90vw, 1100px); margin-inline: auto; padding-inline: 1rem; }
.grid{ display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }

/* Section: Structural elements */
header, nav, main, article, aside, footer { padding: 1rem; }
header{ text-align: center; padding-block: 1.75rem; }
main{ display: grid; place-items: center; padding: 0 1rem; }
article{ width: min(1100px, 90%); display: grid; gap: 1rem; }

/* Section: Hero media */
.image-frame{ aspect-ratio: 16/9; width: 100%; border-radius: 12px; overflow: hidden;
  border: 1px solid rgba(255,255,255,0.28); background: #000; box-shadow: var(--shadow);
}
.image-frame img{ width: 100%; height: 100%; object-fit: cover; display: block; }

/* Section: Glass panels (fallback included) */
.content, .product-ad, .sponsored-page, aside { background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: calc(var(--radius) - 2px); padding: 1rem; -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px); box-shadow: 0 8px 28px rgba(0,0,0,.4); }
@supports not (backdrop-filter: blur(12px)) {
  .content, .product-ad, .sponsored-page, aside { background: var(--glass-soft); }
}
header h1{ font-size: clamp(1.6rem, 2.5vw + 1rem, 2.8rem); line-height: 1.15; margin: 0; font-weight: 700; }

/* Section: Typography & links */
a, button, .btn, .cta { color: inherit; text-decoration: none; cursor: pointer; }
a:hover, a:focus{ text-decoration: underline; color: var(--accent-2); }
button, .btn, .cta { border: 0; background: transparent; color: inherit; font: inherit; }

/* Focus visibility */
:focus-visible{ outline: 3px solid #fff; outline-offset: 2px; border-radius: 6px; }

/* Section: Buttons (variants) */
.btn{ display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .75rem 1.25rem; border-radius: 999px; border: 1px solid rgba(255,255,255,.28);
  background: rgba(10,4,12,.85); color: #fff; font-weight: 600; transition: transform .2s ease, background .2s ease;
}
.btn.primary{ background: linear-gradient(135deg, rgba(60,0,40,.95), rgba(0,0,0,.75)); border-color: rgba(255,255,255,.4); }
.btn.secondary{ background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.4); color: #fff; }
.btn:hover{ transform: translateY(-1px); }
.btn:active{ transform: translateY(0); }

/* Section: Links & text utilities */
ul{ list-style: none; margin: 0; padding: 0; }
li{ margin: 0; padding: 0; }

/* Section: Content structure utilities */
.image-frame{ border-radius: 12px; overflow: hidden; }
.product-ad{ display: block; text-align: left; }
.sponsored-page{ display: block; text-align: left; }

/* Section: Glass content blocks specifics */
.card{ padding: 1rem; border-radius: var(--radius); background: rgba(9,12,28,.22);
  border: 1px solid rgba(255,255,255,.28); }
.tag{ display: inline-block; padding: .25rem .5rem; border-radius: 999px;
  background: rgba(43,212,255,.25); border: 1px solid rgba(43,212,255,.5);
  font-size: .75rem; color: #fff; }

/* Section: Layout refinements for content sections */
header{ position: relative; z-index: 2; }
footer{ padding: 1rem; display: grid; gap: 1rem; }

/* Section: Accessibility & contrast helpers */
@media (prefers-color-scheme: light){
  :root{
    --bg: #f7f7fb;
    --bg-2: #eef0ff;
    --text: #0b1020;
    --muted: #4b4b66;
    --accent: #2658ff;
    --accent-2: #c0186a;
    --glass: rgba(255,255,255,.86);
    --glass-soft: rgba(255,255,255,.92);
    --glass-border: rgba(0,0,0,.15);
  }
  body{ background: linear-gradient(135deg, #fff, #f5f6fb 60%, #fff),
                     repeating-linear-gradient(to bottom, rgba(0,0,0,.04) 0 1px, transparent 1px 2px); color: var(--text); }
  .image-frame{ border-color: rgba(0,0,0,.2); }
  .content, .product-ad, .sponsored-page, aside{ background: var(--glass); border: 1px solid var(--glass-border); }
  a, button, .btn, .cta{ color: var(--accent); }
}
@media (prefers-reduced-motion: reduce){
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print{
  body{ background: #fff; color: #000; }
  header, footer { display: none; }
  img{ max-width: 100%; page-break-inside: avoid; }
}