:root {
  --bg: #0a0b0d;
  --bg-soft: #111317;
  --fg: #e7e9ee;
  --muted: #5b616e;
  --muted-2: #7c8290;
  --accent: #3fe0c5;
  --line: #1b1e24;
  --radius: 0px;
  --gap: 18px;
  --maxw: 1400px;
  --grid-maxw: 1220px;
  --tile-min: 128px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  -webkit-font-smoothing: antialiased;
}

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

/* ---------- Header ---------- */
.site-header {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 34px 48px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 17px;
  letter-spacing: 0.06em;
  color: var(--fg);
}

.nav {
  display: flex;
  align-items: center;
  gap: 34px;
}

.nav-link {
  position: relative;
  font-size: 14px;
  color: var(--muted-2);
  letter-spacing: 0.04em;
  transition: color 0.18s ease;
}

.nav-link:hover { color: var(--fg); }

.nav-link.is-active {
  color: var(--fg);
  font-weight: 500;
}

.nav-link .dot {
  display: none;
  position: absolute;
  left: 50%;
  bottom: -12px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateX(-50%);
}

.nav-link.is-active .dot { display: block; }

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  margin-left: 6px;
}

/* ---------- Content ---------- */
.content {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 40px 48px 80px;
}

.view { display: none; }
.view.is-active { display: block; }

/* ---------- Catalog title ---------- */
.catalog-title {
  text-align: center;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.32em;
  color: var(--fg);
  margin: 8px 0 40px;
}

/* ---------- Grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--tile-min), 1fr));
  gap: var(--gap);
  max-width: var(--grid-maxw);
  margin: 0 auto;
}

.tile {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-soft);
  outline: 1px solid var(--line);
  outline-offset: 0;
  transition: transform 0.22s ease, outline-color 0.22s ease;
  opacity: 0;
  animation: fade-in 0.5s ease forwards;
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(1.02);
  transition: transform 0.4s ease, filter 0.3s ease;
}

.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 50%, rgba(0,0,0,0.55) 100%);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.tile .meta {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 11px;
  z-index: 2;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.tile .title {
  font-size: 12px;
  line-height: 1.3;
  color: #fff;
  letter-spacing: 0.02em;
}

.tile .sub {
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.05em;
  margin-top: 2px;
}

.tile:hover {
  transform: translateY(-3px);
  outline-color: rgba(63, 224, 197, 0.5);
}

.tile:hover img { transform: scale(1.06); filter: saturate(1.15); }
.tile:hover::after { opacity: 1; }
.tile:hover .meta { opacity: 1; transform: translateY(0); }

@keyframes fade-in {
  to { opacity: 1; }
}

/* ---------- Prose pages ---------- */
.prose {
  max-width: 560px;
  padding-top: 8px;
}
.prose h1 {
  font-size: 22px;
  font-weight: 500;
  margin: 0 0 18px;
  letter-spacing: 0.02em;
}
.prose p {
  font-size: 14px;
  line-height: 1.8;
  color: var(--muted-2);
}
.prose a { color: var(--accent); }

/* ---------- Empty / loading ---------- */
.note {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 13px;
  padding: 40px 0;
}

/* ---------- Responsive ----------
   Columns reflow automatically via auto-fill + minmax(--tile-min).
   Below we just tighten chrome + tile size on small screens. */
@media (max-width: 860px) {
  .site-header { padding: 26px 24px 8px; }
  .content { padding: 28px 24px 60px; }
  .grid { --tile-min: 110px; gap: 16px; }
  .nav { gap: 20px; }
}
@media (max-width: 520px) {
  .grid { --tile-min: 92px; gap: 12px; }
  .nav-link[data-view="coding"],
  .nav-link[data-view="about"] { display: none; }
}
