/* Section: Theme Tokens */
:root {
  --bg: #0a0a0e;
  --bg-2: #111216;
  --surface: rgba(20, 20, 25, 0.65);
  --surface-2: rgba(30, 30, 40, 0.55);
  --text: #e9e9e9;
  --muted: #97a0a9;
  --accent: #7ee8ff;
  --accent-2: #9d5cff;
  --border: rgba(255, 255, 255, 0.25);
  --shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  --focus: 0 0 0 3px rgba(126, 232, 255, 0.75);
}

/* Section: Base & Layout */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
html { font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
:root { color-scheme: dark; }

body {
  margin: 0;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.55;
  font-size: clamp(14px, 1.4vw + 12px, 18px);
  background:
    linear-gradient(135deg, rgba(8,8,12,0.95), rgba(12,12,14,0.98) 60%, rgba(2,2,6,0.95)),
    #040508;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  isolation: isolate;
  z-index: 0;
}

/* Layered background: subtle scanlines + noise (pure CSS) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(to bottom,
              rgba(255,255,255,0.04) 0px, rgba(255,255,255,0.04) 1px,
              transparent 1px, transparent 2px);
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle at 20% 20%, rgba(255,255,255,0.04) 0 2px, transparent 2px);
  background-size: 2px 2px;
  opacity: 0.6;
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 0;
}

/* Utility containers */
.container { width: 100%; max-width: clamp(320px, 90vw, 1120px); margin-inline: auto; padding: 0 1rem; }

/* Section: Glass panels (fallback provided) */
header, nav, main, article, aside, footer {
  background: rgba(12, 12, 16, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  padding: 1rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
@supports not (backdrop-filter: blur(12px)) {
  header, nav, main, article, aside, footer {
    background: rgba(12, 12, 16, 0.88);
  }
}

/* Section: Typography & structure */
header { margin: 1rem auto; text-align: center; }
header h1 { font-size: clamp(1.8rem, 2.5vw + 1rem, 3.8rem); margin: 0.25rem 0 0.4rem; letter-spacing: .3px; }
header .meta { color: var(--muted); font-size: clamp(0.8rem, 0.8vw + 0.6rem, 1.1rem); }

/* Main content layout */
main { padding: 1rem; }
article { max-width: 760px; margin-inline: auto; padding: 1rem; }

/* Section: Image framing */
.image-frame { width: min(100%, 820px); aspect-ratio: 16 / 9; margin: 1rem auto; border-radius: 12px; overflow: hidden;
  border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.04);
  box-shadow: 0 6px 20px rgba(0,0,0,.5); }
.image-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Section: Content & headings */
.content { max-width: 60ch; margin-inline: auto; color: var(--text); }
h2 { font-size: clamp(1.25rem, 1vw + 1rem, 2rem); margin: .75rem 0 .25rem; color: var(--text); }
p { color: var(--muted); margin: .5rem 0; }
ul { margin: .5rem 0 1rem 1.1rem; color: var(--muted); }
li { margin: .25rem 0; }

/* Section: Blocks & quotes */
blockquote { margin: .75rem 0; padding: .5rem 1rem; border-left: 3px solid rgba(126,232,255,.6);
  background: rgba(0,0,0,.28); border-radius: 6px; color: var(--text); }

/* Section: Footer product ads */
footer { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; padding-top: 1rem; }
.product-ad, .sponsored-page { display: block; padding: .75rem; text-align: center;
  background: rgba(20,20,25,.65); border: 1px solid rgba(255,255,255,.25); border-radius: 10px;
}
.product-ad a, .sponsored-page a { color: var(--text); text-decoration: none; }

/* Section: Controls & utilities */
a { color: var(--accent); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; outline: none; color: var(--accent-2); }
a:focus-visible { outline: 3px solid rgba(126,232,255,.95); outline-offset: 2px; border-radius: 6px; }

.btn { display: inline-block; padding: .65rem 1rem; border-radius: 8px;
  border: 1px solid var(--border); background: rgba(126,232,255,.22);
  color: var(--text); text-decoration: none; cursor: pointer;
  transition: transform .2s ease, background .2s ease, color .2s ease; }
.btn:hover { background: rgba(126,232,255,.32); transform: translateY(-1px); }
.btn:focus-visible { outline: 3px solid rgba(126,232,255,.95); outline-offset: 2px; }
.btn.solid { background: rgba(126,232,255,.38); border-color: rgba(126,232,255,.8); }
.btn.outline { background: transparent; border-color: rgba(126,232,255,.8); color: var(--text); }

/* Section: Chips / tags */
.tag { display: inline-block; padding: .15rem .5rem; border-radius: 999px; font-size: .75rem;
  background: rgba(126,232,255,.25); border: 1px solid rgba(126,232,255,.6); color: var(--text); }

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

/* Section: Content wrappers */
.card { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.25);
  border-radius: 12px; padding: 1rem; box-shadow: var(--shadow); }

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

/* Section: Motion preferences */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Section: Light mode compatibility (optional polish) */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f6f8;
    --bg-2: #f0f0f4;
    --text: #0a0a0a;
    --muted: #3a3a3a;
    --surface: rgba(255,255,255,.95);
    --border: rgba(0,0,0,.15);
  }
  body {
    background: linear-gradient(135deg, rgba(246,246,248,.95), rgba(230,230,235,.95));
    background-attachment: scroll;
  }
  header, nav, main, article, aside, footer { background: rgba(255,255,255,.75); border-color: rgba(0,0,0,.15); }
  a { color: #1a6ed8; }
  a:hover, a:focus { color: #0b4c9c; text-decoration: underline; }
}