:root {
  --bg: #f7f6f3;
  --surface: #ffffff;
  --surface-2: #f0efe9;
  --text: #16161a;
  --text-muted: #6b6a68;
  --border: #e6e4dd;
  --accent: #b5651d;
  --accent-2: #16161a;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;
  --shadow: 0 12px 40px -12px rgba(20, 18, 12, 0.18);
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

[data-theme='dark'] {
  --bg: #111113;
  --surface: #1a1a1d;
  --surface-2: #212124;
  --text: #f2f1ed;
  --text-muted: #a3a29d;
  --border: #2b2b2f;
  --accent: #e0964a;
  --accent-2: #f2f1ed;
  --shadow: 0 12px 40px -12px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.demo-nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.65rem 1rem;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.demo-nav__brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  margin-right: 0.5rem;
  white-space: nowrap;
}
.demo-nav__links { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.demo-nav__links a {
  font-size: 0.82rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  white-space: nowrap;
}
.demo-nav__links a.is-active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
.demo-nav__theme {
  margin-left: auto;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 0.4rem 0.7rem;
  font-size: 0.8rem;
}

.skeleton {
  background: linear-gradient(100deg, var(--surface-2) 30%, var(--border) 50%, var(--surface-2) 70%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { to { background-position: -200% 0; } }

.state-message {
  max-width: 32rem; margin: 4rem auto; text-align: center;
  padding: 2rem; color: var(--text-muted); font-size: 0.95rem;
}

.cover-fallback {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--surface-2), var(--border));
  color: var(--text-muted);
}
.cover-fallback svg { width: 40%; height: 40%; opacity: 0.55; }
