/* 0. Tokens & Reset */
:root{
  --bg: #120317;
  --bg-2: #2a0424;
  --text: #f7eaff;
  --muted: #d6a6c8;
  --accent: #ff4d9a;
  --accent-2: #f78dcf;
  --panel: rgba(255,255,255,.08);
  --panel-strong: rgba(255,255,255,.18);
  --shadow: 0 6px 20px rgba(0,0,0,.25);
  --radius: 14px;
  --gap: 1rem;
}

*,
*::before,
*::after{ box-sizing: border-box; }

html, body{ height: 100%; }
html, body{ margin: 0; padding: 0; }

:root{ color-scheme: dark; }

/* 1. Base appearance & layered background (gradient + subtle scanlines/noise) */
html, body { 
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-2) 60%, var(--bg) 100%);
  font-size: clamp(14px, 2.3vw, 18px);
  line-height: 1.45;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  word-break: break-word;
}

body::before{
  content: "";
  position: fixed;
  inset: 0;
  /* Subtle checker/scanline pattern over the gradient */
  background-image:
    linear-gradient(rgba(255,255,255,.04), rgba(255,255,255,.04)),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 100% 2px, 6px 6px;
  mix-blend-mode: overlay;
  opacity: .18;
  pointer-events: none;
  z-index: 0;
}
body::after{
  content: "";
  position: fixed;
  inset: 0;
  /* gentle vignette / noise via radial patterns (no images) */
  background:
    radial-gradient(circle at 50% 0%, rgba(0,0,0,.0), rgba(0,0,0,.08) 60%),
    radial-gradient(circle at 100% 100%, rgba(0,0,0,.04), rgba(0,0,0,.0) 40%);
  mix-blend-mode: multiply;
  opacity: .25;
  pointer-events: none;
  z-index: 0;
}

/* 2. Layout helpers & utilities */
.container{
  width: 100%;
  max-width: clamp(320px, 88vw, 1100px);
  margin-inline: auto;
  padding-inline: 1rem;
  position: relative;
  z-index: 1;
}

.grid{ display: grid; gap: var(--gap); }
.card{ background: var(--panel); border: 1px solid rgba(255,255,255,.28);
  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,.12); }
}
.tag{ display:inline-block; padding:.25rem .5rem; border-radius:999px;
  background: rgba(255,255,255,.15); color: #fff; font-size:.75rem;
  border:1px solid rgba(255,255,255,.25);
}
.image-frame{ width:100%; aspect-ratio:16/9; border-radius: calc(var(--radius) - 4px);
  overflow:hidden; border:1px solid rgba(255,255,255,.28);
  background: rgba(0,0,0,.25); box-shadow: inset 0 0 0 1px rgba(255,255,255,.15);
}
.image-frame img{ width:100%; height:100%; object-fit: cover; display:block; }

.content{ padding: .5rem 0 1rem; color: var(--text); }

/* 3. Typography & emphasis */
h1, h2{ line-height: 1.15; margin: .5rem 0; font-weight: 700; color: #fff; text-shadow: 0 2px 6px rgba(0,0,0,.35); }
h1{ font-size: clamp(1.75rem, 4vw, 3rem); }
h2{ font-size: clamp(1.25rem, 2.5vw, 1.75rem); }

blockquote{ margin: .75rem 0; padding: .75rem 1rem; border-left: 3px solid var(--accent); 
  background: rgba(0,0,0,.18); border-radius: 6px; color: #fff; }

/* 4. Structure selectors required by HTML */
html, body, header, nav, main, article, footer, aside{ }
header{ text-align: center; padding: 1rem 0 0.25rem; position: relative; z-index: 1; }
nav{ display: inline-flex; gap:.5rem; justify-content: center; padding-top:.25rem; }
main{ padding: .75rem 0; }
article{ /* glass panel for content */ 
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
footer{ padding: 1rem 0; text-align: center; color: var(--muted); }
aside{ display: none; }

/* 5. Interactive elements (buttons, links, CTAs) */
a, button, .btn, .cta{ color: var(--text); text-decoration: none; outline: none; }
a{ color: var(--accent); }
a:hover, a:focus{ text-decoration: underline; color: var(--accent-2); }

/* Button variants & focus */
button, .btn{ background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.25);
  color: var(--text); padding:.55rem .95rem; border-radius: 8px; cursor: pointer;
  transition: transform .15s ease, background .2s ease, border-color .2s ease;
}
.btn.primary{ background: var(--accent); border-color: rgba(0,0,0,.15); color: #fff; }
.btn.outline{ background: transparent; border: 1px solid var(--accent); color: var(--accent); }
a.btn{ display:inline-flex; align-items:center; justify-content:center; padding:.5rem 1rem; border-radius:999px; }

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

/* 6. Lists & misc */
ul{ padding-left: 1.25rem; margin: .5rem 0; }
li{ margin:.25rem 0; }

/* 7. Header content tweaks for hero feel */
header h1{ font-weight: 800; letter-spacing:.4px; text-transform: none; }

/* 8. Print styles (basic readability) */
@media print{
  body{ background:#fff; color:#000; }
  a{ text-decoration: underline; color: inherit; }
  .image-frame{ page-break-inside: avoid; }
}

/* 9. Responsiveness / motion preferences */
@media (min-width: 640px){
  aside{ display: none; }
}
@media (min-width: 900px){
  .grid{ grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
}
@media (prefers-reduced-motion: reduce){
  *{ animation: none !important; transition: none !important; }
}