:root {
  --bg: #040608;
  --bg-elevated: #111827;
  --bg-elevated-soft: #0b1220;
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.1);
  --accent-strong: #0ea5e9;
  --text: #e5e7eb;
  --text-muted: #9ca3af;
  --border-soft: rgba(148, 163, 184, 0.2);
  --tile-radius: 18px;
  --transition-fast: 150ms ease-out;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: radial-gradient(circle at top, #111827 0, #020617 55%);
  color: var(--text);
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

header {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

header h1 {
  font-size: clamp(2rem, 3vw, 2.4rem);
  letter-spacing: 0.03em;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

header h1 span.accent-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #e5f2ff, var(--accent));
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.7);
}

header p {
  margin: 0;
  color: var(--text-muted);
  max-width: 42rem;
  line-height: 1.5;
  font-size: 0.98rem;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.chip {
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  font-size: 0.75rem;
  color: var(--text-muted);
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(6px);
}

.status-pill {
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  border: 1px solid rgba(74, 222, 128, 0.5);
  color: #bbf7d0;
  font-size: 0.7rem;
  background: radial-gradient(circle at top left, #0f172a, #022c22);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.status-pill span.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #4ade80;
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.7);
}

.category-section {
  margin-bottom: 2.5rem;
}

.category-header {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.category-title {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #9ca3af;
}

.category-count {
  font-size: 0.75rem;
  color: var(--text-muted);
}

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

/* TILE */

.project-tile {
  cursor: pointer;
  background: linear-gradient(
    145deg,
    rgba(15, 23, 42, 0.96),
    rgba(15, 23, 42, 0.85)
  );
  border-radius: var(--tile-radius);
  border: 1px solid var(--border-soft);
  overflow: hidden;
  padding: 0.6rem 0.6rem 0.7rem;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.7);
  position: relative;
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    border-color var(--transition-fast),
    background var(--transition-fast);
}

.project-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at top left,
    rgba(56, 189, 248, 0.2),
    transparent 60%
  );
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

/* grows slightly on hover */
.project-tile:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.9);
  border-color: rgba(148, 163, 184, 0.5);
  background: linear-gradient(
    145deg,
    rgba(15, 23, 42, 0.98),
    rgba(15, 23, 42, 0.92)
  );
}

.project-tile:hover::before {
  opacity: 1;
}

.tile-thumb-wrapper {
  position: relative;
  border-radius: calc(var(--tile-radius) - 4px);
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: radial-gradient(circle at center, #1f2937, #020617);
  border: 1px solid rgba(15, 23, 42, 0.9);
  margin-bottom: 0.6rem;
}

.tile-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.02);
  transition: transform 180ms ease-out;
}

.project-tile:hover .tile-thumb {
  transform: scale(1.06);
}

.tile-thumb-badge {
  position: absolute;
  bottom: 0.4rem;
  left: 0.5rem;
  padding: 0.17rem 0.5rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: var(--text-muted);
  font-size: 0.7rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  backdrop-filter: blur(6px);
}

.tile-thumb-badge span.pip {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent-strong);
  box-shadow: 0 0 6px rgba(56, 189, 248, 0.8);
}

.tile-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.tile-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
}

.tile-title {
  font-size: 0.98rem;
  font-weight: 600;
  color: #e5e7eb;
}

.tile-arrow {
  font-size: 1.1rem;
  color: var(--text-muted);
  transition:
    transform var(--transition-fast),
    color var(--transition-fast);
}

.project-tile:hover .tile-arrow {
  transform: translateX(2px);
  color: var(--accent-strong);
}

.tile-description {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.tile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.3rem;
}

.tile-tag {
  font-size: 0.7rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #bae6fd;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

/* Messages */

.message {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.message.error {
  color: #fecaca;
}

/* Modal */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.82);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
  padding: 1rem;
}

.modal {
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  background: radial-gradient(circle at top left, #111827, #020617);
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  padding: 1.3rem 1.5rem 1.6rem;
  box-shadow: 0 35px 80px rgba(15, 23, 42, 0.9);
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 1.2rem;
  align-items: center;
  color: var(--text);
  position: relative;
}

@media (max-width: 820px) {
  .modal {
    grid-template-columns: minmax(0, 1fr);
    max-height: 96vh;
  }
}

.modal-close {
  position: absolute;
  top: 0.9rem;
  right: 1.1rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.1rem;
  border-radius: 999px;
  transition:
    background 120ms ease-out,
    color 120ms ease-out,
    transform 120ms ease-out;
}

.modal-close:hover {
  background: rgba(15, 23, 42, 0.9);
  color: #f9fafb;
  transform: scale(1.05);
}

/* Carousel */

.carousel-shell {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: radial-gradient(circle at center, #020617, #0b1120);
  border: 1px solid rgba(30, 64, 175, 0.6);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.7);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.carousel-main {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.carousel-main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #020617;
}

.carousel-nav-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 999px;
  width: 2.1rem;
  height: 2.1rem;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  backdrop-filter: blur(6px);
  transition:
    background 120ms ease-out,
    transform 120ms ease-out,
    border-color 120ms ease-out;
}

.carousel-nav-button:hover {
  background: rgba(15, 23, 42, 1);
  border-color: var(--accent-strong);
  transform: translateY(-50%) scale(1.05);
}

.carousel-nav-button.prev {
  left: 0.6rem;
}
.carousel-nav-button.next {
  right: 0.6rem;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.7rem 0.6rem;
}

.carousel-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.9);
  cursor: pointer;
  transition:
    background 120ms ease-out,
    border-color 120ms ease-out,
    transform 120ms ease-out,
    box-shadow 120ms ease-out;
}

.carousel-dot.active {
  background: var(--accent-strong);
  border-color: rgba(56, 189, 248, 0.9);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.9);
  transform: scale(1.2);
}

/* Modal content */

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  position: relative;
}

.modal-header-block {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.modal-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0;
}

.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.25rem;
}

.modal-tag {
  font-size: 0.7rem;
  padding: 0.14rem 0.5rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: var(--text-muted);
}

.modal-description {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.modal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.3rem;
}

.modal-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.8);
  background: var(--accent-soft);
  color: #e0f2fe;
  font-size: 0.8rem;
  text-decoration: none;
  transition:
    background 120ms ease-out,
    transform 120ms ease-out,
    box-shadow 120ms ease-out;
}

.modal-link span.arrow {
  font-size: 0.9rem;
}

.modal-link:hover {
  background: rgba(56, 189, 248, 0.24);
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.9);
  text-decoration: none;
}

.modal-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(15, 23, 42, 0.9);
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
