:root {
  --bg: #ffffff;
  --fg: #0a0a0a;
  --muted: #6b6b6b;
  --line: #0a0a0a;
  --yellow: #f4f48c;
  --blue: #d6ebf7;
  --green: #8fe0a8;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Inter Tight", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--fg);
  font-size: 17px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

.page { max-width: 680px; margin: 0 auto; padding: 48px 20px 120px; }

h1 {
  font-weight: 400;
  font-size: clamp(34px, 7.5vw, 54px);
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin-bottom: 22px;
}

/* Pills */
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.pills:empty { display: none; }
.pill {
  display: inline-flex; align-items: center;
  height: 34px; padding: 0 13px;
  border: 1.5px solid var(--fg); border-radius: 999px;
  font: inherit; font-size: 18px; line-height: 1;
  color: var(--fg); background: transparent;
  text-decoration: none; cursor: pointer;
  transition: background .15s, color .15s;
}
.pill.yellow { background: var(--yellow); }
.pill:hover, .pill.active { background: var(--fg); color: var(--bg); }

.bio { margin-top: 26px; max-width: 580px; white-space: pre-line; }

.section-title {
  font-size: clamp(40px, 8.5vw, 58px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 0.95;
  margin: 96px 0 64px -2px;
}

/* Projects */
.project { margin-bottom: 64px; }
.num {
  font-size: clamp(42px, 8.5vw, 54px);
  font-weight: 400; letter-spacing: -0.03em; line-height: 1;
  margin-bottom: 10px;
}
.rows { border-bottom: 1.5px solid var(--line); }
.row {
  display: grid; grid-template-columns: 36% 1fr; gap: 12px;
  border-top: 1.5px solid var(--line);
  padding: 8px 0 9px;
}
.row b { font-weight: 600; }
.row a { text-decoration: none; }
.row a:hover { text-decoration: underline; }
.tag {
  display: inline-block; padding: 2px 10px; margin: 0 4px 3px 0;
  border-radius: 999px; background: var(--blue); font-size: 16px;
}
.tag:nth-child(2n) { background: var(--green); }

.gallery {
  display: flex; gap: 8px; overflow-x: auto;
  scroll-snap-type: x mandatory;
  margin-top: 12px; padding-bottom: 6px;
  scrollbar-width: thin;
}
.gallery img {
  height: 260px; width: auto; flex: none;
  border-radius: 4px; background: #f2f2f2;
  scroll-snap-align: start; cursor: zoom-in;
}
@media (max-width: 520px) { .gallery img { height: 200px; } }

.empty { color: var(--muted); }

footer {
  margin-top: 96px; padding-top: 10px;
  border-top: 1.5px solid var(--line);
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 14px; color: var(--muted);
}

/* Back to top */
.top {
  position: fixed; right: 20px; bottom: 20px; z-index: 5;
  width: 72px; height: 72px; border-radius: 50%; border: 0;
  background: var(--fg); color: var(--bg);
  display: grid; place-items: center; cursor: pointer;
  opacity: 0; pointer-events: none; transform: translateY(8px);
  transition: opacity .2s, transform .2s;
}
.top.show { opacity: 1; pointer-events: auto; transform: none; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 10;
  background: rgba(0,0,0,.92);
  display: none; place-items: center; padding: 20px; cursor: zoom-out;
}
.lightbox.open { display: grid; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }

.loading { color: var(--muted); }
