/* Section: Base tokens */
:root{
  --bg: #1b1f23;
  --bg-2: #2a2f34;
  --surface: rgba(255,255,255,.08);
  --surface-2: rgba(255,255,255,.14);
  --text: #e9e6e0;
  --muted: #a7a49c;
  --accent: #8a5c2a;
  --accent-2: #d19a62;
  --border: rgba(255,255,255,.28);
  --shadow: 0 6px 18px rgba(0,0,0,.25);
  --radius: 12px;
}
html, body, header, nav, main, article, footer, aside {
  box-sizing: border-box;
}
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    linear-gradient(135deg, rgba(60,60,60,.9), rgba(20,20,20,.95)),
    repeating-linear-gradient(to bottom, rgba(255,255,255,.04) 0 2px, rgba(0,0,0,0) 2px 4px);
  background-blend-mode: overlay, normal;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
@media (prefers-color-scheme: light) {
  :root { --text: #1a1a1a; --surface: rgba(255,255,255,.85); --border: rgba(0,0,0,.15); }
  body { background-color: #f5f7f9; }
}

/* Section: Layout primitives */
.container {
  width: 100%;
  margin-inline: auto;
  padding-inline: 1rem;
  max-width: clamp(320px, 90vw, 1100px);
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.card {
  background: rgba(255,255,255,.08);
  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,.16); border: 1px solid rgba(255,255,255,.40); }
}
.content {
  color: var(--text);
  font-size: clamp(1rem, 2.2vw, 1.125rem);
  line-height: 1.6;
}
.tag {
  display:inline-block;
  padding: .15em .5em;
  font-size: .75rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.4);
  background: rgba(0,0,0,.18);
  color: #fff;
  vertical-align: middle;
}
ul, li { margin: 0 0 .5rem 1.1rem; padding: 0; }
ul { padding-left: 1rem; }

/* Section: Typography scale (fluid) */
h1, h2, h3 {
  margin: .25rem 0;
  line-height: 1.15;
}
h1 { font-size: clamp(1.8rem, 5vw, 3rem); font-weight: 700; letter-spacing: .2px; color: var(--text); }
h2 { font-size: clamp(1.4rem, 4vw, 2.25rem); font-weight: 700; color: var(--text); }
h3 { font-size: clamp(1.15rem, 3vw, 1.5rem); font-weight: 600; color: var(--text); }

/* Section: Image framing */
.image-frame, .featured-image {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.28);
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
  background: rgba(0,0,0,.15);
}
.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 { padding: 0; }

/* Section: Glass panels for major regions (header, main, article, aside, footer) */
header, main, article, aside, footer {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 12px;
  padding: 1rem;
  margin: .75rem auto;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
@media (max-width: 720px){
  header, main, article, aside, footer { border-radius: 12px; padding: .75rem; }
}
@media print {
  body { color: #000; background: #fff; }
  header, main, article, aside, footer { background: #fff; border: none; box-shadow: none; }
}

/* Section: Links and controls */
a { color: var(--accent-2); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 2px; }

/* Button system (solid + outline) */
button, .btn, .cta {
  font-family: inherit;
  font-weight: 600;
  padding: .55em 1em;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, background .2s ease, border-color .2s ease;
  display: inline-block;
  text-align: center;
  text-decoration: none;
  color: #fff;
  background: var(--accent);
}
.btn:hover, .cta:hover { transform: translateY(-1px); }
.btn:focus-visible, .cta:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.btn.primary {
  background: var(--accent);
  color: #fff;
}
.btn.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255,255,255,.5);
}
.btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255,255,255,.25);
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* Section: UI density helpers (nav placeholder, alignment) */
nav { display: none; } /* present in spec but not in content; kept for completeness */
main { padding: 1rem 0; }

/* Section: Print-friendly tweaks (minimal) */
@media print {
  body { font-size: 12pt; line-height: 1.4; }
  header, main, article, aside, footer { border: 0; background: transparent; }
}
