:root {
  --bg: #0f1117;
  --bg-card: #1a1d29;
  --bg-card-body: #1e2230;
  --line: #2a2f3f;
  --blue-bar: #1a56db;
  --ink: #f3f4f6;
  --ink-soft: #b8bcc6;
  --ink-faint: #7c8190;

  --green: #16a34a;
  --green-bg: rgba(22,163,74,0.18);
  --purple: #8b5cf6;
  --purple-bg: rgba(139,92,246,0.18);
  --orange: #f59e0b;
  --orange-bg: rgba(245,158,11,0.18);
  --blue: #3b82f6;
  --blue-bg: rgba(59,130,246,0.18);

  --sans: 'Inter', sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* ============ TOPBAR ============ */
.topbar {
  background: #11151f;
  color: var(--ink-soft);
  padding: 10px 24px;
  text-align: center;
  font-size: 0.92rem;
  border-bottom: 1px solid var(--line);
}

.topbar a {
  color: var(--ink);
  text-decoration: underline;
}

.topbar a:hover {
  color: var(--blue);
}

/* ============ HERO ============ */
.hero {
  text-align: center;
  padding: 56px 24px 48px;
  max-width: 720px;
  margin: 0 auto;
}

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.2rem);
  font-weight: 800;
  margin: 0 0 18px;
}

.subtitle {
  color: var(--ink-soft);
  font-size: 0.98rem;
  margin: 0;
}

/* ============ MAIN / SECTION ============ */
main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

.section-title {
  text-align: center;
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 32px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
  .grid { grid-template-columns: 1fr; }
}

/* ============ CARD ============ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.card:hover, .card:focus-visible {
  transform: translateY(-3px);
  border-color: #3a4156;
  box-shadow: 0 12px 28px -10px rgba(0,0,0,0.55);
}

.card-media {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.media-label {
  font-weight: 700;
  font-size: 1.05rem;
  color: rgba(255,255,255,0.92);
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.card-body {
  background: var(--bg-card-body);
  padding: 16px 18px 18px;
}

.card-body h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 10px;
  color: var(--ink);
}

.tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  font-size: 0.74rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 100px;
}

.tag-green { background: var(--green-bg); color: var(--green); }
.tag-purple { background: var(--purple-bg); color: var(--purple); }
.tag-orange { background: var(--orange-bg); color: var(--orange); }
.tag-blue { background: var(--blue-bg); color: var(--blue); }

/* ============ FOOTER ============ */
.footer {
  text-align: center;
  padding: 32px 24px 48px;
  font-size: 0.88rem;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
}

.footer a { transition: color 0.15s ease; }
.footer a:hover { color: var(--ink); }

.dot-sep {
  margin: 0 10px;
  color: var(--ink-faint);
}

.copyright {
  margin: 18px 0 0;
  font-size: 0.78rem;
  color: var(--ink-faint);
}

/* ============ MODAL ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5,6,10,0.72);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 100;
}

.modal-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-card-body);
  border: 1px solid var(--line);
  border-radius: 14px;
  max-width: 560px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
  transform: translateY(10px) scale(0.98);
  transition: transform 0.2s ease;
}

.modal-overlay.is-open .modal {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.08);
  color: var(--ink);
  font-size: 0.95rem;
  cursor: pointer;
  z-index: 2;
  transition: background 0.15s ease;
}

.modal-close:hover { background: rgba(255,255,255,0.16); }

.modal-media {
  height: 240px;
  border-radius: 14px 14px 0 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.modal-gallery {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 18px 28px 0;
}

.modal-gallery::-webkit-scrollbar {
  height: 8px;
}

.modal-gallery::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.14);
  border-radius: 999px;
}

.modal-gallery-item {
  flex: 0 0 110px;
  height: 94px;
  border-radius: 14px;
  background-size: cover;
  background-position: center;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
  opacity: 0.78;
}

.modal-gallery-item:hover,
.modal-gallery-item.active {
  transform: translateY(-2px);
  opacity: 1;
  border-color: var(--blue);
}

.modal-gallery-item:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.modal-content {
  padding: 26px 28px 32px;
}

.modal-content h3 {
  font-size: 1.3rem;
  margin: 0 0 12px;
}

.modal-content .tags { margin-bottom: 16px; }

.modal-content p {
  color: var(--ink-soft);
  margin: 0 0 18px;
  font-size: 0.95rem;
}

.modal-content ul {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-content ul li {
  font-size: 0.9rem;
  color: var(--ink-soft);
  padding-left: 18px;
  position: relative;
}

.modal-content ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  width: 6px;
  height: 1px;
  background: var(--blue);
}

.modal-link {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--blue);
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}

.modal-link:hover { border-color: var(--blue); }
