/* Base tokens */
:root {
  --bg: #0f1117;
  --bg-2: #141821;
  --surface: rgba(255, 255, 255, 0.08);
  --surface-2: rgba(255, 255, 255, 0.14);
  --text: #f8f7e3;
  --muted: #cbd5e1;
  --accent: #ffd400;
  --accent-2: #f7c600;
  --border: rgba(255, 255, 255, 0.28);
  --radius: 12px;
  --blur: 12px;
  --shadow: 0 6px 20px rgba(0,0,0,.45);
}

/* Layered background: charcoal grid paper + subtle glow */
html, body {
  height: 100%;
}
* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
  color: var(--text);
  background-color: var(--bg);
  /* Grid pattern + gentle scanlines */
  background-image:
    linear-gradient(to right, rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 24px 24px;
  position: relative;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  /* faint overlay to simulate paper texture without images */
  background-image:
    linear-gradient(to bottom, rgba(0,0,0,.0) 0, rgba(0,0,0,.04) 2px),
    linear-gradient(to right, rgba(0,0,0,.0) 0, rgba(0,0,0,.04) 2px);
  background-size: auto, 24px 24px;
  opacity: .25;
  z-index: 0;
}

/* Structural selectors (per requirement) */
html, body, header, nav, main, article, footer, aside {
  display: block;
}
header, main, footer, aside, article {
  padding: 1rem;
  margin: 0;
  position: relative;
  z-index: 1;
  border-radius: var(--radius);
  background: rgba(8,8,12,.60);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
}
a { color: var(--accent); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; color: var(--accent-2); }

/* Layout utilities (compact) */
.container { width: 100%; max-width: clamp(640px, 92vw, 1100px); margin: 0 auto; padding-inline: 1rem; }
.grid { display: grid; gap: 1rem; }
.card { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.25); border-radius: .75rem; padding: .75rem; }
.tag { display:inline-block; padding: .25rem .5rem; border-radius: 999px; background: rgba(255,215,0,.25); color: #000; font-size: .75rem; }

/* Image framing (includes .image-frame and common pattern) */
.image-frame, .featured-image {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.25);
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
  background: #000;
  display: block;
}
.image-frame { aspect-ratio: 16/9; width: 100%; }
.image-frame img, .featured-image img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.featured-image { border-radius: 12px; overflow: hidden; }

/* Content typography and layout (fluid, accessible) */
.content { max-width: 62ch; color: var(--text); }
h1, h2, h3 { line-height: 1.15; margin: .25rem 0 .75rem; color: #fff; }
h1 { font-size: clamp(1.8rem, 4vw + 0.5rem, 3.2rem); }
h2 { font-size: clamp(1.25rem, 1.5vw + .75rem, 1.75rem); margin-top: 1rem; }
p { font-size: clamp(0.95rem, 0.8vw + .9rem, 1.125rem); line-height: 1.55; color: var(--text); margin: .5rem 0; }
blockquote {
  margin: .75rem 0; padding: .75rem 1rem;
  border-left: 4px solid var(--accent);
  background: rgba(0,0,0,.22);
  border-radius: 6px;
  color: #fff;
}
ol, ul { padding-left: 1.25rem; margin: .5rem 0; }
li { margin: .25rem 0; }

/* Hero / CTAs with strong hierarchy */
header { padding: 1.25rem; }
header h1 { font-weight: 700; font-variation-settings: "wght" 700; }

/* Button-like links & CTAs (outline & solid variants) */
.btn, .cta, button, a.btn {
  display: inline-block;
  padding: .6rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.4);
  background: rgba(0,0,0,.28);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, color .2s ease;
}
.btn:hover, .cta:hover, a.btn:hover, button:hover {
  transform: translateY(-1px);
  background: rgba(0,0,0,.38);
}
.btn.primary, a.btn.primary, .cta.primary {
  background: linear-gradient(135deg, rgba(255,212,0,.95), rgba(255,220,0,.75));
  border: 1px solid rgba(0,0,0,.25);
  color: #111;
}
.btn-outline, a.btn-outline {
  background: transparent;
  border: 1px solid rgba(255,255,255,.6);
  color: var(--text);
}
:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(255, 212, 0, 0.65);
  border-radius: 6px;
  /* ensures visible focus ring for keyboard users */
  outline-offset: 2px;
}

/* Lists and navigation tweaks for accessibility */
nav a { font-weight: 500; color: var(--accent); }
nav a:focus-visible { text-decoration: underline; }

/* Print styles (basic readability) */
@media print {
  body { background: #fff; color: #000; }
  header, main, footer { background: #fff; border: none; box-shadow: none; }
  a { color: #000; text-decoration: underline; }
}

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