/* Base tokens */
:root {
  --bg: #0b1020;
  --bg-2: #141a2b;
  --text: #e9e7f3;
  --muted: #b8b4d8;
  --accent: #7a1f2a;      /* deep maroon */
  --accent-2: #3b2a40;    /* indigo-eggplant accent */
  --glass: rgba(255, 255, 255, 0.14);
  --glass-border: rgba(255, 255, 255, 0.28);
  --shadow: 0 10px 28px rgba(0,0,0,.28);
  --focus: #ffd166;
  --radius: 14px;
  --maxw: clamp(320px, 90vw, 1100px);
}

/* Section: Base */
*,
*::before,
*::after { box-sizing: border-box; }
html, body { height: 100%; }
html { font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans", sans-serif; }
body {
  margin: 0;
  color: var(--text);
  background: linear-gradient(135deg, rgba(12,8,28,.98) 0%, rgba(20,12,40,.98) 60%, rgba(12,8,28,.98) 100%), var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
body::before {
  /* Layered noise/scanline texture (pure CSS) */
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 4px 4px, 4px 4px;
  mix-blend-mode: overlay;
  opacity: .65;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }

/* Section: Layout primitives */
.container { width: 100%; max-width: var(--maxw); padding: 0 1rem; margin-inline: auto; }
.grid { display: grid; gap: 1rem; }
.card {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius);
  padding: 0.75rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
}
@supports not (backdrop-filter: blur(8px)) {
  .card { background: rgba(17, 14, 32, 0.28); border-color: rgba(255,255,255,0.40); }
}
.tag {
  display:inline-block;
  padding: .25em .6em;
  font-size: .75rem;
  border-radius: 999px;
  background: rgba(122,25,42,.32);
  color: #fff;
  border: 1px solid rgba(255,255,255,.28);
}
.image-frame {
  aspect-ratio: 16 / 9;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.28);
  box-shadow: 0 8px 28px rgba(0,0,0,.28), inset 0 0 0 1px rgba(255,255,255,.04);
  background: #0b0b0f;
}
.image-frame img { width: 100%; height: 100%; object-fit: cover; }

/* Section: Global typography */
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.15; }
h1 { font-size: clamp(1.6rem, 4vw + .5rem, 2.8rem); letter-spacing: .2px; }
p { margin: 0 0 1rem; color: var(--text); }

/* Section: Header / Hero */
header {
  padding: 1.25rem 1rem;
  text-align: center;
  position: relative;
}
header h1 { margin-bottom: .25rem; font-weight: 700; color: #f7f7ff; }
nav { margin-top: .25rem; }
nav a {
  color: #fff;
  padding: .4rem .6rem;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(0,0,0,.15);
  transition: transform .15s ease, background .15s ease;
}
nav a:hover, nav a:focus-visible { transform: translateY(-1px); background: rgba(0,0,0,.25); outline: none; }

/* Section: Content blocks (glass panels) */
.content {
  background: rgba(8, 10, 28, 0.18);
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 12px;
  padding: 1rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
@supports not (backdrop-filter: blur(12px)) {
  .content { background: rgba(8, 10, 28, 0.28); }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* Section: Actions (buttons / CTAs) */
.btn {
  display: inline-block;
  padding: .65rem 1.05rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.45);
  background: rgba(122,25,42,.82);
  color: #fff;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease;
}
.btn:hover { background: rgba(122,25,42,.92); transform: translateY(-1px); }
.btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.btn:active { transform: translateY(0); }

.btn--outline {
  background: transparent;
  border: 1px solid rgba(122,25,42,.95);
  color: #fff;
}
.btn--outline:hover {
  background: rgba(122,25,42,.15);
}
.cta { composes: .btn; }

/* Section: Links enhancement for accessibility */
a:focus-visible, a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
  color: var(--accent-2);
}
a:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Section: Utilities */
ul { margin: 0 0 1rem; padding-left: 1.25rem; }
li { margin: .25rem 0; }

/* Section: Page sections */
header, main, article, footer, aside {
  display: block;
}
main { padding-inline: 0; }

/* Section: Print (basic readability) */
@media print {
  body { background: #fff; color: #000; }
  a { color: #00f; text-decoration: underline; }
  .image-frame { page-break-inside: avoid; }
}
 
/* Section: Layout composition for this page */
main > article { width: 100%; display: grid; gap: 1rem; }

/* Section: Glassy card examples (image + caption) if needed */
.caption { font-size: .9rem; color: var(--muted); margin-top: .25rem; }

/* Section: Responsive helpers (grid utilities) */
@media (min-width: 640px) {
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
}
