:root {
  --bg: #03020a;
  --bg-soft: #05010d;
  --accent: #a855f7;
  --accent-soft: rgba(168, 85, 247, 0.15);
  --text: #f6f5ff;
  --text-muted: rgba(240, 240, 255, 0.7);
  --border: rgba(255, 255, 255, 0.08);
  --glass: rgba(255, 255, 255, 0.03);
  --font-heading: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', 'Space Grotesk', system-ui, sans-serif;
  --page-width: 1100px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 20% -10%, rgba(168, 85, 247, 0.25), transparent 45%),
    radial-gradient(circle at 80% 0%, rgba(255, 255, 255, 0.08), transparent 40%),
    linear-gradient(180deg, #05030c 0%, #040116 60%, #010107 100%);
  color: var(--text);
  font-family: var(--font-body);
  letter-spacing: 0.01em;
  line-height: 1.65;
  overflow-x: hidden;
}

body.detail-mode {
  background: linear-gradient(180deg, #02010a 0%, #03030d 40%, #000000 100%);
}

body.detail-mode .page-shell {
  padding-bottom: 2rem;
}

.page-shell {
  position: relative;
  padding: 3rem clamp(1rem, 4vw, 3rem) 4rem;
  max-width: var(--page-width);
  margin: 0 auto;
  z-index: 1;
}

h1,
h2,
h3,
h4,
h5 {
  font-family: var(--font-heading);
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--text);
  line-height: 1.3;
}

p {
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0 0 1rem;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  align-items: stretch;
  color: var(--text);
  margin-bottom: 2.5rem;
}

.hero-text h1 {
  margin: 0;
  font-size: clamp(2.3rem, 3.6vw, 3rem);
  line-height: 1.2;
}

.hero-text p {
  max-width: 45ch;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.35em;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.hero-stats {
  display: flex;
  gap: 1.25rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.stat-item strong {
  font-size: 1.5rem;
  color: var(--text);
  display: block;
}

#hero-type {
  text-transform: uppercase;
  letter-spacing: 0.35em;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.75);
}

.hero-highlight {
  background: var(--surface, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 2rem;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 260px;
}

.hero-tag {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 0.6rem;
}

.hero-title {
  margin: 0;
  font-size: clamp(1.6rem, 2.5vw, 2.1rem);
}

.hero-description {
  color: var(--text-muted);
  margin-top: 0.7rem;
  line-height: 1.6;
}

.hero-meta {
  margin-top: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  gap: 1rem;
  color: var(--text-muted);
}

.hero-link {
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.hero-link:hover {
  background: var(--accent);
  color: #08010d;
}

.filters {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 1.5rem;
}

.search-label {
  flex: 1;
}

#search-input {
  width: 100%;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 0.65rem 1.2rem;
  font-size: 0.95rem;
}

.filter-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  padding: 0.45rem 1rem;
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn.is-active,
.filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

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

.preview-card {
  position: relative;
  border-radius: 26px;
  min-height: 280px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--glass);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.45);
}

.card-overlay {
  position: absolute;
  inset: 0;
  background-image: var(--card-bg);
  background-size: cover;
  background-position: center;
  opacity: 0.15;
  transition: opacity 0.3s ease;
  filter: saturate(0.6);
}

.preview-card:hover .card-overlay {
  opacity: 0.3;
}

.card-content {
  position: relative;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: space-between;
  gap: 0.3rem;
  z-index: 2;
}

.card-badge {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.8);
}

.card-content h3 {
  margin: 0;
  font-size: 1.4rem;
}

.card-content p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.5;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--accent);
  font-weight: 600;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.4rem 0 0;
}

.chip {
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.chip-accent {
  border-color: rgba(168, 85, 247, 0.5);
  color: var(--accent);
}

.chip-pill {
  background: rgba(255, 255, 255, 0.08);
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  margin-top: 2rem;
  font-size: 0.95rem;
}

.detail-shell {
  background: rgba(4, 3, 10, 0.8);
  border: 1px solid var(--border);
  border-radius: 32px;
  padding: 2.5rem;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.55);
}

.btn-back {
  border: none;
  background: none;
  color: var(--text);
  font-size: 0.9rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  cursor: pointer;
}

.detail-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(5, 4, 10, 0.8));
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 2.2rem;
  color: var(--text);
}

.detail-card h1 {
  margin: 0.75rem 0;
  font-size: clamp(2.2rem, 3vw, 2.8rem);
}

.detail-date {
  font-family: 'Inter', sans-serif;
  color: var(--text-muted);
  margin-top: 0;
}

.detail-content {
  margin-top: 1.8rem;
  line-height: 1.9;
  color: var(--text-muted);
}

.detail-content p,
.detail-content li {
  margin-bottom: 1rem;
}

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

@media (max-width: 768px) {
  .filters {
    flex-direction: column;
  }

  .hero-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .detail-shell {
    padding: 2rem;
  }

  .detail-card {
    padding: 1.5rem;
  }
}

@media (max-width: 600px) {
  .page-shell {
    padding: 2.5rem 1rem 3rem;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .filters {
    flex-direction: column;
  }

  #search-input {
    font-size: 0.95rem;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .preview-card {
    min-height: 220px;
  }

  .detail-shell {
    padding: 1.5rem;
  }

  .detail-card {
    padding: 1.25rem;
  }
}

@media (max-width: 480px) {
  .hero-text h1 {
    font-size: 2rem;
  }

  .hero-meta {
    gap: 0.5rem;
  }

  .card-content {
    padding: 1rem;
  }

  .card-footer {
    font-size: 0.85rem;
  }
}

.footer {
  margin-top: 4rem;
  padding: 3rem 1.5rem;
  border-top: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow);
  text-align: center;
  position: relative;
  z-index: 10;
  transition: background 0.4s, color 0.4s;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Gradient stripe on top */
.footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-primary-dim));
  border-radius: 2px 2px 0 0;
}

/* Footer content flex */
.footer-content {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

/* Brand logo */
.footer-brand img.brand-logo {
  width: 50px;
  height: auto;
  transition: transform 0.3s ease;
  border-radius: 50%;
}

.footer-brand:hover img.brand-logo {
  transform: scale(1.1);
}

/* Footer links */
.footer-link {
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
}

/* Accent underline on hover */
.footer-link::after {
  content: "";
  display: block;
  width: 0%;
  height: 2px;
  background: var(--accent-primary);
  transition: width 0.3s ease;
  position: absolute;
  bottom: -2px;
  left: 0;
}

.footer-link:hover::after {
  width: 100%;
}

.footer-link:hover {
  color: var(--accent-primary);
}

/* Copyright */
.footer .copyright {
  color: var(--text-tertiary);
  font-size: 0.8rem;
  margin: 0.3rem 0 0 0;
}

/* Made with love */
.footer .made-with-love {
  color: var(--text-tertiary);
  font-size: 0.8rem;
  margin: 0.2rem 0 0 0;
}