*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f7f7f6;
  --surface: #ffffff;
  --border: #e8e8e5;
  --border-soft: #f0f0ed;
  --text: #111110;
  --text-muted: #6b6b68;
  --text-faint: #a8a8a4;
  --radius-lg: 14px;
  --radius-xl: 18px;
}

html { scroll-behavior: smooth; }

body {
  font-family: "DM Sans", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ── NAV ── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 0 2.5rem;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  list-style: none;
}
.nav-links a {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--text); }

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  transition: opacity 0.15s;
}
.nav-icon:hover { opacity: 0.7; }
.nav-icon img { width: 22px; height: 22px; object-fit: contain; }

/* ── HERO ── */
.hero {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 4rem 2rem;
}
.hero-inner {
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3rem;
}
.hero-left { flex: 1; min-width: 0; }
.hero-right { flex-shrink: 0; }

.hero-name {
  font-size: clamp(30px, 5.5vw, 54px);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.03em;
  margin-bottom: 0.55rem;
}
.hero-role {
  font-size: clamp(15px, 2vw, 19px);
  color: var(--text-muted);
  letter-spacing: -0.01em;
  margin-bottom: 1.4rem;
}
.hero-sub {
  font-size: 14.5px;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 480px;
  margin: 0 0 2.5rem;
}

.hero-photo {
  width: 380px;
  height: 380px;
  border-radius: 50%;
  object-fit: cover;
}

.hero-tools { margin-top: 1.5rem; }
.hero-tools-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.hero-tools-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tool-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 4px 9px;
  border-radius: 5px;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s;
}
.tool-pill:hover { border-color: #c8c8c4; color: var(--text); }
.tool-pill img { width: 13px; height: 13px; object-fit: contain; flex-shrink: 0; }

/* ── SECTION ── */
.section {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  background: var(--bg);
  padding: 3.5rem 1.5rem 4.5rem;
}
.section-inner {
  max-width: 1040px;
  margin: 0 auto;
}

.section-header {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}
.section-header h2 {
  font-size: clamp(19px, 2.5vw, 26px);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
}

.section-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 0.4rem;
  text-align: center;
}

.filter-bar {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 1.25rem;
}
.filter-btn {
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.filter-btn:hover { border-color: #c8c8c4; color: var(--text); }
.filter-btn.active { background: var(--text); color: #fff; border-color: var(--text); }

.status-legend {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 1.25rem;
}
.status-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-faint);
}

/* ── GRID ── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

/* ── CARD ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease;
}
.card.fade-in.visible:hover { transform: translateY(-3px); }

.card-carousel {
  position: relative;
  height: 185px;
  background: #111110;
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
  overflow: hidden;
}
.card-carousel-track {
  display: flex;
  height: 100%;
  width: 100%;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}
.card-carousel-slide {
  min-width: 100%;
  width: 100%;
  height: 100%;
  flex-shrink: 0;
  background: #111110;
}
.card-carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.card-carousel-slide .fallback {
  width: 100%;
  height: 100%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--text-faint);
}

.card-body { padding: 0.95rem 1.05rem 1.1rem; }

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 4px;
}
.card-title-row { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.card-title { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.done { background: #22c55e; }
.status-dot.wip  { background: #facc15; }

.card-desc { font-size: 12px; color: var(--text-muted); line-height: 1.65; margin-bottom: 0.75rem; }

.card-stack { display: flex; flex-wrap: wrap; gap: 5px; }

.stack-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 5px;
}
.stack-tag img { width: 13px; height: 13px; object-fit: contain; }

.link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  text-decoration: none;
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.link-btn:hover { opacity: 0.7; }
.link-btn img { width: 14px; height: 14px; object-fit: contain; }
.card-btns { display: flex; gap: 6px; flex-shrink: 0; }

/* ── LIGHTBOX ── */
#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0,0,0,0.85);
  align-items: center;
  justify-content: center;
  animation: lb-in 0.18s ease;
}
@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }
#lightbox.open { display: flex; }

.lb-track {
  display: flex;
  height: 100%;
  width: 100%;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}
.lb-slide {
  min-width: 100%;
  width: 100%;
  height: 100%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lb-slide img {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 64px rgba(0,0,0,0.55);
  cursor: default;
}

.lb-btn {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  font-size: 20px;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  z-index: 10;
  font-family: inherit;
}
.lb-btn:hover { background: rgba(255,255,255,0.22); }
.lb-btn.prev { left: 20px; }
.lb-btn.next { right: 20px; }

.lb-dots {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 10;
}
.lb-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.35);
  padding: 0;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.lb-dot:hover { background: rgba(255,255,255,0.65); }
.lb-dot.active { background: #fff; transform: scale(1.25); }

/* ── FADE IN ── */
.fade-in { opacity: 0; transform: translateY(14px); transition: opacity 0.48s ease, transform 0.48s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ── RESPONSIVE ── */
@media (max-width: 740px) {
  .hero-inner { flex-direction: column; text-align: center; }
  .hero-left { display: flex; flex-direction: column; align-items: center; }
  .hero-sub { margin-left: auto; margin-right: auto; }
  .hero-photo { width: 200px; height: 200px; }
  .hero-tools-list { justify-content: center; }
  .projects-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lb-btn { display: none; }
}
@media (max-width: 600px) {
  nav { padding: 0 1.25rem; }
  .nav-links { gap: 1.1rem; }
  .section { padding: 2.5rem 1rem 3rem; }
}
@media (max-width: 480px) { .projects-grid { grid-template-columns: 1fr; } }
