:root {
  --accent: #22c55e;
  --bg: #020202;
  --panel: #050505;
  --text: #e4ffe6;
  --muted: rgba(226, 255, 230, 0.75);
  --border: rgba(34, 197, 94, 0.25);
  --surface: #0b0b0b;
  --input-bg: rgba(3, 3, 3, 0.6);
  --shadow: rgba(34, 197, 94, 0.2);
  --shadow-strong: rgba(34, 197, 94, 0.35);
}

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

body {
  margin: 0;
  font-family: "Space Grotesk", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.page-shell {
  max-width: 1080px;
  margin: 2rem auto;
  padding: 2rem;
  background: var(--panel);
  border-radius: 36px;
  border-top-left-radius: 0;
  border: 1px solid var(--border);
  box-shadow: 0 40px 80px var(--shadow);
}

.site-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: rgba(9, 9, 9, 0.9);
  border-radius: 20px;
  border-top-left-radius: 0;
  border: 1px solid var(--border);
  box-shadow: 0 20px 50px var(--shadow);
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.brand-icon {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  border-top-left-radius: 0;
  border: 2px solid var(--accent);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.brand p {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent);
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.accent-picker {
  display: flex;
  gap: 0.4rem;
}

.accent-option {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 0;
  background: var(--swatch, var(--accent));
  cursor: pointer;
  transition: transform 0.15s ease;
}

.accent-option.active {
  transform: scale(1.15);
  border-color: #ffffff;
}

.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(15, 23, 42, 0.7);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-links a:hover {
  color: var(--accent);
}

.nav-search {
  position: relative;
  width: 200px;
}

.nav-search input {
  width: 100%;
  padding: 0.4rem 2rem 0.4rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(3, 3, 3, 0.7);
  color: var(--text);
  font-size: 0.9rem;
}

.nav-search i {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

header {
  margin: 2rem 0 1.5rem;
  padding: 0 1rem;
}

main#demos {
  padding: 0 1rem 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.demo-card {
  background: var(--surface);
  border-radius: 22px;
  border-top-left-radius: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  box-shadow: 0 20px 40px var(--shadow-strong);
}

.demo-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.demo-content {
  padding: 0.9rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.demo-title {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
  color: var(--text);
}

.demo-desc {
  margin: 0 0 0.6rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.demo-meta {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  font-size: 0.8rem;
  gap: 0.5rem;
}

.demo-tags {
  opacity: 0.7;
  color: var(--muted);
  text-align: left;
}

.demo-link {
  background: var(--accent);
  color: #010e05;
  text-decoration: none;
  padding: 0.4rem;
  border-radius: 999px;
  border-top-left-radius: 0;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

body.light-theme {
  --bg: #f4f4f4;
  --panel: #ffffff;
  --text: #0f172a;
  --muted: rgba(15, 23, 42, 0.7);
  --surface: #f5f7fb;
  --input-bg: #ffffff;
  --shadow: rgba(15, 23, 42, 0.08);
  --shadow-strong: rgba(15, 23, 42, 0.15);
}

body.light-theme .theme-toggle {
  color: var(--accent);
}

body.light-theme .nav-search input {
  background: #ffffff;
}
