:root {
  --bg-main: #081426;
  --bg-card: #0f223d;
  --bg-elevated: #152e52;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --accent: #ffb74d;
  --accent-dark: #081426;
  --border: rgba(255, 183, 77, 0.18);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
}

.container {
  width: min(1120px, 92%);
  margin: 0 auto;
}

.topbar {
  border-bottom: 1px solid var(--border);
  background: rgba(8, 20, 38, 0.92);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(8px);
}

.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.brand-tag {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-weight: 700;
}

.topbar h1 {
  font-size: 1.25rem;
}

.back-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
}

.back-link:hover {
  text-decoration: underline;
}

.main-content {
  padding: 2.5rem 0 4rem;
}

.intro {
  text-align: center;
  max-width: 620px;
  margin: 0 auto 2rem;
}

.intro h2 {
  color: var(--accent);
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.intro p {
  color: var(--text-muted);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 2rem;
}

.filter-btn {
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-main);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.875rem;
  transition: 0.2s ease;
}

.filter-btn.active,
.filter-btn:hover {
  background: var(--accent);
  color: var(--accent-dark);
  font-weight: 600;
}

.demo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1.5rem;
}

.demo-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.demo-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.demo-thumb {
  height: 250px;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
}

.demo-thumb img {
  max-height: 100%;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.demo-info {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}

.demo-cat {
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
}

.demo-info h3 {
  font-size: 1.05rem;
}

.demo-info p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 50;
}

.modal.open {
  display: flex;
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(8, 20, 38, 0.85);
  color: var(--accent);
  font-size: 1.1rem;
  cursor: pointer;
}

.modal-media {
  background: var(--bg-elevated);
  padding: 1rem;
  display: flex;
  justify-content: center;
}

.modal-media img {
  max-height: 55vh;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.modal-body {
  padding: 1.5rem;
}

.modal-cat {
  font-size: 0.75rem;
  color: var(--accent);
  text-transform: uppercase;
  font-weight: 700;
}

.modal-body h3 {
  font-size: 1.4rem;
  margin: 0.35rem 0 0.6rem;
}

.modal-body p {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-dark);
  text-decoration: none;
  font-weight: 700;
  padding: 0.7rem 1.2rem;
  border-radius: 10px;
}
